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

Module bytecode.
  Module eof.
    Module body.
      (* StructRecord
        {
          name := "EofBody";
          const_params := [];
          ty_params := [];
          fields :=
            [
              ("types_section",
                Ty.apply
                  (Ty.path "alloc::vec::Vec")
                  []
                  [
                    Ty.path "revm_primitives::bytecode::eof::types_section::TypesSection";
                    Ty.path "alloc::alloc::Global"
                  ]);
              ("code_section",
                Ty.apply
                  (Ty.path "alloc::vec::Vec")
                  []
                  [ Ty.path "alloy_primitives::bytes_::Bytes"; Ty.path "alloc::alloc::Global" ]);
              ("container_section",
                Ty.apply
                  (Ty.path "alloc::vec::Vec")
                  []
                  [ Ty.path "alloy_primitives::bytes_::Bytes"; Ty.path "alloc::alloc::Global" ]);
              ("data_section", Ty.path "alloy_primitives::bytes_::Bytes");
              ("is_data_filled", Ty.path "bool")
            ];
        } *)
      
      Module Impl_core_clone_Clone_for_revm_primitives_bytecode_eof_body_EofBody.
        Definition Self : Ty.t := Ty.path "revm_primitives::bytecode::eof::body::EofBody".
        
        (* 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_primitives::bytecode::eof::body::EofBody"
                [
                  ("types_section",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "revm_primitives::bytecode::eof::types_section::TypesSection";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "types_section"
                        |)
                      ]
                    |));
                  ("code_section",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "alloy_primitives::bytes_::Bytes";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "code_section"
                        |)
                      ]
                    |));
                  ("container_section",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "alloy_primitives::bytes_::Bytes";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "container_section"
                        |)
                      ]
                    |));
                  ("data_section",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.path "alloy_primitives::bytes_::Bytes",
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "data_section"
                        |)
                      ]
                    |));
                  ("is_data_filled",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::clone::Clone",
                        Ty.path "bool",
                        [],
                        "clone",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "is_data_filled"
                        |)
                      ]
                    |))
                ]))
          | _, _, _ => 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_primitives_bytecode_eof_body_EofBody.
      
      Module Impl_core_fmt_Debug_for_revm_primitives_bytecode_eof_body_EofBody.
        Definition Self : Ty.t := Ty.path "revm_primitives::bytecode::eof::body::EofBody".
        
        (* 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 "EofBody" |);
                  M.read (| Value.String "types_section" |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm_primitives::bytecode::eof::body::EofBody",
                    "types_section"
                  |);
                  M.read (| Value.String "code_section" |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm_primitives::bytecode::eof::body::EofBody",
                    "code_section"
                  |);
                  M.read (| Value.String "container_section" |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm_primitives::bytecode::eof::body::EofBody",
                    "container_section"
                  |);
                  M.read (| Value.String "data_section" |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "revm_primitives::bytecode::eof::body::EofBody",
                    "data_section"
                  |);
                  M.read (| Value.String "is_data_filled" |);
                  M.alloc (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "revm_primitives::bytecode::eof::body::EofBody",
                      "is_data_filled"
                    |)
                  |)
                ]
              |)))
          | _, _, _ => 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_primitives_bytecode_eof_body_EofBody.
      
      Module Impl_core_default_Default_for_revm_primitives_bytecode_eof_body_EofBody.
        Definition Self : Ty.t := Ty.path "revm_primitives::bytecode::eof::body::EofBody".
        
        (* Default *)
        Definition default (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [] =>
            ltac:(M.monadic
              (Value.StructRecord
                "revm_primitives::bytecode::eof::body::EofBody"
                [
                  ("types_section",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "revm_primitives::bytecode::eof::types_section::TypesSection";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "default",
                        []
                      |),
                      []
                    |));
                  ("code_section",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "alloy_primitives::bytes_::Bytes";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "default",
                        []
                      |),
                      []
                    |));
                  ("container_section",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "alloy_primitives::bytes_::Bytes";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "default",
                        []
                      |),
                      []
                    |));
                  ("data_section",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.path "alloy_primitives::bytes_::Bytes",
                        [],
                        "default",
                        []
                      |),
                      []
                    |));
                  ("is_data_filled",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.path "bool",
                        [],
                        "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_primitives_bytecode_eof_body_EofBody.
      
      Module Impl_core_marker_StructuralPartialEq_for_revm_primitives_bytecode_eof_body_EofBody.
        Definition Self : Ty.t := Ty.path "revm_primitives::bytecode::eof::body::EofBody".
        
        Axiom Implements :
          M.IsTraitInstance
            "core::marker::StructuralPartialEq"
            Self
            (* Trait polymorphic types *) []
            (* Instance *) [].
      End Impl_core_marker_StructuralPartialEq_for_revm_primitives_bytecode_eof_body_EofBody.
      
      Module Impl_core_cmp_PartialEq_for_revm_primitives_bytecode_eof_body_EofBody.
        Definition Self : Ty.t := Ty.path "revm_primitives::bytecode::eof::body::EofBody".
        
        (* 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 "alloc::vec::Vec")
                            []
                            [
                              Ty.path "revm_primitives::bytecode::eof::types_section::TypesSection";
                              Ty.path "alloc::alloc::Global"
                            ],
                          [
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              []
                              [
                                Ty.path
                                  "revm_primitives::bytecode::eof::types_section::TypesSection";
                                Ty.path "alloc::alloc::Global"
                              ]
                          ],
                          "eq",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm_primitives::bytecode::eof::body::EofBody",
                            "types_section"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "revm_primitives::bytecode::eof::body::EofBody",
                            "types_section"
                          |)
                        ]
                      |),
                      ltac:(M.monadic
                        (M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::PartialEq",
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              []
                              [
                                Ty.path "alloy_primitives::bytes_::Bytes";
                                Ty.path "alloc::alloc::Global"
                              ],
                            [
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                []
                                [
                                  Ty.path "alloy_primitives::bytes_::Bytes";
                                  Ty.path "alloc::alloc::Global"
                                ]
                            ],
                            "eq",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "revm_primitives::bytecode::eof::body::EofBody",
                              "code_section"
                            |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| other |),
                              "revm_primitives::bytecode::eof::body::EofBody",
                              "code_section"
                            |)
                          ]
                        |)))
                    |),
                    ltac:(M.monadic
                      (M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialEq",
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            []
                            [
                              Ty.path "alloy_primitives::bytes_::Bytes";
                              Ty.path "alloc::alloc::Global"
                            ],
                          [
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              []
                              [
                                Ty.path "alloy_primitives::bytes_::Bytes";
                                Ty.path "alloc::alloc::Global"
                              ]
                          ],
                          "eq",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "revm_primitives::bytecode::eof::body::EofBody",
                            "container_section"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "revm_primitives::bytecode::eof::body::EofBody",
                            "container_section"
                          |)
                        ]
                      |)))
                  |),
                  ltac:(M.monadic
                    (M.call_closure (|
                      M.get_trait_method (|
                        "core::cmp::PartialEq",
                        Ty.path "alloy_primitives::bytes_::Bytes",
                        [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                        "eq",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "data_section"
                        |);
                        M.SubPointer.get_struct_record_field (|
                          M.read (| other |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "data_section"
                        |)
                      ]
                    |)))
                |),
                ltac:(M.monadic
                  (BinOp.eq (|
                    M.read (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "revm_primitives::bytecode::eof::body::EofBody",
                        "is_data_filled"
                      |)
                    |),
                    M.read (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "revm_primitives::bytecode::eof::body::EofBody",
                        "is_data_filled"
                      |)
                    |)
                  |)))
              |)))
          | _, _, _ => 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_primitives_bytecode_eof_body_EofBody.
      
      Module Impl_core_cmp_Eq_for_revm_primitives_bytecode_eof_body_EofBody.
        Definition Self : Ty.t := Ty.path "revm_primitives::bytecode::eof::body::EofBody".
        
        (* 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.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_primitives_bytecode_eof_body_EofBody.
      
      Module Impl_core_hash_Hash_for_revm_primitives_bytecode_eof_body_EofBody.
        Definition Self : Ty.t := Ty.path "revm_primitives::bytecode::eof::body::EofBody".
        
        (* 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~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::hash::Hash",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "revm_primitives::bytecode::eof::types_section::TypesSection";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "hash",
                        [ __H ]
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "types_section"
                        |);
                        M.read (| state |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::hash::Hash",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "alloy_primitives::bytes_::Bytes";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "hash",
                        [ __H ]
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "code_section"
                        |);
                        M.read (| state |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::hash::Hash",
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "alloy_primitives::bytes_::Bytes";
                            Ty.path "alloc::alloc::Global"
                          ],
                        [],
                        "hash",
                        [ __H ]
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "container_section"
                        |);
                        M.read (| state |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::hash::Hash",
                        Ty.path "alloy_primitives::bytes_::Bytes",
                        [],
                        "hash",
                        [ __H ]
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "data_section"
                        |);
                        M.read (| state |)
                      ]
                    |)
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::hash::Hash",
                      Ty.path "bool",
                      [],
                      "hash",
                      [ __H ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "revm_primitives::bytecode::eof::body::EofBody",
                        "is_data_filled"
                      |);
                      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_primitives_bytecode_eof_body_EofBody.
      
      Module Impl_revm_primitives_bytecode_eof_body_EofBody.
        Definition Self : Ty.t := Ty.path "revm_primitives::bytecode::eof::body::EofBody".
        
        (*
            pub fn code(&self, index: usize) -> Option<&Bytes> {
                self.code_section.get(index)
            }
        *)
        Definition code (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; index ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let index := M.alloc (| index |) in
              M.call_closure (|
                M.get_associated_function (|
                  Ty.apply (Ty.path "slice") [] [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                  "get",
                  [ Ty.path "usize" ]
                |),
                [
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::ops::deref::Deref",
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "alloy_primitives::bytes_::Bytes"; Ty.path "alloc::alloc::Global"
                        ],
                      [],
                      "deref",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "revm_primitives::bytecode::eof::body::EofBody",
                        "code_section"
                      |)
                    ]
                  |);
                  M.read (| index |)
                ]
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_code : M.IsAssociatedFunction Self "code" code.
        
        (*
            pub fn into_eof(self) -> Eof {
                // TODO add bounds checks.
                let header = EofHeader {
                    types_size: self.types_section.len() as u16 * 4,
                    code_sizes: self.code_section.iter().map(|x| x.len() as u16).collect(),
                    container_sizes: self
                        .container_section
                        .iter()
                        .map(|x| x.len() as u16)
                        .collect(),
                    data_size: self.data_section.len() as u16,
                    sum_code_sizes: self.code_section.iter().map(|x| x.len()).sum(),
                    sum_container_sizes: self.container_section.iter().map(|x| x.len()).sum(),
                };
                let mut buffer = Vec::new();
                header.encode(&mut buffer);
                self.encode(&mut buffer);
                Eof {
                    header,
                    body: self,
                    raw: buffer.into(),
                }
            }
        *)
        Definition into_eof (ε : 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~ header :=
                  M.alloc (|
                    Value.StructRecord
                      "revm_primitives::bytecode::eof::header::EofHeader"
                      [
                        ("types_size",
                          BinOp.Wrap.mul (|
                            M.rust_cast
                              (M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "alloc::vec::Vec")
                                    []
                                    [
                                      Ty.path
                                        "revm_primitives::bytecode::eof::types_section::TypesSection";
                                      Ty.path "alloc::alloc::Global"
                                    ],
                                  "len",
                                  []
                                |),
                                [
                                  M.SubPointer.get_struct_record_field (|
                                    self,
                                    "revm_primitives::bytecode::eof::body::EofBody",
                                    "types_section"
                                  |)
                                ]
                              |)),
                            Value.Integer IntegerKind.U16 4
                          |));
                        ("code_sizes",
                          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 "core::slice::iter::Iter")
                                    []
                                    [ Ty.path "alloy_primitives::bytes_::Bytes" ];
                                  Ty.function
                                    [
                                      Ty.tuple
                                        [
                                          Ty.apply
                                            (Ty.path "&")
                                            []
                                            [ Ty.path "alloy_primitives::bytes_::Bytes" ]
                                        ]
                                    ]
                                    (Ty.path "u16")
                                ],
                              [],
                              "collect",
                              [
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [ Ty.path "u16"; Ty.path "alloc::alloc::Global" ]
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::iter::traits::iterator::Iterator",
                                  Ty.apply
                                    (Ty.path "core::slice::iter::Iter")
                                    []
                                    [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                  [],
                                  "map",
                                  [
                                    Ty.path "u16";
                                    Ty.function
                                      [
                                        Ty.tuple
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              []
                                              [ Ty.path "alloy_primitives::bytes_::Bytes" ]
                                          ]
                                      ]
                                      (Ty.path "u16")
                                  ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "slice")
                                        []
                                        [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                      "iter",
                                      []
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::ops::deref::Deref",
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.path "alloy_primitives::bytes_::Bytes";
                                              Ty.path "alloc::alloc::Global"
                                            ],
                                          [],
                                          "deref",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_record_field (|
                                            self,
                                            "revm_primitives::bytecode::eof::body::EofBody",
                                            "code_section"
                                          |)
                                        ]
                                      |)
                                    ]
                                  |);
                                  M.closure
                                    (fun γ =>
                                      ltac:(M.monadic
                                        match γ with
                                        | [ α0 ] =>
                                          ltac:(M.monadic
                                            (M.match_operator (|
                                              M.alloc (| α0 |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let x := M.copy (| γ |) in
                                                    M.rust_cast
                                                      (M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "bytes::bytes::Bytes",
                                                          "len",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::deref::Deref",
                                                              Ty.path
                                                                "alloy_primitives::bytes_::Bytes",
                                                              [],
                                                              "deref",
                                                              []
                                                            |),
                                                            [ M.read (| x |) ]
                                                          |)
                                                        ]
                                                      |))))
                                              ]
                                            |)))
                                        | _ => M.impossible "wrong number of arguments"
                                        end))
                                ]
                              |)
                            ]
                          |));
                        ("container_sizes",
                          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 "core::slice::iter::Iter")
                                    []
                                    [ Ty.path "alloy_primitives::bytes_::Bytes" ];
                                  Ty.function
                                    [
                                      Ty.tuple
                                        [
                                          Ty.apply
                                            (Ty.path "&")
                                            []
                                            [ Ty.path "alloy_primitives::bytes_::Bytes" ]
                                        ]
                                    ]
                                    (Ty.path "u16")
                                ],
                              [],
                              "collect",
                              [
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [ Ty.path "u16"; Ty.path "alloc::alloc::Global" ]
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::iter::traits::iterator::Iterator",
                                  Ty.apply
                                    (Ty.path "core::slice::iter::Iter")
                                    []
                                    [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                  [],
                                  "map",
                                  [
                                    Ty.path "u16";
                                    Ty.function
                                      [
                                        Ty.tuple
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              []
                                              [ Ty.path "alloy_primitives::bytes_::Bytes" ]
                                          ]
                                      ]
                                      (Ty.path "u16")
                                  ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "slice")
                                        []
                                        [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                      "iter",
                                      []
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::ops::deref::Deref",
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.path "alloy_primitives::bytes_::Bytes";
                                              Ty.path "alloc::alloc::Global"
                                            ],
                                          [],
                                          "deref",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_record_field (|
                                            self,
                                            "revm_primitives::bytecode::eof::body::EofBody",
                                            "container_section"
                                          |)
                                        ]
                                      |)
                                    ]
                                  |);
                                  M.closure
                                    (fun γ =>
                                      ltac:(M.monadic
                                        match γ with
                                        | [ α0 ] =>
                                          ltac:(M.monadic
                                            (M.match_operator (|
                                              M.alloc (| α0 |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let x := M.copy (| γ |) in
                                                    M.rust_cast
                                                      (M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "bytes::bytes::Bytes",
                                                          "len",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::deref::Deref",
                                                              Ty.path
                                                                "alloy_primitives::bytes_::Bytes",
                                                              [],
                                                              "deref",
                                                              []
                                                            |),
                                                            [ M.read (| x |) ]
                                                          |)
                                                        ]
                                                      |))))
                                              ]
                                            |)))
                                        | _ => M.impossible "wrong number of arguments"
                                        end))
                                ]
                              |)
                            ]
                          |));
                        ("data_size",
                          M.rust_cast
                            (M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "bytes::bytes::Bytes",
                                "len",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::deref::Deref",
                                    Ty.path "alloy_primitives::bytes_::Bytes",
                                    [],
                                    "deref",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      self,
                                      "revm_primitives::bytecode::eof::body::EofBody",
                                      "data_section"
                                    |)
                                  ]
                                |)
                              ]
                            |)));
                        ("sum_code_sizes",
                          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 "core::slice::iter::Iter")
                                    []
                                    [ Ty.path "alloy_primitives::bytes_::Bytes" ];
                                  Ty.function
                                    [
                                      Ty.tuple
                                        [
                                          Ty.apply
                                            (Ty.path "&")
                                            []
                                            [ Ty.path "alloy_primitives::bytes_::Bytes" ]
                                        ]
                                    ]
                                    (Ty.path "usize")
                                ],
                              [],
                              "sum",
                              [ Ty.path "usize" ]
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::iter::traits::iterator::Iterator",
                                  Ty.apply
                                    (Ty.path "core::slice::iter::Iter")
                                    []
                                    [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                  [],
                                  "map",
                                  [
                                    Ty.path "usize";
                                    Ty.function
                                      [
                                        Ty.tuple
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              []
                                              [ Ty.path "alloy_primitives::bytes_::Bytes" ]
                                          ]
                                      ]
                                      (Ty.path "usize")
                                  ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "slice")
                                        []
                                        [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                      "iter",
                                      []
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::ops::deref::Deref",
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.path "alloy_primitives::bytes_::Bytes";
                                              Ty.path "alloc::alloc::Global"
                                            ],
                                          [],
                                          "deref",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_record_field (|
                                            self,
                                            "revm_primitives::bytecode::eof::body::EofBody",
                                            "code_section"
                                          |)
                                        ]
                                      |)
                                    ]
                                  |);
                                  M.closure
                                    (fun γ =>
                                      ltac:(M.monadic
                                        match γ with
                                        | [ α0 ] =>
                                          ltac:(M.monadic
                                            (M.match_operator (|
                                              M.alloc (| α0 |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let x := M.copy (| γ |) in
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "bytes::bytes::Bytes",
                                                        "len",
                                                        []
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::ops::deref::Deref",
                                                            Ty.path
                                                              "alloy_primitives::bytes_::Bytes",
                                                            [],
                                                            "deref",
                                                            []
                                                          |),
                                                          [ M.read (| x |) ]
                                                        |)
                                                      ]
                                                    |)))
                                              ]
                                            |)))
                                        | _ => M.impossible "wrong number of arguments"
                                        end))
                                ]
                              |)
                            ]
                          |));
                        ("sum_container_sizes",
                          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 "core::slice::iter::Iter")
                                    []
                                    [ Ty.path "alloy_primitives::bytes_::Bytes" ];
                                  Ty.function
                                    [
                                      Ty.tuple
                                        [
                                          Ty.apply
                                            (Ty.path "&")
                                            []
                                            [ Ty.path "alloy_primitives::bytes_::Bytes" ]
                                        ]
                                    ]
                                    (Ty.path "usize")
                                ],
                              [],
                              "sum",
                              [ Ty.path "usize" ]
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::iter::traits::iterator::Iterator",
                                  Ty.apply
                                    (Ty.path "core::slice::iter::Iter")
                                    []
                                    [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                  [],
                                  "map",
                                  [
                                    Ty.path "usize";
                                    Ty.function
                                      [
                                        Ty.tuple
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              []
                                              [ Ty.path "alloy_primitives::bytes_::Bytes" ]
                                          ]
                                      ]
                                      (Ty.path "usize")
                                  ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "slice")
                                        []
                                        [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                      "iter",
                                      []
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::ops::deref::Deref",
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.path "alloy_primitives::bytes_::Bytes";
                                              Ty.path "alloc::alloc::Global"
                                            ],
                                          [],
                                          "deref",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_record_field (|
                                            self,
                                            "revm_primitives::bytecode::eof::body::EofBody",
                                            "container_section"
                                          |)
                                        ]
                                      |)
                                    ]
                                  |);
                                  M.closure
                                    (fun γ =>
                                      ltac:(M.monadic
                                        match γ with
                                        | [ α0 ] =>
                                          ltac:(M.monadic
                                            (M.match_operator (|
                                              M.alloc (| α0 |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let x := M.copy (| γ |) in
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "bytes::bytes::Bytes",
                                                        "len",
                                                        []
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::ops::deref::Deref",
                                                            Ty.path
                                                              "alloy_primitives::bytes_::Bytes",
                                                            [],
                                                            "deref",
                                                            []
                                                          |),
                                                          [ M.read (| x |) ]
                                                        |)
                                                      ]
                                                    |)))
                                              ]
                                            |)))
                                        | _ => M.impossible "wrong number of arguments"
                                        end))
                                ]
                              |)
                            ]
                          |))
                      ]
                  |) in
                let~ buffer :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                        "new",
                        []
                      |),
                      []
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "revm_primitives::bytecode::eof::header::EofHeader",
                        "encode",
                        []
                      |),
                      [ header; buffer ]
                    |)
                  |) in
                let~ _ :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "revm_primitives::bytecode::eof::body::EofBody",
                        "encode",
                        []
                      |),
                      [ self; buffer ]
                    |)
                  |) in
                M.alloc (|
                  Value.StructRecord
                    "revm_primitives::bytecode::eof::Eof"
                    [
                      ("header", M.read (| header |));
                      ("body", M.read (| self |));
                      ("raw",
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::convert::Into",
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              []
                              [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                            [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                            "into",
                            []
                          |),
                          [ M.read (| buffer |) ]
                        |))
                    ]
                |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_into_eof : M.IsAssociatedFunction Self "into_eof" into_eof.
        
        (*
            pub fn encode(&self, buffer: &mut Vec<u8>) {
                for types_section in &self.types_section {
                    types_section.encode(buffer);
                }
        
                for code_section in &self.code_section {
                    buffer.extend_from_slice(code_section);
                }
        
                for container_section in &self.container_section {
                    buffer.extend_from_slice(container_section);
                }
        
                buffer.extend_from_slice(&self.data_section);
            }
        *)
        Definition encode (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ self; buffer ] =>
            ltac:(M.monadic
              (let self := M.alloc (| self |) in
              let buffer := M.alloc (| buffer |) 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 "&")
                              []
                              [
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [
                                    Ty.path
                                      "revm_primitives::bytecode::eof::types_section::TypesSection";
                                    Ty.path "alloc::alloc::Global"
                                  ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "revm_primitives::bytecode::eof::body::EofBody",
                              "types_section"
                            |)
                          ]
                        |)
                      |),
                      [
                        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::slice::iter::Iter")
                                            []
                                            [
                                              Ty.path
                                                "revm_primitives::bytecode::eof::types_section::TypesSection"
                                            ],
                                          [],
                                          "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 types_section := M.copy (| γ0_0 |) in
                                          let~ _ :=
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path
                                                    "revm_primitives::bytecode::eof::types_section::TypesSection",
                                                  "encode",
                                                  []
                                                |),
                                                [ M.read (| types_section |); M.read (| buffer |) ]
                                              |)
                                            |) in
                                          M.alloc (| Value.Tuple [] |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) 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 "&")
                              []
                              [
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [
                                    Ty.path "alloy_primitives::bytes_::Bytes";
                                    Ty.path "alloc::alloc::Global"
                                  ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "revm_primitives::bytecode::eof::body::EofBody",
                              "code_section"
                            |)
                          ]
                        |)
                      |),
                      [
                        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::slice::iter::Iter")
                                            []
                                            [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                          [],
                                          "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 code_section := M.copy (| γ0_0 |) in
                                          let~ _ :=
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.apply
                                                    (Ty.path "alloc::vec::Vec")
                                                    []
                                                    [ Ty.path "u8"; Ty.path "alloc::alloc::Global"
                                                    ],
                                                  "extend_from_slice",
                                                  []
                                                |),
                                                [
                                                  M.read (| buffer |);
                                                  M.call_closure (|
                                                    M.get_trait_method (|
                                                      "core::ops::deref::Deref",
                                                      Ty.path "bytes::bytes::Bytes",
                                                      [],
                                                      "deref",
                                                      []
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::ops::deref::Deref",
                                                          Ty.path "alloy_primitives::bytes_::Bytes",
                                                          [],
                                                          "deref",
                                                          []
                                                        |),
                                                        [ M.read (| code_section |) ]
                                                      |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |) in
                                          M.alloc (| Value.Tuple [] |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) 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 "&")
                              []
                              [
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [
                                    Ty.path "alloy_primitives::bytes_::Bytes";
                                    Ty.path "alloc::alloc::Global"
                                  ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "revm_primitives::bytecode::eof::body::EofBody",
                              "container_section"
                            |)
                          ]
                        |)
                      |),
                      [
                        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::slice::iter::Iter")
                                            []
                                            [ Ty.path "alloy_primitives::bytes_::Bytes" ],
                                          [],
                                          "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 container_section := M.copy (| γ0_0 |) in
                                          let~ _ :=
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.apply
                                                    (Ty.path "alloc::vec::Vec")
                                                    []
                                                    [ Ty.path "u8"; Ty.path "alloc::alloc::Global"
                                                    ],
                                                  "extend_from_slice",
                                                  []
                                                |),
                                                [
                                                  M.read (| buffer |);
                                                  M.call_closure (|
                                                    M.get_trait_method (|
                                                      "core::ops::deref::Deref",
                                                      Ty.path "bytes::bytes::Bytes",
                                                      [],
                                                      "deref",
                                                      []
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::ops::deref::Deref",
                                                          Ty.path "alloy_primitives::bytes_::Bytes",
                                                          [],
                                                          "deref",
                                                          []
                                                        |),
                                                        [ M.read (| container_section |) ]
                                                      |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |) in
                                          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.path "u8"; Ty.path "alloc::alloc::Global" ],
                        "extend_from_slice",
                        []
                      |),
                      [
                        M.read (| buffer |);
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::deref::Deref",
                            Ty.path "bytes::bytes::Bytes",
                            [],
                            "deref",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::ops::deref::Deref",
                                Ty.path "alloy_primitives::bytes_::Bytes",
                                [],
                                "deref",
                                []
                              |),
                              [
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "revm_primitives::bytecode::eof::body::EofBody",
                                  "data_section"
                                |)
                              ]
                            |)
                          ]
                        |)
                      ]
                    |)
                  |) in
                M.alloc (| Value.Tuple [] |)
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_encode : M.IsAssociatedFunction Self "encode" encode.
        
        (*
            pub fn decode(input: &Bytes, header: &EofHeader) -> Result<Self, EofDecodeError> {
                let header_len = header.size();
                let partial_body_len =
                    header.sum_code_sizes + header.sum_container_sizes + header.types_size as usize;
                let full_body_len = partial_body_len + header.data_size as usize;
        
                if input.len() < header_len + partial_body_len {
                    return Err(EofDecodeError::MissingBodyWithoutData);
                }
        
                if input.len() > header_len + full_body_len {
                    return Err(EofDecodeError::DanglingData);
                }
        
                let mut body = EofBody::default();
        
                let mut types_input = &input[header_len..];
                for _ in 0..header.types_count() {
                    let (types_section, local_input) = TypesSection::decode(types_input)?;
                    types_input = local_input;
                    body.types_section.push(types_section);
                }
        
                // extract code section
                let mut start = header_len + header.types_size as usize;
                for size in header.code_sizes.iter().map(|x| *x as usize) {
                    body.code_section.push(input.slice(start..start + size));
                    start += size;
                }
        
                // extract container section
                for size in header.container_sizes.iter().map(|x| *x as usize) {
                    body.container_section
                        .push(input.slice(start..start + size));
                    start += size;
                }
        
                body.data_section = input.slice(start..);
                body.is_data_filled = body.data_section.len() == header.data_size as usize;
        
                Ok(body)
            }
        *)
        Definition decode (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
          match ε, τ, α with
          | [], [], [ input; header ] =>
            ltac:(M.monadic
              (let input := M.alloc (| input |) in
              let header := M.alloc (| header |) in
              M.catch_return (|
                ltac:(M.monadic
                  (M.read (|
                    let~ header_len :=
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "revm_primitives::bytecode::eof::header::EofHeader",
                            "size",
                            []
                          |),
                          [ M.read (| header |) ]
                        |)
                      |) in
                    let~ partial_body_len :=
                      M.alloc (|
                        BinOp.Wrap.add (|
                          BinOp.Wrap.add (|
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| header |),
                                "revm_primitives::bytecode::eof::header::EofHeader",
                                "sum_code_sizes"
                              |)
                            |),
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| header |),
                                "revm_primitives::bytecode::eof::header::EofHeader",
                                "sum_container_sizes"
                              |)
                            |)
                          |),
                          M.rust_cast
                            (M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| header |),
                                "revm_primitives::bytecode::eof::header::EofHeader",
                                "types_size"
                              |)
                            |))
                        |)
                      |) in
                    let~ full_body_len :=
                      M.alloc (|
                        BinOp.Wrap.add (|
                          M.read (| partial_body_len |),
                          M.rust_cast
                            (M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| header |),
                                "revm_primitives::bytecode::eof::header::EofHeader",
                                "data_size"
                              |)
                            |))
                        |)
                      |) in
                    let~ _ :=
                      M.match_operator (|
                        M.alloc (| Value.Tuple [] |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ :=
                                M.use
                                  (M.alloc (|
                                    BinOp.lt (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "bytes::bytes::Bytes",
                                          "len",
                                          []
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::ops::deref::Deref",
                                              Ty.path "alloy_primitives::bytes_::Bytes",
                                              [],
                                              "deref",
                                              []
                                            |),
                                            [ M.read (| input |) ]
                                          |)
                                        ]
                                      |),
                                      BinOp.Wrap.add (|
                                        M.read (| header_len |),
                                        M.read (| partial_body_len |)
                                      |)
                                    |)
                                  |)) 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.StructTuple
                                        "core::result::Result::Err"
                                        [
                                          Value.StructTuple
                                            "revm_primitives::bytecode::eof::EofDecodeError::MissingBodyWithoutData"
                                            []
                                        ]
                                    |)
                                  |)
                                |)
                              |)));
                          fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                        ]
                      |) in
                    let~ _ :=
                      M.match_operator (|
                        M.alloc (| Value.Tuple [] |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ :=
                                M.use
                                  (M.alloc (|
                                    BinOp.gt (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "bytes::bytes::Bytes",
                                          "len",
                                          []
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::ops::deref::Deref",
                                              Ty.path "alloy_primitives::bytes_::Bytes",
                                              [],
                                              "deref",
                                              []
                                            |),
                                            [ M.read (| input |) ]
                                          |)
                                        ]
                                      |),
                                      BinOp.Wrap.add (|
                                        M.read (| header_len |),
                                        M.read (| full_body_len |)
                                      |)
                                    |)
                                  |)) 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.StructTuple
                                        "core::result::Result::Err"
                                        [
                                          Value.StructTuple
                                            "revm_primitives::bytecode::eof::EofDecodeError::DanglingData"
                                            []
                                        ]
                                    |)
                                  |)
                                |)
                              |)));
                          fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                        ]
                      |) in
                    let~ body :=
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::default::Default",
                            Ty.path "revm_primitives::bytecode::eof::body::EofBody",
                            [],
                            "default",
                            []
                          |),
                          []
                        |)
                      |) in
                    let~ types_input :=
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::index::Index",
                            Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ],
                            [
                              Ty.apply
                                (Ty.path "core::ops::range::RangeFrom")
                                []
                                [ Ty.path "usize" ]
                            ],
                            "index",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::ops::deref::Deref",
                                Ty.path "bytes::bytes::Bytes",
                                [],
                                "deref",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::deref::Deref",
                                    Ty.path "alloy_primitives::bytes_::Bytes",
                                    [],
                                    "deref",
                                    []
                                  |),
                                  [ M.read (| input |) ]
                                |)
                              ]
                            |);
                            Value.StructRecord
                              "core::ops::range::RangeFrom"
                              [ ("start", M.read (| header_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 "core::ops::range::Range") [] [ Ty.path "usize" ],
                                [],
                                "into_iter",
                                []
                              |),
                              [
                                Value.StructRecord
                                  "core::ops::range::Range"
                                  [
                                    ("start", Value.Integer IntegerKind.Usize 0);
                                    ("end_",
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path
                                            "revm_primitives::bytecode::eof::header::EofHeader",
                                          "types_count",
                                          []
                                        |),
                                        [ M.read (| header |) ]
                                      |))
                                  ]
                              ]
                            |)
                          |),
                          [
                            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::Range")
                                                []
                                                [ Ty.path "usize" ],
                                              [],
                                              "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
                                              M.match_operator (|
                                                M.match_operator (|
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_trait_method (|
                                                        "core::ops::try_trait::Try",
                                                        Ty.apply
                                                          (Ty.path "core::result::Result")
                                                          []
                                                          [
                                                            Ty.tuple
                                                              [
                                                                Ty.path
                                                                  "revm_primitives::bytecode::eof::types_section::TypesSection";
                                                                Ty.apply
                                                                  (Ty.path "&")
                                                                  []
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "slice")
                                                                      []
                                                                      [ Ty.path "u8" ]
                                                                  ]
                                                              ];
                                                            Ty.path
                                                              "revm_primitives::bytecode::eof::EofDecodeError"
                                                          ],
                                                        [],
                                                        "branch",
                                                        []
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "revm_primitives::bytecode::eof::types_section::TypesSection",
                                                            "decode",
                                                            []
                                                          |),
                                                          [ M.read (| types_input |) ]
                                                        |)
                                                      ]
                                                    |)
                                                  |),
                                                  [
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let γ0_0 :=
                                                          M.SubPointer.get_struct_tuple_field (|
                                                            γ,
                                                            "core::ops::control_flow::ControlFlow::Break",
                                                            0
                                                          |) in
                                                        let residual := M.copy (| γ0_0 |) in
                                                        M.alloc (|
                                                          M.never_to_any (|
                                                            M.read (|
                                                              M.return_ (|
                                                                M.call_closure (|
                                                                  M.get_trait_method (|
                                                                    "core::ops::try_trait::FromResidual",
                                                                    Ty.apply
                                                                      (Ty.path
                                                                        "core::result::Result")
                                                                      []
                                                                      [
                                                                        Ty.path
                                                                          "revm_primitives::bytecode::eof::body::EofBody";
                                                                        Ty.path
                                                                          "revm_primitives::bytecode::eof::EofDecodeError"
                                                                      ],
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path
                                                                          "core::result::Result")
                                                                        []
                                                                        [
                                                                          Ty.path
                                                                            "core::convert::Infallible";
                                                                          Ty.path
                                                                            "revm_primitives::bytecode::eof::EofDecodeError"
                                                                        ]
                                                                    ],
                                                                    "from_residual",
                                                                    []
                                                                  |),
                                                                  [ M.read (| residual |) ]
                                                                |)
                                                              |)
                                                            |)
                                                          |)
                                                        |)));
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let γ0_0 :=
                                                          M.SubPointer.get_struct_tuple_field (|
                                                            γ,
                                                            "core::ops::control_flow::ControlFlow::Continue",
                                                            0
                                                          |) in
                                                        let val := M.copy (| γ0_0 |) in
                                                        val))
                                                  ]
                                                |),
                                                [
                                                  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 types_section := M.copy (| γ0_0 |) in
                                                      let local_input := M.copy (| γ0_1 |) in
                                                      let~ _ :=
                                                        M.write (|
                                                          types_input,
                                                          M.read (| local_input |)
                                                        |) in
                                                      let~ _ :=
                                                        M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.apply
                                                                (Ty.path "alloc::vec::Vec")
                                                                []
                                                                [
                                                                  Ty.path
                                                                    "revm_primitives::bytecode::eof::types_section::TypesSection";
                                                                  Ty.path "alloc::alloc::Global"
                                                                ],
                                                              "push",
                                                              []
                                                            |),
                                                            [
                                                              M.SubPointer.get_struct_record_field (|
                                                                body,
                                                                "revm_primitives::bytecode::eof::body::EofBody",
                                                                "types_section"
                                                              |);
                                                              M.read (| types_section |)
                                                            ]
                                                          |)
                                                        |) in
                                                      M.alloc (| Value.Tuple [] |)))
                                                ]
                                              |)))
                                        ]
                                      |) in
                                    M.alloc (| Value.Tuple [] |)))
                                |)))
                          ]
                        |)) in
                    let~ start :=
                      M.alloc (|
                        BinOp.Wrap.add (|
                          M.read (| header_len |),
                          M.rust_cast
                            (M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| header |),
                                "revm_primitives::bytecode::eof::header::EofHeader",
                                "types_size"
                              |)
                            |))
                        |)
                      |) 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::iter::adapters::map::Map")
                                  []
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      []
                                      [ Ty.path "u16" ];
                                    Ty.function
                                      [ Ty.tuple [ Ty.apply (Ty.path "&") [] [ Ty.path "u16" ] ] ]
                                      (Ty.path "usize")
                                  ],
                                [],
                                "into_iter",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::iter::traits::iterator::Iterator",
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      []
                                      [ Ty.path "u16" ],
                                    [],
                                    "map",
                                    [
                                      Ty.path "usize";
                                      Ty.function
                                        [ Ty.tuple [ Ty.apply (Ty.path "&") [] [ Ty.path "u16" ] ] ]
                                        (Ty.path "usize")
                                    ]
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply (Ty.path "slice") [] [ Ty.path "u16" ],
                                        "iter",
                                        []
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::ops::deref::Deref",
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [ Ty.path "u16"; Ty.path "alloc::alloc::Global" ],
                                            [],
                                            "deref",
                                            []
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| header |),
                                              "revm_primitives::bytecode::eof::header::EofHeader",
                                              "code_sizes"
                                            |)
                                          ]
                                        |)
                                      ]
                                    |);
                                    M.closure
                                      (fun γ =>
                                        ltac:(M.monadic
                                          match γ with
                                          | [ α0 ] =>
                                            ltac:(M.monadic
                                              (M.match_operator (|
                                                M.alloc (| α0 |),
                                                [
                                                  fun γ =>
                                                    ltac:(M.monadic
                                                      (let x := M.copy (| γ |) in
                                                      M.rust_cast (M.read (| M.read (| x |) |))))
                                                ]
                                              |)))
                                          | _ => M.impossible "wrong number of arguments"
                                          end))
                                  ]
                                |)
                              ]
                            |)
                          |),
                          [
                            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::map::Map")
                                                []
                                                [
                                                  Ty.apply
                                                    (Ty.path "core::slice::iter::Iter")
                                                    []
                                                    [ Ty.path "u16" ];
                                                  Ty.function
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            []
                                                            [ Ty.path "u16" ]
                                                        ]
                                                    ]
                                                    (Ty.path "usize")
                                                ],
                                              [],
                                              "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 size := M.copy (| γ0_0 |) in
                                              let~ _ :=
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "alloc::vec::Vec")
                                                        []
                                                        [
                                                          Ty.path "alloy_primitives::bytes_::Bytes";
                                                          Ty.path "alloc::alloc::Global"
                                                        ],
                                                      "push",
                                                      []
                                                    |),
                                                    [
                                                      M.SubPointer.get_struct_record_field (|
                                                        body,
                                                        "revm_primitives::bytecode::eof::body::EofBody",
                                                        "code_section"
                                                      |);
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "alloy_primitives::bytes_::Bytes",
                                                          "slice",
                                                          [
                                                            Ty.apply
                                                              (Ty.path "core::ops::range::Range")
                                                              []
                                                              [ Ty.path "usize" ]
                                                          ]
                                                        |),
                                                        [
                                                          M.read (| input |);
                                                          Value.StructRecord
                                                            "core::ops::range::Range"
                                                            [
                                                              ("start", M.read (| start |));
                                                              ("end_",
                                                                BinOp.Wrap.add (|
                                                                  M.read (| start |),
                                                                  M.read (| size |)
                                                                |))
                                                            ]
                                                        ]
                                                      |)
                                                    ]
                                                  |)
                                                |) in
                                              let~ _ :=
                                                let β := start in
                                                M.write (|
                                                  β,
                                                  BinOp.Wrap.add (|
                                                    M.read (| β |),
                                                    M.read (| size |)
                                                  |)
                                                |) in
                                              M.alloc (| Value.Tuple [] |)))
                                        ]
                                      |) in
                                    M.alloc (| Value.Tuple [] |)))
                                |)))
                          ]
                        |)) 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::iter::adapters::map::Map")
                                  []
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      []
                                      [ Ty.path "u16" ];
                                    Ty.function
                                      [ Ty.tuple [ Ty.apply (Ty.path "&") [] [ Ty.path "u16" ] ] ]
                                      (Ty.path "usize")
                                  ],
                                [],
                                "into_iter",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::iter::traits::iterator::Iterator",
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      []
                                      [ Ty.path "u16" ],
                                    [],
                                    "map",
                                    [
                                      Ty.path "usize";
                                      Ty.function
                                        [ Ty.tuple [ Ty.apply (Ty.path "&") [] [ Ty.path "u16" ] ] ]
                                        (Ty.path "usize")
                                    ]
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply (Ty.path "slice") [] [ Ty.path "u16" ],
                                        "iter",
                                        []
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::ops::deref::Deref",
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [ Ty.path "u16"; Ty.path "alloc::alloc::Global" ],
                                            [],
                                            "deref",
                                            []
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| header |),
                                              "revm_primitives::bytecode::eof::header::EofHeader",
                                              "container_sizes"
                                            |)
                                          ]
                                        |)
                                      ]
                                    |);
                                    M.closure
                                      (fun γ =>
                                        ltac:(M.monadic
                                          match γ with
                                          | [ α0 ] =>
                                            ltac:(M.monadic
                                              (M.match_operator (|
                                                M.alloc (| α0 |),
                                                [
                                                  fun γ =>
                                                    ltac:(M.monadic
                                                      (let x := M.copy (| γ |) in
                                                      M.rust_cast (M.read (| M.read (| x |) |))))
                                                ]
                                              |)))
                                          | _ => M.impossible "wrong number of arguments"
                                          end))
                                  ]
                                |)
                              ]
                            |)
                          |),
                          [
                            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::map::Map")
                                                []
                                                [
                                                  Ty.apply
                                                    (Ty.path "core::slice::iter::Iter")
                                                    []
                                                    [ Ty.path "u16" ];
                                                  Ty.function
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            []
                                                            [ Ty.path "u16" ]
                                                        ]
                                                    ]
                                                    (Ty.path "usize")
                                                ],
                                              [],
                                              "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 size := M.copy (| γ0_0 |) in
                                              let~ _ :=
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "alloc::vec::Vec")
                                                        []
                                                        [
                                                          Ty.path "alloy_primitives::bytes_::Bytes";
                                                          Ty.path "alloc::alloc::Global"
                                                        ],
                                                      "push",
                                                      []
                                                    |),
                                                    [
                                                      M.SubPointer.get_struct_record_field (|
                                                        body,
                                                        "revm_primitives::bytecode::eof::body::EofBody",
                                                        "container_section"
                                                      |);
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "alloy_primitives::bytes_::Bytes",
                                                          "slice",
                                                          [
                                                            Ty.apply
                                                              (Ty.path "core::ops::range::Range")
                                                              []
                                                              [ Ty.path "usize" ]
                                                          ]
                                                        |),
                                                        [
                                                          M.read (| input |);
                                                          Value.StructRecord
                                                            "core::ops::range::Range"
                                                            [
                                                              ("start", M.read (| start |));
                                                              ("end_",
                                                                BinOp.Wrap.add (|
                                                                  M.read (| start |),
                                                                  M.read (| size |)
                                                                |))
                                                            ]
                                                        ]
                                                      |)
                                                    ]
                                                  |)
                                                |) in
                                              let~ _ :=
                                                let β := start in
                                                M.write (|
                                                  β,
                                                  BinOp.Wrap.add (|
                                                    M.read (| β |),
                                                    M.read (| size |)
                                                  |)
                                                |) in
                                              M.alloc (| Value.Tuple [] |)))
                                        ]
                                      |) in
                                    M.alloc (| Value.Tuple [] |)))
                                |)))
                          ]
                        |)) in
                    let~ _ :=
                      M.write (|
                        M.SubPointer.get_struct_record_field (|
                          body,
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "data_section"
                        |),
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "alloy_primitives::bytes_::Bytes",
                            "slice",
                            [
                              Ty.apply
                                (Ty.path "core::ops::range::RangeFrom")
                                []
                                [ Ty.path "usize" ]
                            ]
                          |),
                          [
                            M.read (| input |);
                            Value.StructRecord
                              "core::ops::range::RangeFrom"
                              [ ("start", M.read (| start |)) ]
                          ]
                        |)
                      |) in
                    let~ _ :=
                      M.write (|
                        M.SubPointer.get_struct_record_field (|
                          body,
                          "revm_primitives::bytecode::eof::body::EofBody",
                          "is_data_filled"
                        |),
                        BinOp.eq (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "bytes::bytes::Bytes",
                              "len",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::ops::deref::Deref",
                                  Ty.path "alloy_primitives::bytes_::Bytes",
                                  [],
                                  "deref",
                                  []
                                |),
                                [
                                  M.SubPointer.get_struct_record_field (|
                                    body,
                                    "revm_primitives::bytecode::eof::body::EofBody",
                                    "data_section"
                                  |)
                                ]
                              |)
                            ]
                          |),
                          M.rust_cast
                            (M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| header |),
                                "revm_primitives::bytecode::eof::header::EofHeader",
                                "data_size"
                              |)
                            |))
                        |)
                      |) in
                    M.alloc (| Value.StructTuple "core::result::Result::Ok" [ M.read (| body |) ] |)
                  |)))
              |)))
          | _, _, _ => M.impossible "wrong number of arguments"
          end.
        
        Axiom AssociatedFunction_decode : M.IsAssociatedFunction Self "decode" decode.
      End Impl_revm_primitives_bytecode_eof_body_EofBody.
    End body.
  End eof.
End bytecode.
