(* Generated by coq-of-rust *)
Require Import CoqOfRust.CoqOfRust.

Module db.
  Module states.
    Module bundle_state.
      (* StructRecord
        {
          name := "BundleBuilder";
          const_params := [];
          ty_params := [];
          fields :=
            [
              ("states",
                Ty.apply
                  (Ty.path "std::collections::hash::set::HashSet")
                  []
                  [
                    Ty.path "alloy_primitives::bits::address::Address";
                    Ty.path "std::hash::random::RandomState"
                  ]);
              ("state_original",
                Ty.apply
                  (Ty.path "std::collections::hash::map::HashMap")
                  []
                  [
                    Ty.path "alloy_primitives::bits::address::Address";
                    Ty.path "revm_primitives::state::AccountInfo";
                    Ty.path "std::hash::random::RandomState"
                  ]);
              ("state_present",
                Ty.apply
                  (Ty.path "std::collections::hash::map::HashMap")
                  []
                  [
                    Ty.path "alloy_primitives::bits::address::Address";
                    Ty.path "revm_primitives::state::AccountInfo";
                    Ty.path "std::hash::random::RandomState"
                  ]);
              ("state_storage",
                Ty.apply
                  (Ty.path "std::collections::hash::map::HashMap")
                  []
                  [
                    Ty.path "alloy_primitives::bits::address::Address";
                    Ty.apply
                      (Ty.path "std::collections::hash::map::HashMap")
                      []
                      [
                        Ty.apply
                          (Ty.path "ruint::Uint")
                          [ Value.Integer IntegerKind.Usize 256; Value.Integer IntegerKind.Usize 4 ]
                          [];
                        Ty.tuple
                          [
                            Ty.apply
                              (Ty.path "ruint::Uint")
                              [
                                Value.Integer IntegerKind.Usize 256;
                                Value.Integer IntegerKind.Usize 4
                              ]
                              [];
                            Ty.apply
                              (Ty.path "ruint::Uint")
                              [
                                Value.Integer IntegerKind.Usize 256;
                                Value.Integer IntegerKind.Usize 4
                              ]
                              []
                          ];
                        Ty.path "std::hash::random::RandomState"
                      ];
                    Ty.path "std::hash::random::RandomState"
                  ]);
              ("reverts",
                Ty.apply
                  (Ty.path "alloc::collections::btree::set::BTreeSet")
                  []
                  [
                    Ty.tuple [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                    Ty.path "alloc::alloc::Global"
                  ]);
              ("revert_range",
                Ty.apply (Ty.path "core::ops::range::RangeInclusive") [] [ Ty.path "u64" ]);
              ("revert_account",
                Ty.apply
                  (Ty.path "std::collections::hash::map::HashMap")
                  []
                  [
                    Ty.tuple [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                    Ty.apply
                      (Ty.path "core::option::Option")
                      []
                      [
                        Ty.apply
                          (Ty.path "core::option::Option")
                          []
                          [ Ty.path "revm_primitives::state::AccountInfo" ]
                      ];
                    Ty.path "std::hash::random::RandomState"
                  ]);
              ("revert_storage",
                Ty.apply
                  (Ty.path "std::collections::hash::map::HashMap")
                  []
                  [
                    Ty.tuple [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      []
                      [
                        Ty.tuple
                          [
                            Ty.apply
                              (Ty.path "ruint::Uint")
                              [
                                Value.Integer IntegerKind.Usize 256;
                                Value.Integer IntegerKind.Usize 4
                              ]
                              [];
                            Ty.apply
                              (Ty.path "ruint::Uint")
                              [
                                Value.Integer IntegerKind.Usize 256;
                                Value.Integer IntegerKind.Usize 4
                              ]
                              []
                          ];
                        Ty.path "alloc::alloc::Global"
                      ];
                    Ty.path "std::hash::random::RandomState"
                  ]);
              ("contracts",
                Ty.apply
                  (Ty.path "std::collections::hash::map::HashMap")
                  []
                  [
                    Ty.apply
                      (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                      [ Value.Integer IntegerKind.Usize 32 ]
                      [];
                    Ty.path "revm_primitives::bytecode::Bytecode";
                    Ty.path "std::hash::random::RandomState"
                  ])
            ];
        } *)
      
      Module Impl_core_fmt_Debug_for_revm_db_states_bundle_state_BundleBuilder.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleBuilder".
        
        (* Debug *)
        Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; f ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let f := M.alloc (| f |) in
              M.read (|
                let~ names :=
                  M.alloc (|
                    M.alloc (|
                      Value.Array
                        [
                          M.read (| Value.String "states" |);
                          M.read (| Value.String "state_original" |);
                          M.read (| Value.String "state_present" |);
                          M.read (| Value.String "state_storage" |);
                          M.read (| Value.String "reverts" |);
                          M.read (| Value.String "revert_range" |);
                          M.read (| Value.String "revert_account" |);
                          M.read (| Value.String "revert_storage" |);
                          M.read (| Value.String "contracts" |)
                        ]
                    |)
                  |) in
                let~ values :=
                  M.alloc (|
                    M.alloc (|
                      Value.Array
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleBuilder",
                            "states"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleBuilder",
                            "state_original"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleBuilder",
                            "state_present"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleBuilder",
                            "state_storage"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleBuilder",
                            "reverts"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleBuilder",
                            "revert_range"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleBuilder",
                            "revert_account"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleBuilder",
                            "revert_storage"
                          |);
                          M.alloc (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "revm::db::states::bundle_state::BundleBuilder",
                              "contracts"
                            |)
                          |)
                        ]
                    |)
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "core::fmt::Formatter",
                      "debug_struct_fields_finish",
                      []
                    |),
                    [
                      M.read (| f |);
                      M.read (| Value.String "BundleBuilder" |);
                      M.read (| names |);
                      M.read (| values |)
                    ]
                  |)
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::fmt::Debug"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
      End Impl_core_fmt_Debug_for_revm_db_states_bundle_state_BundleBuilder.
      
      (*
      Enum OriginalValuesKnown
      {
        const_params := [];
        ty_params := [];
        variants :=
          [
            {
              name := "Yes";
              item := StructTuple [];
              discriminant := None;
            };
            {
              name := "No";
              item := StructTuple [];
              discriminant := None;
            }
          ];
      }
      *)
      
      Module Impl_core_clone_Clone_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        (* Clone *)
        Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.read (| M.read (| self |) |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::clone::Clone"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("clone", InstanceField.Method clone) ].
      End Impl_core_clone_Clone_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_marker_Copy_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        Axiom Implements :
          M.IsTraitInstance
            "core::marker::Copy"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [].
      End Impl_core_marker_Copy_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_fmt_Debug_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        (* Debug *)
        Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; f ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let f := M.alloc (| f |) in
              M.call_closure (|
                M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [] |),
                [
                  M.read (| f |);
                  M.read (|
                    M.match_operator (|
                      self,
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ := M.read (| γ |) in
                            let _ :=
                              M.is_struct_tuple (|
                                γ,
                                "revm::db::states::bundle_state::OriginalValuesKnown::Yes"
                              |) in
                            M.alloc (| M.read (| Value.String "Yes" |) |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ := M.read (| γ |) in
                            let _ :=
                              M.is_struct_tuple (|
                                γ,
                                "revm::db::states::bundle_state::OriginalValuesKnown::No"
                              |) in
                            M.alloc (| M.read (| Value.String "No" |) |)))
                      ]
                    |)
                  |)
                ]
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::fmt::Debug"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
      End Impl_core_fmt_Debug_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_marker_StructuralPartialEq_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        Axiom Implements :
          M.IsTraitInstance
            "core::marker::StructuralPartialEq"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [].
      End Impl_core_marker_StructuralPartialEq_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_cmp_PartialEq_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        (* PartialEq *)
        Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; other ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let other := M.alloc (| other |) in
              M.read (|
                let~ __self_discr :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (|
                        "core::intrinsics::discriminant_value",
                        [ Ty.path "revm::db::states::bundle_state::OriginalValuesKnown" ]
                      |),
                      [ M.read (| self |) ]
                    |)
                  |) in
                let~ __arg1_discr :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (|
                        "core::intrinsics::discriminant_value",
                        [ Ty.path "revm::db::states::bundle_state::OriginalValuesKnown" ]
                      |),
                      [ M.read (| other |) ]
                    |)
                  |) in
                M.alloc (| BinOp.eq (| M.read (| __self_discr |), M.read (| __arg1_discr |) |) |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::cmp::PartialEq"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("eq", InstanceField.Method eq) ].
      End Impl_core_cmp_PartialEq_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_cmp_Eq_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        (* Eq *)
        Definition assert_receiver_is_total_eq
            (ε : list Value.t)
            (τ : list Ty.t)
            (α : list Value.t)
            : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              Value.Tuple []))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::cmp::Eq"
            Self
            (* Trait polymorphic types *) []
            (* Instance *)
            [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
      End Impl_core_cmp_Eq_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_cmp_PartialOrd_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        (* PartialOrd *)
        Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; other ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let other := M.alloc (| other |) in
              M.read (|
                let~ __self_discr :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (|
                        "core::intrinsics::discriminant_value",
                        [ Ty.path "revm::db::states::bundle_state::OriginalValuesKnown" ]
                      |),
                      [ M.read (| self |) ]
                    |)
                  |) in
                let~ __arg1_discr :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (|
                        "core::intrinsics::discriminant_value",
                        [ Ty.path "revm::db::states::bundle_state::OriginalValuesKnown" ]
                      |),
                      [ M.read (| other |) ]
                    |)
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::PartialOrd",
                      Ty.path "isize",
                      [ Ty.path "isize" ],
                      "partial_cmp",
                      []
                    |),
                    [ __self_discr; __arg1_discr ]
                  |)
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::cmp::PartialOrd"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
      End Impl_core_cmp_PartialOrd_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_cmp_Ord_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        (* Ord *)
        Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; other ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let other := M.alloc (| other |) in
              M.read (|
                let~ __self_discr :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (|
                        "core::intrinsics::discriminant_value",
                        [ Ty.path "revm::db::states::bundle_state::OriginalValuesKnown" ]
                      |),
                      [ M.read (| self |) ]
                    |)
                  |) in
                let~ __arg1_discr :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (|
                        "core::intrinsics::discriminant_value",
                        [ Ty.path "revm::db::states::bundle_state::OriginalValuesKnown" ]
                      |),
                      [ M.read (| other |) ]
                    |)
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (| "core::cmp::Ord", Ty.path "isize", [], "cmp", [] |),
                    [ __self_discr; __arg1_discr ]
                  |)
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::cmp::Ord"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
      End Impl_core_cmp_Ord_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_hash_Hash_for_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        (* Hash *)
        Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [ __H ], [ self; state ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let state := M.alloc (| state |) in
              M.read (|
                let~ __self_discr :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (|
                        "core::intrinsics::discriminant_value",
                        [ Ty.path "revm::db::states::bundle_state::OriginalValuesKnown" ]
                      |),
                      [ M.read (| self |) ]
                    |)
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::hash::Hash",
                      Ty.path "isize",
                      [],
                      "hash",
                      [ __H ]
                    |),
                    [ __self_discr; M.read (| state |) ]
                  |)
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::hash::Hash"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("hash", InstanceField.Method hash) ].
      End Impl_core_hash_Hash_for_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_revm_db_states_bundle_state_OriginalValuesKnown.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::OriginalValuesKnown".
        
        (*
            pub fn is_not_known(&self) -> bool {
                matches!(self, Self::No)
            }
        *)
        Definition is_not_known (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.read (|
                M.match_operator (|
                  self,
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        let _ :=
                          M.is_struct_tuple (|
                            γ,
                            "revm::db::states::bundle_state::OriginalValuesKnown::No"
                          |) in
                        M.alloc (| Value.Bool true |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Bool false |)))
                  ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_is_not_known :
          M.IsAssociatedFunction Self "is_not_known" is_not_known.
      End Impl_revm_db_states_bundle_state_OriginalValuesKnown.
      
      Module Impl_core_default_Default_for_revm_db_states_bundle_state_BundleBuilder.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleBuilder".
        
        (*
            fn default() -> Self {
                BundleBuilder {
                    states: HashSet::new(),
                    state_original: HashMap::new(),
                    state_present: HashMap::new(),
                    state_storage: HashMap::new(),
                    reverts: BTreeSet::new(),
                    revert_range: 0..=0,
                    revert_account: HashMap::new(),
                    revert_storage: HashMap::new(),
                    contracts: HashMap::new(),
                }
            }
        *)
        Definition default (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [] =>
            ltac:(M.monadic
              (Value.StructRecord
                "revm::db::states::bundle_state::BundleBuilder"
                [
                  ("states",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::set::HashSet")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "new",
                        []
                      |),
                      []
                    |));
                  ("state_original",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "revm_primitives::state::AccountInfo";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "new",
                        []
                      |),
                      []
                    |));
                  ("state_present",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "revm_primitives::state::AccountInfo";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "new",
                        []
                      |),
                      []
                    |));
                  ("state_storage",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.apply
                              (Ty.path "std::collections::hash::map::HashMap")
                              []
                              [
                                Ty.apply
                                  (Ty.path "ruint::Uint")
                                  [
                                    Value.Integer IntegerKind.Usize 256;
                                    Value.Integer IntegerKind.Usize 4
                                  ]
                                  [];
                                Ty.tuple
                                  [
                                    Ty.apply
                                      (Ty.path "ruint::Uint")
                                      [
                                        Value.Integer IntegerKind.Usize 256;
                                        Value.Integer IntegerKind.Usize 4
                                      ]
                                      [];
                                    Ty.apply
                                      (Ty.path "ruint::Uint")
                                      [
                                        Value.Integer IntegerKind.Usize 256;
                                        Value.Integer IntegerKind.Usize 4
                                      ]
                                      []
                                  ];
                                Ty.path "std::hash::random::RandomState"
                              ];
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "new",
                        []
                      |),
                      []
                    |));
                  ("reverts",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::collections::btree::set::BTreeSet")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        "new",
                        []
                      |),
                      []
                    |));
                  ("revert_range",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply (Ty.path "core::ops::range::RangeInclusive") [] [ Ty.path "u64" ],
                        "new",
                        []
                      |),
                      [ Value.Integer IntegerKind.U64 0; Value.Integer IntegerKind.U64 0 ]
                    |));
                  ("revert_account",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.apply
                              (Ty.path "core::option::Option")
                              []
                              [
                                Ty.apply
                                  (Ty.path "core::option::Option")
                                  []
                                  [ Ty.path "revm_primitives::state::AccountInfo" ]
                              ];
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "new",
                        []
                      |),
                      []
                    |));
                  ("revert_storage",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              []
                              [
                                Ty.tuple
                                  [
                                    Ty.apply
                                      (Ty.path "ruint::Uint")
                                      [
                                        Value.Integer IntegerKind.Usize 256;
                                        Value.Integer IntegerKind.Usize 4
                                      ]
                                      [];
                                    Ty.apply
                                      (Ty.path "ruint::Uint")
                                      [
                                        Value.Integer IntegerKind.Usize 256;
                                        Value.Integer IntegerKind.Usize 4
                                      ]
                                      []
                                  ];
                                Ty.path "alloc::alloc::Global"
                              ];
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "new",
                        []
                      |),
                      []
                    |));
                  ("contracts",
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.apply
                              (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                              [ Value.Integer IntegerKind.Usize 32 ]
                              [];
                            Ty.path "revm_primitives::bytecode::Bytecode";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "new",
                        []
                      |),
                      []
                    |))
                ]))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::default::Default"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("default", InstanceField.Method default) ].
      End Impl_core_default_Default_for_revm_db_states_bundle_state_BundleBuilder.
      
      Module Impl_revm_db_states_bundle_state_BundleBuilder.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleBuilder".
        
        (*
            pub fn new(revert_range: RangeInclusive<u64>) -> Self {
                BundleBuilder {
                    revert_range,
                    ..Default::default()
                }
            }
        *)
        Definition new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ revert_range ] =>
            ltac:(M.monadic
              (let revert_range := M.alloc (| revert_range |) in
              M.struct_record_update
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::default::Default",
                    Ty.path "revm::db::states::bundle_state::BundleBuilder",
                    [],
                    "default",
                    []
                  |),
                  []
                |))
                [ ("revert_range", M.read (| revert_range |)) ]))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
        
        (*
            pub fn state_address(mut self, address: Address) -> Self {
                self.states.insert(address);
                self
            }
        *)
        Definition state_address (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; address ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let address := M.alloc (| address |) in
              M.read (|
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::set::HashSet")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "states"
                        |);
                        M.read (| address |)
                      ]
                    |)
                  |) in
                self
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_state_address :
          M.IsAssociatedFunction Self "state_address" state_address.
        
        (*
            pub fn state_original_account_info(mut self, address: Address, original: AccountInfo) -> Self {
                self.states.insert(address);
                self.state_original.insert(address, original);
                self
            }
        *)
        Definition state_original_account_info
            (ε : list Value.t)
            (τ : list Ty.t)
            (α : list Value.t)
            : M :=
          match ε, τ, α with
          | [], [], [ self; address; original ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let address := M.alloc (| address |) in
              let original := M.alloc (| original |) in
              M.read (|
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::set::HashSet")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "states"
                        |);
                        M.read (| address |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "revm_primitives::state::AccountInfo";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "state_original"
                        |);
                        M.read (| address |);
                        M.read (| original |)
                      ]
                    |)
                  |) in
                self
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_state_original_account_info :
          M.IsAssociatedFunction Self "state_original_account_info" state_original_account_info.
        
        (*
            pub fn state_present_account_info(mut self, address: Address, present: AccountInfo) -> Self {
                self.states.insert(address);
                self.state_present.insert(address, present);
                self
            }
        *)
        Definition state_present_account_info
            (ε : list Value.t)
            (τ : list Ty.t)
            (α : list Value.t)
            : M :=
          match ε, τ, α with
          | [], [], [ self; address; present ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let address := M.alloc (| address |) in
              let present := M.alloc (| present |) in
              M.read (|
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::set::HashSet")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "states"
                        |);
                        M.read (| address |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "revm_primitives::state::AccountInfo";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "state_present"
                        |);
                        M.read (| address |);
                        M.read (| present |)
                      ]
                    |)
                  |) in
                self
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_state_present_account_info :
          M.IsAssociatedFunction Self "state_present_account_info" state_present_account_info.
        
        (*
            pub fn state_storage(mut self, address: Address, storage: HashMap<U256, (U256, U256)>) -> Self {
                self.states.insert(address);
                self.state_storage.insert(address, storage);
                self
            }
        *)
        Definition state_storage (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; address; storage ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let address := M.alloc (| address |) in
              let storage := M.alloc (| storage |) in
              M.read (|
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::set::HashSet")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "states"
                        |);
                        M.read (| address |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.apply
                              (Ty.path "std::collections::hash::map::HashMap")
                              []
                              [
                                Ty.apply
                                  (Ty.path "ruint::Uint")
                                  [
                                    Value.Integer IntegerKind.Usize 256;
                                    Value.Integer IntegerKind.Usize 4
                                  ]
                                  [];
                                Ty.tuple
                                  [
                                    Ty.apply
                                      (Ty.path "ruint::Uint")
                                      [
                                        Value.Integer IntegerKind.Usize 256;
                                        Value.Integer IntegerKind.Usize 4
                                      ]
                                      [];
                                    Ty.apply
                                      (Ty.path "ruint::Uint")
                                      [
                                        Value.Integer IntegerKind.Usize 256;
                                        Value.Integer IntegerKind.Usize 4
                                      ]
                                      []
                                  ];
                                Ty.path "std::hash::random::RandomState"
                              ];
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "state_storage"
                        |);
                        M.read (| address |);
                        M.read (| storage |)
                      ]
                    |)
                  |) in
                self
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_state_storage :
          M.IsAssociatedFunction Self "state_storage" state_storage.
        
        (*
            pub fn revert_address(mut self, block_number: u64, address: Address) -> Self {
                self.reverts.insert((block_number, address));
                self
            }
        *)
        Definition revert_address (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; block_number; address ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let block_number := M.alloc (| block_number |) in
              let address := M.alloc (| address |) in
              M.read (|
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::collections::btree::set::BTreeSet")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "reverts"
                        |);
                        Value.Tuple [ M.read (| block_number |); M.read (| address |) ]
                      ]
                    |)
                  |) in
                self
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_revert_address :
          M.IsAssociatedFunction Self "revert_address" revert_address.
        
        (*
            pub fn revert_account_info(
                mut self,
                block_number: u64,
                address: Address,
                account: Option<Option<AccountInfo>>,
            ) -> Self {
                self.reverts.insert((block_number, address));
                self.revert_account.insert((block_number, address), account);
                self
            }
        *)
        Definition revert_account_info (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; block_number; address; account ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let block_number := M.alloc (| block_number |) in
              let address := M.alloc (| address |) in
              let account := M.alloc (| account |) in
              M.read (|
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::collections::btree::set::BTreeSet")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "reverts"
                        |);
                        Value.Tuple [ M.read (| block_number |); M.read (| address |) ]
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.apply
                              (Ty.path "core::option::Option")
                              []
                              [
                                Ty.apply
                                  (Ty.path "core::option::Option")
                                  []
                                  [ Ty.path "revm_primitives::state::AccountInfo" ]
                              ];
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "revert_account"
                        |);
                        Value.Tuple [ M.read (| block_number |); M.read (| address |) ];
                        M.read (| account |)
                      ]
                    |)
                  |) in
                self
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_revert_account_info :
          M.IsAssociatedFunction Self "revert_account_info" revert_account_info.
        
        (*
            pub fn revert_storage(
                mut self,
                block_number: u64,
                address: Address,
                storage: Vec<(U256, U256)>,
            ) -> Self {
                self.reverts.insert((block_number, address));
                self.revert_storage.insert((block_number, address), storage);
                self
            }
        *)
        Definition revert_storage (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; block_number; address; storage ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let block_number := M.alloc (| block_number |) in
              let address := M.alloc (| address |) in
              let storage := M.alloc (| storage |) in
              M.read (|
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::collections::btree::set::BTreeSet")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "reverts"
                        |);
                        Value.Tuple [ M.read (| block_number |); M.read (| address |) ]
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              []
                              [
                                Ty.tuple
                                  [
                                    Ty.apply
                                      (Ty.path "ruint::Uint")
                                      [
                                        Value.Integer IntegerKind.Usize 256;
                                        Value.Integer IntegerKind.Usize 4
                                      ]
                                      [];
                                    Ty.apply
                                      (Ty.path "ruint::Uint")
                                      [
                                        Value.Integer IntegerKind.Usize 256;
                                        Value.Integer IntegerKind.Usize 4
                                      ]
                                      []
                                  ];
                                Ty.path "alloc::alloc::Global"
                              ];
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "revert_storage"
                        |);
                        Value.Tuple [ M.read (| block_number |); M.read (| address |) ];
                        M.read (| storage |)
                      ]
                    |)
                  |) in
                self
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_revert_storage :
          M.IsAssociatedFunction Self "revert_storage" revert_storage.
        
        (*
            pub fn contract(mut self, address: B256, bytecode: Bytecode) -> Self {
                self.contracts.insert(address, bytecode);
                self
            }
        *)
        Definition contract (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; address; bytecode ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let address := M.alloc (| address |) in
              let bytecode := M.alloc (| bytecode |) in
              M.read (|
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.apply
                              (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                              [ Value.Integer IntegerKind.Usize 32 ]
                              [];
                            Ty.path "revm_primitives::bytecode::Bytecode";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "insert",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleBuilder",
                          "contracts"
                        |);
                        M.read (| address |);
                        M.read (| bytecode |)
                      ]
                    |)
                  |) in
                self
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_contract : M.IsAssociatedFunction Self "contract" contract.
        
        (*
            pub fn build(mut self) -> BundleState {
                let mut state_size = 0;
                let state = self
                    .states
                    .into_iter()
                    .map(|address| {
                        let storage = self
                            .state_storage
                            .remove(&address)
                            .map(|s| {
                                s.into_iter()
                                    .map(|(k, (o_val, p_val))| (k, StorageSlot::new_changed(o_val, p_val)))
                                    .collect()
                            })
                            .unwrap_or_default();
                        let bundle_account = BundleAccount::new(
                            self.state_original.remove(&address),
                            self.state_present.remove(&address),
                            storage,
                            AccountStatus::Changed,
                        );
                        state_size += bundle_account.size_hint();
                        (address, bundle_account)
                    })
                    .collect();
        
                let mut reverts_size = 0;
                let mut reverts_map = BTreeMap::new();
                for block_number in self.revert_range {
                    reverts_map.insert(block_number, Vec::new());
                }
                self.reverts
                    .into_iter()
                    .for_each(|(block_number, address)| {
                        let account = match self
                            .revert_account
                            .remove(&(block_number, address))
                            .unwrap_or_default()
                        {
                            Some(Some(account)) => AccountInfoRevert::RevertTo(account),
                            Some(None) => AccountInfoRevert::DeleteIt,
                            None => AccountInfoRevert::DoNothing,
                        };
                        let storage = self
                            .revert_storage
                            .remove(&(block_number, address))
                            .map(|s| {
                                s.into_iter()
                                    .map(|(k, v)| (k, RevertToSlot::Some(v)))
                                    .collect()
                            })
                            .unwrap_or_default();
                        let account_revert = AccountRevert {
                            account,
                            storage,
                            previous_status: AccountStatus::Changed,
                            wipe_storage: false,
                        };
        
                        if reverts_map.contains_key(&block_number) {
                            reverts_size += account_revert.size_hint();
                            reverts_map
                                .entry(block_number)
                                .or_insert(Vec::new())
                                .push((address, account_revert));
                        }
                    });
        
                BundleState {
                    state,
                    contracts: self.contracts,
                    reverts: Reverts::new(reverts_map.into_values().collect()),
                    state_size,
                    reverts_size,
                }
            }
        *)
        Definition build (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.read (|
                let~ state_size := M.alloc (| Value.Integer IntegerKind.Usize 0 |) in
                let~ state :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::iter::traits::iterator::Iterator",
                        Ty.apply
                          (Ty.path "core::iter::adapters::map::Map")
                          []
                          [
                            Ty.apply
                              (Ty.path "std::collections::hash::set::IntoIter")
                              []
                              [ Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.function
                              [ Ty.tuple [ Ty.path "alloy_primitives::bits::address::Address" ] ]
                              (Ty.tuple
                                [
                                  Ty.path "alloy_primitives::bits::address::Address";
                                  Ty.path "revm::db::states::bundle_account::BundleAccount"
                                ])
                          ],
                        [],
                        "collect",
                        [
                          Ty.apply
                            (Ty.path "std::collections::hash::map::HashMap")
                            []
                            [
                              Ty.path "alloy_primitives::bits::address::Address";
                              Ty.path "revm::db::states::bundle_account::BundleAccount";
                              Ty.path "std::hash::random::RandomState"
                            ]
                        ]
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::iterator::Iterator",
                            Ty.apply
                              (Ty.path "std::collections::hash::set::IntoIter")
                              []
                              [ Ty.path "alloy_primitives::bits::address::Address" ],
                            [],
                            "map",
                            [
                              Ty.tuple
                                [
                                  Ty.path "alloy_primitives::bits::address::Address";
                                  Ty.path "revm::db::states::bundle_account::BundleAccount"
                                ];
                              Ty.function
                                [ Ty.tuple [ Ty.path "alloy_primitives::bits::address::Address" ] ]
                                (Ty.tuple
                                  [
                                    Ty.path "alloy_primitives::bits::address::Address";
                                    Ty.path "revm::db::states::bundle_account::BundleAccount"
                                  ])
                            ]
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::collect::IntoIterator",
                                Ty.apply
                                  (Ty.path "std::collections::hash::set::HashSet")
                                  []
                                  [
                                    Ty.path "alloy_primitives::bits::address::Address";
                                    Ty.path "std::hash::random::RandomState"
                                  ],
                                [],
                                "into_iter",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    self,
                                    "revm::db::states::bundle_state::BundleBuilder",
                                    "states"
                                  |)
                                |)
                              ]
                            |);
                            M.closure
                              (fun γ =>
                                ltac:(M.monadic
                                  match γ with
                                  | [ α0 ] =>
                                    ltac:(M.monadic
                                      (M.match_operator (|
                                        M.alloc (| α0 |),
                                        [
                                          fun γ =>
                                            ltac:(M.monadic
                                              (let address := M.copy (| γ |) in
                                              M.read (|
                                                let~ storage :=
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path "core::option::Option")
                                                          []
                                                          [
                                                            Ty.apply
                                                              (Ty.path
                                                                "std::collections::hash::map::HashMap")
                                                              []
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "ruint::Uint")
                                                                  [
                                                                    Value.Integer
                                                                      IntegerKind.Usize
                                                                      256;
                                                                    Value.Integer
                                                                      IntegerKind.Usize
                                                                      4
                                                                  ]
                                                                  [];
                                                                Ty.path
                                                                  "revm_primitives::state::StorageSlot";
                                                                Ty.path
                                                                  "std::hash::random::RandomState"
                                                              ]
                                                          ],
                                                        "unwrap_or_default",
                                                        []
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path "core::option::Option")
                                                              []
                                                              [
                                                                Ty.apply
                                                                  (Ty.path
                                                                    "std::collections::hash::map::HashMap")
                                                                  []
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "ruint::Uint")
                                                                      [
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          256;
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          4
                                                                      ]
                                                                      [];
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          []
                                                                      ];
                                                                    Ty.path
                                                                      "std::hash::random::RandomState"
                                                                  ]
                                                              ],
                                                            "map",
                                                            [
                                                              Ty.apply
                                                                (Ty.path
                                                                  "std::collections::hash::map::HashMap")
                                                                []
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "ruint::Uint")
                                                                    [
                                                                      Value.Integer
                                                                        IntegerKind.Usize
                                                                        256;
                                                                      Value.Integer
                                                                        IntegerKind.Usize
                                                                        4
                                                                    ]
                                                                    [];
                                                                  Ty.path
                                                                    "revm_primitives::state::StorageSlot";
                                                                  Ty.path
                                                                    "std::hash::random::RandomState"
                                                                ];
                                                              Ty.function
                                                                [
                                                                  Ty.tuple
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path
                                                                          "std::collections::hash::map::HashMap")
                                                                        []
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path "ruint::Uint")
                                                                            [
                                                                              Value.Integer
                                                                                IntegerKind.Usize
                                                                                256;
                                                                              Value.Integer
                                                                                IntegerKind.Usize
                                                                                4
                                                                            ]
                                                                            [];
                                                                          Ty.tuple
                                                                            [
                                                                              Ty.apply
                                                                                (Ty.path
                                                                                  "ruint::Uint")
                                                                                [
                                                                                  Value.Integer
                                                                                    IntegerKind.Usize
                                                                                    256;
                                                                                  Value.Integer
                                                                                    IntegerKind.Usize
                                                                                    4
                                                                                ]
                                                                                [];
                                                                              Ty.apply
                                                                                (Ty.path
                                                                                  "ruint::Uint")
                                                                                [
                                                                                  Value.Integer
                                                                                    IntegerKind.Usize
                                                                                    256;
                                                                                  Value.Integer
                                                                                    IntegerKind.Usize
                                                                                    4
                                                                                ]
                                                                                []
                                                                            ];
                                                                          Ty.path
                                                                            "std::hash::random::RandomState"
                                                                        ]
                                                                    ]
                                                                ]
                                                                (Ty.apply
                                                                  (Ty.path
                                                                    "std::collections::hash::map::HashMap")
                                                                  []
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "ruint::Uint")
                                                                      [
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          256;
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          4
                                                                      ]
                                                                      [];
                                                                    Ty.path
                                                                      "revm_primitives::state::StorageSlot";
                                                                    Ty.path
                                                                      "std::hash::random::RandomState"
                                                                  ])
                                                            ]
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.apply
                                                                  (Ty.path
                                                                    "std::collections::hash::map::HashMap")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "alloy_primitives::bits::address::Address";
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "std::collections::hash::map::HashMap")
                                                                      []
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.tuple
                                                                          [
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "ruint::Uint")
                                                                              [
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  256;
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  4
                                                                              ]
                                                                              [];
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "ruint::Uint")
                                                                              [
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  256;
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  4
                                                                              ]
                                                                              []
                                                                          ];
                                                                        Ty.path
                                                                          "std::hash::random::RandomState"
                                                                      ];
                                                                    Ty.path
                                                                      "std::hash::random::RandomState"
                                                                  ],
                                                                "remove",
                                                                [
                                                                  Ty.path
                                                                    "alloy_primitives::bits::address::Address"
                                                                ]
                                                              |),
                                                              [
                                                                M.SubPointer.get_struct_record_field (|
                                                                  self,
                                                                  "revm::db::states::bundle_state::BundleBuilder",
                                                                  "state_storage"
                                                                |);
                                                                address
                                                              ]
                                                            |);
                                                            M.closure
                                                              (fun γ =>
                                                                ltac:(M.monadic
                                                                  match γ with
                                                                  | [ α0 ] =>
                                                                    ltac:(M.monadic
                                                                      (M.match_operator (|
                                                                        M.alloc (| α0 |),
                                                                        [
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (let s :=
                                                                                M.copy (| γ |) in
                                                                              M.call_closure (|
                                                                                M.get_trait_method (|
                                                                                  "core::iter::traits::iterator::Iterator",
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "core::iter::adapters::map::Map")
                                                                                    []
                                                                                    [
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "std::collections::hash::map::IntoIter")
                                                                                        []
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "ruint::Uint")
                                                                                            [
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                256;
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                4
                                                                                            ]
                                                                                            [];
                                                                                          Ty.tuple
                                                                                            [
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                [];
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                []
                                                                                            ]
                                                                                        ];
                                                                                      Ty.function
                                                                                        [
                                                                                          Ty.tuple
                                                                                            [
                                                                                              Ty.tuple
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "ruint::Uint")
                                                                                                    [
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        256;
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        4
                                                                                                    ]
                                                                                                    [];
                                                                                                  Ty.tuple
                                                                                                    [
                                                                                                      Ty.apply
                                                                                                        (Ty.path
                                                                                                          "ruint::Uint")
                                                                                                        [
                                                                                                          Value.Integer
                                                                                                            IntegerKind.Usize
                                                                                                            256;
                                                                                                          Value.Integer
                                                                                                            IntegerKind.Usize
                                                                                                            4
                                                                                                        ]
                                                                                                        [];
                                                                                                      Ty.apply
                                                                                                        (Ty.path
                                                                                                          "ruint::Uint")
                                                                                                        [
                                                                                                          Value.Integer
                                                                                                            IntegerKind.Usize
                                                                                                            256;
                                                                                                          Value.Integer
                                                                                                            IntegerKind.Usize
                                                                                                            4
                                                                                                        ]
                                                                                                        []
                                                                                                    ]
                                                                                                ]
                                                                                            ]
                                                                                        ]
                                                                                        (Ty.tuple
                                                                                          [
                                                                                            Ty.apply
                                                                                              (Ty.path
                                                                                                "ruint::Uint")
                                                                                              [
                                                                                                Value.Integer
                                                                                                  IntegerKind.Usize
                                                                                                  256;
                                                                                                Value.Integer
                                                                                                  IntegerKind.Usize
                                                                                                  4
                                                                                              ]
                                                                                              [];
                                                                                            Ty.path
                                                                                              "revm_primitives::state::StorageSlot"
                                                                                          ])
                                                                                    ],
                                                                                  [],
                                                                                  "collect",
                                                                                  [
                                                                                    Ty.apply
                                                                                      (Ty.path
                                                                                        "std::collections::hash::map::HashMap")
                                                                                      []
                                                                                      [
                                                                                        Ty.apply
                                                                                          (Ty.path
                                                                                            "ruint::Uint")
                                                                                          [
                                                                                            Value.Integer
                                                                                              IntegerKind.Usize
                                                                                              256;
                                                                                            Value.Integer
                                                                                              IntegerKind.Usize
                                                                                              4
                                                                                          ]
                                                                                          [];
                                                                                        Ty.path
                                                                                          "revm_primitives::state::StorageSlot";
                                                                                        Ty.path
                                                                                          "std::hash::random::RandomState"
                                                                                      ]
                                                                                  ]
                                                                                |),
                                                                                [
                                                                                  M.call_closure (|
                                                                                    M.get_trait_method (|
                                                                                      "core::iter::traits::iterator::Iterator",
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "std::collections::hash::map::IntoIter")
                                                                                        []
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "ruint::Uint")
                                                                                            [
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                256;
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                4
                                                                                            ]
                                                                                            [];
                                                                                          Ty.tuple
                                                                                            [
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                [];
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                []
                                                                                            ]
                                                                                        ],
                                                                                      [],
                                                                                      "map",
                                                                                      [
                                                                                        Ty.tuple
                                                                                          [
                                                                                            Ty.apply
                                                                                              (Ty.path
                                                                                                "ruint::Uint")
                                                                                              [
                                                                                                Value.Integer
                                                                                                  IntegerKind.Usize
                                                                                                  256;
                                                                                                Value.Integer
                                                                                                  IntegerKind.Usize
                                                                                                  4
                                                                                              ]
                                                                                              [];
                                                                                            Ty.path
                                                                                              "revm_primitives::state::StorageSlot"
                                                                                          ];
                                                                                        Ty.function
                                                                                          [
                                                                                            Ty.tuple
                                                                                              [
                                                                                                Ty.tuple
                                                                                                  [
                                                                                                    Ty.apply
                                                                                                      (Ty.path
                                                                                                        "ruint::Uint")
                                                                                                      [
                                                                                                        Value.Integer
                                                                                                          IntegerKind.Usize
                                                                                                          256;
                                                                                                        Value.Integer
                                                                                                          IntegerKind.Usize
                                                                                                          4
                                                                                                      ]
                                                                                                      [];
                                                                                                    Ty.tuple
                                                                                                      [
                                                                                                        Ty.apply
                                                                                                          (Ty.path
                                                                                                            "ruint::Uint")
                                                                                                          [
                                                                                                            Value.Integer
                                                                                                              IntegerKind.Usize
                                                                                                              256;
                                                                                                            Value.Integer
                                                                                                              IntegerKind.Usize
                                                                                                              4
                                                                                                          ]
                                                                                                          [];
                                                                                                        Ty.apply
                                                                                                          (Ty.path
                                                                                                            "ruint::Uint")
                                                                                                          [
                                                                                                            Value.Integer
                                                                                                              IntegerKind.Usize
                                                                                                              256;
                                                                                                            Value.Integer
                                                                                                              IntegerKind.Usize
                                                                                                              4
                                                                                                          ]
                                                                                                          []
                                                                                                      ]
                                                                                                  ]
                                                                                              ]
                                                                                          ]
                                                                                          (Ty.tuple
                                                                                            [
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                [];
                                                                                              Ty.path
                                                                                                "revm_primitives::state::StorageSlot"
                                                                                            ])
                                                                                      ]
                                                                                    |),
                                                                                    [
                                                                                      M.call_closure (|
                                                                                        M.get_trait_method (|
                                                                                          "core::iter::traits::collect::IntoIterator",
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "std::collections::hash::map::HashMap")
                                                                                            []
                                                                                            [
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                [];
                                                                                              Ty.tuple
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "ruint::Uint")
                                                                                                    [
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        256;
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        4
                                                                                                    ]
                                                                                                    [];
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "ruint::Uint")
                                                                                                    [
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        256;
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        4
                                                                                                    ]
                                                                                                    []
                                                                                                ];
                                                                                              Ty.path
                                                                                                "std::hash::random::RandomState"
                                                                                            ],
                                                                                          [],
                                                                                          "into_iter",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          M.read (|
                                                                                            s
                                                                                          |)
                                                                                        ]
                                                                                      |);
                                                                                      M.closure
                                                                                        (fun γ =>
                                                                                          ltac:(M.monadic
                                                                                            match γ
                                                                                            with
                                                                                            | [ α0
                                                                                                ] =>
                                                                                              ltac:(M.monadic
                                                                                                (M.match_operator (|
                                                                                                  M.alloc (|
                                                                                                    α0
                                                                                                  |),
                                                                                                  [
                                                                                                    fun
                                                                                                        γ =>
                                                                                                      ltac:(M.monadic
                                                                                                        (let
                                                                                                              γ0_0 :=
                                                                                                          M.SubPointer.get_tuple_field (|
                                                                                                            γ,
                                                                                                            0
                                                                                                          |) in
                                                                                                        let
                                                                                                              γ0_1 :=
                                                                                                          M.SubPointer.get_tuple_field (|
                                                                                                            γ,
                                                                                                            1
                                                                                                          |) in
                                                                                                        let
                                                                                                              k :=
                                                                                                          M.copy (|
                                                                                                            γ0_0
                                                                                                          |) in
                                                                                                        let
                                                                                                              γ1_0 :=
                                                                                                          M.SubPointer.get_tuple_field (|
                                                                                                            γ0_1,
                                                                                                            0
                                                                                                          |) in
                                                                                                        let
                                                                                                              γ1_1 :=
                                                                                                          M.SubPointer.get_tuple_field (|
                                                                                                            γ0_1,
                                                                                                            1
                                                                                                          |) in
                                                                                                        let
                                                                                                              o_val :=
                                                                                                          M.copy (|
                                                                                                            γ1_0
                                                                                                          |) in
                                                                                                        let
                                                                                                              p_val :=
                                                                                                          M.copy (|
                                                                                                            γ1_1
                                                                                                          |) in
                                                                                                        Value.Tuple
                                                                                                          [
                                                                                                            M.read (|
                                                                                                              k
                                                                                                            |);
                                                                                                            M.call_closure (|
                                                                                                              M.get_associated_function (|
                                                                                                                Ty.path
                                                                                                                  "revm_primitives::state::StorageSlot",
                                                                                                                "new_changed",
                                                                                                                []
                                                                                                              |),
                                                                                                              [
                                                                                                                M.read (|
                                                                                                                  o_val
                                                                                                                |);
                                                                                                                M.read (|
                                                                                                                  p_val
                                                                                                                |)
                                                                                                              ]
                                                                                                            |)
                                                                                                          ]))
                                                                                                  ]
                                                                                                |)))
                                                                                            | _ =>
                                                                                              M.impossible
                                                                                                "wrong number of arguments"
                                                                                            end))
                                                                                    ]
                                                                                  |)
                                                                                ]
                                                                              |)))
                                                                        ]
                                                                      |)))
                                                                  | _ =>
                                                                    M.impossible
                                                                      "wrong number of arguments"
                                                                  end))
                                                          ]
                                                        |)
                                                      ]
                                                    |)
                                                  |) in
                                                let~ bundle_account :=
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path
                                                          "revm::db::states::bundle_account::BundleAccount",
                                                        "new",
                                                        []
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path
                                                                "std::collections::hash::map::HashMap")
                                                              []
                                                              [
                                                                Ty.path
                                                                  "alloy_primitives::bits::address::Address";
                                                                Ty.path
                                                                  "revm_primitives::state::AccountInfo";
                                                                Ty.path
                                                                  "std::hash::random::RandomState"
                                                              ],
                                                            "remove",
                                                            [
                                                              Ty.path
                                                                "alloy_primitives::bits::address::Address"
                                                            ]
                                                          |),
                                                          [
                                                            M.SubPointer.get_struct_record_field (|
                                                              self,
                                                              "revm::db::states::bundle_state::BundleBuilder",
                                                              "state_original"
                                                            |);
                                                            address
                                                          ]
                                                        |);
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path
                                                                "std::collections::hash::map::HashMap")
                                                              []
                                                              [
                                                                Ty.path
                                                                  "alloy_primitives::bits::address::Address";
                                                                Ty.path
                                                                  "revm_primitives::state::AccountInfo";
                                                                Ty.path
                                                                  "std::hash::random::RandomState"
                                                              ],
                                                            "remove",
                                                            [
                                                              Ty.path
                                                                "alloy_primitives::bits::address::Address"
                                                            ]
                                                          |),
                                                          [
                                                            M.SubPointer.get_struct_record_field (|
                                                              self,
                                                              "revm::db::states::bundle_state::BundleBuilder",
                                                              "state_present"
                                                            |);
                                                            address
                                                          ]
                                                        |);
                                                        M.read (| storage |);
                                                        Value.StructTuple
                                                          "revm::db::states::account_status::AccountStatus::Changed"
                                                          []
                                                      ]
                                                    |)
                                                  |) in
                                                let~ _ :=
                                                  let β := state_size in
                                                  M.write (|
                                                    β,
                                                    BinOp.Wrap.add (|
                                                      M.read (| β |),
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path
                                                            "revm::db::states::bundle_account::BundleAccount",
                                                          "size_hint",
                                                          []
                                                        |),
                                                        [ bundle_account ]
                                                      |)
                                                    |)
                                                  |) in
                                                M.alloc (|
                                                  Value.Tuple
                                                    [
                                                      M.read (| address |);
                                                      M.read (| bundle_account |)
                                                    ]
                                                |)
                                              |)))
                                        ]
                                      |)))
                                  | _ => M.impossible "wrong number of arguments"
                                  end))
                          ]
                        |)
                      ]
                    |)
                  |) in
                let~ reverts_size := M.alloc (| Value.Integer IntegerKind.Usize 0 |) in
                let~ reverts_map :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::collections::btree::map::BTreeMap")
                          []
                          [
                            Ty.path "u64";
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              []
                              [
                                Ty.tuple
                                  [
                                    Ty.path "alloy_primitives::bits::address::Address";
                                    Ty.path "revm::db::states::reverts::AccountRevert"
                                  ];
                                Ty.path "alloc::alloc::Global"
                              ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        "new",
                        []
                      |),
                      []
                    |)
                  |) in
                let~ _ :=
                  M.use
                    (M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::collect::IntoIterator",
                            Ty.apply
                              (Ty.path "core::ops::range::RangeInclusive")
                              []
                              [ Ty.path "u64" ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                self,
                                "revm::db::states::bundle_state::BundleBuilder",
                                "revert_range"
                              |)
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let iter := M.copy (| γ |) in
                            M.loop (|
                              ltac:(M.monadic
                                (let~ _ :=
                                  M.match_operator (|
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::iter::traits::iterator::Iterator",
                                          Ty.apply
                                            (Ty.path "core::ops::range::RangeInclusive")
                                            []
                                            [ Ty.path "u64" ],
                                          [],
                                          "next",
                                          []
                                        |),
                                        [ iter ]
                                      |)
                                    |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let _ :=
                                            M.is_struct_tuple (|
                                              γ,
                                              "core::option::Option::None"
                                            |) in
                                          M.alloc (|
                                            M.never_to_any (| M.read (| M.break (||) |) |)
                                          |)));
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let γ0_0 :=
                                            M.SubPointer.get_struct_tuple_field (|
                                              γ,
                                              "core::option::Option::Some",
                                              0
                                            |) in
                                          let block_number := M.copy (| γ0_0 |) in
                                          let~ _ :=
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.apply
                                                    (Ty.path
                                                      "alloc::collections::btree::map::BTreeMap")
                                                    []
                                                    [
                                                      Ty.path "u64";
                                                      Ty.apply
                                                        (Ty.path "alloc::vec::Vec")
                                                        []
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.path
                                                                "alloy_primitives::bits::address::Address";
                                                              Ty.path
                                                                "revm::db::states::reverts::AccountRevert"
                                                            ];
                                                          Ty.path "alloc::alloc::Global"
                                                        ];
                                                      Ty.path "alloc::alloc::Global"
                                                    ],
                                                  "insert",
                                                  []
                                                |),
                                                [
                                                  reverts_map;
                                                  M.read (| block_number |);
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "alloc::vec::Vec")
                                                        []
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.path
                                                                "alloy_primitives::bits::address::Address";
                                                              Ty.path
                                                                "revm::db::states::reverts::AccountRevert"
                                                            ];
                                                          Ty.path "alloc::alloc::Global"
                                                        ],
                                                      "new",
                                                      []
                                                    |),
                                                    []
                                                  |)
                                                ]
                                              |)
                                            |) in
                                          M.alloc (| Value.Tuple [] |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::iter::traits::iterator::Iterator",
                        Ty.apply
                          (Ty.path "alloc::collections::btree::set::IntoIter")
                          []
                          [
                            Ty.tuple
                              [ Ty.path "u64"; Ty.path "alloy_primitives::bits::address::Address" ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "for_each",
                        [
                          Ty.function
                            [
                              Ty.tuple
                                [
                                  Ty.tuple
                                    [
                                      Ty.path "u64";
                                      Ty.path "alloy_primitives::bits::address::Address"
                                    ]
                                ]
                            ]
                            (Ty.tuple [])
                        ]
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::collect::IntoIterator",
                            Ty.apply
                              (Ty.path "alloc::collections::btree::set::BTreeSet")
                              []
                              [
                                Ty.tuple
                                  [
                                    Ty.path "u64";
                                    Ty.path "alloy_primitives::bits::address::Address"
                                  ];
                                Ty.path "alloc::alloc::Global"
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                self,
                                "revm::db::states::bundle_state::BundleBuilder",
                                "reverts"
                              |)
                            |)
                          ]
                        |);
                        M.closure
                          (fun γ =>
                            ltac:(M.monadic
                              match γ with
                              | [ α0 ] =>
                                ltac:(M.monadic
                                  (M.match_operator (|
                                    M.alloc (| α0 |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                          let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                          let block_number := M.copy (| γ0_0 |) in
                                          let address := M.copy (| γ0_1 |) in
                                          M.read (|
                                            let~ account :=
                                              M.copy (|
                                                M.match_operator (|
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path "core::option::Option")
                                                          []
                                                          [
                                                            Ty.apply
                                                              (Ty.path "core::option::Option")
                                                              []
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::option::Option")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "revm_primitives::state::AccountInfo"
                                                                  ]
                                                              ]
                                                          ],
                                                        "unwrap_or_default",
                                                        []
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path
                                                                "std::collections::hash::map::HashMap")
                                                              []
                                                              [
                                                                Ty.tuple
                                                                  [
                                                                    Ty.path "u64";
                                                                    Ty.path
                                                                      "alloy_primitives::bits::address::Address"
                                                                  ];
                                                                Ty.apply
                                                                  (Ty.path "core::option::Option")
                                                                  []
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "core::option::Option")
                                                                      []
                                                                      [
                                                                        Ty.path
                                                                          "revm_primitives::state::AccountInfo"
                                                                      ]
                                                                  ];
                                                                Ty.path
                                                                  "std::hash::random::RandomState"
                                                              ],
                                                            "remove",
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.path "u64";
                                                                  Ty.path
                                                                    "alloy_primitives::bits::address::Address"
                                                                ]
                                                            ]
                                                          |),
                                                          [
                                                            M.SubPointer.get_struct_record_field (|
                                                              self,
                                                              "revm::db::states::bundle_state::BundleBuilder",
                                                              "revert_account"
                                                            |);
                                                            M.alloc (|
                                                              Value.Tuple
                                                                [
                                                                  M.read (| block_number |);
                                                                  M.read (| address |)
                                                                ]
                                                            |)
                                                          ]
                                                        |)
                                                      ]
                                                    |)
                                                  |),
                                                  [
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let γ0_0 :=
                                                          M.SubPointer.get_struct_tuple_field (|
                                                            γ,
                                                            "core::option::Option::Some",
                                                            0
                                                          |) in
                                                        let γ1_0 :=
                                                          M.SubPointer.get_struct_tuple_field (|
                                                            γ0_0,
                                                            "core::option::Option::Some",
                                                            0
                                                          |) in
                                                        let account := M.copy (| γ1_0 |) in
                                                        M.alloc (|
                                                          Value.StructTuple
                                                            "revm::db::states::reverts::AccountInfoRevert::RevertTo"
                                                            [ M.read (| account |) ]
                                                        |)));
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let γ0_0 :=
                                                          M.SubPointer.get_struct_tuple_field (|
                                                            γ,
                                                            "core::option::Option::Some",
                                                            0
                                                          |) in
                                                        let _ :=
                                                          M.is_struct_tuple (|
                                                            γ0_0,
                                                            "core::option::Option::None"
                                                          |) in
                                                        M.alloc (|
                                                          Value.StructTuple
                                                            "revm::db::states::reverts::AccountInfoRevert::DeleteIt"
                                                            []
                                                        |)));
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let _ :=
                                                          M.is_struct_tuple (|
                                                            γ,
                                                            "core::option::Option::None"
                                                          |) in
                                                        M.alloc (|
                                                          Value.StructTuple
                                                            "revm::db::states::reverts::AccountInfoRevert::DoNothing"
                                                            []
                                                        |)))
                                                  ]
                                                |)
                                              |) in
                                            let~ storage :=
                                              M.alloc (|
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.apply
                                                      (Ty.path "core::option::Option")
                                                      []
                                                      [
                                                        Ty.apply
                                                          (Ty.path
                                                            "std::collections::hash::map::HashMap")
                                                          []
                                                          [
                                                            Ty.apply
                                                              (Ty.path "ruint::Uint")
                                                              [
                                                                Value.Integer IntegerKind.Usize 256;
                                                                Value.Integer IntegerKind.Usize 4
                                                              ]
                                                              [];
                                                            Ty.path
                                                              "revm::db::states::reverts::RevertToSlot";
                                                            Ty.path "std::hash::random::RandomState"
                                                          ]
                                                      ],
                                                    "unwrap_or_default",
                                                    []
                                                  |),
                                                  [
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path "core::option::Option")
                                                          []
                                                          [
                                                            Ty.apply
                                                              (Ty.path "alloc::vec::Vec")
                                                              []
                                                              [
                                                                Ty.tuple
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "ruint::Uint")
                                                                      [
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          256;
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          4
                                                                      ]
                                                                      [];
                                                                    Ty.apply
                                                                      (Ty.path "ruint::Uint")
                                                                      [
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          256;
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          4
                                                                      ]
                                                                      []
                                                                  ];
                                                                Ty.path "alloc::alloc::Global"
                                                              ]
                                                          ],
                                                        "map",
                                                        [
                                                          Ty.apply
                                                            (Ty.path
                                                              "std::collections::hash::map::HashMap")
                                                            []
                                                            [
                                                              Ty.apply
                                                                (Ty.path "ruint::Uint")
                                                                [
                                                                  Value.Integer
                                                                    IntegerKind.Usize
                                                                    256;
                                                                  Value.Integer IntegerKind.Usize 4
                                                                ]
                                                                [];
                                                              Ty.path
                                                                "revm::db::states::reverts::RevertToSlot";
                                                              Ty.path
                                                                "std::hash::random::RandomState"
                                                            ];
                                                          Ty.function
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "alloc::vec::Vec")
                                                                    []
                                                                    [
                                                                      Ty.tuple
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path "ruint::Uint")
                                                                            [
                                                                              Value.Integer
                                                                                IntegerKind.Usize
                                                                                256;
                                                                              Value.Integer
                                                                                IntegerKind.Usize
                                                                                4
                                                                            ]
                                                                            [];
                                                                          Ty.apply
                                                                            (Ty.path "ruint::Uint")
                                                                            [
                                                                              Value.Integer
                                                                                IntegerKind.Usize
                                                                                256;
                                                                              Value.Integer
                                                                                IntegerKind.Usize
                                                                                4
                                                                            ]
                                                                            []
                                                                        ];
                                                                      Ty.path "alloc::alloc::Global"
                                                                    ]
                                                                ]
                                                            ]
                                                            (Ty.apply
                                                              (Ty.path
                                                                "std::collections::hash::map::HashMap")
                                                              []
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "ruint::Uint")
                                                                  [
                                                                    Value.Integer
                                                                      IntegerKind.Usize
                                                                      256;
                                                                    Value.Integer
                                                                      IntegerKind.Usize
                                                                      4
                                                                  ]
                                                                  [];
                                                                Ty.path
                                                                  "revm::db::states::reverts::RevertToSlot";
                                                                Ty.path
                                                                  "std::hash::random::RandomState"
                                                              ])
                                                        ]
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path
                                                                "std::collections::hash::map::HashMap")
                                                              []
                                                              [
                                                                Ty.tuple
                                                                  [
                                                                    Ty.path "u64";
                                                                    Ty.path
                                                                      "alloy_primitives::bits::address::Address"
                                                                  ];
                                                                Ty.apply
                                                                  (Ty.path "alloc::vec::Vec")
                                                                  []
                                                                  [
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          []
                                                                      ];
                                                                    Ty.path "alloc::alloc::Global"
                                                                  ];
                                                                Ty.path
                                                                  "std::hash::random::RandomState"
                                                              ],
                                                            "remove",
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.path "u64";
                                                                  Ty.path
                                                                    "alloy_primitives::bits::address::Address"
                                                                ]
                                                            ]
                                                          |),
                                                          [
                                                            M.SubPointer.get_struct_record_field (|
                                                              self,
                                                              "revm::db::states::bundle_state::BundleBuilder",
                                                              "revert_storage"
                                                            |);
                                                            M.alloc (|
                                                              Value.Tuple
                                                                [
                                                                  M.read (| block_number |);
                                                                  M.read (| address |)
                                                                ]
                                                            |)
                                                          ]
                                                        |);
                                                        M.closure
                                                          (fun γ =>
                                                            ltac:(M.monadic
                                                              match γ with
                                                              | [ α0 ] =>
                                                                ltac:(M.monadic
                                                                  (M.match_operator (|
                                                                    M.alloc (| α0 |),
                                                                    [
                                                                      fun γ =>
                                                                        ltac:(M.monadic
                                                                          (let s :=
                                                                            M.copy (| γ |) in
                                                                          M.call_closure (|
                                                                            M.get_trait_method (|
                                                                              "core::iter::traits::iterator::Iterator",
                                                                              Ty.apply
                                                                                (Ty.path
                                                                                  "core::iter::adapters::map::Map")
                                                                                []
                                                                                [
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "alloc::vec::into_iter::IntoIter")
                                                                                    []
                                                                                    [
                                                                                      Ty.tuple
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "ruint::Uint")
                                                                                            [
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                256;
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                4
                                                                                            ]
                                                                                            [];
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "ruint::Uint")
                                                                                            [
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                256;
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                4
                                                                                            ]
                                                                                            []
                                                                                        ];
                                                                                      Ty.path
                                                                                        "alloc::alloc::Global"
                                                                                    ];
                                                                                  Ty.function
                                                                                    [
                                                                                      Ty.tuple
                                                                                        [
                                                                                          Ty.tuple
                                                                                            [
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                [];
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                []
                                                                                            ]
                                                                                        ]
                                                                                    ]
                                                                                    (Ty.tuple
                                                                                      [
                                                                                        Ty.apply
                                                                                          (Ty.path
                                                                                            "ruint::Uint")
                                                                                          [
                                                                                            Value.Integer
                                                                                              IntegerKind.Usize
                                                                                              256;
                                                                                            Value.Integer
                                                                                              IntegerKind.Usize
                                                                                              4
                                                                                          ]
                                                                                          [];
                                                                                        Ty.path
                                                                                          "revm::db::states::reverts::RevertToSlot"
                                                                                      ])
                                                                                ],
                                                                              [],
                                                                              "collect",
                                                                              [
                                                                                Ty.apply
                                                                                  (Ty.path
                                                                                    "std::collections::hash::map::HashMap")
                                                                                  []
                                                                                  [
                                                                                    Ty.apply
                                                                                      (Ty.path
                                                                                        "ruint::Uint")
                                                                                      [
                                                                                        Value.Integer
                                                                                          IntegerKind.Usize
                                                                                          256;
                                                                                        Value.Integer
                                                                                          IntegerKind.Usize
                                                                                          4
                                                                                      ]
                                                                                      [];
                                                                                    Ty.path
                                                                                      "revm::db::states::reverts::RevertToSlot";
                                                                                    Ty.path
                                                                                      "std::hash::random::RandomState"
                                                                                  ]
                                                                              ]
                                                                            |),
                                                                            [
                                                                              M.call_closure (|
                                                                                M.get_trait_method (|
                                                                                  "core::iter::traits::iterator::Iterator",
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "alloc::vec::into_iter::IntoIter")
                                                                                    []
                                                                                    [
                                                                                      Ty.tuple
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "ruint::Uint")
                                                                                            [
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                256;
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                4
                                                                                            ]
                                                                                            [];
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "ruint::Uint")
                                                                                            [
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                256;
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                4
                                                                                            ]
                                                                                            []
                                                                                        ];
                                                                                      Ty.path
                                                                                        "alloc::alloc::Global"
                                                                                    ],
                                                                                  [],
                                                                                  "map",
                                                                                  [
                                                                                    Ty.tuple
                                                                                      [
                                                                                        Ty.apply
                                                                                          (Ty.path
                                                                                            "ruint::Uint")
                                                                                          [
                                                                                            Value.Integer
                                                                                              IntegerKind.Usize
                                                                                              256;
                                                                                            Value.Integer
                                                                                              IntegerKind.Usize
                                                                                              4
                                                                                          ]
                                                                                          [];
                                                                                        Ty.path
                                                                                          "revm::db::states::reverts::RevertToSlot"
                                                                                      ];
                                                                                    Ty.function
                                                                                      [
                                                                                        Ty.tuple
                                                                                          [
                                                                                            Ty.tuple
                                                                                              [
                                                                                                Ty.apply
                                                                                                  (Ty.path
                                                                                                    "ruint::Uint")
                                                                                                  [
                                                                                                    Value.Integer
                                                                                                      IntegerKind.Usize
                                                                                                      256;
                                                                                                    Value.Integer
                                                                                                      IntegerKind.Usize
                                                                                                      4
                                                                                                  ]
                                                                                                  [];
                                                                                                Ty.apply
                                                                                                  (Ty.path
                                                                                                    "ruint::Uint")
                                                                                                  [
                                                                                                    Value.Integer
                                                                                                      IntegerKind.Usize
                                                                                                      256;
                                                                                                    Value.Integer
                                                                                                      IntegerKind.Usize
                                                                                                      4
                                                                                                  ]
                                                                                                  []
                                                                                              ]
                                                                                          ]
                                                                                      ]
                                                                                      (Ty.tuple
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "ruint::Uint")
                                                                                            [
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                256;
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                4
                                                                                            ]
                                                                                            [];
                                                                                          Ty.path
                                                                                            "revm::db::states::reverts::RevertToSlot"
                                                                                        ])
                                                                                  ]
                                                                                |),
                                                                                [
                                                                                  M.call_closure (|
                                                                                    M.get_trait_method (|
                                                                                      "core::iter::traits::collect::IntoIterator",
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "alloc::vec::Vec")
                                                                                        []
                                                                                        [
                                                                                          Ty.tuple
                                                                                            [
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                [];
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                []
                                                                                            ];
                                                                                          Ty.path
                                                                                            "alloc::alloc::Global"
                                                                                        ],
                                                                                      [],
                                                                                      "into_iter",
                                                                                      []
                                                                                    |),
                                                                                    [ M.read (| s |)
                                                                                    ]
                                                                                  |);
                                                                                  M.closure
                                                                                    (fun γ =>
                                                                                      ltac:(M.monadic
                                                                                        match γ with
                                                                                        | [ α0 ] =>
                                                                                          ltac:(M.monadic
                                                                                            (M.match_operator (|
                                                                                              M.alloc (|
                                                                                                α0
                                                                                              |),
                                                                                              [
                                                                                                fun
                                                                                                    γ =>
                                                                                                  ltac:(M.monadic
                                                                                                    (let
                                                                                                          γ0_0 :=
                                                                                                      M.SubPointer.get_tuple_field (|
                                                                                                        γ,
                                                                                                        0
                                                                                                      |) in
                                                                                                    let
                                                                                                          γ0_1 :=
                                                                                                      M.SubPointer.get_tuple_field (|
                                                                                                        γ,
                                                                                                        1
                                                                                                      |) in
                                                                                                    let
                                                                                                          k :=
                                                                                                      M.copy (|
                                                                                                        γ0_0
                                                                                                      |) in
                                                                                                    let
                                                                                                          v :=
                                                                                                      M.copy (|
                                                                                                        γ0_1
                                                                                                      |) in
                                                                                                    Value.Tuple
                                                                                                      [
                                                                                                        M.read (|
                                                                                                          k
                                                                                                        |);
                                                                                                        Value.StructTuple
                                                                                                          "revm::db::states::reverts::RevertToSlot::Some"
                                                                                                          [
                                                                                                            M.read (|
                                                                                                              v
                                                                                                            |)
                                                                                                          ]
                                                                                                      ]))
                                                                                              ]
                                                                                            |)))
                                                                                        | _ =>
                                                                                          M.impossible
                                                                                            "wrong number of arguments"
                                                                                        end))
                                                                                ]
                                                                              |)
                                                                            ]
                                                                          |)))
                                                                    ]
                                                                  |)))
                                                              | _ =>
                                                                M.impossible
                                                                  "wrong number of arguments"
                                                              end))
                                                      ]
                                                    |)
                                                  ]
                                                |)
                                              |) in
                                            let~ account_revert :=
                                              M.alloc (|
                                                Value.StructRecord
                                                  "revm::db::states::reverts::AccountRevert"
                                                  [
                                                    ("account", M.read (| account |));
                                                    ("storage", M.read (| storage |));
                                                    ("previous_status",
                                                      Value.StructTuple
                                                        "revm::db::states::account_status::AccountStatus::Changed"
                                                        []);
                                                    ("wipe_storage", Value.Bool false)
                                                  ]
                                              |) in
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.apply
                                                                (Ty.path
                                                                  "alloc::collections::btree::map::BTreeMap")
                                                                []
                                                                [
                                                                  Ty.path "u64";
                                                                  Ty.apply
                                                                    (Ty.path "alloc::vec::Vec")
                                                                    []
                                                                    [
                                                                      Ty.tuple
                                                                        [
                                                                          Ty.path
                                                                            "alloy_primitives::bits::address::Address";
                                                                          Ty.path
                                                                            "revm::db::states::reverts::AccountRevert"
                                                                        ];
                                                                      Ty.path "alloc::alloc::Global"
                                                                    ];
                                                                  Ty.path "alloc::alloc::Global"
                                                                ],
                                                              "contains_key",
                                                              [ Ty.path "u64" ]
                                                            |),
                                                            [ reverts_map; block_number ]
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    let~ _ :=
                                                      let β := reverts_size in
                                                      M.write (|
                                                        β,
                                                        BinOp.Wrap.add (|
                                                          M.read (| β |),
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "revm::db::states::reverts::AccountRevert",
                                                              "size_hint",
                                                              []
                                                            |),
                                                            [ account_revert ]
                                                          |)
                                                        |)
                                                      |) in
                                                    let~ _ :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path "alloc::vec::Vec")
                                                              []
                                                              [
                                                                Ty.tuple
                                                                  [
                                                                    Ty.path
                                                                      "alloy_primitives::bits::address::Address";
                                                                    Ty.path
                                                                      "revm::db::states::reverts::AccountRevert"
                                                                  ];
                                                                Ty.path "alloc::alloc::Global"
                                                              ],
                                                            "push",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.apply
                                                                  (Ty.path
                                                                    "alloc::collections::btree::map::entry::Entry")
                                                                  []
                                                                  [
                                                                    Ty.path "u64";
                                                                    Ty.apply
                                                                      (Ty.path "alloc::vec::Vec")
                                                                      []
                                                                      [
                                                                        Ty.tuple
                                                                          [
                                                                            Ty.path
                                                                              "alloy_primitives::bits::address::Address";
                                                                            Ty.path
                                                                              "revm::db::states::reverts::AccountRevert"
                                                                          ];
                                                                        Ty.path
                                                                          "alloc::alloc::Global"
                                                                      ];
                                                                    Ty.path "alloc::alloc::Global"
                                                                  ],
                                                                "or_insert",
                                                                []
                                                              |),
                                                              [
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "alloc::collections::btree::map::BTreeMap")
                                                                      []
                                                                      [
                                                                        Ty.path "u64";
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "alloc::vec::Vec")
                                                                          []
                                                                          [
                                                                            Ty.tuple
                                                                              [
                                                                                Ty.path
                                                                                  "alloy_primitives::bits::address::Address";
                                                                                Ty.path
                                                                                  "revm::db::states::reverts::AccountRevert"
                                                                              ];
                                                                            Ty.path
                                                                              "alloc::alloc::Global"
                                                                          ];
                                                                        Ty.path
                                                                          "alloc::alloc::Global"
                                                                      ],
                                                                    "entry",
                                                                    []
                                                                  |),
                                                                  [
                                                                    reverts_map;
                                                                    M.read (| block_number |)
                                                                  ]
                                                                |);
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.apply
                                                                      (Ty.path "alloc::vec::Vec")
                                                                      []
                                                                      [
                                                                        Ty.tuple
                                                                          [
                                                                            Ty.path
                                                                              "alloy_primitives::bits::address::Address";
                                                                            Ty.path
                                                                              "revm::db::states::reverts::AccountRevert"
                                                                          ];
                                                                        Ty.path
                                                                          "alloc::alloc::Global"
                                                                      ],
                                                                    "new",
                                                                    []
                                                                  |),
                                                                  []
                                                                |)
                                                              ]
                                                            |);
                                                            Value.Tuple
                                                              [
                                                                M.read (| address |);
                                                                M.read (| account_revert |)
                                                              ]
                                                          ]
                                                        |)
                                                      |) in
                                                    M.alloc (| Value.Tuple [] |)));
                                                fun γ =>
                                                  ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |)
                                          |)))
                                    ]
                                  |)))
                              | _ => M.impossible "wrong number of arguments"
                              end))
                      ]
                    |)
                  |) in
                M.alloc (|
                  Value.StructRecord
                    "revm::db::states::bundle_state::BundleState"
                    [
                      ("state", M.read (| state |));
                      ("contracts",
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            self,
                            "revm::db::states::bundle_state::BundleBuilder",
                            "contracts"
                          |)
                        |));
                      ("reverts",
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "revm::db::states::reverts::Reverts",
                            "new",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::iterator::Iterator",
                                Ty.apply
                                  (Ty.path "alloc::collections::btree::map::IntoValues")
                                  []
                                  [
                                    Ty.path "u64";
                                    Ty.apply
                                      (Ty.path "alloc::vec::Vec")
                                      []
                                      [
                                        Ty.tuple
                                          [
                                            Ty.path "alloy_primitives::bits::address::Address";
                                            Ty.path "revm::db::states::reverts::AccountRevert"
                                          ];
                                        Ty.path "alloc::alloc::Global"
                                      ];
                                    Ty.path "alloc::alloc::Global"
                                  ],
                                [],
                                "collect",
                                [
                                  Ty.apply
                                    (Ty.path "alloc::vec::Vec")
                                    []
                                    [
                                      Ty.apply
                                        (Ty.path "alloc::vec::Vec")
                                        []
                                        [
                                          Ty.tuple
                                            [
                                              Ty.path "alloy_primitives::bits::address::Address";
                                              Ty.path "revm::db::states::reverts::AccountRevert"
                                            ];
                                          Ty.path "alloc::alloc::Global"
                                        ];
                                      Ty.path "alloc::alloc::Global"
                                    ]
                                ]
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "alloc::collections::btree::map::BTreeMap")
                                      []
                                      [
                                        Ty.path "u64";
                                        Ty.apply
                                          (Ty.path "alloc::vec::Vec")
                                          []
                                          [
                                            Ty.tuple
                                              [
                                                Ty.path "alloy_primitives::bits::address::Address";
                                                Ty.path "revm::db::states::reverts::AccountRevert"
                                              ];
                                            Ty.path "alloc::alloc::Global"
                                          ];
                                        Ty.path "alloc::alloc::Global"
                                      ],
                                    "into_values",
                                    []
                                  |),
                                  [ M.read (| reverts_map |) ]
                                |)
                              ]
                            |)
                          ]
                        |));
                      ("state_size", M.read (| state_size |));
                      ("reverts_size", M.read (| reverts_size |))
                    ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_build : M.IsAssociatedFunction Self "build" build.
        
        (*
            pub fn get_states(&self) -> &HashSet<Address> {
                &self.states
            }
        *)
        Definition get_states (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "revm::db::states::bundle_state::BundleBuilder",
                "states"
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_get_states : M.IsAssociatedFunction Self "get_states" get_states.
      End Impl_revm_db_states_bundle_state_BundleBuilder.
      
      (*
      Enum BundleRetention
      {
        const_params := [];
        ty_params := [];
        variants :=
          [
            {
              name := "PlainState";
              item := StructTuple [];
              discriminant := None;
            };
            {
              name := "Reverts";
              item := StructTuple [];
              discriminant := None;
            }
          ];
      }
      *)
      
      Module Impl_core_fmt_Debug_for_revm_db_states_bundle_state_BundleRetention.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleRetention".
        
        (* Debug *)
        Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; f ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let f := M.alloc (| f |) in
              M.call_closure (|
                M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [] |),
                [
                  M.read (| f |);
                  M.read (|
                    M.match_operator (|
                      self,
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ := M.read (| γ |) in
                            let _ :=
                              M.is_struct_tuple (|
                                γ,
                                "revm::db::states::bundle_state::BundleRetention::PlainState"
                              |) in
                            M.alloc (| M.read (| Value.String "PlainState" |) |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ := M.read (| γ |) in
                            let _ :=
                              M.is_struct_tuple (|
                                γ,
                                "revm::db::states::bundle_state::BundleRetention::Reverts"
                              |) in
                            M.alloc (| M.read (| Value.String "Reverts" |) |)))
                      ]
                    |)
                  |)
                ]
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::fmt::Debug"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
      End Impl_core_fmt_Debug_for_revm_db_states_bundle_state_BundleRetention.
      
      Module Impl_revm_db_states_bundle_state_BundleRetention.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleRetention".
        
        (*
            pub fn includes_reverts(&self) -> bool {
                matches!(self, Self::Reverts)
            }
        *)
        Definition includes_reverts (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.read (|
                M.match_operator (|
                  self,
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        let _ :=
                          M.is_struct_tuple (|
                            γ,
                            "revm::db::states::bundle_state::BundleRetention::Reverts"
                          |) in
                        M.alloc (| Value.Bool true |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Bool false |)))
                  ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_includes_reverts :
          M.IsAssociatedFunction Self "includes_reverts" includes_reverts.
      End Impl_revm_db_states_bundle_state_BundleRetention.
      
      (* StructRecord
        {
          name := "BundleState";
          const_params := [];
          ty_params := [];
          fields :=
            [
              ("state",
                Ty.apply
                  (Ty.path "std::collections::hash::map::HashMap")
                  []
                  [
                    Ty.path "alloy_primitives::bits::address::Address";
                    Ty.path "revm::db::states::bundle_account::BundleAccount";
                    Ty.path "std::hash::random::RandomState"
                  ]);
              ("contracts",
                Ty.apply
                  (Ty.path "std::collections::hash::map::HashMap")
                  []
                  [
                    Ty.apply
                      (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                      [ Value.Integer IntegerKind.Usize 32 ]
                      [];
                    Ty.path "revm_primitives::bytecode::Bytecode";
                    Ty.path "std::hash::random::RandomState"
                  ]);
              ("reverts", Ty.path "revm::db::states::reverts::Reverts");
              ("state_size", Ty.path "usize");
              ("reverts_size", Ty.path "usize")
            ];
        } *)
      
      Module Impl_core_default_Default_for_revm_db_states_bundle_state_BundleState.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleState".
        
        (* Default *)
        Definition default (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [] =>
            ltac:(M.monadic
              (Value.StructRecord
                "revm::db::states::bundle_state::BundleState"
                [
                  ("state",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "revm::db::states::bundle_account::BundleAccount";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        [],
                        "default",
                        []
                      |),
                      []
                    |));
                  ("contracts",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.apply
                              (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                              [ Value.Integer IntegerKind.Usize 32 ]
                              [];
                            Ty.path "revm_primitives::bytecode::Bytecode";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        [],
                        "default",
                        []
                      |),
                      []
                    |));
                  ("reverts",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.path "revm::db::states::reverts::Reverts",
                        [],
                        "default",
                        []
                      |),
                      []
                    |));
                  ("state_size",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.path "usize",
                        [],
                        "default",
                        []
                      |),
                      []
                    |));
                  ("reverts_size",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.path "usize",
                        [],
                        "default",
                        []
                      |),
                      []
                    |))
                ]))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::default::Default"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("default", InstanceField.Method default) ].
      End Impl_core_default_Default_for_revm_db_states_bundle_state_BundleState.
      
      Module Impl_core_clone_Clone_for_revm_db_states_bundle_state_BundleState.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleState".
        
        (* Clone *)
        Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              Value.StructRecord
                "revm::db::states::bundle_state::BundleState"
                [
                  ("state",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "revm::db::states::bundle_account::BundleAccount";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm::db::states::bundle_state::BundleState",
                          "state"
                        |)
                      ]
                    |));
                  ("contracts",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.apply
                              (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                              [ Value.Integer IntegerKind.Usize 32 ]
                              [];
                            Ty.path "revm_primitives::bytecode::Bytecode";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm::db::states::bundle_state::BundleState",
                          "contracts"
                        |)
                      ]
                    |));
                  ("reverts",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.path "revm::db::states::reverts::Reverts",
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm::db::states::bundle_state::BundleState",
                          "reverts"
                        |)
                      ]
                    |));
                  ("state_size",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.path "usize",
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm::db::states::bundle_state::BundleState",
                          "state_size"
                        |)
                      ]
                    |));
                  ("reverts_size",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.path "usize",
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm::db::states::bundle_state::BundleState",
                          "reverts_size"
                        |)
                      ]
                    |))
                ]))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::clone::Clone"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("clone", InstanceField.Method clone) ].
      End Impl_core_clone_Clone_for_revm_db_states_bundle_state_BundleState.
      
      Module Impl_core_fmt_Debug_for_revm_db_states_bundle_state_BundleState.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleState".
        
        (* Debug *)
        Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; f ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let f := M.alloc (| f |) in
              M.call_closure (|
                M.get_associated_function (|
                  Ty.path "core::fmt::Formatter",
                  "debug_struct_field5_finish",
                  []
                |),
                [
                  M.read (| f |);
                  M.read (| Value.String "BundleState" |);
                  M.read (| Value.String "state" |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm::db::states::bundle_state::BundleState",
                    "state"
                  |);
                  M.read (| Value.String "contracts" |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm::db::states::bundle_state::BundleState",
                    "contracts"
                  |);
                  M.read (| Value.String "reverts" |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm::db::states::bundle_state::BundleState",
                    "reverts"
                  |);
                  M.read (| Value.String "state_size" |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm::db::states::bundle_state::BundleState",
                    "state_size"
                  |);
                  M.read (| Value.String "reverts_size" |);
                  M.alloc (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "revm::db::states::bundle_state::BundleState",
                      "reverts_size"
                    |)
                  |)
                ]
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::fmt::Debug"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
      End Impl_core_fmt_Debug_for_revm_db_states_bundle_state_BundleState.
      
      Module Impl_core_marker_StructuralPartialEq_for_revm_db_states_bundle_state_BundleState.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleState".
        
        Axiom Implements :
          M.IsTraitInstance
            "core::marker::StructuralPartialEq"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [].
      End Impl_core_marker_StructuralPartialEq_for_revm_db_states_bundle_state_BundleState.
      
      Module Impl_core_cmp_PartialEq_for_revm_db_states_bundle_state_BundleState.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleState".
        
        (* PartialEq *)
        Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; other ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let other := M.alloc (| other |) in
              LogicalOp.and (|
                LogicalOp.and (|
                  LogicalOp.and (|
                    LogicalOp.and (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialEq",
                          Ty.apply
                            (Ty.path "std::collections::hash::map::HashMap")
                            []
                            [
                              Ty.path "alloy_primitives::bits::address::Address";
                              Ty.path "revm::db::states::bundle_account::BundleAccount";
                              Ty.path "std::hash::random::RandomState"
                            ],
                          [
                            Ty.apply
                              (Ty.path "std::collections::hash::map::HashMap")
                              []
                              [
                                Ty.path "alloy_primitives::bits::address::Address";
                                Ty.path "revm::db::states::bundle_account::BundleAccount";
                                Ty.path "std::hash::random::RandomState"
                              ]
                          ],
                          "eq",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleState",
                            "state"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "revm::db::states::bundle_state::BundleState",
                            "state"
                          |)
                        ]
                      |),
                      ltac:(M.monadic
                        (M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::PartialEq",
                            Ty.apply
                              (Ty.path "std::collections::hash::map::HashMap")
                              []
                              [
                                Ty.apply
                                  (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                  [ Value.Integer IntegerKind.Usize 32 ]
                                  [];
                                Ty.path "revm_primitives::bytecode::Bytecode";
                                Ty.path "std::hash::random::RandomState"
                              ],
                            [
                              Ty.apply
                                (Ty.path "std::collections::hash::map::HashMap")
                                []
                                [
                                  Ty.apply
                                    (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                    [ Value.Integer IntegerKind.Usize 32 ]
                                    [];
                                  Ty.path "revm_primitives::bytecode::Bytecode";
                                  Ty.path "std::hash::random::RandomState"
                                ]
                            ],
                            "eq",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "revm::db::states::bundle_state::BundleState",
                              "contracts"
                            |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| other |),
                              "revm::db::states::bundle_state::BundleState",
                              "contracts"
                            |)
                          ]
                        |)))
                    |),
                    ltac:(M.monadic
                      (M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialEq",
                          Ty.path "revm::db::states::reverts::Reverts",
                          [ Ty.path "revm::db::states::reverts::Reverts" ],
                          "eq",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm::db::states::bundle_state::BundleState",
                            "reverts"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "revm::db::states::bundle_state::BundleState",
                            "reverts"
                          |)
                        ]
                      |)))
                  |),
                  ltac:(M.monadic
                    (BinOp.eq (|
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm::db::states::bundle_state::BundleState",
                          "state_size"
                        |)
                      |),
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| other |),
                          "revm::db::states::bundle_state::BundleState",
                          "state_size"
                        |)
                      |)
                    |)))
                |),
                ltac:(M.monadic
                  (BinOp.eq (|
                    M.read (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "revm::db::states::bundle_state::BundleState",
                        "reverts_size"
                      |)
                    |),
                    M.read (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "revm::db::states::bundle_state::BundleState",
                        "reverts_size"
                      |)
                    |)
                  |)))
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::cmp::PartialEq"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [ ("eq", InstanceField.Method eq) ].
      End Impl_core_cmp_PartialEq_for_revm_db_states_bundle_state_BundleState.
      
      Module Impl_core_cmp_Eq_for_revm_db_states_bundle_state_BundleState.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleState".
        
        (* Eq *)
        Definition assert_receiver_is_total_eq
            (ε : list Value.t)
            (τ : list Ty.t)
            (α : list Value.t)
            : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.read (|
                M.match_operator (|
                  Value.DeclaredButUndefined,
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (M.match_operator (|
                          Value.DeclaredButUndefined,
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  Value.DeclaredButUndefined,
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.match_operator (|
                                          Value.DeclaredButUndefined,
                                          [ fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                          ]
                                        |)))
                                  ]
                                |)))
                          ]
                        |)))
                  ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom Implements :
          M.IsTraitInstance
            "core::cmp::Eq"
            Self
            (* Trait polymorphic types *) []
            (* Instance *)
            [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
      End Impl_core_cmp_Eq_for_revm_db_states_bundle_state_BundleState.
      
      Module Impl_revm_db_states_bundle_state_BundleState.
        Definition Self : Ty.t := Ty.path "revm::db::states::bundle_state::BundleState".
        
        (*
            pub fn builder(revert_range: RangeInclusive<u64>) -> BundleBuilder {
                BundleBuilder::new(revert_range)
            }
        *)
        Definition builder (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ revert_range ] =>
            ltac:(M.monadic
              (let revert_range := M.alloc (| revert_range |) in
              M.call_closure (|
                M.get_associated_function (|
                  Ty.path "revm::db::states::bundle_state::BundleBuilder",
                  "new",
                  []
                |),
                [ M.read (| revert_range |) ]
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_builder : M.IsAssociatedFunction Self "builder" builder.
        
        (*
            pub fn new(
                state: impl IntoIterator<
                    Item = (
                        Address,
                        Option<AccountInfo>,
                        Option<AccountInfo>,
                        HashMap<U256, (U256, U256)>,
                    ),
                >,
                reverts: impl IntoIterator<
                    Item = impl IntoIterator<
                        Item = (
                            Address,
                            Option<Option<AccountInfo>>,
                            impl IntoIterator<Item = (U256, U256)>,
                        ),
                    >,
                >,
                contracts: impl IntoIterator<Item = (B256, Bytecode)>,
            ) -> Self {
                // Create state from iterator.
                let mut state_size = 0;
                let state = state
                    .into_iter()
                    .map(|(address, original, present, storage)| {
                        let account = BundleAccount::new(
                            original,
                            present,
                            storage
                                .into_iter()
                                .map(|(k, (o_val, p_val))| (k, StorageSlot::new_changed(o_val, p_val)))
                                .collect(),
                            AccountStatus::Changed,
                        );
                        state_size += account.size_hint();
                        (address, account)
                    })
                    .collect();
        
                // Create reverts from iterator.
                let mut reverts_size = 0;
                let reverts = reverts
                    .into_iter()
                    .map(|block_reverts| {
                        block_reverts
                            .into_iter()
                            .map(|(address, account, storage)| {
                                let account = match account {
                                    Some(Some(account)) => AccountInfoRevert::RevertTo(account),
                                    Some(None) => AccountInfoRevert::DeleteIt,
                                    None => AccountInfoRevert::DoNothing,
                                };
                                let revert = AccountRevert {
                                    account,
                                    storage: storage
                                        .into_iter()
                                        .map(|(k, v)| (k, RevertToSlot::Some(v)))
                                        .collect(),
                                    previous_status: AccountStatus::Changed,
                                    wipe_storage: false,
                                };
                                reverts_size += revert.size_hint();
                                (address, revert)
                            })
                            .collect::<Vec<_>>()
                    })
                    .collect::<Vec<_>>();
        
                Self {
                    state,
                    contracts: contracts.into_iter().collect(),
                    reverts: Reverts::new(reverts),
                    state_size,
                    reverts_size,
                }
            }
        *)
        Definition new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [],
              [
                impl_IntoIterator_Item____Address__Option_AccountInfo___Option_AccountInfo___HashMap_U256___U256__U256____;
                impl_IntoIterator_Item____U256__U256__;
                impl_IntoIterator_Item____Address__Option_Option_AccountInfo____impl_IntoIterator_Item____U256__U256____;
                impl_IntoIterator_Item___impl_IntoIterator_Item____Address__Option_Option_AccountInfo____impl_IntoIterator_Item____U256__U256_____;
                impl_IntoIterator_Item____B256__Bytecode__
              ],
              [ state; reverts; contracts ] =>
            ltac:(M.monadic
              (let state := M.alloc (| state |) in
              let reverts := M.alloc (| reverts |) in
              let contracts := M.alloc (| contracts |) in
              M.read (|
                let~ state_size := M.alloc (| Value.Integer IntegerKind.Usize 0 |) in
                let~ state :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::iter::traits::iterator::Iterator",
                        Ty.apply
                          (Ty.path "core::iter::adapters::map::Map")
                          []
                          [
                            Ty.associated;
                            Ty.function
                              [
                                Ty.tuple
                                  [
                                    Ty.tuple
                                      [
                                        Ty.path "alloy_primitives::bits::address::Address";
                                        Ty.apply
                                          (Ty.path "core::option::Option")
                                          []
                                          [ Ty.path "revm_primitives::state::AccountInfo" ];
                                        Ty.apply
                                          (Ty.path "core::option::Option")
                                          []
                                          [ Ty.path "revm_primitives::state::AccountInfo" ];
                                        Ty.apply
                                          (Ty.path "std::collections::hash::map::HashMap")
                                          []
                                          [
                                            Ty.apply
                                              (Ty.path "ruint::Uint")
                                              [
                                                Value.Integer IntegerKind.Usize 256;
                                                Value.Integer IntegerKind.Usize 4
                                              ]
                                              [];
                                            Ty.tuple
                                              [
                                                Ty.apply
                                                  (Ty.path "ruint::Uint")
                                                  [
                                                    Value.Integer IntegerKind.Usize 256;
                                                    Value.Integer IntegerKind.Usize 4
                                                  ]
                                                  [];
                                                Ty.apply
                                                  (Ty.path "ruint::Uint")
                                                  [
                                                    Value.Integer IntegerKind.Usize 256;
                                                    Value.Integer IntegerKind.Usize 4
                                                  ]
                                                  []
                                              ];
                                            Ty.path "std::hash::random::RandomState"
                                          ]
                                      ]
                                  ]
                              ]
                              (Ty.tuple
                                [
                                  Ty.path "alloy_primitives::bits::address::Address";
                                  Ty.path "revm::db::states::bundle_account::BundleAccount"
                                ])
                          ],
                        [],
                        "collect",
                        [
                          Ty.apply
                            (Ty.path "std::collections::hash::map::HashMap")
                            []
                            [
                              Ty.path "alloy_primitives::bits::address::Address";
                              Ty.path "revm::db::states::bundle_account::BundleAccount";
                              Ty.path "std::hash::random::RandomState"
                            ]
                        ]
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::iterator::Iterator",
                            Ty.associated,
                            [],
                            "map",
                            [
                              Ty.tuple
                                [
                                  Ty.path "alloy_primitives::bits::address::Address";
                                  Ty.path "revm::db::states::bundle_account::BundleAccount"
                                ];
                              Ty.function
                                [
                                  Ty.tuple
                                    [
                                      Ty.tuple
                                        [
                                          Ty.path "alloy_primitives::bits::address::Address";
                                          Ty.apply
                                            (Ty.path "core::option::Option")
                                            []
                                            [ Ty.path "revm_primitives::state::AccountInfo" ];
                                          Ty.apply
                                            (Ty.path "core::option::Option")
                                            []
                                            [ Ty.path "revm_primitives::state::AccountInfo" ];
                                          Ty.apply
                                            (Ty.path "std::collections::hash::map::HashMap")
                                            []
                                            [
                                              Ty.apply
                                                (Ty.path "ruint::Uint")
                                                [
                                                  Value.Integer IntegerKind.Usize 256;
                                                  Value.Integer IntegerKind.Usize 4
                                                ]
                                                [];
                                              Ty.tuple
                                                [
                                                  Ty.apply
                                                    (Ty.path "ruint::Uint")
                                                    [
                                                      Value.Integer IntegerKind.Usize 256;
                                                      Value.Integer IntegerKind.Usize 4
                                                    ]
                                                    [];
                                                  Ty.apply
                                                    (Ty.path "ruint::Uint")
                                                    [
                                                      Value.Integer IntegerKind.Usize 256;
                                                      Value.Integer IntegerKind.Usize 4
                                                    ]
                                                    []
                                                ];
                                              Ty.path "std::hash::random::RandomState"
                                            ]
                                        ]
                                    ]
                                ]
                                (Ty.tuple
                                  [
                                    Ty.path "alloy_primitives::bits::address::Address";
                                    Ty.path "revm::db::states::bundle_account::BundleAccount"
                                  ])
                            ]
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::collect::IntoIterator",
                                impl_IntoIterator_Item____Address__Option_AccountInfo___Option_AccountInfo___HashMap_U256___U256__U256____,
                                [],
                                "into_iter",
                                []
                              |),
                              [ M.read (| state |) ]
                            |);
                            M.closure
                              (fun γ =>
                                ltac:(M.monadic
                                  match γ with
                                  | [ α0 ] =>
                                    ltac:(M.monadic
                                      (M.match_operator (|
                                        M.alloc (| α0 |),
                                        [
                                          fun γ =>
                                            ltac:(M.monadic
                                              (let γ0_0 :=
                                                M.SubPointer.get_tuple_field (| γ, 0 |) in
                                              let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                              let γ0_2 := M.SubPointer.get_tuple_field (| γ, 2 |) in
                                              let γ0_3 := M.SubPointer.get_tuple_field (| γ, 3 |) in
                                              let address := M.copy (| γ0_0 |) in
                                              let original := M.copy (| γ0_1 |) in
                                              let present := M.copy (| γ0_2 |) in
                                              let storage := M.copy (| γ0_3 |) in
                                              M.read (|
                                                let~ account :=
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path
                                                          "revm::db::states::bundle_account::BundleAccount",
                                                        "new",
                                                        []
                                                      |),
                                                      [
                                                        M.read (| original |);
                                                        M.read (| present |);
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::iter::traits::iterator::Iterator",
                                                            Ty.apply
                                                              (Ty.path
                                                                "core::iter::adapters::map::Map")
                                                              []
                                                              [
                                                                Ty.apply
                                                                  (Ty.path
                                                                    "std::collections::hash::map::IntoIter")
                                                                  []
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "ruint::Uint")
                                                                      [
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          256;
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          4
                                                                      ]
                                                                      [];
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          []
                                                                      ]
                                                                  ];
                                                                Ty.function
                                                                  [
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.tuple
                                                                          [
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "ruint::Uint")
                                                                              [
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  256;
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  4
                                                                              ]
                                                                              [];
                                                                            Ty.tuple
                                                                              [
                                                                                Ty.apply
                                                                                  (Ty.path
                                                                                    "ruint::Uint")
                                                                                  [
                                                                                    Value.Integer
                                                                                      IntegerKind.Usize
                                                                                      256;
                                                                                    Value.Integer
                                                                                      IntegerKind.Usize
                                                                                      4
                                                                                  ]
                                                                                  [];
                                                                                Ty.apply
                                                                                  (Ty.path
                                                                                    "ruint::Uint")
                                                                                  [
                                                                                    Value.Integer
                                                                                      IntegerKind.Usize
                                                                                      256;
                                                                                    Value.Integer
                                                                                      IntegerKind.Usize
                                                                                      4
                                                                                  ]
                                                                                  []
                                                                              ]
                                                                          ]
                                                                      ]
                                                                  ]
                                                                  (Ty.tuple
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "ruint::Uint")
                                                                        [
                                                                          Value.Integer
                                                                            IntegerKind.Usize
                                                                            256;
                                                                          Value.Integer
                                                                            IntegerKind.Usize
                                                                            4
                                                                        ]
                                                                        [];
                                                                      Ty.path
                                                                        "revm_primitives::state::StorageSlot"
                                                                    ])
                                                              ],
                                                            [],
                                                            "collect",
                                                            [
                                                              Ty.apply
                                                                (Ty.path
                                                                  "std::collections::hash::map::HashMap")
                                                                []
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "ruint::Uint")
                                                                    [
                                                                      Value.Integer
                                                                        IntegerKind.Usize
                                                                        256;
                                                                      Value.Integer
                                                                        IntegerKind.Usize
                                                                        4
                                                                    ]
                                                                    [];
                                                                  Ty.path
                                                                    "revm_primitives::state::StorageSlot";
                                                                  Ty.path
                                                                    "std::hash::random::RandomState"
                                                                ]
                                                            ]
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_trait_method (|
                                                                "core::iter::traits::iterator::Iterator",
                                                                Ty.apply
                                                                  (Ty.path
                                                                    "std::collections::hash::map::IntoIter")
                                                                  []
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "ruint::Uint")
                                                                      [
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          256;
                                                                        Value.Integer
                                                                          IntegerKind.Usize
                                                                          4
                                                                      ]
                                                                      [];
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          []
                                                                      ]
                                                                  ],
                                                                [],
                                                                "map",
                                                                [
                                                                  Ty.tuple
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "ruint::Uint")
                                                                        [
                                                                          Value.Integer
                                                                            IntegerKind.Usize
                                                                            256;
                                                                          Value.Integer
                                                                            IntegerKind.Usize
                                                                            4
                                                                        ]
                                                                        [];
                                                                      Ty.path
                                                                        "revm_primitives::state::StorageSlot"
                                                                    ];
                                                                  Ty.function
                                                                    [
                                                                      Ty.tuple
                                                                        [
                                                                          Ty.tuple
                                                                            [
                                                                              Ty.apply
                                                                                (Ty.path
                                                                                  "ruint::Uint")
                                                                                [
                                                                                  Value.Integer
                                                                                    IntegerKind.Usize
                                                                                    256;
                                                                                  Value.Integer
                                                                                    IntegerKind.Usize
                                                                                    4
                                                                                ]
                                                                                [];
                                                                              Ty.tuple
                                                                                [
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "ruint::Uint")
                                                                                    [
                                                                                      Value.Integer
                                                                                        IntegerKind.Usize
                                                                                        256;
                                                                                      Value.Integer
                                                                                        IntegerKind.Usize
                                                                                        4
                                                                                    ]
                                                                                    [];
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "ruint::Uint")
                                                                                    [
                                                                                      Value.Integer
                                                                                        IntegerKind.Usize
                                                                                        256;
                                                                                      Value.Integer
                                                                                        IntegerKind.Usize
                                                                                        4
                                                                                    ]
                                                                                    []
                                                                                ]
                                                                            ]
                                                                        ]
                                                                    ]
                                                                    (Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.path
                                                                          "revm_primitives::state::StorageSlot"
                                                                      ])
                                                                ]
                                                              |),
                                                              [
                                                                M.call_closure (|
                                                                  M.get_trait_method (|
                                                                    "core::iter::traits::collect::IntoIterator",
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "std::collections::hash::map::HashMap")
                                                                      []
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.tuple
                                                                          [
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "ruint::Uint")
                                                                              [
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  256;
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  4
                                                                              ]
                                                                              [];
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "ruint::Uint")
                                                                              [
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  256;
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  4
                                                                              ]
                                                                              []
                                                                          ];
                                                                        Ty.path
                                                                          "std::hash::random::RandomState"
                                                                      ],
                                                                    [],
                                                                    "into_iter",
                                                                    []
                                                                  |),
                                                                  [ M.read (| storage |) ]
                                                                |);
                                                                M.closure
                                                                  (fun γ =>
                                                                    ltac:(M.monadic
                                                                      match γ with
                                                                      | [ α0 ] =>
                                                                        ltac:(M.monadic
                                                                          (M.match_operator (|
                                                                            M.alloc (| α0 |),
                                                                            [
                                                                              fun γ =>
                                                                                ltac:(M.monadic
                                                                                  (let γ0_0 :=
                                                                                    M.SubPointer.get_tuple_field (|
                                                                                      γ,
                                                                                      0
                                                                                    |) in
                                                                                  let γ0_1 :=
                                                                                    M.SubPointer.get_tuple_field (|
                                                                                      γ,
                                                                                      1
                                                                                    |) in
                                                                                  let k :=
                                                                                    M.copy (|
                                                                                      γ0_0
                                                                                    |) in
                                                                                  let γ1_0 :=
                                                                                    M.SubPointer.get_tuple_field (|
                                                                                      γ0_1,
                                                                                      0
                                                                                    |) in
                                                                                  let γ1_1 :=
                                                                                    M.SubPointer.get_tuple_field (|
                                                                                      γ0_1,
                                                                                      1
                                                                                    |) in
                                                                                  let o_val :=
                                                                                    M.copy (|
                                                                                      γ1_0
                                                                                    |) in
                                                                                  let p_val :=
                                                                                    M.copy (|
                                                                                      γ1_1
                                                                                    |) in
                                                                                  Value.Tuple
                                                                                    [
                                                                                      M.read (|
                                                                                        k
                                                                                      |);
                                                                                      M.call_closure (|
                                                                                        M.get_associated_function (|
                                                                                          Ty.path
                                                                                            "revm_primitives::state::StorageSlot",
                                                                                          "new_changed",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          M.read (|
                                                                                            o_val
                                                                                          |);
                                                                                          M.read (|
                                                                                            p_val
                                                                                          |)
                                                                                        ]
                                                                                      |)
                                                                                    ]))
                                                                            ]
                                                                          |)))
                                                                      | _ =>
                                                                        M.impossible
                                                                          "wrong number of arguments"
                                                                      end))
                                                              ]
                                                            |)
                                                          ]
                                                        |);
                                                        Value.StructTuple
                                                          "revm::db::states::account_status::AccountStatus::Changed"
                                                          []
                                                      ]
                                                    |)
                                                  |) in
                                                let~ _ :=
                                                  let β := state_size in
                                                  M.write (|
                                                    β,
                                                    BinOp.Wrap.add (|
                                                      M.read (| β |),
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path
                                                            "revm::db::states::bundle_account::BundleAccount",
                                                          "size_hint",
                                                          []
                                                        |),
                                                        [ account ]
                                                      |)
                                                    |)
                                                  |) in
                                                M.alloc (|
                                                  Value.Tuple
                                                    [ M.read (| address |); M.read (| account |) ]
                                                |)
                                              |)))
                                        ]
                                      |)))
                                  | _ => M.impossible "wrong number of arguments"
                                  end))
                          ]
                        |)
                      ]
                    |)
                  |) in
                let~ reverts_size := M.alloc (| Value.Integer IntegerKind.Usize 0 |) in
                let~ reverts :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::iter::traits::iterator::Iterator",
                        Ty.apply
                          (Ty.path "core::iter::adapters::map::Map")
                          []
                          [
                            Ty.associated;
                            Ty.function
                              [
                                Ty.tuple
                                  [
                                    impl_IntoIterator_Item____Address__Option_Option_AccountInfo____impl_IntoIterator_Item____U256__U256____
                                  ]
                              ]
                              (Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                []
                                [
                                  Ty.tuple
                                    [
                                      Ty.path "alloy_primitives::bits::address::Address";
                                      Ty.path "revm::db::states::reverts::AccountRevert"
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ])
                          ],
                        [],
                        "collect",
                        [
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            []
                            [
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                []
                                [
                                  Ty.tuple
                                    [
                                      Ty.path "alloy_primitives::bits::address::Address";
                                      Ty.path "revm::db::states::reverts::AccountRevert"
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ];
                              Ty.path "alloc::alloc::Global"
                            ]
                        ]
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::iterator::Iterator",
                            Ty.associated,
                            [],
                            "map",
                            [
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                []
                                [
                                  Ty.tuple
                                    [
                                      Ty.path "alloy_primitives::bits::address::Address";
                                      Ty.path "revm::db::states::reverts::AccountRevert"
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ];
                              Ty.function
                                [
                                  Ty.tuple
                                    [
                                      impl_IntoIterator_Item____Address__Option_Option_AccountInfo____impl_IntoIterator_Item____U256__U256____
                                    ]
                                ]
                                (Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [
                                    Ty.tuple
                                      [
                                        Ty.path "alloy_primitives::bits::address::Address";
                                        Ty.path "revm::db::states::reverts::AccountRevert"
                                      ];
                                    Ty.path "alloc::alloc::Global"
                                  ])
                            ]
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::collect::IntoIterator",
                                impl_IntoIterator_Item___impl_IntoIterator_Item____Address__Option_Option_AccountInfo____impl_IntoIterator_Item____U256__U256_____,
                                [],
                                "into_iter",
                                []
                              |),
                              [ M.read (| reverts |) ]
                            |);
                            M.closure
                              (fun γ =>
                                ltac:(M.monadic
                                  match γ with
                                  | [ α0 ] =>
                                    ltac:(M.monadic
                                      (M.match_operator (|
                                        M.alloc (| α0 |),
                                        [
                                          fun γ =>
                                            ltac:(M.monadic
                                              (let block_reverts := M.copy (| γ |) in
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::iter::traits::iterator::Iterator",
                                                  Ty.apply
                                                    (Ty.path "core::iter::adapters::map::Map")
                                                    []
                                                    [
                                                      Ty.associated;
                                                      Ty.function
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.path
                                                                    "alloy_primitives::bits::address::Address";
                                                                  Ty.apply
                                                                    (Ty.path "core::option::Option")
                                                                    []
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path
                                                                          "core::option::Option")
                                                                        []
                                                                        [
                                                                          Ty.path
                                                                            "revm_primitives::state::AccountInfo"
                                                                        ]
                                                                    ];
                                                                  impl_IntoIterator_Item____U256__U256__
                                                                ]
                                                            ]
                                                        ]
                                                        (Ty.tuple
                                                          [
                                                            Ty.path
                                                              "alloy_primitives::bits::address::Address";
                                                            Ty.path
                                                              "revm::db::states::reverts::AccountRevert"
                                                          ])
                                                    ],
                                                  [],
                                                  "collect",
                                                  [
                                                    Ty.apply
                                                      (Ty.path "alloc::vec::Vec")
                                                      []
                                                      [
                                                        Ty.tuple
                                                          [
                                                            Ty.path
                                                              "alloy_primitives::bits::address::Address";
                                                            Ty.path
                                                              "revm::db::states::reverts::AccountRevert"
                                                          ];
                                                        Ty.path "alloc::alloc::Global"
                                                      ]
                                                  ]
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_trait_method (|
                                                      "core::iter::traits::iterator::Iterator",
                                                      Ty.associated,
                                                      [],
                                                      "map",
                                                      [
                                                        Ty.tuple
                                                          [
                                                            Ty.path
                                                              "alloy_primitives::bits::address::Address";
                                                            Ty.path
                                                              "revm::db::states::reverts::AccountRevert"
                                                          ];
                                                        Ty.function
                                                          [
                                                            Ty.tuple
                                                              [
                                                                Ty.tuple
                                                                  [
                                                                    Ty.path
                                                                      "alloy_primitives::bits::address::Address";
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "core::option::Option")
                                                                      []
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "core::option::Option")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "revm_primitives::state::AccountInfo"
                                                                          ]
                                                                      ];
                                                                    impl_IntoIterator_Item____U256__U256__
                                                                  ]
                                                              ]
                                                          ]
                                                          (Ty.tuple
                                                            [
                                                              Ty.path
                                                                "alloy_primitives::bits::address::Address";
                                                              Ty.path
                                                                "revm::db::states::reverts::AccountRevert"
                                                            ])
                                                      ]
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::iter::traits::collect::IntoIterator",
                                                          impl_IntoIterator_Item____Address__Option_Option_AccountInfo____impl_IntoIterator_Item____U256__U256____,
                                                          [],
                                                          "into_iter",
                                                          []
                                                        |),
                                                        [ M.read (| block_reverts |) ]
                                                      |);
                                                      M.closure
                                                        (fun γ =>
                                                          ltac:(M.monadic
                                                            match γ with
                                                            | [ α0 ] =>
                                                              ltac:(M.monadic
                                                                (M.match_operator (|
                                                                  M.alloc (| α0 |),
                                                                  [
                                                                    fun γ =>
                                                                      ltac:(M.monadic
                                                                        (let γ0_0 :=
                                                                          M.SubPointer.get_tuple_field (|
                                                                            γ,
                                                                            0
                                                                          |) in
                                                                        let γ0_1 :=
                                                                          M.SubPointer.get_tuple_field (|
                                                                            γ,
                                                                            1
                                                                          |) in
                                                                        let γ0_2 :=
                                                                          M.SubPointer.get_tuple_field (|
                                                                            γ,
                                                                            2
                                                                          |) in
                                                                        let address :=
                                                                          M.copy (| γ0_0 |) in
                                                                        let account :=
                                                                          M.copy (| γ0_1 |) in
                                                                        let storage :=
                                                                          M.copy (| γ0_2 |) in
                                                                        M.read (|
                                                                          let~ account :=
                                                                            M.copy (|
                                                                              M.match_operator (|
                                                                                account,
                                                                                [
                                                                                  fun γ =>
                                                                                    ltac:(M.monadic
                                                                                      (let γ0_0 :=
                                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                                          γ,
                                                                                          "core::option::Option::Some",
                                                                                          0
                                                                                        |) in
                                                                                      let γ1_0 :=
                                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                                          γ0_0,
                                                                                          "core::option::Option::Some",
                                                                                          0
                                                                                        |) in
                                                                                      let account :=
                                                                                        M.copy (|
                                                                                          γ1_0
                                                                                        |) in
                                                                                      M.alloc (|
                                                                                        Value.StructTuple
                                                                                          "revm::db::states::reverts::AccountInfoRevert::RevertTo"
                                                                                          [
                                                                                            M.read (|
                                                                                              account
                                                                                            |)
                                                                                          ]
                                                                                      |)));
                                                                                  fun γ =>
                                                                                    ltac:(M.monadic
                                                                                      (let γ0_0 :=
                                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                                          γ,
                                                                                          "core::option::Option::Some",
                                                                                          0
                                                                                        |) in
                                                                                      let _ :=
                                                                                        M.is_struct_tuple (|
                                                                                          γ0_0,
                                                                                          "core::option::Option::None"
                                                                                        |) in
                                                                                      M.alloc (|
                                                                                        Value.StructTuple
                                                                                          "revm::db::states::reverts::AccountInfoRevert::DeleteIt"
                                                                                          []
                                                                                      |)));
                                                                                  fun γ =>
                                                                                    ltac:(M.monadic
                                                                                      (let _ :=
                                                                                        M.is_struct_tuple (|
                                                                                          γ,
                                                                                          "core::option::Option::None"
                                                                                        |) in
                                                                                      M.alloc (|
                                                                                        Value.StructTuple
                                                                                          "revm::db::states::reverts::AccountInfoRevert::DoNothing"
                                                                                          []
                                                                                      |)))
                                                                                ]
                                                                              |)
                                                                            |) in
                                                                          let~ revert :=
                                                                            M.alloc (|
                                                                              Value.StructRecord
                                                                                "revm::db::states::reverts::AccountRevert"
                                                                                [
                                                                                  ("account",
                                                                                    M.read (|
                                                                                      account
                                                                                    |));
                                                                                  ("storage",
                                                                                    M.call_closure (|
                                                                                      M.get_trait_method (|
                                                                                        "core::iter::traits::iterator::Iterator",
                                                                                        Ty.apply
                                                                                          (Ty.path
                                                                                            "core::iter::adapters::map::Map")
                                                                                          []
                                                                                          [
                                                                                            Ty.associated;
                                                                                            Ty.function
                                                                                              [
                                                                                                Ty.tuple
                                                                                                  [
                                                                                                    Ty.tuple
                                                                                                      [
                                                                                                        Ty.apply
                                                                                                          (Ty.path
                                                                                                            "ruint::Uint")
                                                                                                          [
                                                                                                            Value.Integer
                                                                                                              IntegerKind.Usize
                                                                                                              256;
                                                                                                            Value.Integer
                                                                                                              IntegerKind.Usize
                                                                                                              4
                                                                                                          ]
                                                                                                          [];
                                                                                                        Ty.apply
                                                                                                          (Ty.path
                                                                                                            "ruint::Uint")
                                                                                                          [
                                                                                                            Value.Integer
                                                                                                              IntegerKind.Usize
                                                                                                              256;
                                                                                                            Value.Integer
                                                                                                              IntegerKind.Usize
                                                                                                              4
                                                                                                          ]
                                                                                                          []
                                                                                                      ]
                                                                                                  ]
                                                                                              ]
                                                                                              (Ty.tuple
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "ruint::Uint")
                                                                                                    [
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        256;
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        4
                                                                                                    ]
                                                                                                    [];
                                                                                                  Ty.path
                                                                                                    "revm::db::states::reverts::RevertToSlot"
                                                                                                ])
                                                                                          ],
                                                                                        [],
                                                                                        "collect",
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "std::collections::hash::map::HashMap")
                                                                                            []
                                                                                            [
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "ruint::Uint")
                                                                                                [
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    256;
                                                                                                  Value.Integer
                                                                                                    IntegerKind.Usize
                                                                                                    4
                                                                                                ]
                                                                                                [];
                                                                                              Ty.path
                                                                                                "revm::db::states::reverts::RevertToSlot";
                                                                                              Ty.path
                                                                                                "std::hash::random::RandomState"
                                                                                            ]
                                                                                        ]
                                                                                      |),
                                                                                      [
                                                                                        M.call_closure (|
                                                                                          M.get_trait_method (|
                                                                                            "core::iter::traits::iterator::Iterator",
                                                                                            Ty.associated,
                                                                                            [],
                                                                                            "map",
                                                                                            [
                                                                                              Ty.tuple
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "ruint::Uint")
                                                                                                    [
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        256;
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        4
                                                                                                    ]
                                                                                                    [];
                                                                                                  Ty.path
                                                                                                    "revm::db::states::reverts::RevertToSlot"
                                                                                                ];
                                                                                              Ty.function
                                                                                                [
                                                                                                  Ty.tuple
                                                                                                    [
                                                                                                      Ty.tuple
                                                                                                        [
                                                                                                          Ty.apply
                                                                                                            (Ty.path
                                                                                                              "ruint::Uint")
                                                                                                            [
                                                                                                              Value.Integer
                                                                                                                IntegerKind.Usize
                                                                                                                256;
                                                                                                              Value.Integer
                                                                                                                IntegerKind.Usize
                                                                                                                4
                                                                                                            ]
                                                                                                            [];
                                                                                                          Ty.apply
                                                                                                            (Ty.path
                                                                                                              "ruint::Uint")
                                                                                                            [
                                                                                                              Value.Integer
                                                                                                                IntegerKind.Usize
                                                                                                                256;
                                                                                                              Value.Integer
                                                                                                                IntegerKind.Usize
                                                                                                                4
                                                                                                            ]
                                                                                                            []
                                                                                                        ]
                                                                                                    ]
                                                                                                ]
                                                                                                (Ty.tuple
                                                                                                  [
                                                                                                    Ty.apply
                                                                                                      (Ty.path
                                                                                                        "ruint::Uint")
                                                                                                      [
                                                                                                        Value.Integer
                                                                                                          IntegerKind.Usize
                                                                                                          256;
                                                                                                        Value.Integer
                                                                                                          IntegerKind.Usize
                                                                                                          4
                                                                                                      ]
                                                                                                      [];
                                                                                                    Ty.path
                                                                                                      "revm::db::states::reverts::RevertToSlot"
                                                                                                  ])
                                                                                            ]
                                                                                          |),
                                                                                          [
                                                                                            M.call_closure (|
                                                                                              M.get_trait_method (|
                                                                                                "core::iter::traits::collect::IntoIterator",
                                                                                                impl_IntoIterator_Item____U256__U256__,
                                                                                                [],
                                                                                                "into_iter",
                                                                                                []
                                                                                              |),
                                                                                              [
                                                                                                M.read (|
                                                                                                  storage
                                                                                                |)
                                                                                              ]
                                                                                            |);
                                                                                            M.closure
                                                                                              (fun
                                                                                                  γ =>
                                                                                                ltac:(M.monadic
                                                                                                  match
                                                                                                    γ
                                                                                                  with
                                                                                                  | [
                                                                                                        α0
                                                                                                      ] =>
                                                                                                    ltac:(M.monadic
                                                                                                      (M.match_operator (|
                                                                                                        M.alloc (|
                                                                                                          α0
                                                                                                        |),
                                                                                                        [
                                                                                                          fun
                                                                                                              γ =>
                                                                                                            ltac:(M.monadic
                                                                                                              (let
                                                                                                                    γ0_0 :=
                                                                                                                M.SubPointer.get_tuple_field (|
                                                                                                                  γ,
                                                                                                                  0
                                                                                                                |) in
                                                                                                              let
                                                                                                                    γ0_1 :=
                                                                                                                M.SubPointer.get_tuple_field (|
                                                                                                                  γ,
                                                                                                                  1
                                                                                                                |) in
                                                                                                              let
                                                                                                                    k :=
                                                                                                                M.copy (|
                                                                                                                  γ0_0
                                                                                                                |) in
                                                                                                              let
                                                                                                                    v :=
                                                                                                                M.copy (|
                                                                                                                  γ0_1
                                                                                                                |) in
                                                                                                              Value.Tuple
                                                                                                                [
                                                                                                                  M.read (|
                                                                                                                    k
                                                                                                                  |);
                                                                                                                  Value.StructTuple
                                                                                                                    "revm::db::states::reverts::RevertToSlot::Some"
                                                                                                                    [
                                                                                                                      M.read (|
                                                                                                                        v
                                                                                                                      |)
                                                                                                                    ]
                                                                                                                ]))
                                                                                                        ]
                                                                                                      |)))
                                                                                                  | _ =>
                                                                                                    M.impossible
                                                                                                      "wrong number of arguments"
                                                                                                  end))
                                                                                          ]
                                                                                        |)
                                                                                      ]
                                                                                    |));
                                                                                  ("previous_status",
                                                                                    Value.StructTuple
                                                                                      "revm::db::states::account_status::AccountStatus::Changed"
                                                                                      []);
                                                                                  ("wipe_storage",
                                                                                    Value.Bool
                                                                                      false)
                                                                                ]
                                                                            |) in
                                                                          let~ _ :=
                                                                            let β := reverts_size in
                                                                            M.write (|
                                                                              β,
                                                                              BinOp.Wrap.add (|
                                                                                M.read (| β |),
                                                                                M.call_closure (|
                                                                                  M.get_associated_function (|
                                                                                    Ty.path
                                                                                      "revm::db::states::reverts::AccountRevert",
                                                                                    "size_hint",
                                                                                    []
                                                                                  |),
                                                                                  [ revert ]
                                                                                |)
                                                                              |)
                                                                            |) in
                                                                          M.alloc (|
                                                                            Value.Tuple
                                                                              [
                                                                                M.read (|
                                                                                  address
                                                                                |);
                                                                                M.read (| revert |)
                                                                              ]
                                                                          |)
                                                                        |)))
                                                                  ]
                                                                |)))
                                                            | _ =>
                                                              M.impossible
                                                                "wrong number of arguments"
                                                            end))
                                                    ]
                                                  |)
                                                ]
                                              |)))
                                        ]
                                      |)))
                                  | _ => M.impossible "wrong number of arguments"
                                  end))
                          ]
                        |)
                      ]
                    |)
                  |) in
                M.alloc (|
                  Value.StructRecord
                    "revm::db::states::bundle_state::BundleState"
                    [
                      ("state", M.read (| state |));
                      ("contracts",
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::iterator::Iterator",
                            Ty.associated,
                            [],
                            "collect",
                            [
                              Ty.apply
                                (Ty.path "std::collections::hash::map::HashMap")
                                []
                                [
                                  Ty.apply
                                    (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                    [ Value.Integer IntegerKind.Usize 32 ]
                                    [];
                                  Ty.path "revm_primitives::bytecode::Bytecode";
                                  Ty.path "std::hash::random::RandomState"
                                ]
                            ]
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::collect::IntoIterator",
                                impl_IntoIterator_Item____B256__Bytecode__,
                                [],
                                "into_iter",
                                []
                              |),
                              [ M.read (| contracts |) ]
                            |)
                          ]
                        |));
                      ("reverts",
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "revm::db::states::reverts::Reverts",
                            "new",
                            []
                          |),
                          [ M.read (| reverts |) ]
                        |));
                      ("state_size", M.read (| state_size |));
                      ("reverts_size", M.read (| reverts_size |))
                    ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
        
        (*
            pub fn size_hint(&self) -> usize {
                self.state_size + self.reverts_size + self.contracts.len()
            }
        *)
        Definition size_hint (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              BinOp.Wrap.add (|
                BinOp.Wrap.add (|
                  M.read (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "revm::db::states::bundle_state::BundleState",
                      "state_size"
                    |)
                  |),
                  M.read (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "revm::db::states::bundle_state::BundleState",
                      "reverts_size"
                    |)
                  |)
                |),
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "std::collections::hash::map::HashMap")
                      []
                      [
                        Ty.apply
                          (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                          [ Value.Integer IntegerKind.Usize 32 ]
                          [];
                        Ty.path "revm_primitives::bytecode::Bytecode";
                        Ty.path "std::hash::random::RandomState"
                      ],
                    "len",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "revm::db::states::bundle_state::BundleState",
                      "contracts"
                    |)
                  ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_size_hint : M.IsAssociatedFunction Self "size_hint" size_hint.
        
        (*
            pub fn state(&self) -> &HashMap<Address, BundleAccount> {
                &self.state
            }
        *)
        Definition state (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "revm::db::states::bundle_state::BundleState",
                "state"
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_state : M.IsAssociatedFunction Self "state" state.
        
        (*
            pub fn is_empty(&self) -> bool {
                self.len() == 0
            }
        *)
        Definition is_empty (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              BinOp.eq (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "revm::db::states::bundle_state::BundleState",
                    "len",
                    []
                  |),
                  [ M.read (| self |) ]
                |),
                Value.Integer IntegerKind.Usize 0
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_is_empty : M.IsAssociatedFunction Self "is_empty" is_empty.
        
        (*
            pub fn len(&self) -> usize {
                self.state.len()
            }
        *)
        Definition len (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.call_closure (|
                M.get_associated_function (|
                  Ty.apply
                    (Ty.path "std::collections::hash::map::HashMap")
                    []
                    [
                      Ty.path "alloy_primitives::bits::address::Address";
                      Ty.path "revm::db::states::bundle_account::BundleAccount";
                      Ty.path "std::hash::random::RandomState"
                    ],
                  "len",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm::db::states::bundle_state::BundleState",
                    "state"
                  |)
                ]
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_len : M.IsAssociatedFunction Self "len" len.
        
        (*
            pub fn account(&self, address: &Address) -> Option<&BundleAccount> {
                self.state.get(address)
            }
        *)
        Definition account (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; address ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let address := M.alloc (| address |) in
              M.call_closure (|
                M.get_associated_function (|
                  Ty.apply
                    (Ty.path "std::collections::hash::map::HashMap")
                    []
                    [
                      Ty.path "alloy_primitives::bits::address::Address";
                      Ty.path "revm::db::states::bundle_account::BundleAccount";
                      Ty.path "std::hash::random::RandomState"
                    ],
                  "get",
                  [ Ty.path "alloy_primitives::bits::address::Address" ]
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm::db::states::bundle_state::BundleState",
                    "state"
                  |);
                  M.read (| address |)
                ]
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_account : M.IsAssociatedFunction Self "account" account.
        
        (*
            pub fn bytecode(&self, hash: &B256) -> Option<Bytecode> {
                self.contracts.get(hash).cloned()
            }
        *)
        Definition bytecode (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; hash ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let hash := M.alloc (| hash |) in
              M.call_closure (|
                M.get_associated_function (|
                  Ty.apply
                    (Ty.path "core::option::Option")
                    []
                    [ Ty.apply (Ty.path "&") [] [ Ty.path "revm_primitives::bytecode::Bytecode" ] ],
                  "cloned",
                  []
                |),
                [
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "std::collections::hash::map::HashMap")
                        []
                        [
                          Ty.apply
                            (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                            [ Value.Integer IntegerKind.Usize 32 ]
                            [];
                          Ty.path "revm_primitives::bytecode::Bytecode";
                          Ty.path "std::hash::random::RandomState"
                        ],
                      "get",
                      [
                        Ty.apply
                          (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                          [ Value.Integer IntegerKind.Usize 32 ]
                          []
                      ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "revm::db::states::bundle_state::BundleState",
                        "contracts"
                      |);
                      M.read (| hash |)
                    ]
                  |)
                ]
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_bytecode : M.IsAssociatedFunction Self "bytecode" bytecode.
        
        (*
            pub fn apply_transitions_and_create_reverts(
                &mut self,
                transitions: TransitionState,
                retention: BundleRetention,
            ) {
                let include_reverts = retention.includes_reverts();
                // pessimistically pre-allocate assuming _all_ accounts changed.
                let reverts_capacity = if include_reverts {
                    transitions.transitions.len()
                } else {
                    0
                };
                let mut reverts = Vec::with_capacity(reverts_capacity);
        
                for (address, transition) in transitions.transitions.into_iter() {
                    // add new contract if it was created/changed.
                    if let Some((hash, new_bytecode)) = transition.has_new_contract() {
                        self.contracts.insert(hash, new_bytecode.clone());
                    }
                    // update state and create revert.
                    let revert = match self.state.entry(address) {
                        hash_map::Entry::Occupied(mut entry) => {
                            let entry = entry.get_mut();
                            self.state_size -= entry.size_hint();
                            // update and create revert if it is present
                            let revert = entry.update_and_create_revert(transition);
                            // update the state size
                            self.state_size += entry.size_hint();
                            revert
                        }
                        hash_map::Entry::Vacant(entry) => {
                            // make revert from transition account
                            let present_bundle = transition.present_bundle_account();
                            let revert = transition.create_revert();
                            if revert.is_some() {
                                self.state_size += present_bundle.size_hint();
                                entry.insert(present_bundle);
                            }
                            revert
                        }
                    };
        
                    // append revert if present.
                    if let Some(revert) = revert.filter(|_| include_reverts) {
                        self.reverts_size += revert.size_hint();
                        reverts.push((address, revert));
                    }
                }
        
                self.reverts.push(reverts);
            }
        *)
        Definition apply_transitions_and_create_reverts
            (ε : list Value.t)
            (τ : list Ty.t)
            (α : list Value.t)
            : M :=
          match ε, τ, α with
          | [], [], [ self; transitions; retention ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let transitions := M.alloc (| transitions |) in
              let retention := M.alloc (| retention |) in
              M.read (|
                let~ include_reverts :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "revm::db::states::bundle_state::BundleRetention",
                        "includes_reverts",
                        []
                      |),
                      [ retention ]
                    |)
                  |) in
                let~ reverts_capacity :=
                  M.copy (|
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ := M.use include_reverts in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "std::collections::hash::map::HashMap")
                                    []
                                    [
                                      Ty.path "alloy_primitives::bits::address::Address";
                                      Ty.path
                                        "revm::db::states::transition_account::TransitionAccount";
                                      Ty.path "std::hash::random::RandomState"
                                    ],
                                  "len",
                                  []
                                |),
                                [
                                  M.SubPointer.get_struct_record_field (|
                                    transitions,
                                    "revm::db::states::transition_state::TransitionState",
                                    "transitions"
                                  |)
                                ]
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Integer IntegerKind.Usize 0 |)))
                      ]
                    |)
                  |) in
                let~ reverts :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.tuple
                              [
                                Ty.path "alloy_primitives::bits::address::Address";
                                Ty.path "revm::db::states::reverts::AccountRevert"
                              ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        "with_capacity",
                        []
                      |),
                      [ M.read (| reverts_capacity |) ]
                    |)
                  |) in
                let~ _ :=
                  M.use
                    (M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::collect::IntoIterator",
                            Ty.apply
                              (Ty.path "std::collections::hash::map::IntoIter")
                              []
                              [
                                Ty.path "alloy_primitives::bits::address::Address";
                                Ty.path "revm::db::states::transition_account::TransitionAccount"
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::collect::IntoIterator",
                                Ty.apply
                                  (Ty.path "std::collections::hash::map::HashMap")
                                  []
                                  [
                                    Ty.path "alloy_primitives::bits::address::Address";
                                    Ty.path
                                      "revm::db::states::transition_account::TransitionAccount";
                                    Ty.path "std::hash::random::RandomState"
                                  ],
                                [],
                                "into_iter",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    transitions,
                                    "revm::db::states::transition_state::TransitionState",
                                    "transitions"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let iter := M.copy (| γ |) in
                            M.loop (|
                              ltac:(M.monadic
                                (let~ _ :=
                                  M.match_operator (|
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::iter::traits::iterator::Iterator",
                                          Ty.apply
                                            (Ty.path "std::collections::hash::map::IntoIter")
                                            []
                                            [
                                              Ty.path "alloy_primitives::bits::address::Address";
                                              Ty.path
                                                "revm::db::states::transition_account::TransitionAccount"
                                            ],
                                          [],
                                          "next",
                                          []
                                        |),
                                        [ iter ]
                                      |)
                                    |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let _ :=
                                            M.is_struct_tuple (|
                                              γ,
                                              "core::option::Option::None"
                                            |) in
                                          M.alloc (|
                                            M.never_to_any (| M.read (| M.break (||) |) |)
                                          |)));
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let γ0_0 :=
                                            M.SubPointer.get_struct_tuple_field (|
                                              γ,
                                              "core::option::Option::Some",
                                              0
                                            |) in
                                          let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                          let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                          let address := M.copy (| γ1_0 |) in
                                          let transition := M.copy (| γ1_1 |) in
                                          let~ _ :=
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "revm::db::states::transition_account::TransitionAccount",
                                                            "has_new_contract",
                                                            []
                                                          |),
                                                          [ transition ]
                                                        |)
                                                      |) in
                                                    let γ0_0 :=
                                                      M.SubPointer.get_struct_tuple_field (|
                                                        γ,
                                                        "core::option::Option::Some",
                                                        0
                                                      |) in
                                                    let γ1_0 :=
                                                      M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                                    let γ1_1 :=
                                                      M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                                    let hash := M.copy (| γ1_0 |) in
                                                    let new_bytecode := M.copy (| γ1_1 |) in
                                                    let~ _ :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path
                                                                "std::collections::hash::map::HashMap")
                                                              []
                                                              [
                                                                Ty.apply
                                                                  (Ty.path
                                                                    "alloy_primitives::bits::fixed::FixedBytes")
                                                                  [
                                                                    Value.Integer
                                                                      IntegerKind.Usize
                                                                      32
                                                                  ]
                                                                  [];
                                                                Ty.path
                                                                  "revm_primitives::bytecode::Bytecode";
                                                                Ty.path
                                                                  "std::hash::random::RandomState"
                                                              ],
                                                            "insert",
                                                            []
                                                          |),
                                                          [
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "revm::db::states::bundle_state::BundleState",
                                                              "contracts"
                                                            |);
                                                            M.read (| hash |);
                                                            M.call_closure (|
                                                              M.get_trait_method (|
                                                                "core::clone::Clone",
                                                                Ty.path
                                                                  "revm_primitives::bytecode::Bytecode",
                                                                [],
                                                                "clone",
                                                                []
                                                              |),
                                                              [ M.read (| new_bytecode |) ]
                                                            |)
                                                          ]
                                                        |)
                                                      |) in
                                                    M.alloc (| Value.Tuple [] |)));
                                                fun γ =>
                                                  ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |) in
                                          let~ revert :=
                                            M.copy (|
                                              M.match_operator (|
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path
                                                          "std::collections::hash::map::HashMap")
                                                        []
                                                        [
                                                          Ty.path
                                                            "alloy_primitives::bits::address::Address";
                                                          Ty.path
                                                            "revm::db::states::bundle_account::BundleAccount";
                                                          Ty.path "std::hash::random::RandomState"
                                                        ],
                                                      "entry",
                                                      []
                                                    |),
                                                    [
                                                      M.SubPointer.get_struct_record_field (|
                                                        M.read (| self |),
                                                        "revm::db::states::bundle_state::BundleState",
                                                        "state"
                                                      |);
                                                      M.read (| address |)
                                                    ]
                                                  |)
                                                |),
                                                [
                                                  fun γ =>
                                                    ltac:(M.monadic
                                                      (let γ0_0 :=
                                                        M.SubPointer.get_struct_tuple_field (|
                                                          γ,
                                                          "std::collections::hash::map::Entry::Occupied",
                                                          0
                                                        |) in
                                                      let entry := M.copy (| γ0_0 |) in
                                                      let~ entry :=
                                                        M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.apply
                                                                (Ty.path
                                                                  "std::collections::hash::map::OccupiedEntry")
                                                                []
                                                                [
                                                                  Ty.path
                                                                    "alloy_primitives::bits::address::Address";
                                                                  Ty.path
                                                                    "revm::db::states::bundle_account::BundleAccount"
                                                                ],
                                                              "get_mut",
                                                              []
                                                            |),
                                                            [ entry ]
                                                          |)
                                                        |) in
                                                      let~ _ :=
                                                        let β :=
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| self |),
                                                            "revm::db::states::bundle_state::BundleState",
                                                            "state_size"
                                                          |) in
                                                        M.write (|
                                                          β,
                                                          BinOp.Wrap.sub (|
                                                            M.read (| β |),
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path
                                                                  "revm::db::states::bundle_account::BundleAccount",
                                                                "size_hint",
                                                                []
                                                              |),
                                                              [ M.read (| entry |) ]
                                                            |)
                                                          |)
                                                        |) in
                                                      let~ revert :=
                                                        M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "revm::db::states::bundle_account::BundleAccount",
                                                              "update_and_create_revert",
                                                              []
                                                            |),
                                                            [
                                                              M.read (| entry |);
                                                              M.read (| transition |)
                                                            ]
                                                          |)
                                                        |) in
                                                      let~ _ :=
                                                        let β :=
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| self |),
                                                            "revm::db::states::bundle_state::BundleState",
                                                            "state_size"
                                                          |) in
                                                        M.write (|
                                                          β,
                                                          BinOp.Wrap.add (|
                                                            M.read (| β |),
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path
                                                                  "revm::db::states::bundle_account::BundleAccount",
                                                                "size_hint",
                                                                []
                                                              |),
                                                              [ M.read (| entry |) ]
                                                            |)
                                                          |)
                                                        |) in
                                                      revert));
                                                  fun γ =>
                                                    ltac:(M.monadic
                                                      (let γ0_0 :=
                                                        M.SubPointer.get_struct_tuple_field (|
                                                          γ,
                                                          "std::collections::hash::map::Entry::Vacant",
                                                          0
                                                        |) in
                                                      let entry := M.copy (| γ0_0 |) in
                                                      let~ present_bundle :=
                                                        M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "revm::db::states::transition_account::TransitionAccount",
                                                              "present_bundle_account",
                                                              []
                                                            |),
                                                            [ transition ]
                                                          |)
                                                        |) in
                                                      let~ revert :=
                                                        M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "revm::db::states::transition_account::TransitionAccount",
                                                              "create_revert",
                                                              []
                                                            |),
                                                            [ M.read (| transition |) ]
                                                          |)
                                                        |) in
                                                      let~ _ :=
                                                        M.match_operator (|
                                                          M.alloc (| Value.Tuple [] |),
                                                          [
                                                            fun γ =>
                                                              ltac:(M.monadic
                                                                (let γ :=
                                                                  M.use
                                                                    (M.alloc (|
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "core::option::Option")
                                                                            []
                                                                            [
                                                                              Ty.path
                                                                                "revm::db::states::reverts::AccountRevert"
                                                                            ],
                                                                          "is_some",
                                                                          []
                                                                        |),
                                                                        [ revert ]
                                                                      |)
                                                                    |)) in
                                                                let _ :=
                                                                  M.is_constant_or_break_match (|
                                                                    M.read (| γ |),
                                                                    Value.Bool true
                                                                  |) in
                                                                let~ _ :=
                                                                  let β :=
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "revm::db::states::bundle_state::BundleState",
                                                                      "state_size"
                                                                    |) in
                                                                  M.write (|
                                                                    β,
                                                                    BinOp.Wrap.add (|
                                                                      M.read (| β |),
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.path
                                                                            "revm::db::states::bundle_account::BundleAccount",
                                                                          "size_hint",
                                                                          []
                                                                        |),
                                                                        [ present_bundle ]
                                                                      |)
                                                                    |)
                                                                  |) in
                                                                let~ _ :=
                                                                  M.alloc (|
                                                                    M.call_closure (|
                                                                      M.get_associated_function (|
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "std::collections::hash::map::VacantEntry")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "alloy_primitives::bits::address::Address";
                                                                            Ty.path
                                                                              "revm::db::states::bundle_account::BundleAccount"
                                                                          ],
                                                                        "insert",
                                                                        []
                                                                      |),
                                                                      [
                                                                        M.read (| entry |);
                                                                        M.read (| present_bundle |)
                                                                      ]
                                                                    |)
                                                                  |) in
                                                                M.alloc (| Value.Tuple [] |)));
                                                            fun γ =>
                                                              ltac:(M.monadic
                                                                (M.alloc (| Value.Tuple [] |)))
                                                          ]
                                                        |) in
                                                      revert))
                                                ]
                                              |)
                                            |) in
                                          M.match_operator (|
                                            M.alloc (| Value.Tuple [] |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.apply
                                                            (Ty.path "core::option::Option")
                                                            []
                                                            [
                                                              Ty.path
                                                                "revm::db::states::reverts::AccountRevert"
                                                            ],
                                                          "filter",
                                                          [
                                                            Ty.function
                                                              [
                                                                Ty.tuple
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "&")
                                                                      []
                                                                      [
                                                                        Ty.path
                                                                          "revm::db::states::reverts::AccountRevert"
                                                                      ]
                                                                  ]
                                                              ]
                                                              (Ty.path "bool")
                                                          ]
                                                        |),
                                                        [
                                                          M.read (| revert |);
                                                          M.closure
                                                            (fun γ =>
                                                              ltac:(M.monadic
                                                                match γ with
                                                                | [ α0 ] =>
                                                                  ltac:(M.monadic
                                                                    (M.match_operator (|
                                                                      M.alloc (| α0 |),
                                                                      [
                                                                        fun γ =>
                                                                          ltac:(M.monadic
                                                                            (M.read (|
                                                                              include_reverts
                                                                            |)))
                                                                      ]
                                                                    |)))
                                                                | _ =>
                                                                  M.impossible
                                                                    "wrong number of arguments"
                                                                end))
                                                        ]
                                                      |)
                                                    |) in
                                                  let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::option::Option::Some",
                                                      0
                                                    |) in
                                                  let revert := M.copy (| γ0_0 |) in
                                                  let~ _ :=
                                                    let β :=
                                                      M.SubPointer.get_struct_record_field (|
                                                        M.read (| self |),
                                                        "revm::db::states::bundle_state::BundleState",
                                                        "reverts_size"
                                                      |) in
                                                    M.write (|
                                                      β,
                                                      BinOp.Wrap.add (|
                                                        M.read (| β |),
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "revm::db::states::reverts::AccountRevert",
                                                            "size_hint",
                                                            []
                                                          |),
                                                          [ revert ]
                                                        |)
                                                      |)
                                                    |) in
                                                  let~ _ :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.apply
                                                            (Ty.path "alloc::vec::Vec")
                                                            []
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.path
                                                                    "alloy_primitives::bits::address::Address";
                                                                  Ty.path
                                                                    "revm::db::states::reverts::AccountRevert"
                                                                ];
                                                              Ty.path "alloc::alloc::Global"
                                                            ],
                                                          "push",
                                                          []
                                                        |),
                                                        [
                                                          reverts;
                                                          Value.Tuple
                                                            [
                                                              M.read (| address |);
                                                              M.read (| revert |)
                                                            ]
                                                        ]
                                                      |)
                                                    |) in
                                                  M.alloc (| Value.Tuple [] |)));
                                              fun γ =>
                                                ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              []
                              [
                                Ty.tuple
                                  [
                                    Ty.path "alloy_primitives::bits::address::Address";
                                    Ty.path "revm::db::states::reverts::AccountRevert"
                                  ];
                                Ty.path "alloc::alloc::Global"
                              ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        "push",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::deref::DerefMut",
                            Ty.path "revm::db::states::reverts::Reverts",
                            [],
                            "deref_mut",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "revm::db::states::bundle_state::BundleState",
                              "reverts"
                            |)
                          ]
                        |);
                        M.read (| reverts |)
                      ]
                    |)
                  |) in
                M.alloc (| Value.Tuple [] |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_apply_transitions_and_create_reverts :
          M.IsAssociatedFunction
            Self
            "apply_transitions_and_create_reverts"
            apply_transitions_and_create_reverts.
        
        (*
            pub fn into_plain_state(self, is_value_known: OriginalValuesKnown) -> StateChangeset {
                // pessimistically pre-allocate assuming _all_ accounts changed.
                let state_len = self.state.len();
                let mut accounts = Vec::with_capacity(state_len);
                let mut storage = Vec::with_capacity(state_len);
        
                for (address, account) in self.state {
                    // append account info if it is changed.
                    let was_destroyed = account.was_destroyed();
                    if is_value_known.is_not_known() || account.is_info_changed() {
                        let info = account.info.map(AccountInfo::without_code);
                        accounts.push((address, info));
                    }
        
                    // append storage changes
        
                    // NOTE: Assumption is that revert is going to remove whole plain storage from
                    // database so we can check if plain state was wiped or not.
                    let mut account_storage_changed = Vec::with_capacity(account.storage.len());
        
                    for (key, slot) in account.storage {
                        // If storage was destroyed that means that storage was wiped.
                        // In that case we need to check if present storage value is different then ZERO.
                        let destroyed_and_not_zero = was_destroyed && slot.present_value != U256::ZERO;
        
                        // If account is not destroyed check if original values was changed,
                        // so we can update it.
                        let not_destroyed_and_changed = !was_destroyed && slot.is_changed();
        
                        if is_value_known.is_not_known()
                            || destroyed_and_not_zero
                            || not_destroyed_and_changed
                        {
                            account_storage_changed.push((key, slot.present_value));
                        }
                    }
        
                    if !account_storage_changed.is_empty() || was_destroyed {
                        // append storage changes to account.
                        storage.push(PlainStorageChangeset {
                            address,
                            wipe_storage: was_destroyed,
                            storage: account_storage_changed,
                        });
                    }
                }
                let contracts = self
                    .contracts
                    .into_iter()
                    // remove empty bytecodes
                    .filter(|(b, _)| *b != KECCAK_EMPTY)
                    .collect::<Vec<_>>();
                StateChangeset {
                    accounts,
                    storage,
                    contracts,
                }
            }
        *)
        Definition into_plain_state (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; is_value_known ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let is_value_known := M.alloc (| is_value_known |) in
              M.read (|
                let~ state_len :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.path "alloy_primitives::bits::address::Address";
                            Ty.path "revm::db::states::bundle_account::BundleAccount";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        "len",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          self,
                          "revm::db::states::bundle_state::BundleState",
                          "state"
                        |)
                      ]
                    |)
                  |) in
                let~ accounts :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.tuple
                              [
                                Ty.path "alloy_primitives::bits::address::Address";
                                Ty.apply
                                  (Ty.path "core::option::Option")
                                  []
                                  [ Ty.path "revm_primitives::state::AccountInfo" ]
                              ];
                            Ty.path "alloc::alloc::Global"
                          ],
                        "with_capacity",
                        []
                      |),
                      [ M.read (| state_len |) ]
                    |)
                  |) in
                let~ storage :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "revm::db::states::changes::PlainStorageChangeset";
                            Ty.path "alloc::alloc::Global"
                          ],
                        "with_capacity",
                        []
                      |),
                      [ M.read (| state_len |) ]
                    |)
                  |) in
                let~ _ :=
                  M.use
                    (M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::collect::IntoIterator",
                            Ty.apply
                              (Ty.path "std::collections::hash::map::HashMap")
                              []
                              [
                                Ty.path "alloy_primitives::bits::address::Address";
                                Ty.path "revm::db::states::bundle_account::BundleAccount";
                                Ty.path "std::hash::random::RandomState"
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                self,
                                "revm::db::states::bundle_state::BundleState",
                                "state"
                              |)
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let iter := M.copy (| γ |) in
                            M.loop (|
                              ltac:(M.monadic
                                (let~ _ :=
                                  M.match_operator (|
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::iter::traits::iterator::Iterator",
                                          Ty.apply
                                            (Ty.path "std::collections::hash::map::IntoIter")
                                            []
                                            [
                                              Ty.path "alloy_primitives::bits::address::Address";
                                              Ty.path
                                                "revm::db::states::bundle_account::BundleAccount"
                                            ],
                                          [],
                                          "next",
                                          []
                                        |),
                                        [ iter ]
                                      |)
                                    |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let _ :=
                                            M.is_struct_tuple (|
                                              γ,
                                              "core::option::Option::None"
                                            |) in
                                          M.alloc (|
                                            M.never_to_any (| M.read (| M.break (||) |) |)
                                          |)));
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let γ0_0 :=
                                            M.SubPointer.get_struct_tuple_field (|
                                              γ,
                                              "core::option::Option::Some",
                                              0
                                            |) in
                                          let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                          let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                          let address := M.copy (| γ1_0 |) in
                                          let account := M.copy (| γ1_1 |) in
                                          let~ was_destroyed :=
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path
                                                    "revm::db::states::bundle_account::BundleAccount",
                                                  "was_destroyed",
                                                  []
                                                |),
                                                [ account ]
                                              |)
                                            |) in
                                          let~ _ :=
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          LogicalOp.or (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path
                                                                  "revm::db::states::bundle_state::OriginalValuesKnown",
                                                                "is_not_known",
                                                                []
                                                              |),
                                                              [ is_value_known ]
                                                            |),
                                                            ltac:(M.monadic
                                                              (M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "revm::db::states::bundle_account::BundleAccount",
                                                                  "is_info_changed",
                                                                  []
                                                                |),
                                                                [ account ]
                                                              |)))
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    let~ info :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path "core::option::Option")
                                                              []
                                                              [
                                                                Ty.path
                                                                  "revm_primitives::state::AccountInfo"
                                                              ],
                                                            "map",
                                                            [
                                                              Ty.path
                                                                "revm_primitives::state::AccountInfo";
                                                              Ty.function
                                                                [
                                                                  Ty.path
                                                                    "revm_primitives::state::AccountInfo"
                                                                ]
                                                                (Ty.path
                                                                  "revm_primitives::state::AccountInfo")
                                                            ]
                                                          |),
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                account,
                                                                "revm::db::states::bundle_account::BundleAccount",
                                                                "info"
                                                              |)
                                                            |);
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "revm_primitives::state::AccountInfo",
                                                              "without_code",
                                                              []
                                                            |)
                                                          ]
                                                        |)
                                                      |) in
                                                    let~ _ :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path "alloc::vec::Vec")
                                                              []
                                                              [
                                                                Ty.tuple
                                                                  [
                                                                    Ty.path
                                                                      "alloy_primitives::bits::address::Address";
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "core::option::Option")
                                                                      []
                                                                      [
                                                                        Ty.path
                                                                          "revm_primitives::state::AccountInfo"
                                                                      ]
                                                                  ];
                                                                Ty.path "alloc::alloc::Global"
                                                              ],
                                                            "push",
                                                            []
                                                          |),
                                                          [
                                                            accounts;
                                                            Value.Tuple
                                                              [
                                                                M.read (| address |);
                                                                M.read (| info |)
                                                              ]
                                                          ]
                                                        |)
                                                      |) in
                                                    M.alloc (| Value.Tuple [] |)));
                                                fun γ =>
                                                  ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |) in
                                          let~ account_storage_changed :=
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.apply
                                                    (Ty.path "alloc::vec::Vec")
                                                    []
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.apply
                                                            (Ty.path "ruint::Uint")
                                                            [
                                                              Value.Integer IntegerKind.Usize 256;
                                                              Value.Integer IntegerKind.Usize 4
                                                            ]
                                                            [];
                                                          Ty.apply
                                                            (Ty.path "ruint::Uint")
                                                            [
                                                              Value.Integer IntegerKind.Usize 256;
                                                              Value.Integer IntegerKind.Usize 4
                                                            ]
                                                            []
                                                        ];
                                                      Ty.path "alloc::alloc::Global"
                                                    ],
                                                  "with_capacity",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path
                                                          "std::collections::hash::map::HashMap")
                                                        []
                                                        [
                                                          Ty.apply
                                                            (Ty.path "ruint::Uint")
                                                            [
                                                              Value.Integer IntegerKind.Usize 256;
                                                              Value.Integer IntegerKind.Usize 4
                                                            ]
                                                            [];
                                                          Ty.path
                                                            "revm_primitives::state::StorageSlot";
                                                          Ty.path "std::hash::random::RandomState"
                                                        ],
                                                      "len",
                                                      []
                                                    |),
                                                    [
                                                      M.SubPointer.get_struct_record_field (|
                                                        account,
                                                        "revm::db::states::bundle_account::BundleAccount",
                                                        "storage"
                                                      |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |) in
                                          let~ _ :=
                                            M.use
                                              (M.match_operator (|
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_trait_method (|
                                                      "core::iter::traits::collect::IntoIterator",
                                                      Ty.apply
                                                        (Ty.path
                                                          "std::collections::hash::map::HashMap")
                                                        []
                                                        [
                                                          Ty.apply
                                                            (Ty.path "ruint::Uint")
                                                            [
                                                              Value.Integer IntegerKind.Usize 256;
                                                              Value.Integer IntegerKind.Usize 4
                                                            ]
                                                            [];
                                                          Ty.path
                                                            "revm_primitives::state::StorageSlot";
                                                          Ty.path "std::hash::random::RandomState"
                                                        ],
                                                      [],
                                                      "into_iter",
                                                      []
                                                    |),
                                                    [
                                                      M.read (|
                                                        M.SubPointer.get_struct_record_field (|
                                                          account,
                                                          "revm::db::states::bundle_account::BundleAccount",
                                                          "storage"
                                                        |)
                                                      |)
                                                    ]
                                                  |)
                                                |),
                                                [
                                                  fun γ =>
                                                    ltac:(M.monadic
                                                      (let iter := M.copy (| γ |) in
                                                      M.loop (|
                                                        ltac:(M.monadic
                                                          (let~ _ :=
                                                            M.match_operator (|
                                                              M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_trait_method (|
                                                                    "core::iter::traits::iterator::Iterator",
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "std::collections::hash::map::IntoIter")
                                                                      []
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.path
                                                                          "revm_primitives::state::StorageSlot"
                                                                      ],
                                                                    [],
                                                                    "next",
                                                                    []
                                                                  |),
                                                                  [ iter ]
                                                                |)
                                                              |),
                                                              [
                                                                fun γ =>
                                                                  ltac:(M.monadic
                                                                    (let _ :=
                                                                      M.is_struct_tuple (|
                                                                        γ,
                                                                        "core::option::Option::None"
                                                                      |) in
                                                                    M.alloc (|
                                                                      M.never_to_any (|
                                                                        M.read (| M.break (||) |)
                                                                      |)
                                                                    |)));
                                                                fun γ =>
                                                                  ltac:(M.monadic
                                                                    (let γ0_0 :=
                                                                      M.SubPointer.get_struct_tuple_field (|
                                                                        γ,
                                                                        "core::option::Option::Some",
                                                                        0
                                                                      |) in
                                                                    let γ1_0 :=
                                                                      M.SubPointer.get_tuple_field (|
                                                                        γ0_0,
                                                                        0
                                                                      |) in
                                                                    let γ1_1 :=
                                                                      M.SubPointer.get_tuple_field (|
                                                                        γ0_0,
                                                                        1
                                                                      |) in
                                                                    let key := M.copy (| γ1_0 |) in
                                                                    let slot := M.copy (| γ1_1 |) in
                                                                    let~ destroyed_and_not_zero :=
                                                                      M.alloc (|
                                                                        LogicalOp.and (|
                                                                          M.read (|
                                                                            was_destroyed
                                                                          |),
                                                                          ltac:(M.monadic
                                                                            (M.call_closure (|
                                                                              M.get_trait_method (|
                                                                                "core::cmp::PartialEq",
                                                                                Ty.apply
                                                                                  (Ty.path
                                                                                    "ruint::Uint")
                                                                                  [
                                                                                    Value.Integer
                                                                                      IntegerKind.Usize
                                                                                      256;
                                                                                    Value.Integer
                                                                                      IntegerKind.Usize
                                                                                      4
                                                                                  ]
                                                                                  [],
                                                                                [
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "ruint::Uint")
                                                                                    [
                                                                                      Value.Integer
                                                                                        IntegerKind.Usize
                                                                                        256;
                                                                                      Value.Integer
                                                                                        IntegerKind.Usize
                                                                                        4
                                                                                    ]
                                                                                    []
                                                                                ],
                                                                                "ne",
                                                                                []
                                                                              |),
                                                                              [
                                                                                M.SubPointer.get_struct_record_field (|
                                                                                  slot,
                                                                                  "revm_primitives::state::StorageSlot",
                                                                                  "present_value"
                                                                                |);
                                                                                M.get_constant (|
                                                                                  "ruint::ZERO"
                                                                                |)
                                                                              ]
                                                                            |)))
                                                                        |)
                                                                      |) in
                                                                    let~
                                                                          not_destroyed_and_changed :=
                                                                      M.alloc (|
                                                                        LogicalOp.and (|
                                                                          UnOp.not (|
                                                                            M.read (|
                                                                              was_destroyed
                                                                            |)
                                                                          |),
                                                                          ltac:(M.monadic
                                                                            (M.call_closure (|
                                                                              M.get_associated_function (|
                                                                                Ty.path
                                                                                  "revm_primitives::state::StorageSlot",
                                                                                "is_changed",
                                                                                []
                                                                              |),
                                                                              [ slot ]
                                                                            |)))
                                                                        |)
                                                                      |) in
                                                                    M.match_operator (|
                                                                      M.alloc (| Value.Tuple [] |),
                                                                      [
                                                                        fun γ =>
                                                                          ltac:(M.monadic
                                                                            (let γ :=
                                                                              M.use
                                                                                (M.alloc (|
                                                                                  LogicalOp.or (|
                                                                                    LogicalOp.or (|
                                                                                      M.call_closure (|
                                                                                        M.get_associated_function (|
                                                                                          Ty.path
                                                                                            "revm::db::states::bundle_state::OriginalValuesKnown",
                                                                                          "is_not_known",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          is_value_known
                                                                                        ]
                                                                                      |),
                                                                                      ltac:(M.monadic
                                                                                        (M.read (|
                                                                                          destroyed_and_not_zero
                                                                                        |)))
                                                                                    |),
                                                                                    ltac:(M.monadic
                                                                                      (M.read (|
                                                                                        not_destroyed_and_changed
                                                                                      |)))
                                                                                  |)
                                                                                |)) in
                                                                            let _ :=
                                                                              M.is_constant_or_break_match (|
                                                                                M.read (| γ |),
                                                                                Value.Bool true
                                                                              |) in
                                                                            let~ _ :=
                                                                              M.alloc (|
                                                                                M.call_closure (|
                                                                                  M.get_associated_function (|
                                                                                    Ty.apply
                                                                                      (Ty.path
                                                                                        "alloc::vec::Vec")
                                                                                      []
                                                                                      [
                                                                                        Ty.tuple
                                                                                          [
                                                                                            Ty.apply
                                                                                              (Ty.path
                                                                                                "ruint::Uint")
                                                                                              [
                                                                                                Value.Integer
                                                                                                  IntegerKind.Usize
                                                                                                  256;
                                                                                                Value.Integer
                                                                                                  IntegerKind.Usize
                                                                                                  4
                                                                                              ]
                                                                                              [];
                                                                                            Ty.apply
                                                                                              (Ty.path
                                                                                                "ruint::Uint")
                                                                                              [
                                                                                                Value.Integer
                                                                                                  IntegerKind.Usize
                                                                                                  256;
                                                                                                Value.Integer
                                                                                                  IntegerKind.Usize
                                                                                                  4
                                                                                              ]
                                                                                              []
                                                                                          ];
                                                                                        Ty.path
                                                                                          "alloc::alloc::Global"
                                                                                      ],
                                                                                    "push",
                                                                                    []
                                                                                  |),
                                                                                  [
                                                                                    account_storage_changed;
                                                                                    Value.Tuple
                                                                                      [
                                                                                        M.read (|
                                                                                          key
                                                                                        |);
                                                                                        M.read (|
                                                                                          M.SubPointer.get_struct_record_field (|
                                                                                            slot,
                                                                                            "revm_primitives::state::StorageSlot",
                                                                                            "present_value"
                                                                                          |)
                                                                                        |)
                                                                                      ]
                                                                                  ]
                                                                                |)
                                                                              |) in
                                                                            M.alloc (|
                                                                              Value.Tuple []
                                                                            |)));
                                                                        fun γ =>
                                                                          ltac:(M.monadic
                                                                            (M.alloc (|
                                                                              Value.Tuple []
                                                                            |)))
                                                                      ]
                                                                    |)))
                                                              ]
                                                            |) in
                                                          M.alloc (| Value.Tuple [] |)))
                                                      |)))
                                                ]
                                              |)) in
                                          M.match_operator (|
                                            M.alloc (| Value.Tuple [] |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ :=
                                                    M.use
                                                      (M.alloc (|
                                                        LogicalOp.or (|
                                                          UnOp.not (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.apply
                                                                  (Ty.path "alloc::vec::Vec")
                                                                  []
                                                                  [
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          []
                                                                      ];
                                                                    Ty.path "alloc::alloc::Global"
                                                                  ],
                                                                "is_empty",
                                                                []
                                                              |),
                                                              [ account_storage_changed ]
                                                            |)
                                                          |),
                                                          ltac:(M.monadic
                                                            (M.read (| was_destroyed |)))
                                                        |)
                                                      |)) in
                                                  let _ :=
                                                    M.is_constant_or_break_match (|
                                                      M.read (| γ |),
                                                      Value.Bool true
                                                    |) in
                                                  let~ _ :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.apply
                                                            (Ty.path "alloc::vec::Vec")
                                                            []
                                                            [
                                                              Ty.path
                                                                "revm::db::states::changes::PlainStorageChangeset";
                                                              Ty.path "alloc::alloc::Global"
                                                            ],
                                                          "push",
                                                          []
                                                        |),
                                                        [
                                                          storage;
                                                          Value.StructRecord
                                                            "revm::db::states::changes::PlainStorageChangeset"
                                                            [
                                                              ("address", M.read (| address |));
                                                              ("wipe_storage",
                                                                M.read (| was_destroyed |));
                                                              ("storage",
                                                                M.read (|
                                                                  account_storage_changed
                                                                |))
                                                            ]
                                                        ]
                                                      |)
                                                    |) in
                                                  M.alloc (| Value.Tuple [] |)));
                                              fun γ =>
                                                ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                let~ contracts :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::iter::traits::iterator::Iterator",
                        Ty.apply
                          (Ty.path "core::iter::adapters::filter::Filter")
                          []
                          [
                            Ty.apply
                              (Ty.path "std::collections::hash::map::IntoIter")
                              []
                              [
                                Ty.apply
                                  (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                  [ Value.Integer IntegerKind.Usize 32 ]
                                  [];
                                Ty.path "revm_primitives::bytecode::Bytecode"
                              ];
                            Ty.function
                              [
                                Ty.tuple
                                  [
                                    Ty.apply
                                      (Ty.path "&")
                                      []
                                      [
                                        Ty.tuple
                                          [
                                            Ty.apply
                                              (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                              [ Value.Integer IntegerKind.Usize 32 ]
                                              [];
                                            Ty.path "revm_primitives::bytecode::Bytecode"
                                          ]
                                      ]
                                  ]
                              ]
                              (Ty.path "bool")
                          ],
                        [],
                        "collect",
                        [
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            []
                            [
                              Ty.tuple
                                [
                                  Ty.apply
                                    (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                    [ Value.Integer IntegerKind.Usize 32 ]
                                    [];
                                  Ty.path "revm_primitives::bytecode::Bytecode"
                                ];
                              Ty.path "alloc::alloc::Global"
                            ]
                        ]
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::iterator::Iterator",
                            Ty.apply
                              (Ty.path "std::collections::hash::map::IntoIter")
                              []
                              [
                                Ty.apply
                                  (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                  [ Value.Integer IntegerKind.Usize 32 ]
                                  [];
                                Ty.path "revm_primitives::bytecode::Bytecode"
                              ],
                            [],
                            "filter",
                            [
                              Ty.function
                                [
                                  Ty.tuple
                                    [
                                      Ty.apply
                                        (Ty.path "&")
                                        []
                                        [
                                          Ty.tuple
                                            [
                                              Ty.apply
                                                (Ty.path
                                                  "alloy_primitives::bits::fixed::FixedBytes")
                                                [ Value.Integer IntegerKind.Usize 32 ]
                                                [];
                                              Ty.path "revm_primitives::bytecode::Bytecode"
                                            ]
                                        ]
                                    ]
                                ]
                                (Ty.path "bool")
                            ]
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::collect::IntoIterator",
                                Ty.apply
                                  (Ty.path "std::collections::hash::map::HashMap")
                                  []
                                  [
                                    Ty.apply
                                      (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                      [ Value.Integer IntegerKind.Usize 32 ]
                                      [];
                                    Ty.path "revm_primitives::bytecode::Bytecode";
                                    Ty.path "std::hash::random::RandomState"
                                  ],
                                [],
                                "into_iter",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    self,
                                    "revm::db::states::bundle_state::BundleState",
                                    "contracts"
                                  |)
                                |)
                              ]
                            |);
                            M.closure
                              (fun γ =>
                                ltac:(M.monadic
                                  match γ with
                                  | [ α0 ] =>
                                    ltac:(M.monadic
                                      (M.match_operator (|
                                        M.alloc (| α0 |),
                                        [
                                          fun γ =>
                                            ltac:(M.monadic
                                              (let γ := M.read (| γ |) in
                                              let γ1_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                              let γ1_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                              let b := M.alloc (| γ1_0 |) in
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::cmp::PartialEq",
                                                  Ty.apply
                                                    (Ty.path
                                                      "alloy_primitives::bits::fixed::FixedBytes")
                                                    [ Value.Integer IntegerKind.Usize 32 ]
                                                    [],
                                                  [
                                                    Ty.apply
                                                      (Ty.path
                                                        "alloy_primitives::bits::fixed::FixedBytes")
                                                      [ Value.Integer IntegerKind.Usize 32 ]
                                                      []
                                                  ],
                                                  "ne",
                                                  []
                                                |),
                                                [
                                                  M.read (| b |);
                                                  M.get_constant (|
                                                    "revm_primitives::utilities::KECCAK_EMPTY"
                                                  |)
                                                ]
                                              |)))
                                        ]
                                      |)))
                                  | _ => M.impossible "wrong number of arguments"
                                  end))
                          ]
                        |)
                      ]
                    |)
                  |) in
                M.alloc (|
                  Value.StructRecord
                    "revm::db::states::changes::StateChangeset"
                    [
                      ("accounts", M.read (| accounts |));
                      ("storage", M.read (| storage |));
                      ("contracts", M.read (| contracts |))
                    ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_into_plain_state :
          M.IsAssociatedFunction Self "into_plain_state" into_plain_state.
        
        (*
            pub fn into_plain_state_and_reverts(
                mut self,
                is_value_known: OriginalValuesKnown,
            ) -> (StateChangeset, PlainStateReverts) {
                let reverts = self.take_all_reverts();
                let plain_state = self.into_plain_state(is_value_known);
                (plain_state, reverts.into_plain_state_reverts())
            }
        *)
        Definition into_plain_state_and_reverts
            (ε : list Value.t)
            (τ : list Ty.t)
            (α : list Value.t)
            : M :=
          match ε, τ, α with
          | [], [], [ self; is_value_known ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let is_value_known := M.alloc (| is_value_known |) in
              M.read (|
                let~ reverts :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "revm::db::states::bundle_state::BundleState",
                        "take_all_reverts",
                        []
                      |),
                      [ self ]
                    |)
                  |) in
                let~ plain_state :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "revm::db::states::bundle_state::BundleState",
                        "into_plain_state",
                        []
                      |),
                      [ M.read (| self |); M.read (| is_value_known |) ]
                    |)
                  |) in
                M.alloc (|
                  Value.Tuple
                    [
                      M.read (| plain_state |);
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "revm::db::states::reverts::Reverts",
                          "into_plain_state_reverts",
                          []
                        |),
                        [ M.read (| reverts |) ]
                      |)
                    ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_into_plain_state_and_reverts :
          M.IsAssociatedFunction Self "into_plain_state_and_reverts" into_plain_state_and_reverts.
        
        (*
            pub fn extend_state(&mut self, other_state: HashMap<Address, BundleAccount>) {
                for (address, other_account) in other_state {
                    match self.state.entry(address) {
                        hash_map::Entry::Occupied(mut entry) => {
                            let this = entry.get_mut();
                            self.state_size -= this.size_hint();
        
                            // if other was destroyed. replace `this` storage with
                            // the `other one.
                            if other_account.was_destroyed() {
                                this.storage = other_account.storage;
                            } else {
                                // otherwise extend this storage with other
                                for (key, storage_slot) in other_account.storage {
                                    // update present value or insert storage slot.
                                    this.storage
                                        .entry(key)
                                        .or_insert(storage_slot)
                                        .present_value = storage_slot.present_value;
                                }
                            }
                            this.info = other_account.info;
                            this.status.transition(other_account.status);
        
                            // Update the state size
                            self.state_size += this.size_hint();
                        }
                        hash_map::Entry::Vacant(entry) => {
                            // just insert if empty
                            self.state_size += other_account.size_hint();
                            entry.insert(other_account);
                        }
                    }
                }
            }
        *)
        Definition extend_state (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; other_state ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let other_state := M.alloc (| other_state |) in
              M.read (|
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "std::collections::hash::map::HashMap")
                            []
                            [
                              Ty.path "alloy_primitives::bits::address::Address";
                              Ty.path "revm::db::states::bundle_account::BundleAccount";
                              Ty.path "std::hash::random::RandomState"
                            ],
                          [],
                          "into_iter",
                          []
                        |),
                        [ M.read (| other_state |) ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let~ _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "std::collections::hash::map::IntoIter")
                                          []
                                          [
                                            Ty.path "alloy_primitives::bits::address::Address";
                                            Ty.path
                                              "revm::db::states::bundle_account::BundleAccount"
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                                        M.alloc (|
                                          M.never_to_any (| M.read (| M.break (||) |) |)
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let γ0_0 :=
                                          M.SubPointer.get_struct_tuple_field (|
                                            γ,
                                            "core::option::Option::Some",
                                            0
                                          |) in
                                        let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                        let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                        let address := M.copy (| γ1_0 |) in
                                        let other_account := M.copy (| γ1_1 |) in
                                        M.match_operator (|
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "std::collections::hash::map::HashMap")
                                                  []
                                                  [
                                                    Ty.path
                                                      "alloy_primitives::bits::address::Address";
                                                    Ty.path
                                                      "revm::db::states::bundle_account::BundleAccount";
                                                    Ty.path "std::hash::random::RandomState"
                                                  ],
                                                "entry",
                                                []
                                              |),
                                              [
                                                M.SubPointer.get_struct_record_field (|
                                                  M.read (| self |),
                                                  "revm::db::states::bundle_state::BundleState",
                                                  "state"
                                                |);
                                                M.read (| address |)
                                              ]
                                            |)
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_struct_tuple_field (|
                                                    γ,
                                                    "std::collections::hash::map::Entry::Occupied",
                                                    0
                                                  |) in
                                                let entry := M.copy (| γ0_0 |) in
                                                let~ this :=
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path
                                                            "std::collections::hash::map::OccupiedEntry")
                                                          []
                                                          [
                                                            Ty.path
                                                              "alloy_primitives::bits::address::Address";
                                                            Ty.path
                                                              "revm::db::states::bundle_account::BundleAccount"
                                                          ],
                                                        "get_mut",
                                                        []
                                                      |),
                                                      [ entry ]
                                                    |)
                                                  |) in
                                                let~ _ :=
                                                  let β :=
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.read (| self |),
                                                      "revm::db::states::bundle_state::BundleState",
                                                      "state_size"
                                                    |) in
                                                  M.write (|
                                                    β,
                                                    BinOp.Wrap.sub (|
                                                      M.read (| β |),
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path
                                                            "revm::db::states::bundle_account::BundleAccount",
                                                          "size_hint",
                                                          []
                                                        |),
                                                        [ M.read (| this |) ]
                                                      |)
                                                    |)
                                                  |) in
                                                let~ _ :=
                                                  M.match_operator (|
                                                    M.alloc (| Value.Tuple [] |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ :=
                                                            M.use
                                                              (M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "revm::db::states::bundle_account::BundleAccount",
                                                                    "was_destroyed",
                                                                    []
                                                                  |),
                                                                  [ other_account ]
                                                                |)
                                                              |)) in
                                                          let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Bool true
                                                            |) in
                                                          let~ _ :=
                                                            M.write (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| this |),
                                                                "revm::db::states::bundle_account::BundleAccount",
                                                                "storage"
                                                              |),
                                                              M.read (|
                                                                M.SubPointer.get_struct_record_field (|
                                                                  other_account,
                                                                  "revm::db::states::bundle_account::BundleAccount",
                                                                  "storage"
                                                                |)
                                                              |)
                                                            |) in
                                                          M.alloc (| Value.Tuple [] |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.use
                                                            (M.match_operator (|
                                                              M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_trait_method (|
                                                                    "core::iter::traits::collect::IntoIterator",
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "std::collections::hash::map::HashMap")
                                                                      []
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "ruint::Uint")
                                                                          [
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              256;
                                                                            Value.Integer
                                                                              IntegerKind.Usize
                                                                              4
                                                                          ]
                                                                          [];
                                                                        Ty.path
                                                                          "revm_primitives::state::StorageSlot";
                                                                        Ty.path
                                                                          "std::hash::random::RandomState"
                                                                      ],
                                                                    [],
                                                                    "into_iter",
                                                                    []
                                                                  |),
                                                                  [
                                                                    M.read (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        other_account,
                                                                        "revm::db::states::bundle_account::BundleAccount",
                                                                        "storage"
                                                                      |)
                                                                    |)
                                                                  ]
                                                                |)
                                                              |),
                                                              [
                                                                fun γ =>
                                                                  ltac:(M.monadic
                                                                    (let iter := M.copy (| γ |) in
                                                                    M.loop (|
                                                                      ltac:(M.monadic
                                                                        (let~ _ :=
                                                                          M.match_operator (|
                                                                            M.alloc (|
                                                                              M.call_closure (|
                                                                                M.get_trait_method (|
                                                                                  "core::iter::traits::iterator::Iterator",
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "std::collections::hash::map::IntoIter")
                                                                                    []
                                                                                    [
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "ruint::Uint")
                                                                                        [
                                                                                          Value.Integer
                                                                                            IntegerKind.Usize
                                                                                            256;
                                                                                          Value.Integer
                                                                                            IntegerKind.Usize
                                                                                            4
                                                                                        ]
                                                                                        [];
                                                                                      Ty.path
                                                                                        "revm_primitives::state::StorageSlot"
                                                                                    ],
                                                                                  [],
                                                                                  "next",
                                                                                  []
                                                                                |),
                                                                                [ iter ]
                                                                              |)
                                                                            |),
                                                                            [
                                                                              fun γ =>
                                                                                ltac:(M.monadic
                                                                                  (let _ :=
                                                                                    M.is_struct_tuple (|
                                                                                      γ,
                                                                                      "core::option::Option::None"
                                                                                    |) in
                                                                                  M.alloc (|
                                                                                    M.never_to_any (|
                                                                                      M.read (|
                                                                                        M.break (||)
                                                                                      |)
                                                                                    |)
                                                                                  |)));
                                                                              fun γ =>
                                                                                ltac:(M.monadic
                                                                                  (let γ0_0 :=
                                                                                    M.SubPointer.get_struct_tuple_field (|
                                                                                      γ,
                                                                                      "core::option::Option::Some",
                                                                                      0
                                                                                    |) in
                                                                                  let γ1_0 :=
                                                                                    M.SubPointer.get_tuple_field (|
                                                                                      γ0_0,
                                                                                      0
                                                                                    |) in
                                                                                  let γ1_1 :=
                                                                                    M.SubPointer.get_tuple_field (|
                                                                                      γ0_0,
                                                                                      1
                                                                                    |) in
                                                                                  let key :=
                                                                                    M.copy (|
                                                                                      γ1_0
                                                                                    |) in
                                                                                  let
                                                                                        storage_slot :=
                                                                                    M.copy (|
                                                                                      γ1_1
                                                                                    |) in
                                                                                  let~ _ :=
                                                                                    M.write (|
                                                                                      M.SubPointer.get_struct_record_field (|
                                                                                        M.call_closure (|
                                                                                          M.get_associated_function (|
                                                                                            Ty.apply
                                                                                              (Ty.path
                                                                                                "std::collections::hash::map::Entry")
                                                                                              []
                                                                                              [
                                                                                                Ty.apply
                                                                                                  (Ty.path
                                                                                                    "ruint::Uint")
                                                                                                  [
                                                                                                    Value.Integer
                                                                                                      IntegerKind.Usize
                                                                                                      256;
                                                                                                    Value.Integer
                                                                                                      IntegerKind.Usize
                                                                                                      4
                                                                                                  ]
                                                                                                  [];
                                                                                                Ty.path
                                                                                                  "revm_primitives::state::StorageSlot"
                                                                                              ],
                                                                                            "or_insert",
                                                                                            []
                                                                                          |),
                                                                                          [
                                                                                            M.call_closure (|
                                                                                              M.get_associated_function (|
                                                                                                Ty.apply
                                                                                                  (Ty.path
                                                                                                    "std::collections::hash::map::HashMap")
                                                                                                  []
                                                                                                  [
                                                                                                    Ty.apply
                                                                                                      (Ty.path
                                                                                                        "ruint::Uint")
                                                                                                      [
                                                                                                        Value.Integer
                                                                                                          IntegerKind.Usize
                                                                                                          256;
                                                                                                        Value.Integer
                                                                                                          IntegerKind.Usize
                                                                                                          4
                                                                                                      ]
                                                                                                      [];
                                                                                                    Ty.path
                                                                                                      "revm_primitives::state::StorageSlot";
                                                                                                    Ty.path
                                                                                                      "std::hash::random::RandomState"
                                                                                                  ],
                                                                                                "entry",
                                                                                                []
                                                                                              |),
                                                                                              [
                                                                                                M.SubPointer.get_struct_record_field (|
                                                                                                  M.read (|
                                                                                                    this
                                                                                                  |),
                                                                                                  "revm::db::states::bundle_account::BundleAccount",
                                                                                                  "storage"
                                                                                                |);
                                                                                                M.read (|
                                                                                                  key
                                                                                                |)
                                                                                              ]
                                                                                            |);
                                                                                            M.read (|
                                                                                              storage_slot
                                                                                            |)
                                                                                          ]
                                                                                        |),
                                                                                        "revm_primitives::state::StorageSlot",
                                                                                        "present_value"
                                                                                      |),
                                                                                      M.read (|
                                                                                        M.SubPointer.get_struct_record_field (|
                                                                                          storage_slot,
                                                                                          "revm_primitives::state::StorageSlot",
                                                                                          "present_value"
                                                                                        |)
                                                                                      |)
                                                                                    |) in
                                                                                  M.alloc (|
                                                                                    Value.Tuple []
                                                                                  |)))
                                                                            ]
                                                                          |) in
                                                                        M.alloc (|
                                                                          Value.Tuple []
                                                                        |)))
                                                                    |)))
                                                              ]
                                                            |))))
                                                    ]
                                                  |) in
                                                let~ _ :=
                                                  M.write (|
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.read (| this |),
                                                      "revm::db::states::bundle_account::BundleAccount",
                                                      "info"
                                                    |),
                                                    M.read (|
                                                      M.SubPointer.get_struct_record_field (|
                                                        other_account,
                                                        "revm::db::states::bundle_account::BundleAccount",
                                                        "info"
                                                      |)
                                                    |)
                                                  |) in
                                                let~ _ :=
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path
                                                          "revm::db::states::account_status::AccountStatus",
                                                        "transition",
                                                        []
                                                      |),
                                                      [
                                                        M.SubPointer.get_struct_record_field (|
                                                          M.read (| this |),
                                                          "revm::db::states::bundle_account::BundleAccount",
                                                          "status"
                                                        |);
                                                        M.read (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            other_account,
                                                            "revm::db::states::bundle_account::BundleAccount",
                                                            "status"
                                                          |)
                                                        |)
                                                      ]
                                                    |)
                                                  |) in
                                                let~ _ :=
                                                  let β :=
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.read (| self |),
                                                      "revm::db::states::bundle_state::BundleState",
                                                      "state_size"
                                                    |) in
                                                  M.write (|
                                                    β,
                                                    BinOp.Wrap.add (|
                                                      M.read (| β |),
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path
                                                            "revm::db::states::bundle_account::BundleAccount",
                                                          "size_hint",
                                                          []
                                                        |),
                                                        [ M.read (| this |) ]
                                                      |)
                                                    |)
                                                  |) in
                                                M.alloc (| Value.Tuple [] |)));
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_struct_tuple_field (|
                                                    γ,
                                                    "std::collections::hash::map::Entry::Vacant",
                                                    0
                                                  |) in
                                                let entry := M.copy (| γ0_0 |) in
                                                let~ _ :=
                                                  let β :=
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.read (| self |),
                                                      "revm::db::states::bundle_state::BundleState",
                                                      "state_size"
                                                    |) in
                                                  M.write (|
                                                    β,
                                                    BinOp.Wrap.add (|
                                                      M.read (| β |),
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path
                                                            "revm::db::states::bundle_account::BundleAccount",
                                                          "size_hint",
                                                          []
                                                        |),
                                                        [ other_account ]
                                                      |)
                                                    |)
                                                  |) in
                                                let~ _ :=
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path
                                                            "std::collections::hash::map::VacantEntry")
                                                          []
                                                          [
                                                            Ty.path
                                                              "alloy_primitives::bits::address::Address";
                                                            Ty.path
                                                              "revm::db::states::bundle_account::BundleAccount"
                                                          ],
                                                        "insert",
                                                        []
                                                      |),
                                                      [
                                                        M.read (| entry |);
                                                        M.read (| other_account |)
                                                      ]
                                                    |)
                                                  |) in
                                                M.alloc (| Value.Tuple [] |)))
                                          ]
                                        |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |))
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_extend_state :
          M.IsAssociatedFunction Self "extend_state" extend_state.
        
        (*
            pub fn extend(&mut self, mut other: Self) {
                // iterate over reverts and if its storage is wiped try to add previous bundle
                // state as there is potential missing slots.
                for (address, revert) in other.reverts.iter_mut().flatten() {
                    if revert.wipe_storage {
                        // If there is wipe storage in `other` revert
                        // we need to move storage from present state.
                        if let Some(this_account) = self.state.get_mut(address) {
                            // As this account was destroyed inside `other` bundle.
                            // we are fine to wipe/drain this storage and put it inside revert.
                            for (key, value) in this_account.storage.drain() {
                                revert
                                    .storage
                                    .entry(key)
                                    .or_insert(RevertToSlot::Some(value.present_value));
                            }
        
                            // nullify `other` wipe as primary database wipe is done in `this`.
                            if this_account.was_destroyed() {
                                revert.wipe_storage = false;
                            }
                        }
                    }
        
                    // Increment reverts size for each of the updated reverts.
                    self.reverts_size += revert.size_hint();
                }
                // Extension of state
                self.extend_state(other.state);
                // Contract can be just extended, when counter is introduced we will take into account that.
                self.contracts.extend(other.contracts);
                // Reverts can be just extended
                self.reverts.extend(other.reverts);
            }
        *)
        Definition extend (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; other ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let other := M.alloc (| other |) in
              M.read (|
                let~ _ :=
                  M.use
                    (M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::collect::IntoIterator",
                            Ty.apply
                              (Ty.path "core::iter::adapters::flatten::Flatten")
                              []
                              [
                                Ty.apply
                                  (Ty.path "core::slice::iter::IterMut")
                                  []
                                  [
                                    Ty.apply
                                      (Ty.path "alloc::vec::Vec")
                                      []
                                      [
                                        Ty.tuple
                                          [
                                            Ty.path "alloy_primitives::bits::address::Address";
                                            Ty.path "revm::db::states::reverts::AccountRevert"
                                          ];
                                        Ty.path "alloc::alloc::Global"
                                      ]
                                  ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::iterator::Iterator",
                                Ty.apply
                                  (Ty.path "core::slice::iter::IterMut")
                                  []
                                  [
                                    Ty.apply
                                      (Ty.path "alloc::vec::Vec")
                                      []
                                      [
                                        Ty.tuple
                                          [
                                            Ty.path "alloy_primitives::bits::address::Address";
                                            Ty.path "revm::db::states::reverts::AccountRevert"
                                          ];
                                        Ty.path "alloc::alloc::Global"
                                      ]
                                  ],
                                [],
                                "flatten",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "slice")
                                      []
                                      [
                                        Ty.apply
                                          (Ty.path "alloc::vec::Vec")
                                          []
                                          [
                                            Ty.tuple
                                              [
                                                Ty.path "alloy_primitives::bits::address::Address";
                                                Ty.path "revm::db::states::reverts::AccountRevert"
                                              ];
                                            Ty.path "alloc::alloc::Global"
                                          ]
                                      ],
                                    "iter_mut",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::DerefMut",
                                        Ty.apply
                                          (Ty.path "alloc::vec::Vec")
                                          []
                                          [
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [
                                                Ty.tuple
                                                  [
                                                    Ty.path
                                                      "alloy_primitives::bits::address::Address";
                                                    Ty.path
                                                      "revm::db::states::reverts::AccountRevert"
                                                  ];
                                                Ty.path "alloc::alloc::Global"
                                              ];
                                            Ty.path "alloc::alloc::Global"
                                          ],
                                        [],
                                        "deref_mut",
                                        []
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::ops::deref::DerefMut",
                                            Ty.path "revm::db::states::reverts::Reverts",
                                            [],
                                            "deref_mut",
                                            []
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              other,
                                              "revm::db::states::bundle_state::BundleState",
                                              "reverts"
                                            |)
                                          ]
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let iter := M.copy (| γ |) in
                            M.loop (|
                              ltac:(M.monadic
                                (let~ _ :=
                                  M.match_operator (|
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::iter::traits::iterator::Iterator",
                                          Ty.apply
                                            (Ty.path "core::iter::adapters::flatten::Flatten")
                                            []
                                            [
                                              Ty.apply
                                                (Ty.path "core::slice::iter::IterMut")
                                                []
                                                [
                                                  Ty.apply
                                                    (Ty.path "alloc::vec::Vec")
                                                    []
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path
                                                            "alloy_primitives::bits::address::Address";
                                                          Ty.path
                                                            "revm::db::states::reverts::AccountRevert"
                                                        ];
                                                      Ty.path "alloc::alloc::Global"
                                                    ]
                                                ]
                                            ],
                                          [],
                                          "next",
                                          []
                                        |),
                                        [ iter ]
                                      |)
                                    |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let _ :=
                                            M.is_struct_tuple (|
                                              γ,
                                              "core::option::Option::None"
                                            |) in
                                          M.alloc (|
                                            M.never_to_any (| M.read (| M.break (||) |) |)
                                          |)));
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let γ0_0 :=
                                            M.SubPointer.get_struct_tuple_field (|
                                              γ,
                                              "core::option::Option::Some",
                                              0
                                            |) in
                                          let γ0_0 := M.read (| γ0_0 |) in
                                          let γ2_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                          let γ2_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                          let address := M.alloc (| γ2_0 |) in
                                          let revert := M.alloc (| γ2_1 |) in
                                          let~ _ :=
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.SubPointer.get_struct_record_field (|
                                                          M.read (| revert |),
                                                          "revm::db::states::reverts::AccountRevert",
                                                          "wipe_storage"
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    M.match_operator (|
                                                      M.alloc (| Value.Tuple [] |),
                                                      [
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (let γ :=
                                                              M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "std::collections::hash::map::HashMap")
                                                                      []
                                                                      [
                                                                        Ty.path
                                                                          "alloy_primitives::bits::address::Address";
                                                                        Ty.path
                                                                          "revm::db::states::bundle_account::BundleAccount";
                                                                        Ty.path
                                                                          "std::hash::random::RandomState"
                                                                      ],
                                                                    "get_mut",
                                                                    [
                                                                      Ty.path
                                                                        "alloy_primitives::bits::address::Address"
                                                                    ]
                                                                  |),
                                                                  [
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "revm::db::states::bundle_state::BundleState",
                                                                      "state"
                                                                    |);
                                                                    M.read (| address |)
                                                                  ]
                                                                |)
                                                              |) in
                                                            let γ0_0 :=
                                                              M.SubPointer.get_struct_tuple_field (|
                                                                γ,
                                                                "core::option::Option::Some",
                                                                0
                                                              |) in
                                                            let this_account := M.copy (| γ0_0 |) in
                                                            let~ _ :=
                                                              M.use
                                                                (M.match_operator (|
                                                                  M.alloc (|
                                                                    M.call_closure (|
                                                                      M.get_trait_method (|
                                                                        "core::iter::traits::collect::IntoIterator",
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "std::collections::hash::map::Drain")
                                                                          []
                                                                          [
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "ruint::Uint")
                                                                              [
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  256;
                                                                                Value.Integer
                                                                                  IntegerKind.Usize
                                                                                  4
                                                                              ]
                                                                              [];
                                                                            Ty.path
                                                                              "revm_primitives::state::StorageSlot"
                                                                          ],
                                                                        [],
                                                                        "into_iter",
                                                                        []
                                                                      |),
                                                                      [
                                                                        M.call_closure (|
                                                                          M.get_associated_function (|
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "std::collections::hash::map::HashMap")
                                                                              []
                                                                              [
                                                                                Ty.apply
                                                                                  (Ty.path
                                                                                    "ruint::Uint")
                                                                                  [
                                                                                    Value.Integer
                                                                                      IntegerKind.Usize
                                                                                      256;
                                                                                    Value.Integer
                                                                                      IntegerKind.Usize
                                                                                      4
                                                                                  ]
                                                                                  [];
                                                                                Ty.path
                                                                                  "revm_primitives::state::StorageSlot";
                                                                                Ty.path
                                                                                  "std::hash::random::RandomState"
                                                                              ],
                                                                            "drain",
                                                                            []
                                                                          |),
                                                                          [
                                                                            M.SubPointer.get_struct_record_field (|
                                                                              M.read (|
                                                                                this_account
                                                                              |),
                                                                              "revm::db::states::bundle_account::BundleAccount",
                                                                              "storage"
                                                                            |)
                                                                          ]
                                                                        |)
                                                                      ]
                                                                    |)
                                                                  |),
                                                                  [
                                                                    fun γ =>
                                                                      ltac:(M.monadic
                                                                        (let iter :=
                                                                          M.copy (| γ |) in
                                                                        M.loop (|
                                                                          ltac:(M.monadic
                                                                            (let~ _ :=
                                                                              M.match_operator (|
                                                                                M.alloc (|
                                                                                  M.call_closure (|
                                                                                    M.get_trait_method (|
                                                                                      "core::iter::traits::iterator::Iterator",
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "std::collections::hash::map::Drain")
                                                                                        []
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "ruint::Uint")
                                                                                            [
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                256;
                                                                                              Value.Integer
                                                                                                IntegerKind.Usize
                                                                                                4
                                                                                            ]
                                                                                            [];
                                                                                          Ty.path
                                                                                            "revm_primitives::state::StorageSlot"
                                                                                        ],
                                                                                      [],
                                                                                      "next",
                                                                                      []
                                                                                    |),
                                                                                    [ iter ]
                                                                                  |)
                                                                                |),
                                                                                [
                                                                                  fun γ =>
                                                                                    ltac:(M.monadic
                                                                                      (let _ :=
                                                                                        M.is_struct_tuple (|
                                                                                          γ,
                                                                                          "core::option::Option::None"
                                                                                        |) in
                                                                                      M.alloc (|
                                                                                        M.never_to_any (|
                                                                                          M.read (|
                                                                                            M.break (||)
                                                                                          |)
                                                                                        |)
                                                                                      |)));
                                                                                  fun γ =>
                                                                                    ltac:(M.monadic
                                                                                      (let γ0_0 :=
                                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                                          γ,
                                                                                          "core::option::Option::Some",
                                                                                          0
                                                                                        |) in
                                                                                      let γ1_0 :=
                                                                                        M.SubPointer.get_tuple_field (|
                                                                                          γ0_0,
                                                                                          0
                                                                                        |) in
                                                                                      let γ1_1 :=
                                                                                        M.SubPointer.get_tuple_field (|
                                                                                          γ0_0,
                                                                                          1
                                                                                        |) in
                                                                                      let key :=
                                                                                        M.copy (|
                                                                                          γ1_0
                                                                                        |) in
                                                                                      let value :=
                                                                                        M.copy (|
                                                                                          γ1_1
                                                                                        |) in
                                                                                      let~ _ :=
                                                                                        M.alloc (|
                                                                                          M.call_closure (|
                                                                                            M.get_associated_function (|
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "std::collections::hash::map::Entry")
                                                                                                []
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "ruint::Uint")
                                                                                                    [
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        256;
                                                                                                      Value.Integer
                                                                                                        IntegerKind.Usize
                                                                                                        4
                                                                                                    ]
                                                                                                    [];
                                                                                                  Ty.path
                                                                                                    "revm::db::states::reverts::RevertToSlot"
                                                                                                ],
                                                                                              "or_insert",
                                                                                              []
                                                                                            |),
                                                                                            [
                                                                                              M.call_closure (|
                                                                                                M.get_associated_function (|
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "std::collections::hash::map::HashMap")
                                                                                                    []
                                                                                                    [
                                                                                                      Ty.apply
                                                                                                        (Ty.path
                                                                                                          "ruint::Uint")
                                                                                                        [
                                                                                                          Value.Integer
                                                                                                            IntegerKind.Usize
                                                                                                            256;
                                                                                                          Value.Integer
                                                                                                            IntegerKind.Usize
                                                                                                            4
                                                                                                        ]
                                                                                                        [];
                                                                                                      Ty.path
                                                                                                        "revm::db::states::reverts::RevertToSlot";
                                                                                                      Ty.path
                                                                                                        "std::hash::random::RandomState"
                                                                                                    ],
                                                                                                  "entry",
                                                                                                  []
                                                                                                |),
                                                                                                [
                                                                                                  M.SubPointer.get_struct_record_field (|
                                                                                                    M.read (|
                                                                                                      revert
                                                                                                    |),
                                                                                                    "revm::db::states::reverts::AccountRevert",
                                                                                                    "storage"
                                                                                                  |);
                                                                                                  M.read (|
                                                                                                    key
                                                                                                  |)
                                                                                                ]
                                                                                              |);
                                                                                              Value.StructTuple
                                                                                                "revm::db::states::reverts::RevertToSlot::Some"
                                                                                                [
                                                                                                  M.read (|
                                                                                                    M.SubPointer.get_struct_record_field (|
                                                                                                      value,
                                                                                                      "revm_primitives::state::StorageSlot",
                                                                                                      "present_value"
                                                                                                    |)
                                                                                                  |)
                                                                                                ]
                                                                                            ]
                                                                                          |)
                                                                                        |) in
                                                                                      M.alloc (|
                                                                                        Value.Tuple
                                                                                          []
                                                                                      |)))
                                                                                ]
                                                                              |) in
                                                                            M.alloc (|
                                                                              Value.Tuple []
                                                                            |)))
                                                                        |)))
                                                                  ]
                                                                |)) in
                                                            M.match_operator (|
                                                              M.alloc (| Value.Tuple [] |),
                                                              [
                                                                fun γ =>
                                                                  ltac:(M.monadic
                                                                    (let γ :=
                                                                      M.use
                                                                        (M.alloc (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.path
                                                                                "revm::db::states::bundle_account::BundleAccount",
                                                                              "was_destroyed",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                this_account
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        |)) in
                                                                    let _ :=
                                                                      M.is_constant_or_break_match (|
                                                                        M.read (| γ |),
                                                                        Value.Bool true
                                                                      |) in
                                                                    let~ _ :=
                                                                      M.write (|
                                                                        M.SubPointer.get_struct_record_field (|
                                                                          M.read (| revert |),
                                                                          "revm::db::states::reverts::AccountRevert",
                                                                          "wipe_storage"
                                                                        |),
                                                                        Value.Bool false
                                                                      |) in
                                                                    M.alloc (| Value.Tuple [] |)));
                                                                fun γ =>
                                                                  ltac:(M.monadic
                                                                    (M.alloc (| Value.Tuple [] |)))
                                                              ]
                                                            |)));
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (M.alloc (| Value.Tuple [] |)))
                                                      ]
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |) in
                                          let~ _ :=
                                            let β :=
                                              M.SubPointer.get_struct_record_field (|
                                                M.read (| self |),
                                                "revm::db::states::bundle_state::BundleState",
                                                "reverts_size"
                                              |) in
                                            M.write (|
                                              β,
                                              BinOp.Wrap.add (|
                                                M.read (| β |),
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "revm::db::states::reverts::AccountRevert",
                                                    "size_hint",
                                                    []
                                                  |),
                                                  [ M.read (| revert |) ]
                                                |)
                                              |)
                                            |) in
                                          M.alloc (| Value.Tuple [] |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "revm::db::states::bundle_state::BundleState",
                        "extend_state",
                        []
                      |),
                      [
                        M.read (| self |);
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            other,
                            "revm::db::states::bundle_state::BundleState",
                            "state"
                          |)
                        |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::iter::traits::collect::Extend",
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.apply
                              (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                              [ Value.Integer IntegerKind.Usize 32 ]
                              [];
                            Ty.path "revm_primitives::bytecode::Bytecode";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        [
                          Ty.tuple
                            [
                              Ty.apply
                                (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                [ Value.Integer IntegerKind.Usize 32 ]
                                [];
                              Ty.path "revm_primitives::bytecode::Bytecode"
                            ]
                        ],
                        "extend",
                        [
                          Ty.apply
                            (Ty.path "std::collections::hash::map::HashMap")
                            []
                            [
                              Ty.apply
                                (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                [ Value.Integer IntegerKind.Usize 32 ]
                                [];
                              Ty.path "revm_primitives::bytecode::Bytecode";
                              Ty.path "std::hash::random::RandomState"
                            ]
                        ]
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm::db::states::bundle_state::BundleState",
                          "contracts"
                        |);
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            other,
                            "revm::db::states::bundle_state::BundleState",
                            "contracts"
                          |)
                        |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "revm::db::states::reverts::Reverts",
                        "extend",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm::db::states::bundle_state::BundleState",
                          "reverts"
                        |);
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            other,
                            "revm::db::states::bundle_state::BundleState",
                            "reverts"
                          |)
                        |)
                      ]
                    |)
                  |) in
                M.alloc (| Value.Tuple [] |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_extend : M.IsAssociatedFunction Self "extend" extend.
        
        (*
            pub fn take_n_reverts(&mut self, reverts_to_take: usize) -> Reverts {
                // split is done as [0, num) and [num, len].
                if reverts_to_take > self.reverts.len() {
                    return self.take_all_reverts();
                }
                let (detach, this) = self.reverts.split_at(reverts_to_take);
                let detached_reverts = Reverts::new(detach.to_vec());
                self.reverts_size = this
                    .iter()
                    .flatten()
                    .fold(0, |acc, (_, revert)| acc + revert.size_hint());
                self.reverts = Reverts::new(this.to_vec());
                detached_reverts
            }
        *)
        Definition take_n_reverts (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; reverts_to_take ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let reverts_to_take := M.alloc (| reverts_to_take |) in
              M.catch_return (|
                ltac:(M.monadic
                  (M.read (|
                    let~ _ :=
                      M.match_operator (|
                        M.alloc (| Value.Tuple [] |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ :=
                                M.use
                                  (M.alloc (|
                                    BinOp.gt (|
                                      M.read (| reverts_to_take |),
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.apply
                                                (Ty.path "alloc::vec::Vec")
                                                []
                                                [
                                                  Ty.tuple
                                                    [
                                                      Ty.path
                                                        "alloy_primitives::bits::address::Address";
                                                      Ty.path
                                                        "revm::db::states::reverts::AccountRevert"
                                                    ];
                                                  Ty.path "alloc::alloc::Global"
                                                ];
                                              Ty.path "alloc::alloc::Global"
                                            ],
                                          "len",
                                          []
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::ops::deref::Deref",
                                              Ty.path "revm::db::states::reverts::Reverts",
                                              [],
                                              "deref",
                                              []
                                            |),
                                            [
                                              M.SubPointer.get_struct_record_field (|
                                                M.read (| self |),
                                                "revm::db::states::bundle_state::BundleState",
                                                "reverts"
                                              |)
                                            ]
                                          |)
                                        ]
                                      |)
                                    |)
                                  |)) in
                              let _ :=
                                M.is_constant_or_break_match (|
                                  M.read (| γ |),
                                  Value.Bool true
                                |) in
                              M.alloc (|
                                M.never_to_any (|
                                  M.read (|
                                    M.return_ (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "revm::db::states::bundle_state::BundleState",
                                          "take_all_reverts",
                                          []
                                        |),
                                        [ M.read (| self |) ]
                                      |)
                                    |)
                                  |)
                                |)
                              |)));
                          fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                        ]
                      |) in
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              []
                              [
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [
                                    Ty.tuple
                                      [
                                        Ty.path "alloy_primitives::bits::address::Address";
                                        Ty.path "revm::db::states::reverts::AccountRevert"
                                      ];
                                    Ty.path "alloc::alloc::Global"
                                  ]
                              ],
                            "split_at",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::ops::deref::Deref",
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [
                                    Ty.apply
                                      (Ty.path "alloc::vec::Vec")
                                      []
                                      [
                                        Ty.tuple
                                          [
                                            Ty.path "alloy_primitives::bits::address::Address";
                                            Ty.path "revm::db::states::reverts::AccountRevert"
                                          ];
                                        Ty.path "alloc::alloc::Global"
                                      ];
                                    Ty.path "alloc::alloc::Global"
                                  ],
                                [],
                                "deref",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::deref::Deref",
                                    Ty.path "revm::db::states::reverts::Reverts",
                                    [],
                                    "deref",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "revm::db::states::bundle_state::BundleState",
                                      "reverts"
                                    |)
                                  ]
                                |)
                              ]
                            |);
                            M.read (| reverts_to_take |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let detach := M.copy (| γ0_0 |) in
                            let this := M.copy (| γ0_1 |) in
                            let~ detached_reverts :=
                              M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "revm::db::states::reverts::Reverts",
                                    "new",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply
                                          (Ty.path "slice")
                                          []
                                          [
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [
                                                Ty.tuple
                                                  [
                                                    Ty.path
                                                      "alloy_primitives::bits::address::Address";
                                                    Ty.path
                                                      "revm::db::states::reverts::AccountRevert"
                                                  ];
                                                Ty.path "alloc::alloc::Global"
                                              ]
                                          ],
                                        "to_vec",
                                        []
                                      |),
                                      [ M.read (| detach |) ]
                                    |)
                                  ]
                                |)
                              |) in
                            let~ _ :=
                              M.write (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "revm::db::states::bundle_state::BundleState",
                                  "reverts_size"
                                |),
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::iter::traits::iterator::Iterator",
                                    Ty.apply
                                      (Ty.path "core::iter::adapters::flatten::Flatten")
                                      []
                                      [
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          []
                                          [
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [
                                                Ty.tuple
                                                  [
                                                    Ty.path
                                                      "alloy_primitives::bits::address::Address";
                                                    Ty.path
                                                      "revm::db::states::reverts::AccountRevert"
                                                  ];
                                                Ty.path "alloc::alloc::Global"
                                              ]
                                          ]
                                      ],
                                    [],
                                    "fold",
                                    [
                                      Ty.path "usize";
                                      Ty.function
                                        [
                                          Ty.tuple
                                            [
                                              Ty.path "usize";
                                              Ty.apply
                                                (Ty.path "&")
                                                []
                                                [
                                                  Ty.tuple
                                                    [
                                                      Ty.path
                                                        "alloy_primitives::bits::address::Address";
                                                      Ty.path
                                                        "revm::db::states::reverts::AccountRevert"
                                                    ]
                                                ]
                                            ]
                                        ]
                                        (Ty.path "usize")
                                    ]
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          []
                                          [
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [
                                                Ty.tuple
                                                  [
                                                    Ty.path
                                                      "alloy_primitives::bits::address::Address";
                                                    Ty.path
                                                      "revm::db::states::reverts::AccountRevert"
                                                  ];
                                                Ty.path "alloc::alloc::Global"
                                              ]
                                          ],
                                        [],
                                        "flatten",
                                        []
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.apply
                                              (Ty.path "slice")
                                              []
                                              [
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  []
                                                  [
                                                    Ty.tuple
                                                      [
                                                        Ty.path
                                                          "alloy_primitives::bits::address::Address";
                                                        Ty.path
                                                          "revm::db::states::reverts::AccountRevert"
                                                      ];
                                                    Ty.path "alloc::alloc::Global"
                                                  ]
                                              ],
                                            "iter",
                                            []
                                          |),
                                          [ M.read (| this |) ]
                                        |)
                                      ]
                                    |);
                                    Value.Integer IntegerKind.Usize 0;
                                    M.closure
                                      (fun γ =>
                                        ltac:(M.monadic
                                          match γ with
                                          | [ α0; α1 ] =>
                                            ltac:(M.monadic
                                              (M.match_operator (|
                                                M.alloc (| α0 |),
                                                [
                                                  fun γ =>
                                                    ltac:(M.monadic
                                                      (let acc := M.copy (| γ |) in
                                                      M.match_operator (|
                                                        M.alloc (| α1 |),
                                                        [
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ := M.read (| γ |) in
                                                              let γ1_0 :=
                                                                M.SubPointer.get_tuple_field (|
                                                                  γ,
                                                                  0
                                                                |) in
                                                              let γ1_1 :=
                                                                M.SubPointer.get_tuple_field (|
                                                                  γ,
                                                                  1
                                                                |) in
                                                              let revert := M.alloc (| γ1_1 |) in
                                                              BinOp.Wrap.add (|
                                                                M.read (| acc |),
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "revm::db::states::reverts::AccountRevert",
                                                                    "size_hint",
                                                                    []
                                                                  |),
                                                                  [ M.read (| revert |) ]
                                                                |)
                                                              |)))
                                                        ]
                                                      |)))
                                                ]
                                              |)))
                                          | _ => M.impossible "wrong number of arguments"
                                          end))
                                  ]
                                |)
                              |) in
                            let~ _ :=
                              M.write (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "revm::db::states::bundle_state::BundleState",
                                  "reverts"
                                |),
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "revm::db::states::reverts::Reverts",
                                    "new",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply
                                          (Ty.path "slice")
                                          []
                                          [
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [
                                                Ty.tuple
                                                  [
                                                    Ty.path
                                                      "alloy_primitives::bits::address::Address";
                                                    Ty.path
                                                      "revm::db::states::reverts::AccountRevert"
                                                  ];
                                                Ty.path "alloc::alloc::Global"
                                              ]
                                          ],
                                        "to_vec",
                                        []
                                      |),
                                      [ M.read (| this |) ]
                                    |)
                                  ]
                                |)
                              |) in
                            detached_reverts))
                      ]
                    |)
                  |)))
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_take_n_reverts :
          M.IsAssociatedFunction Self "take_n_reverts" take_n_reverts.
        
        (*
            pub fn take_all_reverts(&mut self) -> Reverts {
                self.reverts_size = 0;
                core::mem::take(&mut self.reverts)
            }
        *)
        Definition take_all_reverts (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.read (|
                let~ _ :=
                  M.write (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "revm::db::states::bundle_state::BundleState",
                      "reverts_size"
                    |),
                    Value.Integer IntegerKind.Usize 0
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::mem::take",
                      [ Ty.path "revm::db::states::reverts::Reverts" ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "revm::db::states::bundle_state::BundleState",
                        "reverts"
                      |)
                    ]
                  |)
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_take_all_reverts :
          M.IsAssociatedFunction Self "take_all_reverts" take_all_reverts.
        
        (*
            pub fn revert_latest(&mut self) -> bool {
                // revert the latest recorded state
                if let Some(reverts) = self.reverts.pop() {
                    for (address, revert_account) in reverts.into_iter() {
                        self.reverts_size -= revert_account.size_hint();
                        match self.state.entry(address) {
                            Entry::Occupied(mut entry) => {
                                let account = entry.get_mut();
                                self.state_size -= account.size_hint();
                                if account.revert(revert_account) {
                                    entry.remove();
                                } else {
                                    self.state_size += account.size_hint();
                                }
                            }
                            Entry::Vacant(entry) => {
                                // create empty account that we will revert on.
                                // Only place where this account is not existing is if revert is DeleteIt.
                                let mut account = BundleAccount::new(
                                    None,
                                    None,
                                    HashMap::new(),
                                    AccountStatus::LoadedNotExisting,
                                );
                                if !account.revert(revert_account) {
                                    self.state_size += account.size_hint();
                                    entry.insert(account);
                                }
                            }
                        }
                    }
                    return true;
                }
        
                false
            }
        *)
        Definition revert_latest (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              M.catch_return (|
                ltac:(M.monadic
                  (M.read (|
                    let~ _ :=
                      M.match_operator (|
                        M.alloc (| Value.Tuple [] |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ :=
                                M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::vec::Vec")
                                        []
                                        [
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.tuple
                                                [
                                                  Ty.path
                                                    "alloy_primitives::bits::address::Address";
                                                  Ty.path "revm::db::states::reverts::AccountRevert"
                                                ];
                                              Ty.path "alloc::alloc::Global"
                                            ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "pop",
                                      []
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::ops::deref::DerefMut",
                                          Ty.path "revm::db::states::reverts::Reverts",
                                          [],
                                          "deref_mut",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "revm::db::states::bundle_state::BundleState",
                                            "reverts"
                                          |)
                                        ]
                                      |)
                                    ]
                                  |)
                                |) in
                              let γ0_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ,
                                  "core::option::Option::Some",
                                  0
                                |) in
                              let reverts := M.copy (| γ0_0 |) in
                              M.alloc (|
                                M.never_to_any (|
                                  M.read (|
                                    let~ _ :=
                                      M.use
                                        (M.match_operator (|
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_trait_method (|
                                                "core::iter::traits::collect::IntoIterator",
                                                Ty.apply
                                                  (Ty.path "alloc::vec::into_iter::IntoIter")
                                                  []
                                                  [
                                                    Ty.tuple
                                                      [
                                                        Ty.path
                                                          "alloy_primitives::bits::address::Address";
                                                        Ty.path
                                                          "revm::db::states::reverts::AccountRevert"
                                                      ];
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                [],
                                                "into_iter",
                                                []
                                              |),
                                              [
                                                M.call_closure (|
                                                  M.get_trait_method (|
                                                    "core::iter::traits::collect::IntoIterator",
                                                    Ty.apply
                                                      (Ty.path "alloc::vec::Vec")
                                                      []
                                                      [
                                                        Ty.tuple
                                                          [
                                                            Ty.path
                                                              "alloy_primitives::bits::address::Address";
                                                            Ty.path
                                                              "revm::db::states::reverts::AccountRevert"
                                                          ];
                                                        Ty.path "alloc::alloc::Global"
                                                      ],
                                                    [],
                                                    "into_iter",
                                                    []
                                                  |),
                                                  [ M.read (| reverts |) ]
                                                |)
                                              ]
                                            |)
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let iter := M.copy (| γ |) in
                                                M.loop (|
                                                  ltac:(M.monadic
                                                    (let~ _ :=
                                                      M.match_operator (|
                                                        M.alloc (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::iter::traits::iterator::Iterator",
                                                              Ty.apply
                                                                (Ty.path
                                                                  "alloc::vec::into_iter::IntoIter")
                                                                []
                                                                [
                                                                  Ty.tuple
                                                                    [
                                                                      Ty.path
                                                                        "alloy_primitives::bits::address::Address";
                                                                      Ty.path
                                                                        "revm::db::states::reverts::AccountRevert"
                                                                    ];
                                                                  Ty.path "alloc::alloc::Global"
                                                                ],
                                                              [],
                                                              "next",
                                                              []
                                                            |),
                                                            [ iter ]
                                                          |)
                                                        |),
                                                        [
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let _ :=
                                                                M.is_struct_tuple (|
                                                                  γ,
                                                                  "core::option::Option::None"
                                                                |) in
                                                              M.alloc (|
                                                                M.never_to_any (|
                                                                  M.read (| M.break (||) |)
                                                                |)
                                                              |)));
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ0_0 :=
                                                                M.SubPointer.get_struct_tuple_field (|
                                                                  γ,
                                                                  "core::option::Option::Some",
                                                                  0
                                                                |) in
                                                              let γ1_0 :=
                                                                M.SubPointer.get_tuple_field (|
                                                                  γ0_0,
                                                                  0
                                                                |) in
                                                              let γ1_1 :=
                                                                M.SubPointer.get_tuple_field (|
                                                                  γ0_0,
                                                                  1
                                                                |) in
                                                              let address := M.copy (| γ1_0 |) in
                                                              let revert_account :=
                                                                M.copy (| γ1_1 |) in
                                                              let~ _ :=
                                                                let β :=
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "revm::db::states::bundle_state::BundleState",
                                                                    "reverts_size"
                                                                  |) in
                                                                M.write (|
                                                                  β,
                                                                  BinOp.Wrap.sub (|
                                                                    M.read (| β |),
                                                                    M.call_closure (|
                                                                      M.get_associated_function (|
                                                                        Ty.path
                                                                          "revm::db::states::reverts::AccountRevert",
                                                                        "size_hint",
                                                                        []
                                                                      |),
                                                                      [ revert_account ]
                                                                    |)
                                                                  |)
                                                                |) in
                                                              M.match_operator (|
                                                                M.alloc (|
                                                                  M.call_closure (|
                                                                    M.get_associated_function (|
                                                                      Ty.apply
                                                                        (Ty.path
                                                                          "std::collections::hash::map::HashMap")
                                                                        []
                                                                        [
                                                                          Ty.path
                                                                            "alloy_primitives::bits::address::Address";
                                                                          Ty.path
                                                                            "revm::db::states::bundle_account::BundleAccount";
                                                                          Ty.path
                                                                            "std::hash::random::RandomState"
                                                                        ],
                                                                      "entry",
                                                                      []
                                                                    |),
                                                                    [
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "revm::db::states::bundle_state::BundleState",
                                                                        "state"
                                                                      |);
                                                                      M.read (| address |)
                                                                    ]
                                                                  |)
                                                                |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let γ0_0 :=
                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                          γ,
                                                                          "std::collections::hash::map::Entry::Occupied",
                                                                          0
                                                                        |) in
                                                                      let entry :=
                                                                        M.copy (| γ0_0 |) in
                                                                      let~ account :=
                                                                        M.alloc (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.apply
                                                                                (Ty.path
                                                                                  "std::collections::hash::map::OccupiedEntry")
                                                                                []
                                                                                [
                                                                                  Ty.path
                                                                                    "alloy_primitives::bits::address::Address";
                                                                                  Ty.path
                                                                                    "revm::db::states::bundle_account::BundleAccount"
                                                                                ],
                                                                              "get_mut",
                                                                              []
                                                                            |),
                                                                            [ entry ]
                                                                          |)
                                                                        |) in
                                                                      let~ _ :=
                                                                        let β :=
                                                                          M.SubPointer.get_struct_record_field (|
                                                                            M.read (| self |),
                                                                            "revm::db::states::bundle_state::BundleState",
                                                                            "state_size"
                                                                          |) in
                                                                        M.write (|
                                                                          β,
                                                                          BinOp.Wrap.sub (|
                                                                            M.read (| β |),
                                                                            M.call_closure (|
                                                                              M.get_associated_function (|
                                                                                Ty.path
                                                                                  "revm::db::states::bundle_account::BundleAccount",
                                                                                "size_hint",
                                                                                []
                                                                              |),
                                                                              [ M.read (| account |)
                                                                              ]
                                                                            |)
                                                                          |)
                                                                        |) in
                                                                      M.match_operator (|
                                                                        M.alloc (|
                                                                          Value.Tuple []
                                                                        |),
                                                                        [
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (let γ :=
                                                                                M.use
                                                                                  (M.alloc (|
                                                                                    M.call_closure (|
                                                                                      M.get_associated_function (|
                                                                                        Ty.path
                                                                                          "revm::db::states::bundle_account::BundleAccount",
                                                                                        "revert",
                                                                                        []
                                                                                      |),
                                                                                      [
                                                                                        M.read (|
                                                                                          account
                                                                                        |);
                                                                                        M.read (|
                                                                                          revert_account
                                                                                        |)
                                                                                      ]
                                                                                    |)
                                                                                  |)) in
                                                                              let _ :=
                                                                                M.is_constant_or_break_match (|
                                                                                  M.read (| γ |),
                                                                                  Value.Bool true
                                                                                |) in
                                                                              let~ _ :=
                                                                                M.alloc (|
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "std::collections::hash::map::OccupiedEntry")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "alloy_primitives::bits::address::Address";
                                                                                          Ty.path
                                                                                            "revm::db::states::bundle_account::BundleAccount"
                                                                                        ],
                                                                                      "remove",
                                                                                      []
                                                                                    |),
                                                                                    [
                                                                                      M.read (|
                                                                                        entry
                                                                                      |)
                                                                                    ]
                                                                                  |)
                                                                                |) in
                                                                              M.alloc (|
                                                                                Value.Tuple []
                                                                              |)));
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (let~ _ :=
                                                                                let β :=
                                                                                  M.SubPointer.get_struct_record_field (|
                                                                                    M.read (|
                                                                                      self
                                                                                    |),
                                                                                    "revm::db::states::bundle_state::BundleState",
                                                                                    "state_size"
                                                                                  |) in
                                                                                M.write (|
                                                                                  β,
                                                                                  BinOp.Wrap.add (|
                                                                                    M.read (| β |),
                                                                                    M.call_closure (|
                                                                                      M.get_associated_function (|
                                                                                        Ty.path
                                                                                          "revm::db::states::bundle_account::BundleAccount",
                                                                                        "size_hint",
                                                                                        []
                                                                                      |),
                                                                                      [
                                                                                        M.read (|
                                                                                          account
                                                                                        |)
                                                                                      ]
                                                                                    |)
                                                                                  |)
                                                                                |) in
                                                                              M.alloc (|
                                                                                Value.Tuple []
                                                                              |)))
                                                                        ]
                                                                      |)));
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let γ0_0 :=
                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                          γ,
                                                                          "std::collections::hash::map::Entry::Vacant",
                                                                          0
                                                                        |) in
                                                                      let entry :=
                                                                        M.copy (| γ0_0 |) in
                                                                      let~ account :=
                                                                        M.alloc (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.path
                                                                                "revm::db::states::bundle_account::BundleAccount",
                                                                              "new",
                                                                              []
                                                                            |),
                                                                            [
                                                                              Value.StructTuple
                                                                                "core::option::Option::None"
                                                                                [];
                                                                              Value.StructTuple
                                                                                "core::option::Option::None"
                                                                                [];
                                                                              M.call_closure (|
                                                                                M.get_associated_function (|
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "std::collections::hash::map::HashMap")
                                                                                    []
                                                                                    [
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "ruint::Uint")
                                                                                        [
                                                                                          Value.Integer
                                                                                            IntegerKind.Usize
                                                                                            256;
                                                                                          Value.Integer
                                                                                            IntegerKind.Usize
                                                                                            4
                                                                                        ]
                                                                                        [];
                                                                                      Ty.path
                                                                                        "revm_primitives::state::StorageSlot";
                                                                                      Ty.path
                                                                                        "std::hash::random::RandomState"
                                                                                    ],
                                                                                  "new",
                                                                                  []
                                                                                |),
                                                                                []
                                                                              |);
                                                                              Value.StructTuple
                                                                                "revm::db::states::account_status::AccountStatus::LoadedNotExisting"
                                                                                []
                                                                            ]
                                                                          |)
                                                                        |) in
                                                                      M.match_operator (|
                                                                        M.alloc (|
                                                                          Value.Tuple []
                                                                        |),
                                                                        [
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (let γ :=
                                                                                M.use
                                                                                  (M.alloc (|
                                                                                    UnOp.not (|
                                                                                      M.call_closure (|
                                                                                        M.get_associated_function (|
                                                                                          Ty.path
                                                                                            "revm::db::states::bundle_account::BundleAccount",
                                                                                          "revert",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          account;
                                                                                          M.read (|
                                                                                            revert_account
                                                                                          |)
                                                                                        ]
                                                                                      |)
                                                                                    |)
                                                                                  |)) in
                                                                              let _ :=
                                                                                M.is_constant_or_break_match (|
                                                                                  M.read (| γ |),
                                                                                  Value.Bool true
                                                                                |) in
                                                                              let~ _ :=
                                                                                let β :=
                                                                                  M.SubPointer.get_struct_record_field (|
                                                                                    M.read (|
                                                                                      self
                                                                                    |),
                                                                                    "revm::db::states::bundle_state::BundleState",
                                                                                    "state_size"
                                                                                  |) in
                                                                                M.write (|
                                                                                  β,
                                                                                  BinOp.Wrap.add (|
                                                                                    M.read (| β |),
                                                                                    M.call_closure (|
                                                                                      M.get_associated_function (|
                                                                                        Ty.path
                                                                                          "revm::db::states::bundle_account::BundleAccount",
                                                                                        "size_hint",
                                                                                        []
                                                                                      |),
                                                                                      [ account ]
                                                                                    |)
                                                                                  |)
                                                                                |) in
                                                                              let~ _ :=
                                                                                M.alloc (|
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "std::collections::hash::map::VacantEntry")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "alloy_primitives::bits::address::Address";
                                                                                          Ty.path
                                                                                            "revm::db::states::bundle_account::BundleAccount"
                                                                                        ],
                                                                                      "insert",
                                                                                      []
                                                                                    |),
                                                                                    [
                                                                                      M.read (|
                                                                                        entry
                                                                                      |);
                                                                                      M.read (|
                                                                                        account
                                                                                      |)
                                                                                    ]
                                                                                  |)
                                                                                |) in
                                                                              M.alloc (|
                                                                                Value.Tuple []
                                                                              |)));
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (M.alloc (|
                                                                                Value.Tuple []
                                                                              |)))
                                                                        ]
                                                                      |)))
                                                                ]
                                                              |)))
                                                        ]
                                                      |) in
                                                    M.alloc (| Value.Tuple [] |)))
                                                |)))
                                          ]
                                        |)) in
                                    M.return_ (| Value.Bool true |)
                                  |)
                                |)
                              |)));
                          fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                        ]
                      |) in
                    M.alloc (| Value.Bool false |)
                  |)))
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_revert_latest :
          M.IsAssociatedFunction Self "revert_latest" revert_latest.
        
        (*
            pub fn revert(&mut self, mut num_transitions: usize) {
                if num_transitions == 0 {
                    return;
                }
        
                while self.revert_latest() {
                    num_transitions -= 1;
                    if num_transitions == 0 {
                        // break the loop.
                        break;
                    }
                }
            }
        *)
        Definition revert (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; num_transitions ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let num_transitions := M.alloc (| num_transitions |) in
              M.catch_return (|
                ltac:(M.monadic
                  (M.read (|
                    let~ _ :=
                      M.match_operator (|
                        M.alloc (| Value.Tuple [] |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ :=
                                M.use
                                  (M.alloc (|
                                    BinOp.eq (|
                                      M.read (| num_transitions |),
                                      Value.Integer IntegerKind.Usize 0
                                    |)
                                  |)) in
                              let _ :=
                                M.is_constant_or_break_match (|
                                  M.read (| γ |),
                                  Value.Bool true
                                |) in
                              M.alloc (|
                                M.never_to_any (| M.read (| M.return_ (| Value.Tuple [] |) |) |)
                              |)));
                          fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                        ]
                      |) in
                    M.loop (|
                      ltac:(M.monadic
                        (M.match_operator (|
                          M.alloc (| Value.Tuple [] |),
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (let γ :=
                                  M.use
                                    (M.alloc (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "revm::db::states::bundle_state::BundleState",
                                          "revert_latest",
                                          []
                                        |),
                                        [ M.read (| self |) ]
                                      |)
                                    |)) in
                                let _ :=
                                  M.is_constant_or_break_match (|
                                    M.read (| γ |),
                                    Value.Bool true
                                  |) in
                                let~ _ :=
                                  let β := num_transitions in
                                  M.write (|
                                    β,
                                    BinOp.Wrap.sub (|
                                      M.read (| β |),
                                      Value.Integer IntegerKind.Usize 1
                                    |)
                                  |) in
                                M.match_operator (|
                                  M.alloc (| Value.Tuple [] |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let γ :=
                                          M.use
                                            (M.alloc (|
                                              BinOp.eq (|
                                                M.read (| num_transitions |),
                                                Value.Integer IntegerKind.Usize 0
                                              |)
                                            |)) in
                                        let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Bool true
                                          |) in
                                        M.alloc (|
                                          M.never_to_any (| M.read (| M.break (||) |) |)
                                        |)));
                                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                  ]
                                |)));
                            fun γ =>
                              ltac:(M.monadic
                                (M.alloc (|
                                  M.never_to_any (|
                                    M.read (|
                                      let~ _ :=
                                        M.alloc (|
                                          M.never_to_any (| M.read (| M.break (||) |) |)
                                        |) in
                                      M.alloc (| Value.Tuple [] |)
                                    |)
                                  |)
                                |)))
                          ]
                        |)))
                    |)
                  |)))
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_revert : M.IsAssociatedFunction Self "revert" revert.
        
        (*
            pub fn prepend_state(&mut self, mut other: BundleState) {
                // take this bundle
                let this_bundle = mem::take(self);
                // extend other bundle state with this
                other.extend_state(this_bundle.state);
                // extend other contracts
                other.contracts.extend(this_bundle.contracts);
                // swap bundles
                mem::swap(self, &mut other)
            }
        *)
        Definition prepend_state (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; other ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let other := M.alloc (| other |) in
              M.read (|
                let~ this_bundle :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_function (|
                        "core::mem::take",
                        [ Ty.path "revm::db::states::bundle_state::BundleState" ]
                      |),
                      [ M.read (| self |) ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "revm::db::states::bundle_state::BundleState",
                        "extend_state",
                        []
                      |),
                      [
                        other;
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            this_bundle,
                            "revm::db::states::bundle_state::BundleState",
                            "state"
                          |)
                        |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::iter::traits::collect::Extend",
                        Ty.apply
                          (Ty.path "std::collections::hash::map::HashMap")
                          []
                          [
                            Ty.apply
                              (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                              [ Value.Integer IntegerKind.Usize 32 ]
                              [];
                            Ty.path "revm_primitives::bytecode::Bytecode";
                            Ty.path "std::hash::random::RandomState"
                          ],
                        [
                          Ty.tuple
                            [
                              Ty.apply
                                (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                [ Value.Integer IntegerKind.Usize 32 ]
                                [];
                              Ty.path "revm_primitives::bytecode::Bytecode"
                            ]
                        ],
                        "extend",
                        [
                          Ty.apply
                            (Ty.path "std::collections::hash::map::HashMap")
                            []
                            [
                              Ty.apply
                                (Ty.path "alloy_primitives::bits::fixed::FixedBytes")
                                [ Value.Integer IntegerKind.Usize 32 ]
                                [];
                              Ty.path "revm_primitives::bytecode::Bytecode";
                              Ty.path "std::hash::random::RandomState"
                            ]
                        ]
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          other,
                          "revm::db::states::bundle_state::BundleState",
                          "contracts"
                        |);
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            this_bundle,
                            "revm::db::states::bundle_state::BundleState",
                            "contracts"
                          |)
                        |)
                      ]
                    |)
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::mem::swap",
                      [ Ty.path "revm::db::states::bundle_state::BundleState" ]
                    |),
                    [ M.read (| self |); other ]
                  |)
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_prepend_state :
          M.IsAssociatedFunction Self "prepend_state" prepend_state.
      End Impl_revm_db_states_bundle_state_BundleState.
    End bundle_state.
  End states.
End db.
