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

Module check_bounds.
  (*
  Enum BoundsCheckingContext
  {
    const_params := [];
    ty_params := [];
    variants :=
      [
        {
          name := "Module";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "ModuleFunction";
          item :=
            StructTuple [ Ty.path "move_binary_format::file_format::FunctionDefinitionIndex" ];
          discriminant := None;
        }
      ];
  }
  *)
  
  (* StructRecord
    {
      name := "BoundsChecker";
      const_params := [];
      ty_params := [];
      fields :=
        [
          ("module",
            Ty.apply
              (Ty.path "&")
              []
              [ Ty.path "move_binary_format::file_format::CompiledModule" ]);
          ("context", Ty.path "move_binary_format::check_bounds::BoundsCheckingContext")
        ];
    } *)
  
  Module Impl_move_binary_format_check_bounds_BoundsChecker.
    Definition Self : Ty.t := Ty.path "move_binary_format::check_bounds::BoundsChecker".
    
    (*
        pub fn verify_module(module: &'a CompiledModule) -> PartialVMResult<()> {
            let mut bounds_check = Self {
                module,
                context: BoundsCheckingContext::Module,
            };
            if bounds_check.module.module_handles().is_empty() {
                let status =
                    verification_error(StatusCode::NO_MODULE_HANDLES, IndexKind::ModuleHandle, 0);
                return Err(status);
            }
            bounds_check.verify_impl()
        }
    *)
    Definition verify_module (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ module ] =>
        ltac:(M.monadic
          (let module := M.alloc (| module |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ bounds_check :=
                  M.alloc (|
                    Value.StructRecord
                      "move_binary_format::check_bounds::BoundsChecker"
                      [
                        ("module", M.read (| module |));
                        ("context",
                          Value.StructTuple
                            "move_binary_format::check_bounds::BoundsCheckingContext::Module"
                            [])
                      ]
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.use
                              (M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "slice")
                                      []
                                      [ Ty.path "move_binary_format::file_format::ModuleHandle" ],
                                    "is_empty",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "move_binary_format::file_format::CompiledModule",
                                        "module_handles",
                                        []
                                      |),
                                      [
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            bounds_check,
                                            "move_binary_format::check_bounds::BoundsChecker",
                                            "module"
                                          |)
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              |)) in
                          let _ :=
                            M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                          M.alloc (|
                            M.never_to_any (|
                              M.read (|
                                let~ status :=
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_function (|
                                        "move_binary_format::errors::verification_error",
                                        []
                                      |),
                                      [
                                        Value.StructTuple
                                          "move_core_types::vm_status::StatusCode::NO_MODULE_HANDLES"
                                          [];
                                        Value.StructTuple
                                          "move_binary_format::IndexKind::ModuleHandle"
                                          [];
                                        Value.Integer IntegerKind.U16 0
                                      ]
                                    |)
                                  |) in
                                M.return_ (|
                                  Value.StructTuple
                                    "core::result::Result::Err"
                                    [ M.read (| status |) ]
                                |)
                              |)
                            |)
                          |)));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "move_binary_format::check_bounds::BoundsChecker",
                      "verify_impl",
                      []
                    |),
                    [ bounds_check ]
                  |)
                |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_verify_module :
      M.IsAssociatedFunction Self "verify_module" verify_module.
    
    (*
        fn verify_impl(&mut self) -> PartialVMResult<()> {
            self.check_signatures()?;
            self.check_constants()?;
            self.check_module_handles()?;
            self.check_self_module_handle()?;
            self.check_struct_handles()?;
            self.check_function_handles()?;
            self.check_field_handles()?;
            self.check_friend_decls()?;
            self.check_struct_instantiations()?;
            self.check_function_instantiations()?;
            self.check_field_instantiations()?;
            self.check_struct_defs()?;
            self.check_function_defs()
        }
    *)
    Definition verify_impl (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::try_trait::Try",
                          Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_signatures",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_constants",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_module_handles",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_self_module_handle",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_struct_handles",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_function_handles",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_field_handles",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_friend_decls",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_struct_instantiations",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_function_instantiations",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_field_instantiations",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "check_struct_defs",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "move_binary_format::check_bounds::BoundsChecker",
                      "check_function_defs",
                      []
                    |),
                    [ M.read (| self |) ]
                  |)
                |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_verify_impl : M.IsAssociatedFunction Self "verify_impl" verify_impl.
    
    (*
        fn check_signatures(&self) -> PartialVMResult<()> {
            for signature in self.module.signatures() {
                self.check_signature(signature)?
            }
            Ok(())
        }
    *)
    Definition check_signatures (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::Signature" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "signatures",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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 "move_binary_format::file_format::Signature"
                                            ],
                                          [],
                                          "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 signature := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_signature",
                                                      []
                                                    |),
                                                    [ M.read (| self |); M.read (| signature |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_signatures :
      M.IsAssociatedFunction Self "check_signatures" check_signatures.
    
    (*
        fn check_constants(&self) -> PartialVMResult<()> {
            for constant in self.module.constant_pool() {
                self.check_constant(constant)?
            }
            Ok(())
        }
    *)
    Definition check_constants (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::Constant" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "constant_pool",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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 "move_binary_format::file_format::Constant" ],
                                          [],
                                          "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 constant := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_constant",
                                                      []
                                                    |),
                                                    [ M.read (| self |); M.read (| constant |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_constants :
      M.IsAssociatedFunction Self "check_constants" check_constants.
    
    (*
        fn check_module_handles(&self) -> PartialVMResult<()> {
            for script_handle in self.module.module_handles() {
                self.check_module_handle(script_handle)?
            }
            Ok(())
        }
    *)
    Definition check_module_handles (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::ModuleHandle" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "module_handles",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::ModuleHandle"
                                            ],
                                          [],
                                          "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 script_handle := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_module_handle",
                                                      []
                                                    |),
                                                    [ M.read (| self |); M.read (| script_handle |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_module_handles :
      M.IsAssociatedFunction Self "check_module_handles" check_module_handles.
    
    (*
        fn check_struct_handles(&self) -> PartialVMResult<()> {
            for struct_handle in self.module.struct_handles() {
                self.check_struct_handle(struct_handle)?
            }
            Ok(())
        }
    *)
    Definition check_struct_handles (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::StructHandle" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "struct_handles",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::StructHandle"
                                            ],
                                          [],
                                          "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 struct_handle := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_struct_handle",
                                                      []
                                                    |),
                                                    [ M.read (| self |); M.read (| struct_handle |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_struct_handles :
      M.IsAssociatedFunction Self "check_struct_handles" check_struct_handles.
    
    (*
        fn check_function_handles(&self) -> PartialVMResult<()> {
            for function_handle in self.module.function_handles() {
                self.check_function_handle(function_handle)?
            }
            Ok(())
        }
    *)
    Definition check_function_handles (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::FunctionHandle" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "function_handles",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::FunctionHandle"
                                            ],
                                          [],
                                          "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 function_handle := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_function_handle",
                                                      []
                                                    |),
                                                    [
                                                      M.read (| self |);
                                                      M.read (| function_handle |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_function_handles :
      M.IsAssociatedFunction Self "check_function_handles" check_function_handles.
    
    (*
        fn check_field_handles(&self) -> PartialVMResult<()> {
            for field_handle in self.module.field_handles() {
                self.check_field_handle(field_handle)?
            }
            Ok(())
        }
    *)
    Definition check_field_handles (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::FieldHandle" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "field_handles",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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 "move_binary_format::file_format::FieldHandle"
                                            ],
                                          [],
                                          "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 field_handle := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_field_handle",
                                                      []
                                                    |),
                                                    [ M.read (| self |); M.read (| field_handle |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_field_handles :
      M.IsAssociatedFunction Self "check_field_handles" check_field_handles.
    
    (*
        fn check_friend_decls(&self) -> PartialVMResult<()> {
            for friend_decl in self.module.friend_decls() {
                self.check_module_handle(friend_decl)?
            }
            Ok(())
        }
    *)
    Definition check_friend_decls (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::ModuleHandle" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "friend_decls",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::ModuleHandle"
                                            ],
                                          [],
                                          "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 friend_decl := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_module_handle",
                                                      []
                                                    |),
                                                    [ M.read (| self |); M.read (| friend_decl |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_friend_decls :
      M.IsAssociatedFunction Self "check_friend_decls" check_friend_decls.
    
    (*
        fn check_struct_instantiations(&self) -> PartialVMResult<()> {
            for struct_instantiation in self.module.struct_instantiations() {
                self.check_struct_instantiation(struct_instantiation)?
            }
            Ok(())
        }
    *)
    Definition check_struct_instantiations
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [
                                    Ty.path
                                      "move_binary_format::file_format::StructDefInstantiation"
                                  ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "struct_instantiations",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::StructDefInstantiation"
                                            ],
                                          [],
                                          "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 struct_instantiation := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_struct_instantiation",
                                                      []
                                                    |),
                                                    [
                                                      M.read (| self |);
                                                      M.read (| struct_instantiation |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_struct_instantiations :
      M.IsAssociatedFunction Self "check_struct_instantiations" check_struct_instantiations.
    
    (*
        fn check_function_instantiations(&self) -> PartialVMResult<()> {
            for function_instantiation in self.module.function_instantiations() {
                self.check_function_instantiation(function_instantiation)?
            }
            Ok(())
        }
    *)
    Definition check_function_instantiations
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::FunctionInstantiation"
                                  ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "function_instantiations",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::FunctionInstantiation"
                                            ],
                                          [],
                                          "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 function_instantiation := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_function_instantiation",
                                                      []
                                                    |),
                                                    [
                                                      M.read (| self |);
                                                      M.read (| function_instantiation |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_function_instantiations :
      M.IsAssociatedFunction Self "check_function_instantiations" check_function_instantiations.
    
    (*
        fn check_field_instantiations(&self) -> PartialVMResult<()> {
            for field_instantiation in self.module.field_instantiations() {
                self.check_field_instantiation(field_instantiation)?
            }
            Ok(())
        }
    *)
    Definition check_field_instantiations
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::FieldInstantiation" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "field_instantiations",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::FieldInstantiation"
                                            ],
                                          [],
                                          "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 field_instantiation := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_field_instantiation",
                                                      []
                                                    |),
                                                    [
                                                      M.read (| self |);
                                                      M.read (| field_instantiation |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_field_instantiations :
      M.IsAssociatedFunction Self "check_field_instantiations" check_field_instantiations.
    
    (*
        fn check_struct_defs(&self) -> PartialVMResult<()> {
            for struct_def in self.module.struct_defs() {
                self.check_struct_def(struct_def)?
            }
            Ok(())
        }
    *)
    Definition check_struct_defs (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::StructDefinition" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::CompiledModule",
                                "struct_defs",
                                []
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "move_binary_format::check_bounds::BoundsChecker",
                                    "module"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::StructDefinition"
                                            ],
                                          [],
                                          "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 struct_def := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_struct_def",
                                                      []
                                                    |),
                                                    [ M.read (| self |); M.read (| struct_def |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_struct_defs :
      M.IsAssociatedFunction Self "check_struct_defs" check_struct_defs.
    
    (*
        fn check_function_defs(&mut self) -> PartialVMResult<()> {
            for (function_def_idx, function_def) in self.module.function_defs().iter().enumerate() {
                self.check_function_def(function_def_idx, function_def)?
            }
            Ok(())
        }
    *)
    Definition check_function_defs (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.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::enumerate::Enumerate")
                              []
                              [
                                Ty.apply
                                  (Ty.path "core::slice::iter::Iter")
                                  []
                                  [ Ty.path "move_binary_format::file_format::FunctionDefinition" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::iterator::Iterator",
                                Ty.apply
                                  (Ty.path "core::slice::iter::Iter")
                                  []
                                  [ Ty.path "move_binary_format::file_format::FunctionDefinition" ],
                                [],
                                "enumerate",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "slice")
                                      []
                                      [
                                        Ty.path
                                          "move_binary_format::file_format::FunctionDefinition"
                                      ],
                                    "iter",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "move_binary_format::file_format::CompiledModule",
                                        "function_defs",
                                        []
                                      |),
                                      [
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "move_binary_format::check_bounds::BoundsChecker",
                                            "module"
                                          |)
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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::enumerate::Enumerate")
                                            []
                                            [
                                              Ty.apply
                                                (Ty.path "core::slice::iter::Iter")
                                                []
                                                [
                                                  Ty.path
                                                    "move_binary_format::file_format::FunctionDefinition"
                                                ]
                                            ],
                                          [],
                                          "next",
                                          []
                                        |),
                                        [ iter ]
                                      |)
                                    |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let _ :=
                                            M.is_struct_tuple (|
                                              γ,
                                              "core::option::Option::None"
                                            |) in
                                          M.alloc (|
                                            M.never_to_any (| M.read (| M.break (||) |) |)
                                          |)));
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let γ0_0 :=
                                            M.SubPointer.get_struct_tuple_field (|
                                              γ,
                                              "core::option::Option::Some",
                                              0
                                            |) in
                                          let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                          let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                          let function_def_idx := M.copy (| γ1_0 |) in
                                          let function_def := M.copy (| γ1_1 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_function_def",
                                                      []
                                                    |),
                                                    [
                                                      M.read (| self |);
                                                      M.read (| function_def_idx |);
                                                      M.read (| function_def |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_function_defs :
      M.IsAssociatedFunction Self "check_function_defs" check_function_defs.
    
    (*
        fn check_module_handle(&self, module_handle: &ModuleHandle) -> PartialVMResult<()> {
            check_bounds_impl(self.module.address_identifiers(), module_handle.address)?;
            check_bounds_impl(self.module.identifiers(), module_handle.name)
        }
    *)
    Definition check_module_handle (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; module_handle ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let module_handle := M.alloc (| module_handle |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_core_types::account_address::AccountAddress";
                                Ty.path "move_binary_format::file_format::AddressIdentifierIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "address_identifiers",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| module_handle |),
                                  "move_binary_format::file_format::ModuleHandle",
                                  "address"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "move_binary_format::check_bounds::check_bounds_impl",
                      [
                        Ty.path "move_core_types::identifier::Identifier";
                        Ty.path "move_binary_format::file_format::IdentifierIndex"
                      ]
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_binary_format::file_format::CompiledModule",
                          "identifiers",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_binary_format::check_bounds::BoundsChecker",
                              "module"
                            |)
                          |)
                        ]
                      |);
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| module_handle |),
                          "move_binary_format::file_format::ModuleHandle",
                          "name"
                        |)
                      |)
                    ]
                  |)
                |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_module_handle :
      M.IsAssociatedFunction Self "check_module_handle" check_module_handle.
    
    (*
        fn check_self_module_handle(&self) -> PartialVMResult<()> {
            check_bounds_impl(self.module.module_handles(), self.module.self_handle_idx())
        }
    *)
    Definition check_self_module_handle (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.call_closure (|
            M.get_function (|
              "move_binary_format::check_bounds::check_bounds_impl",
              [
                Ty.path "move_binary_format::file_format::ModuleHandle";
                Ty.path "move_binary_format::file_format::ModuleHandleIndex"
              ]
            |),
            [
              M.call_closure (|
                M.get_associated_function (|
                  Ty.path "move_binary_format::file_format::CompiledModule",
                  "module_handles",
                  []
                |),
                [
                  M.read (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_binary_format::check_bounds::BoundsChecker",
                      "module"
                    |)
                  |)
                ]
              |);
              M.call_closure (|
                M.get_associated_function (|
                  Ty.path "move_binary_format::file_format::CompiledModule",
                  "self_handle_idx",
                  []
                |),
                [
                  M.read (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_binary_format::check_bounds::BoundsChecker",
                      "module"
                    |)
                  |)
                ]
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_self_module_handle :
      M.IsAssociatedFunction Self "check_self_module_handle" check_self_module_handle.
    
    (*
        fn check_struct_handle(&self, struct_handle: &StructHandle) -> PartialVMResult<()> {
            check_bounds_impl(self.module.module_handles(), struct_handle.module)?;
            check_bounds_impl(self.module.identifiers(), struct_handle.name)
        }
    *)
    Definition check_struct_handle (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; struct_handle ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let struct_handle := M.alloc (| struct_handle |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::ModuleHandle";
                                Ty.path "move_binary_format::file_format::ModuleHandleIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "module_handles",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| struct_handle |),
                                  "move_binary_format::file_format::StructHandle",
                                  "module"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "move_binary_format::check_bounds::check_bounds_impl",
                      [
                        Ty.path "move_core_types::identifier::Identifier";
                        Ty.path "move_binary_format::file_format::IdentifierIndex"
                      ]
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_binary_format::file_format::CompiledModule",
                          "identifiers",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_binary_format::check_bounds::BoundsChecker",
                              "module"
                            |)
                          |)
                        ]
                      |);
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| struct_handle |),
                          "move_binary_format::file_format::StructHandle",
                          "name"
                        |)
                      |)
                    ]
                  |)
                |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_struct_handle :
      M.IsAssociatedFunction Self "check_struct_handle" check_struct_handle.
    
    (*
        fn check_function_handle(&self, function_handle: &FunctionHandle) -> PartialVMResult<()> {
            check_bounds_impl(self.module.module_handles(), function_handle.module)?;
            check_bounds_impl(self.module.identifiers(), function_handle.name)?;
            check_bounds_impl(self.module.signatures(), function_handle.parameters)?;
            check_bounds_impl(self.module.signatures(), function_handle.return_)?;
            // function signature type paramters must be in bounds to the function type parameters
            let type_param_count = function_handle.type_parameters.len();
            if let Some(sig) = self
                .module
                .signatures()
                .get(function_handle.parameters.into_index())
            {
                for ty in &sig.0 {
                    self.check_type_parameter(ty, type_param_count)?
                }
            }
            if let Some(sig) = self
                .module
                .signatures()
                .get(function_handle.return_.into_index())
            {
                for ty in &sig.0 {
                    self.check_type_parameter(ty, type_param_count)?
                }
            }
            Ok(())
        }
    *)
    Definition check_function_handle (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; function_handle ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let function_handle := M.alloc (| function_handle |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::ModuleHandle";
                                Ty.path "move_binary_format::file_format::ModuleHandleIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "module_handles",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| function_handle |),
                                  "move_binary_format::file_format::FunctionHandle",
                                  "module"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_core_types::identifier::Identifier";
                                Ty.path "move_binary_format::file_format::IdentifierIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "identifiers",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| function_handle |),
                                  "move_binary_format::file_format::FunctionHandle",
                                  "name"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::Signature";
                                Ty.path "move_binary_format::file_format::SignatureIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "signatures",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| function_handle |),
                                  "move_binary_format::file_format::FunctionHandle",
                                  "parameters"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::Signature";
                                Ty.path "move_binary_format::file_format::SignatureIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "signatures",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| function_handle |),
                                  "move_binary_format::file_format::FunctionHandle",
                                  "return_"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ type_param_count :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "move_binary_format::file_format::AbilitySet";
                            Ty.path "alloc::alloc::Global"
                          ],
                        "len",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| function_handle |),
                          "move_binary_format::file_format::FunctionHandle",
                          "type_parameters"
                        |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "slice")
                                    []
                                    [ Ty.path "move_binary_format::file_format::Signature" ],
                                  "get",
                                  [ Ty.path "usize" ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "move_binary_format::file_format::CompiledModule",
                                      "signatures",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| self |),
                                          "move_binary_format::check_bounds::BoundsChecker",
                                          "module"
                                        |)
                                      |)
                                    ]
                                  |);
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "move_binary_format::internals::ModuleIndex",
                                      Ty.path "move_binary_format::file_format::SignatureIndex",
                                      [],
                                      "into_index",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| function_handle |),
                                          "move_binary_format::file_format::FunctionHandle",
                                          "parameters"
                                        |)
                                      |)
                                    ]
                                  |)
                                ]
                              |)
                            |) in
                          let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::option::Option::Some",
                              0
                            |) in
                          let sig := M.copy (| γ0_0 |) in
                          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
                                              "move_binary_format::file_format::SignatureToken";
                                            Ty.path "alloc::alloc::Global"
                                          ]
                                      ],
                                    [],
                                    "into_iter",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_tuple_field (|
                                      M.read (| sig |),
                                      "move_binary_format::file_format::Signature",
                                      0
                                    |)
                                  ]
                                |)
                              |),
                              [
                                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
                                                        "move_binary_format::file_format::SignatureToken"
                                                    ],
                                                  [],
                                                  "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 ty := M.copy (| γ0_0 |) in
                                                  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
                                                                "move_binary_format::errors::PartialVMError"
                                                            ],
                                                          [],
                                                          "branch",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "move_binary_format::check_bounds::BoundsChecker",
                                                              "check_type_parameter",
                                                              []
                                                            |),
                                                            [
                                                              M.read (| self |);
                                                              M.read (| ty |);
                                                              M.read (| type_param_count |)
                                                            ]
                                                          |)
                                                        ]
                                                      |)
                                                    |),
                                                    [
                                                      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.tuple [];
                                                                          Ty.path
                                                                            "move_binary_format::errors::PartialVMError"
                                                                        ],
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "core::result::Result")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "core::convert::Infallible";
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ]
                                                                      ],
                                                                      "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))
                                                    ]
                                                  |)))
                                            ]
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                    |)))
                              ]
                            |))));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "slice")
                                    []
                                    [ Ty.path "move_binary_format::file_format::Signature" ],
                                  "get",
                                  [ Ty.path "usize" ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "move_binary_format::file_format::CompiledModule",
                                      "signatures",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| self |),
                                          "move_binary_format::check_bounds::BoundsChecker",
                                          "module"
                                        |)
                                      |)
                                    ]
                                  |);
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "move_binary_format::internals::ModuleIndex",
                                      Ty.path "move_binary_format::file_format::SignatureIndex",
                                      [],
                                      "into_index",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| function_handle |),
                                          "move_binary_format::file_format::FunctionHandle",
                                          "return_"
                                        |)
                                      |)
                                    ]
                                  |)
                                ]
                              |)
                            |) in
                          let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::option::Option::Some",
                              0
                            |) in
                          let sig := M.copy (| γ0_0 |) in
                          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
                                              "move_binary_format::file_format::SignatureToken";
                                            Ty.path "alloc::alloc::Global"
                                          ]
                                      ],
                                    [],
                                    "into_iter",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_tuple_field (|
                                      M.read (| sig |),
                                      "move_binary_format::file_format::Signature",
                                      0
                                    |)
                                  ]
                                |)
                              |),
                              [
                                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
                                                        "move_binary_format::file_format::SignatureToken"
                                                    ],
                                                  [],
                                                  "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 ty := M.copy (| γ0_0 |) in
                                                  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
                                                                "move_binary_format::errors::PartialVMError"
                                                            ],
                                                          [],
                                                          "branch",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "move_binary_format::check_bounds::BoundsChecker",
                                                              "check_type_parameter",
                                                              []
                                                            |),
                                                            [
                                                              M.read (| self |);
                                                              M.read (| ty |);
                                                              M.read (| type_param_count |)
                                                            ]
                                                          |)
                                                        ]
                                                      |)
                                                    |),
                                                    [
                                                      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.tuple [];
                                                                          Ty.path
                                                                            "move_binary_format::errors::PartialVMError"
                                                                        ],
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "core::result::Result")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "core::convert::Infallible";
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ]
                                                                      ],
                                                                      "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))
                                                    ]
                                                  |)))
                                            ]
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                    |)))
                              ]
                            |))));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_function_handle :
      M.IsAssociatedFunction Self "check_function_handle" check_function_handle.
    
    (*
        fn check_field_handle(&self, field_handle: &FieldHandle) -> PartialVMResult<()> {
            check_bounds_impl(self.module.struct_defs(), field_handle.owner)?;
            // field offset must be in bounds, struct def just checked above must exist
            if let Some(struct_def) = &self
                .module
                .struct_defs()
                .get(field_handle.owner.into_index())
            {
                let fields_count = match &struct_def.field_information {
                    StructFieldInformation::Native => 0,
                    StructFieldInformation::Declared(fields) => fields.len(),
                };
                if field_handle.field as usize >= fields_count {
                    return Err(bounds_error(
                        StatusCode::INDEX_OUT_OF_BOUNDS,
                        IndexKind::MemberCount,
                        field_handle.field,
                        fields_count,
                    ));
                }
            }
            Ok(())
        }
    *)
    Definition check_field_handle (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; field_handle ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let field_handle := M.alloc (| field_handle |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::StructDefinition";
                                Ty.path "move_binary_format::file_format::StructDefinitionIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "struct_defs",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| field_handle |),
                                  "move_binary_format::file_format::FieldHandle",
                                  "owner"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.alloc (|
                              M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "slice")
                                      []
                                      [ Ty.path "move_binary_format::file_format::StructDefinition"
                                      ],
                                    "get",
                                    [ Ty.path "usize" ]
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "move_binary_format::file_format::CompiledModule",
                                        "struct_defs",
                                        []
                                      |),
                                      [
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "move_binary_format::check_bounds::BoundsChecker",
                                            "module"
                                          |)
                                        |)
                                      ]
                                    |);
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "move_binary_format::internals::ModuleIndex",
                                        Ty.path
                                          "move_binary_format::file_format::StructDefinitionIndex",
                                        [],
                                        "into_index",
                                        []
                                      |),
                                      [
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| field_handle |),
                                            "move_binary_format::file_format::FieldHandle",
                                            "owner"
                                          |)
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              |)
                            |) in
                          let γ := M.read (| γ |) in
                          let γ1_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::option::Option::Some",
                              0
                            |) in
                          let struct_def := M.alloc (| γ1_0 |) in
                          let~ fields_count :=
                            M.copy (|
                              M.match_operator (|
                                M.alloc (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| M.read (| struct_def |) |),
                                    "move_binary_format::file_format::StructDefinition",
                                    "field_information"
                                  |)
                                |),
                                [
                                  fun γ =>
                                    ltac:(M.monadic
                                      (let γ := M.read (| γ |) in
                                      let _ :=
                                        M.is_struct_tuple (|
                                          γ,
                                          "move_binary_format::file_format::StructFieldInformation::Native"
                                        |) in
                                      M.alloc (| Value.Integer IntegerKind.Usize 0 |)));
                                  fun γ =>
                                    ltac:(M.monadic
                                      (let γ := M.read (| γ |) in
                                      let γ1_0 :=
                                        M.SubPointer.get_struct_tuple_field (|
                                          γ,
                                          "move_binary_format::file_format::StructFieldInformation::Declared",
                                          0
                                        |) in
                                      let fields := M.alloc (| γ1_0 |) in
                                      M.alloc (|
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [
                                                Ty.path
                                                  "move_binary_format::file_format::FieldDefinition";
                                                Ty.path "alloc::alloc::Global"
                                              ],
                                            "len",
                                            []
                                          |),
                                          [ M.read (| fields |) ]
                                        |)
                                      |)))
                                ]
                              |)
                            |) in
                          M.match_operator (|
                            M.alloc (| Value.Tuple [] |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ :=
                                    M.use
                                      (M.alloc (|
                                        BinOp.ge (|
                                          M.rust_cast
                                            (M.read (|
                                              M.SubPointer.get_struct_record_field (|
                                                M.read (| field_handle |),
                                                "move_binary_format::file_format::FieldHandle",
                                                "field"
                                              |)
                                            |)),
                                          M.read (| fields_count |)
                                        |)
                                      |)) 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"
                                            [
                                              M.call_closure (|
                                                M.get_function (|
                                                  "move_binary_format::errors::bounds_error",
                                                  []
                                                |),
                                                [
                                                  Value.StructTuple
                                                    "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                                                    [];
                                                  Value.StructTuple
                                                    "move_binary_format::IndexKind::MemberCount"
                                                    [];
                                                  M.read (|
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.read (| field_handle |),
                                                      "move_binary_format::file_format::FieldHandle",
                                                      "field"
                                                    |)
                                                  |);
                                                  M.read (| fields_count |)
                                                ]
                                              |)
                                            ]
                                        |)
                                      |)
                                    |)
                                  |)));
                              fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                            ]
                          |)));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_field_handle :
      M.IsAssociatedFunction Self "check_field_handle" check_field_handle.
    
    (*
        fn check_struct_instantiation(
            &self,
            struct_instantiation: &StructDefInstantiation,
        ) -> PartialVMResult<()> {
            check_bounds_impl(self.module.struct_defs(), struct_instantiation.def)?;
            check_bounds_impl(
                self.module.signatures(),
                struct_instantiation.type_parameters,
            )
        }
    *)
    Definition check_struct_instantiation
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self; struct_instantiation ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let struct_instantiation := M.alloc (| struct_instantiation |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::StructDefinition";
                                Ty.path "move_binary_format::file_format::StructDefinitionIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "struct_defs",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| struct_instantiation |),
                                  "move_binary_format::file_format::StructDefInstantiation",
                                  "def"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "move_binary_format::check_bounds::check_bounds_impl",
                      [
                        Ty.path "move_binary_format::file_format::Signature";
                        Ty.path "move_binary_format::file_format::SignatureIndex"
                      ]
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_binary_format::file_format::CompiledModule",
                          "signatures",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_binary_format::check_bounds::BoundsChecker",
                              "module"
                            |)
                          |)
                        ]
                      |);
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| struct_instantiation |),
                          "move_binary_format::file_format::StructDefInstantiation",
                          "type_parameters"
                        |)
                      |)
                    ]
                  |)
                |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_struct_instantiation :
      M.IsAssociatedFunction Self "check_struct_instantiation" check_struct_instantiation.
    
    (*
        fn check_function_instantiation(
            &self,
            function_instantiation: &FunctionInstantiation,
        ) -> PartialVMResult<()> {
            check_bounds_impl(
                self.module.function_handles(),
                function_instantiation.handle,
            )?;
            check_bounds_impl(
                self.module.signatures(),
                function_instantiation.type_parameters,
            )
        }
    *)
    Definition check_function_instantiation
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self; function_instantiation ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let function_instantiation := M.alloc (| function_instantiation |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::FunctionHandle";
                                Ty.path "move_binary_format::file_format::FunctionHandleIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "function_handles",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| function_instantiation |),
                                  "move_binary_format::file_format::FunctionInstantiation",
                                  "handle"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "move_binary_format::check_bounds::check_bounds_impl",
                      [
                        Ty.path "move_binary_format::file_format::Signature";
                        Ty.path "move_binary_format::file_format::SignatureIndex"
                      ]
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_binary_format::file_format::CompiledModule",
                          "signatures",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_binary_format::check_bounds::BoundsChecker",
                              "module"
                            |)
                          |)
                        ]
                      |);
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| function_instantiation |),
                          "move_binary_format::file_format::FunctionInstantiation",
                          "type_parameters"
                        |)
                      |)
                    ]
                  |)
                |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_function_instantiation :
      M.IsAssociatedFunction Self "check_function_instantiation" check_function_instantiation.
    
    (*
        fn check_field_instantiation(
            &self,
            field_instantiation: &FieldInstantiation,
        ) -> PartialVMResult<()> {
            check_bounds_impl(self.module.field_handles(), field_instantiation.handle)?;
            check_bounds_impl(
                self.module.signatures(),
                field_instantiation.type_parameters,
            )
        }
    *)
    Definition check_field_instantiation
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [], [ self; field_instantiation ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let field_instantiation := M.alloc (| field_instantiation |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::FieldHandle";
                                Ty.path "move_binary_format::file_format::FieldHandleIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "field_handles",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| field_instantiation |),
                                  "move_binary_format::file_format::FieldInstantiation",
                                  "handle"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "move_binary_format::check_bounds::check_bounds_impl",
                      [
                        Ty.path "move_binary_format::file_format::Signature";
                        Ty.path "move_binary_format::file_format::SignatureIndex"
                      ]
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_binary_format::file_format::CompiledModule",
                          "signatures",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_binary_format::check_bounds::BoundsChecker",
                              "module"
                            |)
                          |)
                        ]
                      |);
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| field_instantiation |),
                          "move_binary_format::file_format::FieldInstantiation",
                          "type_parameters"
                        |)
                      |)
                    ]
                  |)
                |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_field_instantiation :
      M.IsAssociatedFunction Self "check_field_instantiation" check_field_instantiation.
    
    (*
        fn check_signature(&self, signature: &Signature) -> PartialVMResult<()> {
            for ty in &signature.0 {
                self.check_type(ty)?
            }
            Ok(())
        }
    *)
    Definition check_signature (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; signature ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let signature := M.alloc (| signature |) in
          M.catch_return (|
            ltac:(M.monadic
              (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 "move_binary_format::file_format::SignatureToken";
                                    Ty.path "alloc::alloc::Global"
                                  ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_tuple_field (|
                              M.read (| signature |),
                              "move_binary_format::file_format::Signature",
                              0
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::SignatureToken"
                                            ],
                                          [],
                                          "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 ty := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_type",
                                                      []
                                                    |),
                                                    [ M.read (| self |); M.read (| ty |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_signature :
      M.IsAssociatedFunction Self "check_signature" check_signature.
    
    (*
        fn check_constant(&self, constant: &Constant) -> PartialVMResult<()> {
            self.check_type(&constant.type_)
        }
    *)
    Definition check_constant (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; constant ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let constant := M.alloc (| constant |) in
          M.call_closure (|
            M.get_associated_function (|
              Ty.path "move_binary_format::check_bounds::BoundsChecker",
              "check_type",
              []
            |),
            [
              M.read (| self |);
              M.SubPointer.get_struct_record_field (|
                M.read (| constant |),
                "move_binary_format::file_format::Constant",
                "type_"
              |)
            ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_constant :
      M.IsAssociatedFunction Self "check_constant" check_constant.
    
    (*
        fn check_struct_def(&self, struct_def: &StructDefinition) -> PartialVMResult<()> {
            check_bounds_impl(self.module.struct_handles(), struct_def.struct_handle)?;
            // check signature (type) and type parameter for the field type
            if let StructFieldInformation::Declared(fields) = &struct_def.field_information {
                let type_param_count = self
                    .module
                    .struct_handles()
                    .get(struct_def.struct_handle.into_index())
                    .map_or(0, |sh| sh.type_parameters.len());
                // field signatures are inlined
                for field in fields {
                    check_bounds_impl(self.module.identifiers(), field.name)?;
                    self.check_type(&field.signature.0)?;
                    self.check_type_parameter(&field.signature.0, type_param_count)?;
                }
            }
            Ok(())
        }
    *)
    Definition check_struct_def (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; struct_def ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let struct_def := M.alloc (| struct_def |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::StructHandle";
                                Ty.path "move_binary_format::file_format::StructHandleIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "struct_handles",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| struct_def |),
                                  "move_binary_format::file_format::StructDefinition",
                                  "struct_handle"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.alloc (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| struct_def |),
                                "move_binary_format::file_format::StructDefinition",
                                "field_information"
                              |)
                            |) in
                          let γ := M.read (| γ |) in
                          let γ1_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "move_binary_format::file_format::StructFieldInformation::Declared",
                              0
                            |) in
                          let fields := M.alloc (| γ1_0 |) in
                          let~ type_param_count :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "core::option::Option")
                                    []
                                    [
                                      Ty.apply
                                        (Ty.path "&")
                                        []
                                        [ Ty.path "move_binary_format::file_format::StructHandle" ]
                                    ],
                                  "map_or",
                                  [
                                    Ty.path "usize";
                                    Ty.function
                                      [
                                        Ty.tuple
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              []
                                              [
                                                Ty.path
                                                  "move_binary_format::file_format::StructHandle"
                                              ]
                                          ]
                                      ]
                                      (Ty.path "usize")
                                  ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "slice")
                                        []
                                        [ Ty.path "move_binary_format::file_format::StructHandle" ],
                                      "get",
                                      [ Ty.path "usize" ]
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "move_binary_format::file_format::CompiledModule",
                                          "struct_handles",
                                          []
                                        |),
                                        [
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "move_binary_format::check_bounds::BoundsChecker",
                                              "module"
                                            |)
                                          |)
                                        ]
                                      |);
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "move_binary_format::internals::ModuleIndex",
                                          Ty.path
                                            "move_binary_format::file_format::StructHandleIndex",
                                          [],
                                          "into_index",
                                          []
                                        |),
                                        [
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| struct_def |),
                                              "move_binary_format::file_format::StructDefinition",
                                              "struct_handle"
                                            |)
                                          |)
                                        ]
                                      |)
                                    ]
                                  |);
                                  Value.Integer IntegerKind.Usize 0;
                                  M.closure
                                    (fun γ =>
                                      ltac:(M.monadic
                                        match γ with
                                        | [ α0 ] =>
                                          ltac:(M.monadic
                                            (M.match_operator (|
                                              M.alloc (| α0 |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let sh := M.copy (| γ |) in
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path "alloc::vec::Vec")
                                                          []
                                                          [
                                                            Ty.path
                                                              "move_binary_format::file_format::StructTypeParameter";
                                                            Ty.path "alloc::alloc::Global"
                                                          ],
                                                        "len",
                                                        []
                                                      |),
                                                      [
                                                        M.SubPointer.get_struct_record_field (|
                                                          M.read (| sh |),
                                                          "move_binary_format::file_format::StructHandle",
                                                          "type_parameters"
                                                        |)
                                                      ]
                                                    |)))
                                              ]
                                            |)))
                                        | _ => M.impossible "wrong number of arguments"
                                        end))
                                ]
                              |)
                            |) in
                          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
                                              "move_binary_format::file_format::FieldDefinition";
                                            Ty.path "alloc::alloc::Global"
                                          ]
                                      ],
                                    [],
                                    "into_iter",
                                    []
                                  |),
                                  [ M.read (| fields |) ]
                                |)
                              |),
                              [
                                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
                                                        "move_binary_format::file_format::FieldDefinition"
                                                    ],
                                                  [],
                                                  "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 field := M.copy (| γ0_0 |) in
                                                  let~ _ :=
                                                    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
                                                                  "move_binary_format::errors::PartialVMError"
                                                              ],
                                                            [],
                                                            "branch",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_function (|
                                                                "move_binary_format::check_bounds::check_bounds_impl",
                                                                [
                                                                  Ty.path
                                                                    "move_core_types::identifier::Identifier";
                                                                  Ty.path
                                                                    "move_binary_format::file_format::IdentifierIndex"
                                                                ]
                                                              |),
                                                              [
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "move_binary_format::file_format::CompiledModule",
                                                                    "identifiers",
                                                                    []
                                                                  |),
                                                                  [
                                                                    M.read (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                                        "module"
                                                                      |)
                                                                    |)
                                                                  ]
                                                                |);
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| field |),
                                                                    "move_binary_format::file_format::FieldDefinition",
                                                                    "name"
                                                                  |)
                                                                |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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.tuple [];
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ],
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "core::result::Result")
                                                                            []
                                                                            [
                                                                              Ty.path
                                                                                "core::convert::Infallible";
                                                                              Ty.path
                                                                                "move_binary_format::errors::PartialVMError"
                                                                            ]
                                                                        ],
                                                                        "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))
                                                      ]
                                                    |) in
                                                  let~ _ :=
                                                    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
                                                                  "move_binary_format::errors::PartialVMError"
                                                              ],
                                                            [],
                                                            "branch",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path
                                                                  "move_binary_format::check_bounds::BoundsChecker",
                                                                "check_type",
                                                                []
                                                              |),
                                                              [
                                                                M.read (| self |);
                                                                M.SubPointer.get_struct_tuple_field (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| field |),
                                                                    "move_binary_format::file_format::FieldDefinition",
                                                                    "signature"
                                                                  |),
                                                                  "move_binary_format::file_format::TypeSignature",
                                                                  0
                                                                |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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.tuple [];
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ],
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "core::result::Result")
                                                                            []
                                                                            [
                                                                              Ty.path
                                                                                "core::convert::Infallible";
                                                                              Ty.path
                                                                                "move_binary_format::errors::PartialVMError"
                                                                            ]
                                                                        ],
                                                                        "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))
                                                      ]
                                                    |) in
                                                  let~ _ :=
                                                    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
                                                                  "move_binary_format::errors::PartialVMError"
                                                              ],
                                                            [],
                                                            "branch",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path
                                                                  "move_binary_format::check_bounds::BoundsChecker",
                                                                "check_type_parameter",
                                                                []
                                                              |),
                                                              [
                                                                M.read (| self |);
                                                                M.SubPointer.get_struct_tuple_field (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| field |),
                                                                    "move_binary_format::file_format::FieldDefinition",
                                                                    "signature"
                                                                  |),
                                                                  "move_binary_format::file_format::TypeSignature",
                                                                  0
                                                                |);
                                                                M.read (| type_param_count |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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.tuple [];
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ],
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "core::result::Result")
                                                                            []
                                                                            [
                                                                              Ty.path
                                                                                "core::convert::Infallible";
                                                                              Ty.path
                                                                                "move_binary_format::errors::PartialVMError"
                                                                            ]
                                                                        ],
                                                                        "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))
                                                      ]
                                                    |) in
                                                  M.alloc (| Value.Tuple [] |)))
                                            ]
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                    |)))
                              ]
                            |))));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_struct_def :
      M.IsAssociatedFunction Self "check_struct_def" check_struct_def.
    
    (*
        fn check_function_def(
            &mut self,
            function_def_idx: usize,
            function_def: &FunctionDefinition,
        ) -> PartialVMResult<()> {
            self.context = BoundsCheckingContext::ModuleFunction(FunctionDefinitionIndex(
                function_def_idx as TableIndex,
            ));
            check_bounds_impl(self.module.function_handles(), function_def.function)?;
            for ty in &function_def.acquires_global_resources {
                check_bounds_impl(self.module.struct_defs(), *ty)?;
            }
    
            let code_unit = match &function_def.code {
                Some(code) => code,
                None => return Ok(()),
            };
    
            if function_def.function.into_index() >= self.module.function_handles().len() {
                return Err(verification_error(
                    StatusCode::INDEX_OUT_OF_BOUNDS,
                    IndexKind::FunctionDefinition,
                    function_def_idx as TableIndex,
                ));
            }
            let function_handle = &self.module.function_handles()[function_def.function.into_index()];
            if function_handle.parameters.into_index() >= self.module.signatures().len() {
                return Err(verification_error(
                    StatusCode::INDEX_OUT_OF_BOUNDS,
                    IndexKind::FunctionDefinition,
                    function_def_idx as TableIndex,
                ));
            }
            let parameters = &self.module.signatures()[function_handle.parameters.into_index()];
    
            self.check_code(
                code_unit,
                &function_handle.type_parameters,
                parameters,
                function_def_idx,
            )
        }
    *)
    Definition check_function_def (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; function_def_idx; function_def ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let function_def_idx := M.alloc (| function_def_idx |) in
          let function_def := M.alloc (| function_def |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.write (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "move_binary_format::check_bounds::BoundsChecker",
                      "context"
                    |),
                    Value.StructTuple
                      "move_binary_format::check_bounds::BoundsCheckingContext::ModuleFunction"
                      [
                        Value.StructTuple
                          "move_binary_format::file_format::FunctionDefinitionIndex"
                          [ M.rust_cast (M.read (| function_def_idx |)) ]
                      ]
                  |) in
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::FunctionHandle";
                                Ty.path "move_binary_format::file_format::FunctionHandleIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "function_handles",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| function_def |),
                                  "move_binary_format::file_format::FunctionDefinition",
                                  "function"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) 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
                                      "move_binary_format::file_format::StructDefinitionIndex";
                                    Ty.path "alloc::alloc::Global"
                                  ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| function_def |),
                              "move_binary_format::file_format::FunctionDefinition",
                              "acquires_global_resources"
                            |)
                          ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::StructDefinitionIndex"
                                            ],
                                          [],
                                          "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 ty := M.copy (| γ0_0 |) in
                                          let~ _ :=
                                            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
                                                          "move_binary_format::errors::PartialVMError"
                                                      ],
                                                    [],
                                                    "branch",
                                                    []
                                                  |),
                                                  [
                                                    M.call_closure (|
                                                      M.get_function (|
                                                        "move_binary_format::check_bounds::check_bounds_impl",
                                                        [
                                                          Ty.path
                                                            "move_binary_format::file_format::StructDefinition";
                                                          Ty.path
                                                            "move_binary_format::file_format::StructDefinitionIndex"
                                                        ]
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "move_binary_format::file_format::CompiledModule",
                                                            "struct_defs",
                                                            []
                                                          |),
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "move_binary_format::check_bounds::BoundsChecker",
                                                                "module"
                                                              |)
                                                            |)
                                                          ]
                                                        |);
                                                        M.read (| M.read (| ty |) |)
                                                      ]
                                                    |)
                                                  ]
                                                |)
                                              |),
                                              [
                                                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.tuple [];
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ],
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "core::result::Result")
                                                                    []
                                                                    [
                                                                      Ty.path
                                                                        "core::convert::Infallible";
                                                                      Ty.path
                                                                        "move_binary_format::errors::PartialVMError"
                                                                    ]
                                                                ],
                                                                "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))
                                              ]
                                            |) in
                                          M.alloc (| Value.Tuple [] |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                let~ code_unit :=
                  M.copy (|
                    M.match_operator (|
                      M.alloc (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| function_def |),
                          "move_binary_format::file_format::FunctionDefinition",
                          "code"
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ := M.read (| γ |) in
                            let γ1_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::option::Option::Some",
                                0
                              |) in
                            let code := M.alloc (| γ1_0 |) in
                            code));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ := M.read (| γ |) in
                            let _ := M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ]
                                  |)
                                |)
                              |)
                            |)))
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.use
                              (M.alloc (|
                                BinOp.ge (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "move_binary_format::internals::ModuleIndex",
                                      Ty.path
                                        "move_binary_format::file_format::FunctionHandleIndex",
                                      [],
                                      "into_index",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| function_def |),
                                          "move_binary_format::file_format::FunctionDefinition",
                                          "function"
                                        |)
                                      |)
                                    ]
                                  |),
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "slice")
                                        []
                                        [ Ty.path "move_binary_format::file_format::FunctionHandle"
                                        ],
                                      "len",
                                      []
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "move_binary_format::file_format::CompiledModule",
                                          "function_handles",
                                          []
                                        |),
                                        [
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "move_binary_format::check_bounds::BoundsChecker",
                                              "module"
                                            |)
                                          |)
                                        ]
                                      |)
                                    ]
                                  |)
                                |)
                              |)) 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"
                                    [
                                      M.call_closure (|
                                        M.get_function (|
                                          "move_binary_format::errors::verification_error",
                                          []
                                        |),
                                        [
                                          Value.StructTuple
                                            "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                                            [];
                                          Value.StructTuple
                                            "move_binary_format::IndexKind::FunctionDefinition"
                                            [];
                                          M.rust_cast (M.read (| function_def_idx |))
                                        ]
                                      |)
                                    ]
                                |)
                              |)
                            |)
                          |)));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                let~ function_handle :=
                  M.alloc (|
                    M.SubPointer.get_array_field (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_binary_format::file_format::CompiledModule",
                          "function_handles",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_binary_format::check_bounds::BoundsChecker",
                              "module"
                            |)
                          |)
                        ]
                      |),
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "move_binary_format::internals::ModuleIndex",
                            Ty.path "move_binary_format::file_format::FunctionHandleIndex",
                            [],
                            "into_index",
                            []
                          |),
                          [
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| function_def |),
                                "move_binary_format::file_format::FunctionDefinition",
                                "function"
                              |)
                            |)
                          ]
                        |)
                      |)
                    |)
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.use
                              (M.alloc (|
                                BinOp.ge (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "move_binary_format::internals::ModuleIndex",
                                      Ty.path "move_binary_format::file_format::SignatureIndex",
                                      [],
                                      "into_index",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| function_handle |),
                                          "move_binary_format::file_format::FunctionHandle",
                                          "parameters"
                                        |)
                                      |)
                                    ]
                                  |),
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "slice")
                                        []
                                        [ Ty.path "move_binary_format::file_format::Signature" ],
                                      "len",
                                      []
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "move_binary_format::file_format::CompiledModule",
                                          "signatures",
                                          []
                                        |),
                                        [
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "move_binary_format::check_bounds::BoundsChecker",
                                              "module"
                                            |)
                                          |)
                                        ]
                                      |)
                                    ]
                                  |)
                                |)
                              |)) 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"
                                    [
                                      M.call_closure (|
                                        M.get_function (|
                                          "move_binary_format::errors::verification_error",
                                          []
                                        |),
                                        [
                                          Value.StructTuple
                                            "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                                            [];
                                          Value.StructTuple
                                            "move_binary_format::IndexKind::FunctionDefinition"
                                            [];
                                          M.rust_cast (M.read (| function_def_idx |))
                                        ]
                                      |)
                                    ]
                                |)
                              |)
                            |)
                          |)));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                let~ parameters :=
                  M.alloc (|
                    M.SubPointer.get_array_field (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_binary_format::file_format::CompiledModule",
                          "signatures",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "move_binary_format::check_bounds::BoundsChecker",
                              "module"
                            |)
                          |)
                        ]
                      |),
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "move_binary_format::internals::ModuleIndex",
                            Ty.path "move_binary_format::file_format::SignatureIndex",
                            [],
                            "into_index",
                            []
                          |),
                          [
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| function_handle |),
                                "move_binary_format::file_format::FunctionHandle",
                                "parameters"
                              |)
                            |)
                          ]
                        |)
                      |)
                    |)
                  |) in
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "move_binary_format::check_bounds::BoundsChecker",
                      "check_code",
                      []
                    |),
                    [
                      M.read (| self |);
                      M.read (| code_unit |);
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::deref::Deref",
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            []
                            [
                              Ty.path "move_binary_format::file_format::AbilitySet";
                              Ty.path "alloc::alloc::Global"
                            ],
                          [],
                          "deref",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| function_handle |),
                            "move_binary_format::file_format::FunctionHandle",
                            "type_parameters"
                          |)
                        ]
                      |);
                      M.read (| parameters |);
                      M.read (| function_def_idx |)
                    ]
                  |)
                |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_function_def :
      M.IsAssociatedFunction Self "check_function_def" check_function_def.
    
    (*
        fn check_code(
            &self,
            code_unit: &CodeUnit,
            type_parameters: &[AbilitySet],
            parameters: &Signature,
            index: usize,
        ) -> PartialVMResult<()> {
            check_bounds_impl(self.module.signatures(), code_unit.locals)?;
    
            let locals = self.get_locals(code_unit)?;
            // Use saturating add for stability
            let locals_count = locals.len().saturating_add(parameters.len());
    
            if locals_count > LocalIndex::MAX as usize {
                return Err(verification_error(
                    StatusCode::TOO_MANY_LOCALS,
                    IndexKind::FunctionDefinition,
                    index as TableIndex,
                ));
            }
    
            // if there are locals check that the type parameters in local signature are in bounds.
            let type_param_count = type_parameters.len();
            for local in locals {
                self.check_type_parameter(local, type_param_count)?
            }
    
            // check bytecodes
            let code_len = code_unit.code.len();
            for (bytecode_offset, bytecode) in code_unit.code.iter().enumerate() {
                use self::Bytecode::*;
    
                match bytecode {
                    LdConst(idx) => self.check_code_unit_bounds_impl(
                        self.module.constant_pool(),
                        *idx,
                        bytecode_offset,
                    )?,
                    MutBorrowField(idx) | ImmBorrowField(idx) => self.check_code_unit_bounds_impl(
                        self.module.field_handles(),
                        *idx,
                        bytecode_offset,
                    )?,
                    MutBorrowFieldGeneric(idx) | ImmBorrowFieldGeneric(idx) => {
                        self.check_code_unit_bounds_impl(
                            self.module.field_instantiations(),
                            *idx,
                            bytecode_offset,
                        )?;
                        // check type parameters in borrow are bound to the function type parameters
                        if let Some(field_inst) =
                            self.module.field_instantiations().get(idx.into_index())
                        {
                            if let Some(sig) = self
                                .module
                                .signatures()
                                .get(field_inst.type_parameters.into_index())
                            {
                                for ty in &sig.0 {
                                    self.check_type_parameter(ty, type_param_count)?
                                }
                            }
                        }
                    }
                    Call(idx) => self.check_code_unit_bounds_impl(
                        self.module.function_handles(),
                        *idx,
                        bytecode_offset,
                    )?,
                    CallGeneric(idx) => {
                        self.check_code_unit_bounds_impl(
                            self.module.function_instantiations(),
                            *idx,
                            bytecode_offset,
                        )?;
                        // check type parameters in call are bound to the function type parameters
                        if let Some(func_inst) =
                            self.module.function_instantiations().get(idx.into_index())
                        {
                            if let Some(sig) = self
                                .module
                                .signatures()
                                .get(func_inst.type_parameters.into_index())
                            {
                                for ty in &sig.0 {
                                    self.check_type_parameter(ty, type_param_count)?
                                }
                            }
                        }
                    }
                    Pack(idx)
                    | Unpack(idx)
                    | ExistsDeprecated(idx)
                    | ImmBorrowGlobalDeprecated(idx)
                    | MutBorrowGlobalDeprecated(idx)
                    | MoveFromDeprecated(idx)
                    | MoveToDeprecated(idx) => self.check_code_unit_bounds_impl(
                        self.module.struct_defs(),
                        *idx,
                        bytecode_offset,
                    )?,
                    PackGeneric(idx)
                    | UnpackGeneric(idx)
                    | ExistsGenericDeprecated(idx)
                    | ImmBorrowGlobalGenericDeprecated(idx)
                    | MutBorrowGlobalGenericDeprecated(idx)
                    | MoveFromGenericDeprecated(idx)
                    | MoveToGenericDeprecated(idx) => {
                        self.check_code_unit_bounds_impl(
                            self.module.struct_instantiations(),
                            *idx,
                            bytecode_offset,
                        )?;
                        // check type parameters in type operations are bound to the function type parameters
                        if let Some(struct_inst) =
                            self.module.struct_instantiations().get(idx.into_index())
                        {
                            if let Some(sig) = self
                                .module
                                .signatures()
                                .get(struct_inst.type_parameters.into_index())
                            {
                                for ty in &sig.0 {
                                    self.check_type_parameter(ty, type_param_count)?
                                }
                            }
                        }
                    }
                    // Instructions that refer to this code block.
                    BrTrue(offset) | BrFalse(offset) | Branch(offset) => {
                        let offset = *offset as usize;
                        if offset >= code_len {
                            return Err(self.offset_out_of_bounds(
                                StatusCode::INDEX_OUT_OF_BOUNDS,
                                IndexKind::CodeDefinition,
                                offset,
                                code_len,
                                bytecode_offset as CodeOffset,
                            ));
                        }
                    }
                    // Instructions that refer to the locals.
                    CopyLoc(idx) | MoveLoc(idx) | StLoc(idx) | MutBorrowLoc(idx)
                    | ImmBorrowLoc(idx) => {
                        let idx = *idx as usize;
                        if idx >= locals_count {
                            return Err(self.offset_out_of_bounds(
                                StatusCode::INDEX_OUT_OF_BOUNDS,
                                IndexKind::LocalPool,
                                idx,
                                locals_count,
                                bytecode_offset as CodeOffset,
                            ));
                        }
                    }
    
                    // Instructions that refer to a signature
                    VecPack(idx, _)
                    | VecLen(idx)
                    | VecImmBorrow(idx)
                    | VecMutBorrow(idx)
                    | VecPushBack(idx)
                    | VecPopBack(idx)
                    | VecUnpack(idx, _)
                    | VecSwap(idx) => {
                        self.check_code_unit_bounds_impl(
                            self.module.signatures(),
                            *idx,
                            bytecode_offset,
                        )?;
                        if let Some(sig) = self.module.signatures().get(idx.into_index()) {
                            for ty in &sig.0 {
                                self.check_type_parameter(ty, type_param_count)?;
                            }
                        }
                    }
    
                    // List out the other options explicitly so there's a compile error if a new
                    // bytecode gets added.
                    FreezeRef | Pop | Ret | LdU8(_) | LdU16(_) | LdU32(_) | LdU64(_) | LdU256(_)
                    | LdU128(_) | CastU8 | CastU16 | CastU32 | CastU64 | CastU128 | CastU256
                    | LdTrue | LdFalse | ReadRef | WriteRef | Add | Sub | Mul | Mod | Div | BitOr
                    | BitAnd | Xor | Shl | Shr | Or | And | Not | Eq | Neq | Lt | Gt | Le | Ge
                    | Abort | Nop => (),
                }
            }
            Ok(())
        }
    *)
    Definition check_code (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; code_unit; type_parameters; parameters; index ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let code_unit := M.alloc (| code_unit |) in
          let type_parameters := M.alloc (| type_parameters |) in
          let parameters := M.alloc (| parameters |) in
          let index := M.alloc (| index |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  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 "move_binary_format::errors::PartialVMError" ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (|
                              "move_binary_format::check_bounds::check_bounds_impl",
                              [
                                Ty.path "move_binary_format::file_format::Signature";
                                Ty.path "move_binary_format::file_format::SignatureIndex"
                              ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "move_binary_format::file_format::CompiledModule",
                                  "signatures",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "move_binary_format::check_bounds::BoundsChecker",
                                      "module"
                                    |)
                                  |)
                                ]
                              |);
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| code_unit |),
                                  "move_binary_format::file_format::CodeUnit",
                                  "locals"
                                |)
                              |)
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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.tuple [];
                                          Ty.path "move_binary_format::errors::PartialVMError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ]
                                      ],
                                      "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))
                    ]
                  |) in
                let~ locals :=
                  M.copy (|
                    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.apply
                                  (Ty.path "&")
                                  []
                                  [
                                    Ty.apply
                                      (Ty.path "slice")
                                      []
                                      [ Ty.path "move_binary_format::file_format::SignatureToken" ]
                                  ];
                                Ty.path "move_binary_format::errors::PartialVMError"
                              ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::check_bounds::BoundsChecker",
                                "get_locals",
                                []
                              |),
                              [ M.read (| self |); M.read (| code_unit |) ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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.tuple [];
                                            Ty.path "move_binary_format::errors::PartialVMError"
                                          ],
                                        [
                                          Ty.apply
                                            (Ty.path "core::result::Result")
                                            []
                                            [
                                              Ty.path "core::convert::Infallible";
                                              Ty.path "move_binary_format::errors::PartialVMError"
                                            ]
                                        ],
                                        "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))
                      ]
                    |)
                  |) in
                let~ locals_count :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (| Ty.path "usize", "saturating_add", [] |),
                      [
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              []
                              [ Ty.path "move_binary_format::file_format::SignatureToken" ],
                            "len",
                            []
                          |),
                          [ M.read (| locals |) ]
                        |);
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "move_binary_format::file_format::Signature",
                            "len",
                            []
                          |),
                          [ M.read (| parameters |) ]
                        |)
                      ]
                    |)
                  |) in
                let~ _ :=
                  M.match_operator (|
                    M.alloc (| Value.Tuple [] |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ :=
                            M.use
                              (M.alloc (|
                                BinOp.gt (|
                                  M.read (| locals_count |),
                                  M.rust_cast (M.read (| M.get_constant (| "core::num::MAX" |) |))
                                |)
                              |)) 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"
                                    [
                                      M.call_closure (|
                                        M.get_function (|
                                          "move_binary_format::errors::verification_error",
                                          []
                                        |),
                                        [
                                          Value.StructTuple
                                            "move_core_types::vm_status::StatusCode::TOO_MANY_LOCALS"
                                            [];
                                          Value.StructTuple
                                            "move_binary_format::IndexKind::FunctionDefinition"
                                            [];
                                          M.rust_cast (M.read (| index |))
                                        ]
                                      |)
                                    ]
                                |)
                              |)
                            |)
                          |)));
                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                    ]
                  |) in
                let~ type_param_count :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "slice")
                          []
                          [ Ty.path "move_binary_format::file_format::AbilitySet" ],
                        "len",
                        []
                      |),
                      [ M.read (| type_parameters |) ]
                    |)
                  |) 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 "slice")
                                  []
                                  [ Ty.path "move_binary_format::file_format::SignatureToken" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [ M.read (| locals |) ]
                        |)
                      |),
                      [
                        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
                                                "move_binary_format::file_format::SignatureToken"
                                            ],
                                          [],
                                          "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 local := M.copy (| γ0_0 |) in
                                          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
                                                        "move_binary_format::errors::PartialVMError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                      "check_type_parameter",
                                                      []
                                                    |),
                                                    [
                                                      M.read (| self |);
                                                      M.read (| local |);
                                                      M.read (| type_param_count |)
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              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.tuple [];
                                                                  Ty.path
                                                                    "move_binary_format::errors::PartialVMError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  []
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "move_binary_format::errors::PartialVMError"
                                                                  ]
                                                              ],
                                                              "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))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                let~ code_len :=
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::vec::Vec")
                          []
                          [
                            Ty.path "move_binary_format::file_format::Bytecode";
                            Ty.path "alloc::alloc::Global"
                          ],
                        "len",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| code_unit |),
                          "move_binary_format::file_format::CodeUnit",
                          "code"
                        |)
                      ]
                    |)
                  |) 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::enumerate::Enumerate")
                              []
                              [
                                Ty.apply
                                  (Ty.path "core::slice::iter::Iter")
                                  []
                                  [ Ty.path "move_binary_format::file_format::Bytecode" ]
                              ],
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::iterator::Iterator",
                                Ty.apply
                                  (Ty.path "core::slice::iter::Iter")
                                  []
                                  [ Ty.path "move_binary_format::file_format::Bytecode" ],
                                [],
                                "enumerate",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "slice")
                                      []
                                      [ Ty.path "move_binary_format::file_format::Bytecode" ],
                                    "iter",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::Deref",
                                        Ty.apply
                                          (Ty.path "alloc::vec::Vec")
                                          []
                                          [
                                            Ty.path "move_binary_format::file_format::Bytecode";
                                            Ty.path "alloc::alloc::Global"
                                          ],
                                        [],
                                        "deref",
                                        []
                                      |),
                                      [
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| code_unit |),
                                          "move_binary_format::file_format::CodeUnit",
                                          "code"
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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::enumerate::Enumerate")
                                            []
                                            [
                                              Ty.apply
                                                (Ty.path "core::slice::iter::Iter")
                                                []
                                                [
                                                  Ty.path
                                                    "move_binary_format::file_format::Bytecode"
                                                ]
                                            ],
                                          [],
                                          "next",
                                          []
                                        |),
                                        [ iter ]
                                      |)
                                    |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let _ :=
                                            M.is_struct_tuple (|
                                              γ,
                                              "core::option::Option::None"
                                            |) in
                                          M.alloc (|
                                            M.never_to_any (| M.read (| M.break (||) |) |)
                                          |)));
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let γ0_0 :=
                                            M.SubPointer.get_struct_tuple_field (|
                                              γ,
                                              "core::option::Option::Some",
                                              0
                                            |) in
                                          let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                          let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                          let bytecode_offset := M.copy (| γ1_0 |) in
                                          let bytecode := M.copy (| γ1_1 |) in
                                          M.match_operator (|
                                            bytecode,
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ := M.read (| γ |) in
                                                  let γ1_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "move_binary_format::file_format::Bytecode::LdConst",
                                                      0
                                                    |) in
                                                  let idx := M.alloc (| γ1_0 |) in
                                                  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
                                                                "move_binary_format::errors::PartialVMError"
                                                            ],
                                                          [],
                                                          "branch",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "move_binary_format::check_bounds::BoundsChecker",
                                                              "check_code_unit_bounds_impl",
                                                              [
                                                                Ty.path
                                                                  "move_binary_format::file_format::Constant";
                                                                Ty.path
                                                                  "move_binary_format::file_format::ConstantPoolIndex"
                                                              ]
                                                            |),
                                                            [
                                                              M.read (| self |);
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "move_binary_format::file_format::CompiledModule",
                                                                  "constant_pool",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "move_binary_format::check_bounds::BoundsChecker",
                                                                      "module"
                                                                    |)
                                                                  |)
                                                                ]
                                                              |);
                                                              M.read (| M.read (| idx |) |);
                                                              M.read (| bytecode_offset |)
                                                            ]
                                                          |)
                                                        ]
                                                      |)
                                                    |),
                                                    [
                                                      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.tuple [];
                                                                          Ty.path
                                                                            "move_binary_format::errors::PartialVMError"
                                                                        ],
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "core::result::Result")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "core::convert::Infallible";
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ]
                                                                      ],
                                                                      "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
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MutBorrowField",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::ImmBorrowField",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ idx ] =>
                                                            ltac:(M.monadic
                                                              (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
                                                                            "move_binary_format::errors::PartialVMError"
                                                                        ],
                                                                      [],
                                                                      "branch",
                                                                      []
                                                                    |),
                                                                    [
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.path
                                                                            "move_binary_format::check_bounds::BoundsChecker",
                                                                          "check_code_unit_bounds_impl",
                                                                          [
                                                                            Ty.path
                                                                              "move_binary_format::file_format::FieldHandle";
                                                                            Ty.path
                                                                              "move_binary_format::file_format::FieldHandleIndex"
                                                                          ]
                                                                        |),
                                                                        [
                                                                          M.read (| self |);
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.path
                                                                                "move_binary_format::file_format::CompiledModule",
                                                                              "field_handles",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                M.SubPointer.get_struct_record_field (|
                                                                                  M.read (| self |),
                                                                                  "move_binary_format::check_bounds::BoundsChecker",
                                                                                  "module"
                                                                                |)
                                                                              |)
                                                                            ]
                                                                          |);
                                                                          M.read (|
                                                                            M.read (| idx |)
                                                                          |);
                                                                          M.read (|
                                                                            bytecode_offset
                                                                          |)
                                                                        ]
                                                                      |)
                                                                    ]
                                                                  |)
                                                                |),
                                                                [
                                                                  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.tuple [];
                                                                                      Ty.path
                                                                                        "move_binary_format::errors::PartialVMError"
                                                                                    ],
                                                                                  [
                                                                                    Ty.apply
                                                                                      (Ty.path
                                                                                        "core::result::Result")
                                                                                      []
                                                                                      [
                                                                                        Ty.path
                                                                                          "core::convert::Infallible";
                                                                                        Ty.path
                                                                                          "move_binary_format::errors::PartialVMError"
                                                                                      ]
                                                                                  ],
                                                                                  "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))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MutBorrowFieldGeneric",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::ImmBorrowFieldGeneric",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ idx ] =>
                                                            ltac:(M.monadic
                                                              (let~ _ :=
                                                                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
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ],
                                                                        [],
                                                                        "branch",
                                                                        []
                                                                      |),
                                                                      [
                                                                        M.call_closure (|
                                                                          M.get_associated_function (|
                                                                            Ty.path
                                                                              "move_binary_format::check_bounds::BoundsChecker",
                                                                            "check_code_unit_bounds_impl",
                                                                            [
                                                                              Ty.path
                                                                                "move_binary_format::file_format::FieldInstantiation";
                                                                              Ty.path
                                                                                "move_binary_format::file_format::FieldInstantiationIndex"
                                                                            ]
                                                                          |),
                                                                          [
                                                                            M.read (| self |);
                                                                            M.call_closure (|
                                                                              M.get_associated_function (|
                                                                                Ty.path
                                                                                  "move_binary_format::file_format::CompiledModule",
                                                                                "field_instantiations",
                                                                                []
                                                                              |),
                                                                              [
                                                                                M.read (|
                                                                                  M.SubPointer.get_struct_record_field (|
                                                                                    M.read (|
                                                                                      self
                                                                                    |),
                                                                                    "move_binary_format::check_bounds::BoundsChecker",
                                                                                    "module"
                                                                                  |)
                                                                                |)
                                                                              ]
                                                                            |);
                                                                            M.read (|
                                                                              M.read (| idx |)
                                                                            |);
                                                                            M.read (|
                                                                              bytecode_offset
                                                                            |)
                                                                          ]
                                                                        |)
                                                                      ]
                                                                    |)
                                                                  |),
                                                                  [
                                                                    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.tuple [];
                                                                                        Ty.path
                                                                                          "move_binary_format::errors::PartialVMError"
                                                                                      ],
                                                                                    [
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "core::result::Result")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "core::convert::Infallible";
                                                                                          Ty.path
                                                                                            "move_binary_format::errors::PartialVMError"
                                                                                        ]
                                                                                    ],
                                                                                    "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))
                                                                  ]
                                                                |) in
                                                              M.match_operator (|
                                                                M.alloc (| Value.Tuple [] |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let γ :=
                                                                        M.alloc (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.apply
                                                                                (Ty.path "slice")
                                                                                []
                                                                                [
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::FieldInstantiation"
                                                                                ],
                                                                              "get",
                                                                              [ Ty.path "usize" ]
                                                                            |),
                                                                            [
                                                                              M.call_closure (|
                                                                                M.get_associated_function (|
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::CompiledModule",
                                                                                  "field_instantiations",
                                                                                  []
                                                                                |),
                                                                                [
                                                                                  M.read (|
                                                                                    M.SubPointer.get_struct_record_field (|
                                                                                      M.read (|
                                                                                        self
                                                                                      |),
                                                                                      "move_binary_format::check_bounds::BoundsChecker",
                                                                                      "module"
                                                                                    |)
                                                                                  |)
                                                                                ]
                                                                              |);
                                                                              M.call_closure (|
                                                                                M.get_trait_method (|
                                                                                  "move_binary_format::internals::ModuleIndex",
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::FieldInstantiationIndex",
                                                                                  [],
                                                                                  "into_index",
                                                                                  []
                                                                                |),
                                                                                [
                                                                                  M.read (|
                                                                                    M.read (| idx |)
                                                                                  |)
                                                                                ]
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        |) in
                                                                      let γ0_0 :=
                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                          γ,
                                                                          "core::option::Option::Some",
                                                                          0
                                                                        |) in
                                                                      let field_inst :=
                                                                        M.copy (| γ0_0 |) in
                                                                      M.match_operator (|
                                                                        M.alloc (|
                                                                          Value.Tuple []
                                                                        |),
                                                                        [
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (let γ :=
                                                                                M.alloc (|
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "slice")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "move_binary_format::file_format::Signature"
                                                                                        ],
                                                                                      "get",
                                                                                      [
                                                                                        Ty.path
                                                                                          "usize"
                                                                                      ]
                                                                                    |),
                                                                                    [
                                                                                      M.call_closure (|
                                                                                        M.get_associated_function (|
                                                                                          Ty.path
                                                                                            "move_binary_format::file_format::CompiledModule",
                                                                                          "signatures",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          M.read (|
                                                                                            M.SubPointer.get_struct_record_field (|
                                                                                              M.read (|
                                                                                                self
                                                                                              |),
                                                                                              "move_binary_format::check_bounds::BoundsChecker",
                                                                                              "module"
                                                                                            |)
                                                                                          |)
                                                                                        ]
                                                                                      |);
                                                                                      M.call_closure (|
                                                                                        M.get_trait_method (|
                                                                                          "move_binary_format::internals::ModuleIndex",
                                                                                          Ty.path
                                                                                            "move_binary_format::file_format::SignatureIndex",
                                                                                          [],
                                                                                          "into_index",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          M.read (|
                                                                                            M.SubPointer.get_struct_record_field (|
                                                                                              M.read (|
                                                                                                field_inst
                                                                                              |),
                                                                                              "move_binary_format::file_format::FieldInstantiation",
                                                                                              "type_parameters"
                                                                                            |)
                                                                                          |)
                                                                                        ]
                                                                                      |)
                                                                                    ]
                                                                                  |)
                                                                                |) in
                                                                              let γ0_0 :=
                                                                                M.SubPointer.get_struct_tuple_field (|
                                                                                  γ,
                                                                                  "core::option::Option::Some",
                                                                                  0
                                                                                |) in
                                                                              let sig :=
                                                                                M.copy (| γ0_0 |) in
                                                                              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
                                                                                                  "move_binary_format::file_format::SignatureToken";
                                                                                                Ty.path
                                                                                                  "alloc::alloc::Global"
                                                                                              ]
                                                                                          ],
                                                                                        [],
                                                                                        "into_iter",
                                                                                        []
                                                                                      |),
                                                                                      [
                                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                                          M.read (|
                                                                                            sig
                                                                                          |),
                                                                                          "move_binary_format::file_format::Signature",
                                                                                          0
                                                                                        |)
                                                                                      ]
                                                                                    |)
                                                                                  |),
                                                                                  [
                                                                                    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
                                                                                                            "move_binary_format::file_format::SignatureToken"
                                                                                                        ],
                                                                                                      [],
                                                                                                      "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
                                                                                                            ty :=
                                                                                                        M.copy (|
                                                                                                          γ0_0
                                                                                                        |) in
                                                                                                      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
                                                                                                                    "move_binary_format::errors::PartialVMError"
                                                                                                                ],
                                                                                                              [],
                                                                                                              "branch",
                                                                                                              []
                                                                                                            |),
                                                                                                            [
                                                                                                              M.call_closure (|
                                                                                                                M.get_associated_function (|
                                                                                                                  Ty.path
                                                                                                                    "move_binary_format::check_bounds::BoundsChecker",
                                                                                                                  "check_type_parameter",
                                                                                                                  []
                                                                                                                |),
                                                                                                                [
                                                                                                                  M.read (|
                                                                                                                    self
                                                                                                                  |);
                                                                                                                  M.read (|
                                                                                                                    ty
                                                                                                                  |);
                                                                                                                  M.read (|
                                                                                                                    type_param_count
                                                                                                                  |)
                                                                                                                ]
                                                                                                              |)
                                                                                                            ]
                                                                                                          |)
                                                                                                        |),
                                                                                                        [
                                                                                                          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.tuple
                                                                                                                                [];
                                                                                                                              Ty.path
                                                                                                                                "move_binary_format::errors::PartialVMError"
                                                                                                                            ],
                                                                                                                          [
                                                                                                                            Ty.apply
                                                                                                                              (Ty.path
                                                                                                                                "core::result::Result")
                                                                                                                              []
                                                                                                                              [
                                                                                                                                Ty.path
                                                                                                                                  "core::convert::Infallible";
                                                                                                                                Ty.path
                                                                                                                                  "move_binary_format::errors::PartialVMError"
                                                                                                                              ]
                                                                                                                          ],
                                                                                                                          "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))
                                                                                                        ]
                                                                                                      |)))
                                                                                                ]
                                                                                              |) in
                                                                                            M.alloc (|
                                                                                              Value.Tuple
                                                                                                []
                                                                                            |)))
                                                                                        |)))
                                                                                  ]
                                                                                |))));
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (M.alloc (|
                                                                                Value.Tuple []
                                                                              |)))
                                                                        ]
                                                                      |)));
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (M.alloc (|
                                                                        Value.Tuple []
                                                                      |)))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ := M.read (| γ |) in
                                                  let γ1_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "move_binary_format::file_format::Bytecode::Call",
                                                      0
                                                    |) in
                                                  let idx := M.alloc (| γ1_0 |) in
                                                  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
                                                                "move_binary_format::errors::PartialVMError"
                                                            ],
                                                          [],
                                                          "branch",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "move_binary_format::check_bounds::BoundsChecker",
                                                              "check_code_unit_bounds_impl",
                                                              [
                                                                Ty.path
                                                                  "move_binary_format::file_format::FunctionHandle";
                                                                Ty.path
                                                                  "move_binary_format::file_format::FunctionHandleIndex"
                                                              ]
                                                            |),
                                                            [
                                                              M.read (| self |);
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "move_binary_format::file_format::CompiledModule",
                                                                  "function_handles",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "move_binary_format::check_bounds::BoundsChecker",
                                                                      "module"
                                                                    |)
                                                                  |)
                                                                ]
                                                              |);
                                                              M.read (| M.read (| idx |) |);
                                                              M.read (| bytecode_offset |)
                                                            ]
                                                          |)
                                                        ]
                                                      |)
                                                    |),
                                                    [
                                                      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.tuple [];
                                                                          Ty.path
                                                                            "move_binary_format::errors::PartialVMError"
                                                                        ],
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "core::result::Result")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "core::convert::Infallible";
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ]
                                                                      ],
                                                                      "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 γ := M.read (| γ |) in
                                                  let γ1_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "move_binary_format::file_format::Bytecode::CallGeneric",
                                                      0
                                                    |) in
                                                  let idx := M.alloc (| γ1_0 |) in
                                                  let~ _ :=
                                                    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
                                                                  "move_binary_format::errors::PartialVMError"
                                                              ],
                                                            [],
                                                            "branch",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path
                                                                  "move_binary_format::check_bounds::BoundsChecker",
                                                                "check_code_unit_bounds_impl",
                                                                [
                                                                  Ty.path
                                                                    "move_binary_format::file_format::FunctionInstantiation";
                                                                  Ty.path
                                                                    "move_binary_format::file_format::FunctionInstantiationIndex"
                                                                ]
                                                              |),
                                                              [
                                                                M.read (| self |);
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "move_binary_format::file_format::CompiledModule",
                                                                    "function_instantiations",
                                                                    []
                                                                  |),
                                                                  [
                                                                    M.read (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                                        "module"
                                                                      |)
                                                                    |)
                                                                  ]
                                                                |);
                                                                M.read (| M.read (| idx |) |);
                                                                M.read (| bytecode_offset |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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.tuple [];
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ],
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "core::result::Result")
                                                                            []
                                                                            [
                                                                              Ty.path
                                                                                "core::convert::Infallible";
                                                                              Ty.path
                                                                                "move_binary_format::errors::PartialVMError"
                                                                            ]
                                                                        ],
                                                                        "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))
                                                      ]
                                                    |) in
                                                  M.match_operator (|
                                                    M.alloc (| Value.Tuple [] |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.apply
                                                                    (Ty.path "slice")
                                                                    []
                                                                    [
                                                                      Ty.path
                                                                        "move_binary_format::file_format::FunctionInstantiation"
                                                                    ],
                                                                  "get",
                                                                  [ Ty.path "usize" ]
                                                                |),
                                                                [
                                                                  M.call_closure (|
                                                                    M.get_associated_function (|
                                                                      Ty.path
                                                                        "move_binary_format::file_format::CompiledModule",
                                                                      "function_instantiations",
                                                                      []
                                                                    |),
                                                                    [
                                                                      M.read (|
                                                                        M.SubPointer.get_struct_record_field (|
                                                                          M.read (| self |),
                                                                          "move_binary_format::check_bounds::BoundsChecker",
                                                                          "module"
                                                                        |)
                                                                      |)
                                                                    ]
                                                                  |);
                                                                  M.call_closure (|
                                                                    M.get_trait_method (|
                                                                      "move_binary_format::internals::ModuleIndex",
                                                                      Ty.path
                                                                        "move_binary_format::file_format::FunctionInstantiationIndex",
                                                                      [],
                                                                      "into_index",
                                                                      []
                                                                    |),
                                                                    [ M.read (| M.read (| idx |) |)
                                                                    ]
                                                                  |)
                                                                ]
                                                              |)
                                                            |) in
                                                          let γ0_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "core::option::Option::Some",
                                                              0
                                                            |) in
                                                          let func_inst := M.copy (| γ0_0 |) in
                                                          M.match_operator (|
                                                            M.alloc (| Value.Tuple [] |),
                                                            [
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (let γ :=
                                                                    M.alloc (|
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.apply
                                                                            (Ty.path "slice")
                                                                            []
                                                                            [
                                                                              Ty.path
                                                                                "move_binary_format::file_format::Signature"
                                                                            ],
                                                                          "get",
                                                                          [ Ty.path "usize" ]
                                                                        |),
                                                                        [
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.path
                                                                                "move_binary_format::file_format::CompiledModule",
                                                                              "signatures",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                M.SubPointer.get_struct_record_field (|
                                                                                  M.read (| self |),
                                                                                  "move_binary_format::check_bounds::BoundsChecker",
                                                                                  "module"
                                                                                |)
                                                                              |)
                                                                            ]
                                                                          |);
                                                                          M.call_closure (|
                                                                            M.get_trait_method (|
                                                                              "move_binary_format::internals::ModuleIndex",
                                                                              Ty.path
                                                                                "move_binary_format::file_format::SignatureIndex",
                                                                              [],
                                                                              "into_index",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                M.SubPointer.get_struct_record_field (|
                                                                                  M.read (|
                                                                                    func_inst
                                                                                  |),
                                                                                  "move_binary_format::file_format::FunctionInstantiation",
                                                                                  "type_parameters"
                                                                                |)
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        ]
                                                                      |)
                                                                    |) in
                                                                  let γ0_0 :=
                                                                    M.SubPointer.get_struct_tuple_field (|
                                                                      γ,
                                                                      "core::option::Option::Some",
                                                                      0
                                                                    |) in
                                                                  let sig := M.copy (| γ0_0 |) in
                                                                  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
                                                                                      "move_binary_format::file_format::SignatureToken";
                                                                                    Ty.path
                                                                                      "alloc::alloc::Global"
                                                                                  ]
                                                                              ],
                                                                            [],
                                                                            "into_iter",
                                                                            []
                                                                          |),
                                                                          [
                                                                            M.SubPointer.get_struct_tuple_field (|
                                                                              M.read (| sig |),
                                                                              "move_binary_format::file_format::Signature",
                                                                              0
                                                                            |)
                                                                          ]
                                                                        |)
                                                                      |),
                                                                      [
                                                                        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
                                                                                                "move_binary_format::file_format::SignatureToken"
                                                                                            ],
                                                                                          [],
                                                                                          "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 ty :=
                                                                                            M.copy (|
                                                                                              γ0_0
                                                                                            |) in
                                                                                          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
                                                                                                        "move_binary_format::errors::PartialVMError"
                                                                                                    ],
                                                                                                  [],
                                                                                                  "branch",
                                                                                                  []
                                                                                                |),
                                                                                                [
                                                                                                  M.call_closure (|
                                                                                                    M.get_associated_function (|
                                                                                                      Ty.path
                                                                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                                                                      "check_type_parameter",
                                                                                                      []
                                                                                                    |),
                                                                                                    [
                                                                                                      M.read (|
                                                                                                        self
                                                                                                      |);
                                                                                                      M.read (|
                                                                                                        ty
                                                                                                      |);
                                                                                                      M.read (|
                                                                                                        type_param_count
                                                                                                      |)
                                                                                                    ]
                                                                                                  |)
                                                                                                ]
                                                                                              |)
                                                                                            |),
                                                                                            [
                                                                                              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.tuple
                                                                                                                    [];
                                                                                                                  Ty.path
                                                                                                                    "move_binary_format::errors::PartialVMError"
                                                                                                                ],
                                                                                                              [
                                                                                                                Ty.apply
                                                                                                                  (Ty.path
                                                                                                                    "core::result::Result")
                                                                                                                  []
                                                                                                                  [
                                                                                                                    Ty.path
                                                                                                                      "core::convert::Infallible";
                                                                                                                    Ty.path
                                                                                                                      "move_binary_format::errors::PartialVMError"
                                                                                                                  ]
                                                                                                              ],
                                                                                                              "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))
                                                                                            ]
                                                                                          |)))
                                                                                    ]
                                                                                  |) in
                                                                                M.alloc (|
                                                                                  Value.Tuple []
                                                                                |)))
                                                                            |)))
                                                                      ]
                                                                    |))));
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (M.alloc (| Value.Tuple [] |)))
                                                            ]
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.alloc (| Value.Tuple [] |)))
                                                    ]
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Pack",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Unpack",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::ExistsDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::ImmBorrowGlobalDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MutBorrowGlobalDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MoveFromDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MoveToDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ idx ] =>
                                                            ltac:(M.monadic
                                                              (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
                                                                            "move_binary_format::errors::PartialVMError"
                                                                        ],
                                                                      [],
                                                                      "branch",
                                                                      []
                                                                    |),
                                                                    [
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.path
                                                                            "move_binary_format::check_bounds::BoundsChecker",
                                                                          "check_code_unit_bounds_impl",
                                                                          [
                                                                            Ty.path
                                                                              "move_binary_format::file_format::StructDefinition";
                                                                            Ty.path
                                                                              "move_binary_format::file_format::StructDefinitionIndex"
                                                                          ]
                                                                        |),
                                                                        [
                                                                          M.read (| self |);
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.path
                                                                                "move_binary_format::file_format::CompiledModule",
                                                                              "struct_defs",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                M.SubPointer.get_struct_record_field (|
                                                                                  M.read (| self |),
                                                                                  "move_binary_format::check_bounds::BoundsChecker",
                                                                                  "module"
                                                                                |)
                                                                              |)
                                                                            ]
                                                                          |);
                                                                          M.read (|
                                                                            M.read (| idx |)
                                                                          |);
                                                                          M.read (|
                                                                            bytecode_offset
                                                                          |)
                                                                        ]
                                                                      |)
                                                                    ]
                                                                  |)
                                                                |),
                                                                [
                                                                  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.tuple [];
                                                                                      Ty.path
                                                                                        "move_binary_format::errors::PartialVMError"
                                                                                    ],
                                                                                  [
                                                                                    Ty.apply
                                                                                      (Ty.path
                                                                                        "core::result::Result")
                                                                                      []
                                                                                      [
                                                                                        Ty.path
                                                                                          "core::convert::Infallible";
                                                                                        Ty.path
                                                                                          "move_binary_format::errors::PartialVMError"
                                                                                      ]
                                                                                  ],
                                                                                  "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))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::PackGeneric",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::UnpackGeneric",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::ExistsGenericDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::ImmBorrowGlobalGenericDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MutBorrowGlobalGenericDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MoveFromGenericDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MoveToGenericDeprecated",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ idx ] =>
                                                            ltac:(M.monadic
                                                              (let~ _ :=
                                                                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
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ],
                                                                        [],
                                                                        "branch",
                                                                        []
                                                                      |),
                                                                      [
                                                                        M.call_closure (|
                                                                          M.get_associated_function (|
                                                                            Ty.path
                                                                              "move_binary_format::check_bounds::BoundsChecker",
                                                                            "check_code_unit_bounds_impl",
                                                                            [
                                                                              Ty.path
                                                                                "move_binary_format::file_format::StructDefInstantiation";
                                                                              Ty.path
                                                                                "move_binary_format::file_format::StructDefInstantiationIndex"
                                                                            ]
                                                                          |),
                                                                          [
                                                                            M.read (| self |);
                                                                            M.call_closure (|
                                                                              M.get_associated_function (|
                                                                                Ty.path
                                                                                  "move_binary_format::file_format::CompiledModule",
                                                                                "struct_instantiations",
                                                                                []
                                                                              |),
                                                                              [
                                                                                M.read (|
                                                                                  M.SubPointer.get_struct_record_field (|
                                                                                    M.read (|
                                                                                      self
                                                                                    |),
                                                                                    "move_binary_format::check_bounds::BoundsChecker",
                                                                                    "module"
                                                                                  |)
                                                                                |)
                                                                              ]
                                                                            |);
                                                                            M.read (|
                                                                              M.read (| idx |)
                                                                            |);
                                                                            M.read (|
                                                                              bytecode_offset
                                                                            |)
                                                                          ]
                                                                        |)
                                                                      ]
                                                                    |)
                                                                  |),
                                                                  [
                                                                    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.tuple [];
                                                                                        Ty.path
                                                                                          "move_binary_format::errors::PartialVMError"
                                                                                      ],
                                                                                    [
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "core::result::Result")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "core::convert::Infallible";
                                                                                          Ty.path
                                                                                            "move_binary_format::errors::PartialVMError"
                                                                                        ]
                                                                                    ],
                                                                                    "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))
                                                                  ]
                                                                |) in
                                                              M.match_operator (|
                                                                M.alloc (| Value.Tuple [] |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let γ :=
                                                                        M.alloc (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.apply
                                                                                (Ty.path "slice")
                                                                                []
                                                                                [
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::StructDefInstantiation"
                                                                                ],
                                                                              "get",
                                                                              [ Ty.path "usize" ]
                                                                            |),
                                                                            [
                                                                              M.call_closure (|
                                                                                M.get_associated_function (|
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::CompiledModule",
                                                                                  "struct_instantiations",
                                                                                  []
                                                                                |),
                                                                                [
                                                                                  M.read (|
                                                                                    M.SubPointer.get_struct_record_field (|
                                                                                      M.read (|
                                                                                        self
                                                                                      |),
                                                                                      "move_binary_format::check_bounds::BoundsChecker",
                                                                                      "module"
                                                                                    |)
                                                                                  |)
                                                                                ]
                                                                              |);
                                                                              M.call_closure (|
                                                                                M.get_trait_method (|
                                                                                  "move_binary_format::internals::ModuleIndex",
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::StructDefInstantiationIndex",
                                                                                  [],
                                                                                  "into_index",
                                                                                  []
                                                                                |),
                                                                                [
                                                                                  M.read (|
                                                                                    M.read (| idx |)
                                                                                  |)
                                                                                ]
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        |) in
                                                                      let γ0_0 :=
                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                          γ,
                                                                          "core::option::Option::Some",
                                                                          0
                                                                        |) in
                                                                      let struct_inst :=
                                                                        M.copy (| γ0_0 |) in
                                                                      M.match_operator (|
                                                                        M.alloc (|
                                                                          Value.Tuple []
                                                                        |),
                                                                        [
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (let γ :=
                                                                                M.alloc (|
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "slice")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "move_binary_format::file_format::Signature"
                                                                                        ],
                                                                                      "get",
                                                                                      [
                                                                                        Ty.path
                                                                                          "usize"
                                                                                      ]
                                                                                    |),
                                                                                    [
                                                                                      M.call_closure (|
                                                                                        M.get_associated_function (|
                                                                                          Ty.path
                                                                                            "move_binary_format::file_format::CompiledModule",
                                                                                          "signatures",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          M.read (|
                                                                                            M.SubPointer.get_struct_record_field (|
                                                                                              M.read (|
                                                                                                self
                                                                                              |),
                                                                                              "move_binary_format::check_bounds::BoundsChecker",
                                                                                              "module"
                                                                                            |)
                                                                                          |)
                                                                                        ]
                                                                                      |);
                                                                                      M.call_closure (|
                                                                                        M.get_trait_method (|
                                                                                          "move_binary_format::internals::ModuleIndex",
                                                                                          Ty.path
                                                                                            "move_binary_format::file_format::SignatureIndex",
                                                                                          [],
                                                                                          "into_index",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          M.read (|
                                                                                            M.SubPointer.get_struct_record_field (|
                                                                                              M.read (|
                                                                                                struct_inst
                                                                                              |),
                                                                                              "move_binary_format::file_format::StructDefInstantiation",
                                                                                              "type_parameters"
                                                                                            |)
                                                                                          |)
                                                                                        ]
                                                                                      |)
                                                                                    ]
                                                                                  |)
                                                                                |) in
                                                                              let γ0_0 :=
                                                                                M.SubPointer.get_struct_tuple_field (|
                                                                                  γ,
                                                                                  "core::option::Option::Some",
                                                                                  0
                                                                                |) in
                                                                              let sig :=
                                                                                M.copy (| γ0_0 |) in
                                                                              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
                                                                                                  "move_binary_format::file_format::SignatureToken";
                                                                                                Ty.path
                                                                                                  "alloc::alloc::Global"
                                                                                              ]
                                                                                          ],
                                                                                        [],
                                                                                        "into_iter",
                                                                                        []
                                                                                      |),
                                                                                      [
                                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                                          M.read (|
                                                                                            sig
                                                                                          |),
                                                                                          "move_binary_format::file_format::Signature",
                                                                                          0
                                                                                        |)
                                                                                      ]
                                                                                    |)
                                                                                  |),
                                                                                  [
                                                                                    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
                                                                                                            "move_binary_format::file_format::SignatureToken"
                                                                                                        ],
                                                                                                      [],
                                                                                                      "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
                                                                                                            ty :=
                                                                                                        M.copy (|
                                                                                                          γ0_0
                                                                                                        |) in
                                                                                                      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
                                                                                                                    "move_binary_format::errors::PartialVMError"
                                                                                                                ],
                                                                                                              [],
                                                                                                              "branch",
                                                                                                              []
                                                                                                            |),
                                                                                                            [
                                                                                                              M.call_closure (|
                                                                                                                M.get_associated_function (|
                                                                                                                  Ty.path
                                                                                                                    "move_binary_format::check_bounds::BoundsChecker",
                                                                                                                  "check_type_parameter",
                                                                                                                  []
                                                                                                                |),
                                                                                                                [
                                                                                                                  M.read (|
                                                                                                                    self
                                                                                                                  |);
                                                                                                                  M.read (|
                                                                                                                    ty
                                                                                                                  |);
                                                                                                                  M.read (|
                                                                                                                    type_param_count
                                                                                                                  |)
                                                                                                                ]
                                                                                                              |)
                                                                                                            ]
                                                                                                          |)
                                                                                                        |),
                                                                                                        [
                                                                                                          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.tuple
                                                                                                                                [];
                                                                                                                              Ty.path
                                                                                                                                "move_binary_format::errors::PartialVMError"
                                                                                                                            ],
                                                                                                                          [
                                                                                                                            Ty.apply
                                                                                                                              (Ty.path
                                                                                                                                "core::result::Result")
                                                                                                                              []
                                                                                                                              [
                                                                                                                                Ty.path
                                                                                                                                  "core::convert::Infallible";
                                                                                                                                Ty.path
                                                                                                                                  "move_binary_format::errors::PartialVMError"
                                                                                                                              ]
                                                                                                                          ],
                                                                                                                          "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))
                                                                                                        ]
                                                                                                      |)))
                                                                                                ]
                                                                                              |) in
                                                                                            M.alloc (|
                                                                                              Value.Tuple
                                                                                                []
                                                                                            |)))
                                                                                        |)))
                                                                                  ]
                                                                                |))));
                                                                          fun γ =>
                                                                            ltac:(M.monadic
                                                                              (M.alloc (|
                                                                                Value.Tuple []
                                                                              |)))
                                                                        ]
                                                                      |)));
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (M.alloc (|
                                                                        Value.Tuple []
                                                                      |)))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::BrTrue",
                                                              0
                                                            |) in
                                                          let offset := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ offset ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::BrFalse",
                                                              0
                                                            |) in
                                                          let offset := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ offset ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Branch",
                                                              0
                                                            |) in
                                                          let offset := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ offset ]))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ offset ] =>
                                                            ltac:(M.monadic
                                                              (let~ offset :=
                                                                M.alloc (|
                                                                  M.rust_cast
                                                                    (M.read (|
                                                                      M.read (| offset |)
                                                                    |))
                                                                |) in
                                                              M.match_operator (|
                                                                M.alloc (| Value.Tuple [] |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let γ :=
                                                                        M.use
                                                                          (M.alloc (|
                                                                            BinOp.ge (|
                                                                              M.read (| offset |),
                                                                              M.read (| code_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"
                                                                                [
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.path
                                                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                                                      "offset_out_of_bounds",
                                                                                      []
                                                                                    |),
                                                                                    [
                                                                                      M.read (|
                                                                                        self
                                                                                      |);
                                                                                      Value.StructTuple
                                                                                        "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                                                                                        [];
                                                                                      Value.StructTuple
                                                                                        "move_binary_format::IndexKind::CodeDefinition"
                                                                                        [];
                                                                                      M.read (|
                                                                                        offset
                                                                                      |);
                                                                                      M.read (|
                                                                                        code_len
                                                                                      |);
                                                                                      M.rust_cast
                                                                                        (M.read (|
                                                                                          bytecode_offset
                                                                                        |))
                                                                                    ]
                                                                                  |)
                                                                                ]
                                                                            |)
                                                                          |)
                                                                        |)
                                                                      |)));
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (M.alloc (|
                                                                        Value.Tuple []
                                                                      |)))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::CopyLoc",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MoveLoc",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::StLoc",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::MutBorrowLoc",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::ImmBorrowLoc",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ idx ] =>
                                                            ltac:(M.monadic
                                                              (let~ idx :=
                                                                M.alloc (|
                                                                  M.rust_cast
                                                                    (M.read (| M.read (| idx |) |))
                                                                |) in
                                                              M.match_operator (|
                                                                M.alloc (| Value.Tuple [] |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let γ :=
                                                                        M.use
                                                                          (M.alloc (|
                                                                            BinOp.ge (|
                                                                              M.read (| idx |),
                                                                              M.read (|
                                                                                locals_count
                                                                              |)
                                                                            |)
                                                                          |)) 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"
                                                                                [
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.path
                                                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                                                      "offset_out_of_bounds",
                                                                                      []
                                                                                    |),
                                                                                    [
                                                                                      M.read (|
                                                                                        self
                                                                                      |);
                                                                                      Value.StructTuple
                                                                                        "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                                                                                        [];
                                                                                      Value.StructTuple
                                                                                        "move_binary_format::IndexKind::LocalPool"
                                                                                        [];
                                                                                      M.read (|
                                                                                        idx
                                                                                      |);
                                                                                      M.read (|
                                                                                        locals_count
                                                                                      |);
                                                                                      M.rust_cast
                                                                                        (M.read (|
                                                                                          bytecode_offset
                                                                                        |))
                                                                                    ]
                                                                                  |)
                                                                                ]
                                                                            |)
                                                                          |)
                                                                        |)
                                                                      |)));
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (M.alloc (|
                                                                        Value.Tuple []
                                                                      |)))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecPack",
                                                              0
                                                            |) in
                                                          let γ1_1 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecPack",
                                                              1
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecLen",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecImmBorrow",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecMutBorrow",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecPushBack",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecPopBack",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecUnpack",
                                                              0
                                                            |) in
                                                          let γ1_1 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecUnpack",
                                                              1
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::VecSwap",
                                                              0
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          Value.Tuple [ idx ]))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [ idx ] =>
                                                            ltac:(M.monadic
                                                              (let~ _ :=
                                                                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
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ],
                                                                        [],
                                                                        "branch",
                                                                        []
                                                                      |),
                                                                      [
                                                                        M.call_closure (|
                                                                          M.get_associated_function (|
                                                                            Ty.path
                                                                              "move_binary_format::check_bounds::BoundsChecker",
                                                                            "check_code_unit_bounds_impl",
                                                                            [
                                                                              Ty.path
                                                                                "move_binary_format::file_format::Signature";
                                                                              Ty.path
                                                                                "move_binary_format::file_format::SignatureIndex"
                                                                            ]
                                                                          |),
                                                                          [
                                                                            M.read (| self |);
                                                                            M.call_closure (|
                                                                              M.get_associated_function (|
                                                                                Ty.path
                                                                                  "move_binary_format::file_format::CompiledModule",
                                                                                "signatures",
                                                                                []
                                                                              |),
                                                                              [
                                                                                M.read (|
                                                                                  M.SubPointer.get_struct_record_field (|
                                                                                    M.read (|
                                                                                      self
                                                                                    |),
                                                                                    "move_binary_format::check_bounds::BoundsChecker",
                                                                                    "module"
                                                                                  |)
                                                                                |)
                                                                              ]
                                                                            |);
                                                                            M.read (|
                                                                              M.read (| idx |)
                                                                            |);
                                                                            M.read (|
                                                                              bytecode_offset
                                                                            |)
                                                                          ]
                                                                        |)
                                                                      ]
                                                                    |)
                                                                  |),
                                                                  [
                                                                    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.tuple [];
                                                                                        Ty.path
                                                                                          "move_binary_format::errors::PartialVMError"
                                                                                      ],
                                                                                    [
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "core::result::Result")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "core::convert::Infallible";
                                                                                          Ty.path
                                                                                            "move_binary_format::errors::PartialVMError"
                                                                                        ]
                                                                                    ],
                                                                                    "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))
                                                                  ]
                                                                |) in
                                                              M.match_operator (|
                                                                M.alloc (| Value.Tuple [] |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let γ :=
                                                                        M.alloc (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.apply
                                                                                (Ty.path "slice")
                                                                                []
                                                                                [
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::Signature"
                                                                                ],
                                                                              "get",
                                                                              [ Ty.path "usize" ]
                                                                            |),
                                                                            [
                                                                              M.call_closure (|
                                                                                M.get_associated_function (|
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::CompiledModule",
                                                                                  "signatures",
                                                                                  []
                                                                                |),
                                                                                [
                                                                                  M.read (|
                                                                                    M.SubPointer.get_struct_record_field (|
                                                                                      M.read (|
                                                                                        self
                                                                                      |),
                                                                                      "move_binary_format::check_bounds::BoundsChecker",
                                                                                      "module"
                                                                                    |)
                                                                                  |)
                                                                                ]
                                                                              |);
                                                                              M.call_closure (|
                                                                                M.get_trait_method (|
                                                                                  "move_binary_format::internals::ModuleIndex",
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::SignatureIndex",
                                                                                  [],
                                                                                  "into_index",
                                                                                  []
                                                                                |),
                                                                                [
                                                                                  M.read (|
                                                                                    M.read (| idx |)
                                                                                  |)
                                                                                ]
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        |) in
                                                                      let γ0_0 :=
                                                                        M.SubPointer.get_struct_tuple_field (|
                                                                          γ,
                                                                          "core::option::Option::Some",
                                                                          0
                                                                        |) in
                                                                      let sig :=
                                                                        M.copy (| γ0_0 |) in
                                                                      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
                                                                                          "move_binary_format::file_format::SignatureToken";
                                                                                        Ty.path
                                                                                          "alloc::alloc::Global"
                                                                                      ]
                                                                                  ],
                                                                                [],
                                                                                "into_iter",
                                                                                []
                                                                              |),
                                                                              [
                                                                                M.SubPointer.get_struct_tuple_field (|
                                                                                  M.read (| sig |),
                                                                                  "move_binary_format::file_format::Signature",
                                                                                  0
                                                                                |)
                                                                              ]
                                                                            |)
                                                                          |),
                                                                          [
                                                                            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
                                                                                                    "move_binary_format::file_format::SignatureToken"
                                                                                                ],
                                                                                              [],
                                                                                              "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
                                                                                                    ty :=
                                                                                                M.copy (|
                                                                                                  γ0_0
                                                                                                |) in
                                                                                              let~
                                                                                                    _ :=
                                                                                                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
                                                                                                              "move_binary_format::errors::PartialVMError"
                                                                                                          ],
                                                                                                        [],
                                                                                                        "branch",
                                                                                                        []
                                                                                                      |),
                                                                                                      [
                                                                                                        M.call_closure (|
                                                                                                          M.get_associated_function (|
                                                                                                            Ty.path
                                                                                                              "move_binary_format::check_bounds::BoundsChecker",
                                                                                                            "check_type_parameter",
                                                                                                            []
                                                                                                          |),
                                                                                                          [
                                                                                                            M.read (|
                                                                                                              self
                                                                                                            |);
                                                                                                            M.read (|
                                                                                                              ty
                                                                                                            |);
                                                                                                            M.read (|
                                                                                                              type_param_count
                                                                                                            |)
                                                                                                          ]
                                                                                                        |)
                                                                                                      ]
                                                                                                    |)
                                                                                                  |),
                                                                                                  [
                                                                                                    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.tuple
                                                                                                                          [];
                                                                                                                        Ty.path
                                                                                                                          "move_binary_format::errors::PartialVMError"
                                                                                                                      ],
                                                                                                                    [
                                                                                                                      Ty.apply
                                                                                                                        (Ty.path
                                                                                                                          "core::result::Result")
                                                                                                                        []
                                                                                                                        [
                                                                                                                          Ty.path
                                                                                                                            "core::convert::Infallible";
                                                                                                                          Ty.path
                                                                                                                            "move_binary_format::errors::PartialVMError"
                                                                                                                        ]
                                                                                                                    ],
                                                                                                                    "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))
                                                                                                  ]
                                                                                                |) in
                                                                                              M.alloc (|
                                                                                                Value.Tuple
                                                                                                  []
                                                                                              |)))
                                                                                        ]
                                                                                      |) in
                                                                                    M.alloc (|
                                                                                      Value.Tuple []
                                                                                    |)))
                                                                                |)))
                                                                          ]
                                                                        |))));
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (M.alloc (|
                                                                        Value.Tuple []
                                                                      |)))
                                                                ]
                                                              |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::FreezeRef"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Pop"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Ret"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::LdU8",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::LdU16",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::LdU32",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::LdU64",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::LdU256",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::LdU128",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::CastU8"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::CastU16"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::CastU32"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::CastU64"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::CastU128"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::CastU256"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::LdTrue"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::LdFalse"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::ReadRef"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::WriteRef"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Add"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Sub"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Mul"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Mod"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Div"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::BitOr"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::BitAnd"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Xor"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Shl"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Shr"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Or"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::And"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Not"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Eq"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Neq"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Lt"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Gt"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Le"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Ge"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Abort"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::Bytecode::Nop"
                                                            |) in
                                                          Value.Tuple []))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [] =>
                                                            ltac:(M.monadic
                                                              (M.alloc (| Value.Tuple [] |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_code : M.IsAssociatedFunction Self "check_code" check_code.
    
    (*
        fn check_type(&self, ty: &SignatureToken) -> PartialVMResult<()> {
            use self::SignatureToken::*;
    
            for ty in ty.preorder_traversal() {
                match ty {
                    Bool | U8 | U16 | U32 | U64 | U128 | U256 | Address | Signer | TypeParameter(_)
                    | Reference(_) | MutableReference(_) | Vector(_) => (),
                    Struct(idx) => {
                        check_bounds_impl(self.module.struct_handles(), *idx)?;
                        if let Some(sh) = self.module.struct_handles().get(idx.into_index()) {
                            if !sh.type_parameters.is_empty() {
                                return Err(PartialVMError::new(
                                    StatusCode::NUMBER_OF_TYPE_ARGUMENTS_MISMATCH,
                                )
                                .with_message(format!(
                                    "expected {} type parameters got 0 (Struct)",
                                    sh.type_parameters.len(),
                                )));
                            }
                        }
                    }
                    StructInstantiation(struct_inst) => {
                        let (idx, type_params) = &**struct_inst;
                        check_bounds_impl(self.module.struct_handles(), *idx)?;
                        if let Some(sh) = self.module.struct_handles().get(idx.into_index()) {
                            if sh.type_parameters.len() != type_params.len() {
                                return Err(PartialVMError::new(
                                    StatusCode::NUMBER_OF_TYPE_ARGUMENTS_MISMATCH,
                                )
                                .with_message(format!(
                                    "expected {} type parameters got {}",
                                    sh.type_parameters.len(),
                                    type_params.len(),
                                )));
                            }
                        }
                    }
                }
            }
            Ok(())
        }
    *)
    Definition check_type (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; ty ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let ty := M.alloc (| ty |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.use
                    (M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::collect::IntoIterator",
                            Ty.path
                              "move_binary_format::file_format::SignatureTokenPreorderTraversalIter",
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::SignatureToken",
                                "preorder_traversal",
                                []
                              |),
                              [ M.read (| ty |) ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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.path
                                            "move_binary_format::file_format::SignatureTokenPreorderTraversalIter",
                                          [],
                                          "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 ty := M.copy (| γ0_0 |) in
                                          M.match_operator (|
                                            ty,
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Bool"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U8"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U16"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U32"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U64"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U128"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U256"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Address"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Signer"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::TypeParameter",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Reference",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::MutableReference",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Vector",
                                                              0
                                                            |) in
                                                          Value.Tuple []))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [] =>
                                                            ltac:(M.monadic
                                                              (M.alloc (| Value.Tuple [] |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ := M.read (| γ |) in
                                                  let γ1_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "move_binary_format::file_format::SignatureToken::Struct",
                                                      0
                                                    |) in
                                                  let idx := M.alloc (| γ1_0 |) in
                                                  let~ _ :=
                                                    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
                                                                  "move_binary_format::errors::PartialVMError"
                                                              ],
                                                            [],
                                                            "branch",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_function (|
                                                                "move_binary_format::check_bounds::check_bounds_impl",
                                                                [
                                                                  Ty.path
                                                                    "move_binary_format::file_format::StructHandle";
                                                                  Ty.path
                                                                    "move_binary_format::file_format::StructHandleIndex"
                                                                ]
                                                              |),
                                                              [
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "move_binary_format::file_format::CompiledModule",
                                                                    "struct_handles",
                                                                    []
                                                                  |),
                                                                  [
                                                                    M.read (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "move_binary_format::check_bounds::BoundsChecker",
                                                                        "module"
                                                                      |)
                                                                    |)
                                                                  ]
                                                                |);
                                                                M.read (| M.read (| idx |) |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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.tuple [];
                                                                            Ty.path
                                                                              "move_binary_format::errors::PartialVMError"
                                                                          ],
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "core::result::Result")
                                                                            []
                                                                            [
                                                                              Ty.path
                                                                                "core::convert::Infallible";
                                                                              Ty.path
                                                                                "move_binary_format::errors::PartialVMError"
                                                                            ]
                                                                        ],
                                                                        "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))
                                                      ]
                                                    |) in
                                                  M.match_operator (|
                                                    M.alloc (| Value.Tuple [] |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.apply
                                                                    (Ty.path "slice")
                                                                    []
                                                                    [
                                                                      Ty.path
                                                                        "move_binary_format::file_format::StructHandle"
                                                                    ],
                                                                  "get",
                                                                  [ Ty.path "usize" ]
                                                                |),
                                                                [
                                                                  M.call_closure (|
                                                                    M.get_associated_function (|
                                                                      Ty.path
                                                                        "move_binary_format::file_format::CompiledModule",
                                                                      "struct_handles",
                                                                      []
                                                                    |),
                                                                    [
                                                                      M.read (|
                                                                        M.SubPointer.get_struct_record_field (|
                                                                          M.read (| self |),
                                                                          "move_binary_format::check_bounds::BoundsChecker",
                                                                          "module"
                                                                        |)
                                                                      |)
                                                                    ]
                                                                  |);
                                                                  M.call_closure (|
                                                                    M.get_trait_method (|
                                                                      "move_binary_format::internals::ModuleIndex",
                                                                      Ty.path
                                                                        "move_binary_format::file_format::StructHandleIndex",
                                                                      [],
                                                                      "into_index",
                                                                      []
                                                                    |),
                                                                    [ M.read (| M.read (| idx |) |)
                                                                    ]
                                                                  |)
                                                                ]
                                                              |)
                                                            |) in
                                                          let γ0_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "core::option::Option::Some",
                                                              0
                                                            |) in
                                                          let sh := M.copy (| γ0_0 |) in
                                                          M.match_operator (|
                                                            M.alloc (| Value.Tuple [] |),
                                                            [
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (let γ :=
                                                                    M.use
                                                                      (M.alloc (|
                                                                        UnOp.not (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.apply
                                                                                (Ty.path
                                                                                  "alloc::vec::Vec")
                                                                                []
                                                                                [
                                                                                  Ty.path
                                                                                    "move_binary_format::file_format::StructTypeParameter";
                                                                                  Ty.path
                                                                                    "alloc::alloc::Global"
                                                                                ],
                                                                              "is_empty",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.SubPointer.get_struct_record_field (|
                                                                                M.read (| sh |),
                                                                                "move_binary_format::file_format::StructHandle",
                                                                                "type_parameters"
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        |)
                                                                      |)) 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"
                                                                            [
                                                                              M.call_closure (|
                                                                                M.get_associated_function (|
                                                                                  Ty.path
                                                                                    "move_binary_format::errors::PartialVMError",
                                                                                  "with_message",
                                                                                  []
                                                                                |),
                                                                                [
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.path
                                                                                        "move_binary_format::errors::PartialVMError",
                                                                                      "new",
                                                                                      []
                                                                                    |),
                                                                                    [
                                                                                      Value.StructTuple
                                                                                        "move_core_types::vm_status::StatusCode::NUMBER_OF_TYPE_ARGUMENTS_MISMATCH"
                                                                                        []
                                                                                    ]
                                                                                  |);
                                                                                  M.call_closure (|
                                                                                    M.get_function (|
                                                                                      "core::hint::must_use",
                                                                                      [
                                                                                        Ty.path
                                                                                          "alloc::string::String"
                                                                                      ]
                                                                                    |),
                                                                                    [
                                                                                      M.read (|
                                                                                        let~ res :=
                                                                                          M.alloc (|
                                                                                            M.call_closure (|
                                                                                              M.get_function (|
                                                                                                "alloc::fmt::format",
                                                                                                []
                                                                                              |),
                                                                                              [
                                                                                                M.call_closure (|
                                                                                                  M.get_associated_function (|
                                                                                                    Ty.path
                                                                                                      "core::fmt::Arguments",
                                                                                                    "new_v1",
                                                                                                    []
                                                                                                  |),
                                                                                                  [
                                                                                                    M.alloc (|
                                                                                                      Value.Array
                                                                                                        [
                                                                                                          M.read (|
                                                                                                            Value.String
                                                                                                              "expected "
                                                                                                          |);
                                                                                                          M.read (|
                                                                                                            Value.String
                                                                                                              " type parameters got 0 (Struct)"
                                                                                                          |)
                                                                                                        ]
                                                                                                    |);
                                                                                                    M.alloc (|
                                                                                                      Value.Array
                                                                                                        [
                                                                                                          M.call_closure (|
                                                                                                            M.get_associated_function (|
                                                                                                              Ty.path
                                                                                                                "core::fmt::rt::Argument",
                                                                                                              "new_display",
                                                                                                              [
                                                                                                                Ty.path
                                                                                                                  "usize"
                                                                                                              ]
                                                                                                            |),
                                                                                                            [
                                                                                                              M.alloc (|
                                                                                                                M.call_closure (|
                                                                                                                  M.get_associated_function (|
                                                                                                                    Ty.apply
                                                                                                                      (Ty.path
                                                                                                                        "alloc::vec::Vec")
                                                                                                                      []
                                                                                                                      [
                                                                                                                        Ty.path
                                                                                                                          "move_binary_format::file_format::StructTypeParameter";
                                                                                                                        Ty.path
                                                                                                                          "alloc::alloc::Global"
                                                                                                                      ],
                                                                                                                    "len",
                                                                                                                    []
                                                                                                                  |),
                                                                                                                  [
                                                                                                                    M.SubPointer.get_struct_record_field (|
                                                                                                                      M.read (|
                                                                                                                        sh
                                                                                                                      |),
                                                                                                                      "move_binary_format::file_format::StructHandle",
                                                                                                                      "type_parameters"
                                                                                                                    |)
                                                                                                                  ]
                                                                                                                |)
                                                                                                              |)
                                                                                                            ]
                                                                                                          |)
                                                                                                        ]
                                                                                                    |)
                                                                                                  ]
                                                                                                |)
                                                                                              ]
                                                                                            |)
                                                                                          |) in
                                                                                        res
                                                                                      |)
                                                                                    ]
                                                                                  |)
                                                                                ]
                                                                              |)
                                                                            ]
                                                                        |)
                                                                      |)
                                                                    |)
                                                                  |)));
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (M.alloc (| Value.Tuple [] |)))
                                                            ]
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.alloc (| Value.Tuple [] |)))
                                                    ]
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ := M.read (| γ |) in
                                                  let γ1_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "move_binary_format::file_format::SignatureToken::StructInstantiation",
                                                      0
                                                    |) in
                                                  let struct_inst := M.alloc (| γ1_0 |) in
                                                  M.match_operator (|
                                                    M.alloc (|
                                                      M.read (| M.read (| struct_inst |) |)
                                                    |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_tuple_field (|
                                                              γ,
                                                              0
                                                            |) in
                                                          let γ1_1 :=
                                                            M.SubPointer.get_tuple_field (|
                                                              γ,
                                                              1
                                                            |) in
                                                          let idx := M.alloc (| γ1_0 |) in
                                                          let type_params := M.alloc (| γ1_1 |) in
                                                          let~ _ :=
                                                            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
                                                                          "move_binary_format::errors::PartialVMError"
                                                                      ],
                                                                    [],
                                                                    "branch",
                                                                    []
                                                                  |),
                                                                  [
                                                                    M.call_closure (|
                                                                      M.get_function (|
                                                                        "move_binary_format::check_bounds::check_bounds_impl",
                                                                        [
                                                                          Ty.path
                                                                            "move_binary_format::file_format::StructHandle";
                                                                          Ty.path
                                                                            "move_binary_format::file_format::StructHandleIndex"
                                                                        ]
                                                                      |),
                                                                      [
                                                                        M.call_closure (|
                                                                          M.get_associated_function (|
                                                                            Ty.path
                                                                              "move_binary_format::file_format::CompiledModule",
                                                                            "struct_handles",
                                                                            []
                                                                          |),
                                                                          [
                                                                            M.read (|
                                                                              M.SubPointer.get_struct_record_field (|
                                                                                M.read (| self |),
                                                                                "move_binary_format::check_bounds::BoundsChecker",
                                                                                "module"
                                                                              |)
                                                                            |)
                                                                          ]
                                                                        |);
                                                                        M.read (|
                                                                          M.read (| idx |)
                                                                        |)
                                                                      ]
                                                                    |)
                                                                  ]
                                                                |)
                                                              |),
                                                              [
                                                                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.tuple [];
                                                                                    Ty.path
                                                                                      "move_binary_format::errors::PartialVMError"
                                                                                  ],
                                                                                [
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "core::result::Result")
                                                                                    []
                                                                                    [
                                                                                      Ty.path
                                                                                        "core::convert::Infallible";
                                                                                      Ty.path
                                                                                        "move_binary_format::errors::PartialVMError"
                                                                                    ]
                                                                                ],
                                                                                "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))
                                                              ]
                                                            |) in
                                                          M.match_operator (|
                                                            M.alloc (| Value.Tuple [] |),
                                                            [
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (let γ :=
                                                                    M.alloc (|
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.apply
                                                                            (Ty.path "slice")
                                                                            []
                                                                            [
                                                                              Ty.path
                                                                                "move_binary_format::file_format::StructHandle"
                                                                            ],
                                                                          "get",
                                                                          [ Ty.path "usize" ]
                                                                        |),
                                                                        [
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.path
                                                                                "move_binary_format::file_format::CompiledModule",
                                                                              "struct_handles",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                M.SubPointer.get_struct_record_field (|
                                                                                  M.read (| self |),
                                                                                  "move_binary_format::check_bounds::BoundsChecker",
                                                                                  "module"
                                                                                |)
                                                                              |)
                                                                            ]
                                                                          |);
                                                                          M.call_closure (|
                                                                            M.get_trait_method (|
                                                                              "move_binary_format::internals::ModuleIndex",
                                                                              Ty.path
                                                                                "move_binary_format::file_format::StructHandleIndex",
                                                                              [],
                                                                              "into_index",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                M.read (| idx |)
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        ]
                                                                      |)
                                                                    |) in
                                                                  let γ0_0 :=
                                                                    M.SubPointer.get_struct_tuple_field (|
                                                                      γ,
                                                                      "core::option::Option::Some",
                                                                      0
                                                                    |) in
                                                                  let sh := M.copy (| γ0_0 |) in
                                                                  M.match_operator (|
                                                                    M.alloc (| Value.Tuple [] |),
                                                                    [
                                                                      fun γ =>
                                                                        ltac:(M.monadic
                                                                          (let γ :=
                                                                            M.use
                                                                              (M.alloc (|
                                                                                BinOp.ne (|
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "alloc::vec::Vec")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "move_binary_format::file_format::StructTypeParameter";
                                                                                          Ty.path
                                                                                            "alloc::alloc::Global"
                                                                                        ],
                                                                                      "len",
                                                                                      []
                                                                                    |),
                                                                                    [
                                                                                      M.SubPointer.get_struct_record_field (|
                                                                                        M.read (|
                                                                                          sh
                                                                                        |),
                                                                                        "move_binary_format::file_format::StructHandle",
                                                                                        "type_parameters"
                                                                                      |)
                                                                                    ]
                                                                                  |),
                                                                                  M.call_closure (|
                                                                                    M.get_associated_function (|
                                                                                      Ty.apply
                                                                                        (Ty.path
                                                                                          "alloc::vec::Vec")
                                                                                        []
                                                                                        [
                                                                                          Ty.path
                                                                                            "move_binary_format::file_format::SignatureToken";
                                                                                          Ty.path
                                                                                            "alloc::alloc::Global"
                                                                                        ],
                                                                                      "len",
                                                                                      []
                                                                                    |),
                                                                                    [
                                                                                      M.read (|
                                                                                        type_params
                                                                                      |)
                                                                                    ]
                                                                                  |)
                                                                                |)
                                                                              |)) 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"
                                                                                    [
                                                                                      M.call_closure (|
                                                                                        M.get_associated_function (|
                                                                                          Ty.path
                                                                                            "move_binary_format::errors::PartialVMError",
                                                                                          "with_message",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          M.call_closure (|
                                                                                            M.get_associated_function (|
                                                                                              Ty.path
                                                                                                "move_binary_format::errors::PartialVMError",
                                                                                              "new",
                                                                                              []
                                                                                            |),
                                                                                            [
                                                                                              Value.StructTuple
                                                                                                "move_core_types::vm_status::StatusCode::NUMBER_OF_TYPE_ARGUMENTS_MISMATCH"
                                                                                                []
                                                                                            ]
                                                                                          |);
                                                                                          M.call_closure (|
                                                                                            M.get_function (|
                                                                                              "core::hint::must_use",
                                                                                              [
                                                                                                Ty.path
                                                                                                  "alloc::string::String"
                                                                                              ]
                                                                                            |),
                                                                                            [
                                                                                              M.read (|
                                                                                                let~
                                                                                                      res :=
                                                                                                  M.alloc (|
                                                                                                    M.call_closure (|
                                                                                                      M.get_function (|
                                                                                                        "alloc::fmt::format",
                                                                                                        []
                                                                                                      |),
                                                                                                      [
                                                                                                        M.call_closure (|
                                                                                                          M.get_associated_function (|
                                                                                                            Ty.path
                                                                                                              "core::fmt::Arguments",
                                                                                                            "new_v1",
                                                                                                            []
                                                                                                          |),
                                                                                                          [
                                                                                                            M.alloc (|
                                                                                                              Value.Array
                                                                                                                [
                                                                                                                  M.read (|
                                                                                                                    Value.String
                                                                                                                      "expected "
                                                                                                                  |);
                                                                                                                  M.read (|
                                                                                                                    Value.String
                                                                                                                      " type parameters got "
                                                                                                                  |)
                                                                                                                ]
                                                                                                            |);
                                                                                                            M.alloc (|
                                                                                                              Value.Array
                                                                                                                [
                                                                                                                  M.call_closure (|
                                                                                                                    M.get_associated_function (|
                                                                                                                      Ty.path
                                                                                                                        "core::fmt::rt::Argument",
                                                                                                                      "new_display",
                                                                                                                      [
                                                                                                                        Ty.path
                                                                                                                          "usize"
                                                                                                                      ]
                                                                                                                    |),
                                                                                                                    [
                                                                                                                      M.alloc (|
                                                                                                                        M.call_closure (|
                                                                                                                          M.get_associated_function (|
                                                                                                                            Ty.apply
                                                                                                                              (Ty.path
                                                                                                                                "alloc::vec::Vec")
                                                                                                                              []
                                                                                                                              [
                                                                                                                                Ty.path
                                                                                                                                  "move_binary_format::file_format::StructTypeParameter";
                                                                                                                                Ty.path
                                                                                                                                  "alloc::alloc::Global"
                                                                                                                              ],
                                                                                                                            "len",
                                                                                                                            []
                                                                                                                          |),
                                                                                                                          [
                                                                                                                            M.SubPointer.get_struct_record_field (|
                                                                                                                              M.read (|
                                                                                                                                sh
                                                                                                                              |),
                                                                                                                              "move_binary_format::file_format::StructHandle",
                                                                                                                              "type_parameters"
                                                                                                                            |)
                                                                                                                          ]
                                                                                                                        |)
                                                                                                                      |)
                                                                                                                    ]
                                                                                                                  |);
                                                                                                                  M.call_closure (|
                                                                                                                    M.get_associated_function (|
                                                                                                                      Ty.path
                                                                                                                        "core::fmt::rt::Argument",
                                                                                                                      "new_display",
                                                                                                                      [
                                                                                                                        Ty.path
                                                                                                                          "usize"
                                                                                                                      ]
                                                                                                                    |),
                                                                                                                    [
                                                                                                                      M.alloc (|
                                                                                                                        M.call_closure (|
                                                                                                                          M.get_associated_function (|
                                                                                                                            Ty.apply
                                                                                                                              (Ty.path
                                                                                                                                "alloc::vec::Vec")
                                                                                                                              []
                                                                                                                              [
                                                                                                                                Ty.path
                                                                                                                                  "move_binary_format::file_format::SignatureToken";
                                                                                                                                Ty.path
                                                                                                                                  "alloc::alloc::Global"
                                                                                                                              ],
                                                                                                                            "len",
                                                                                                                            []
                                                                                                                          |),
                                                                                                                          [
                                                                                                                            M.read (|
                                                                                                                              type_params
                                                                                                                            |)
                                                                                                                          ]
                                                                                                                        |)
                                                                                                                      |)
                                                                                                                    ]
                                                                                                                  |)
                                                                                                                ]
                                                                                                            |)
                                                                                                          ]
                                                                                                        |)
                                                                                                      ]
                                                                                                    |)
                                                                                                  |) in
                                                                                                res
                                                                                              |)
                                                                                            ]
                                                                                          |)
                                                                                        ]
                                                                                      |)
                                                                                    ]
                                                                                |)
                                                                              |)
                                                                            |)
                                                                          |)));
                                                                      fun γ =>
                                                                        ltac:(M.monadic
                                                                          (M.alloc (|
                                                                            Value.Tuple []
                                                                          |)))
                                                                    ]
                                                                  |)));
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (M.alloc (| Value.Tuple [] |)))
                                                            ]
                                                          |)))
                                                    ]
                                                  |)))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_type : M.IsAssociatedFunction Self "check_type" check_type.
    
    (*
        fn check_type_parameter(
            &self,
            ty: &SignatureToken,
            type_param_count: usize,
        ) -> PartialVMResult<()> {
            use self::SignatureToken::*;
    
            for ty in ty.preorder_traversal() {
                match ty {
                    SignatureToken::TypeParameter(idx) => {
                        if *idx as usize >= type_param_count {
                            return Err(bounds_error(
                                StatusCode::INDEX_OUT_OF_BOUNDS,
                                IndexKind::TypeParameter,
                                *idx,
                                type_param_count,
                            ));
                        }
                    }
    
                    Bool
                    | U8
                    | U16
                    | U32
                    | U64
                    | U128
                    | U256
                    | Address
                    | Signer
                    | Struct(_)
                    | Reference(_)
                    | MutableReference(_)
                    | Vector(_)
                    | StructInstantiation(_) => (),
                }
            }
            Ok(())
        }
    *)
    Definition check_type_parameter (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; ty; type_param_count ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let ty := M.alloc (| ty |) in
          let type_param_count := M.alloc (| type_param_count |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let~ _ :=
                  M.use
                    (M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::collect::IntoIterator",
                            Ty.path
                              "move_binary_format::file_format::SignatureTokenPreorderTraversalIter",
                            [],
                            "into_iter",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "move_binary_format::file_format::SignatureToken",
                                "preorder_traversal",
                                []
                              |),
                              [ M.read (| ty |) ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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.path
                                            "move_binary_format::file_format::SignatureTokenPreorderTraversalIter",
                                          [],
                                          "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 ty := M.copy (| γ0_0 |) in
                                          M.match_operator (|
                                            ty,
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ := M.read (| γ |) in
                                                  let γ1_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "move_binary_format::file_format::SignatureToken::TypeParameter",
                                                      0
                                                    |) in
                                                  let idx := M.alloc (| γ1_0 |) in
                                                  M.match_operator (|
                                                    M.alloc (| Value.Tuple [] |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ :=
                                                            M.use
                                                              (M.alloc (|
                                                                BinOp.ge (|
                                                                  M.rust_cast
                                                                    (M.read (| M.read (| idx |) |)),
                                                                  M.read (| type_param_count |)
                                                                |)
                                                              |)) 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"
                                                                    [
                                                                      M.call_closure (|
                                                                        M.get_function (|
                                                                          "move_binary_format::errors::bounds_error",
                                                                          []
                                                                        |),
                                                                        [
                                                                          Value.StructTuple
                                                                            "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                                                                            [];
                                                                          Value.StructTuple
                                                                            "move_binary_format::IndexKind::TypeParameter"
                                                                            [];
                                                                          M.read (|
                                                                            M.read (| idx |)
                                                                          |);
                                                                          M.read (|
                                                                            type_param_count
                                                                          |)
                                                                        ]
                                                                      |)
                                                                    ]
                                                                |)
                                                              |)
                                                            |)
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.alloc (| Value.Tuple [] |)))
                                                    ]
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.find_or_pattern (|
                                                    γ,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Bool"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U8"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U16"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U32"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U64"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U128"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::U256"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Address"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let _ :=
                                                            M.is_struct_tuple (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Signer"
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Struct",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Reference",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::MutableReference",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::Vector",
                                                              0
                                                            |) in
                                                          Value.Tuple []));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ := M.read (| γ |) in
                                                          let γ1_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "move_binary_format::file_format::SignatureToken::StructInstantiation",
                                                              0
                                                            |) in
                                                          Value.Tuple []))
                                                    ],
                                                    M.closure
                                                      (fun γ =>
                                                        ltac:(M.monadic
                                                          match γ with
                                                          | [] =>
                                                            ltac:(M.monadic
                                                              (M.alloc (| Value.Tuple [] |)))
                                                          | _ =>
                                                            M.impossible "wrong number of arguments"
                                                          end))
                                                  |)))
                                            ]
                                          |)))
                                    ]
                                  |) in
                                M.alloc (| Value.Tuple [] |)))
                            |)))
                      ]
                    |)) in
                M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
              |)))
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_type_parameter :
      M.IsAssociatedFunction Self "check_type_parameter" check_type_parameter.
    
    (*
        fn check_code_unit_bounds_impl<T, I>(
            &self,
            pool: &[T],
            idx: I,
            bytecode_offset: usize,
        ) -> PartialVMResult<()>
        where
            I: ModuleIndex,
        {
            let idx = idx.into_index();
            let len = pool.len();
            if idx >= len {
                Err(self.offset_out_of_bounds(
                    StatusCode::INDEX_OUT_OF_BOUNDS,
                    I::KIND,
                    idx,
                    len,
                    bytecode_offset as CodeOffset,
                ))
            } else {
                Ok(())
            }
        }
    *)
    Definition check_code_unit_bounds_impl
        (ε : list Value.t)
        (τ : list Ty.t)
        (α : list Value.t)
        : M :=
      match ε, τ, α with
      | [], [ T; _ as I ], [ self; pool; idx; bytecode_offset ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let pool := M.alloc (| pool |) in
          let idx := M.alloc (| idx |) in
          let bytecode_offset := M.alloc (| bytecode_offset |) in
          M.read (|
            let~ idx :=
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "move_binary_format::internals::ModuleIndex",
                    I,
                    [],
                    "into_index",
                    []
                  |),
                  [ M.read (| idx |) ]
                |)
              |) in
            let~ len :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (| Ty.apply (Ty.path "slice") [] [ T ], "len", [] |),
                  [ M.read (| pool |) ]
                |)
              |) in
            M.match_operator (|
              M.alloc (| Value.Tuple [] |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ :=
                      M.use (M.alloc (| BinOp.ge (| M.read (| idx |), M.read (| len |) |) |)) in
                    let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Err"
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::check_bounds::BoundsChecker",
                              "offset_out_of_bounds",
                              []
                            |),
                            [
                              M.read (| self |);
                              Value.StructTuple
                                "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                                [];
                              M.read (|
                                M.get_constant (|
                                  "move_binary_format::internals::ModuleIndex::KIND"
                                |)
                              |);
                              M.read (| idx |);
                              M.read (| len |);
                              M.rust_cast (M.read (| bytecode_offset |))
                            ]
                          |)
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_check_code_unit_bounds_impl :
      M.IsAssociatedFunction Self "check_code_unit_bounds_impl" check_code_unit_bounds_impl.
    
    (*
        fn get_locals(&self, code_unit: &CodeUnit) -> PartialVMResult<&[SignatureToken]> {
            match self.module.signatures().get(code_unit.locals.into_index()) {
                Some(signature) => Ok(&signature.0),
                None => Err(bounds_error(
                    StatusCode::INDEX_OUT_OF_BOUNDS,
                    IndexKind::Signature,
                    code_unit.locals.into_index() as u16,
                    self.module.signatures().len(),
                )),
            }
        }
    *)
    Definition get_locals (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; code_unit ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let code_unit := M.alloc (| code_unit |) in
          M.read (|
            M.match_operator (|
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "slice")
                      []
                      [ Ty.path "move_binary_format::file_format::Signature" ],
                    "get",
                    [ Ty.path "usize" ]
                  |),
                  [
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "move_binary_format::file_format::CompiledModule",
                        "signatures",
                        []
                      |),
                      [
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "move_binary_format::check_bounds::BoundsChecker",
                            "module"
                          |)
                        |)
                      ]
                    |);
                    M.call_closure (|
                      M.get_trait_method (|
                        "move_binary_format::internals::ModuleIndex",
                        Ty.path "move_binary_format::file_format::SignatureIndex",
                        [],
                        "into_index",
                        []
                      |),
                      [
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| code_unit |),
                            "move_binary_format::file_format::CodeUnit",
                            "locals"
                          |)
                        |)
                      ]
                    |)
                  ]
                |)
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ0_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "core::option::Option::Some",
                        0
                      |) in
                    let signature := M.copy (| γ0_0 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                []
                                [
                                  Ty.path "move_binary_format::file_format::SignatureToken";
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_tuple_field (|
                                M.read (| signature |),
                                "move_binary_format::file_format::Signature",
                                0
                              |)
                            ]
                          |)
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Err"
                        [
                          M.call_closure (|
                            M.get_function (| "move_binary_format::errors::bounds_error", [] |),
                            [
                              Value.StructTuple
                                "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                                [];
                              Value.StructTuple "move_binary_format::IndexKind::Signature" [];
                              M.rust_cast
                                (M.call_closure (|
                                  M.get_trait_method (|
                                    "move_binary_format::internals::ModuleIndex",
                                    Ty.path "move_binary_format::file_format::SignatureIndex",
                                    [],
                                    "into_index",
                                    []
                                  |),
                                  [
                                    M.read (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| code_unit |),
                                        "move_binary_format::file_format::CodeUnit",
                                        "locals"
                                      |)
                                    |)
                                  ]
                                |));
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "slice")
                                    []
                                    [ Ty.path "move_binary_format::file_format::Signature" ],
                                  "len",
                                  []
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "move_binary_format::file_format::CompiledModule",
                                      "signatures",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| self |),
                                          "move_binary_format::check_bounds::BoundsChecker",
                                          "module"
                                        |)
                                      |)
                                    ]
                                  |)
                                ]
                              |)
                            ]
                          |)
                        ]
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_get_locals : M.IsAssociatedFunction Self "get_locals" get_locals.
    
    (*
        fn offset_out_of_bounds(
            &self,
            status: StatusCode,
            kind: IndexKind,
            target_offset: usize,
            target_pool_len: usize,
            cur_bytecode_offset: CodeOffset,
        ) -> PartialVMError {
            match self.context {
                BoundsCheckingContext::Module => {
                    let msg = format!("Indexing into bytecode {} during bounds checking but 'current_function' was not set", cur_bytecode_offset);
                    PartialVMError::new(StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR).with_message(msg)
                }
                BoundsCheckingContext::ModuleFunction(current_function_index) => {
                    offset_out_of_bounds_error(
                        status,
                        kind,
                        target_offset,
                        target_pool_len,
                        current_function_index,
                        cur_bytecode_offset,
                    )
                }
            }
        }
    *)
    Definition offset_out_of_bounds (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ self; status; kind; target_offset; target_pool_len; cur_bytecode_offset ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let status := M.alloc (| status |) in
          let kind := M.alloc (| kind |) in
          let target_offset := M.alloc (| target_offset |) in
          let target_pool_len := M.alloc (| target_pool_len |) in
          let cur_bytecode_offset := M.alloc (| cur_bytecode_offset |) in
          M.read (|
            M.match_operator (|
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "move_binary_format::check_bounds::BoundsChecker",
                "context"
              |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let _ :=
                      M.is_struct_tuple (|
                        γ,
                        "move_binary_format::check_bounds::BoundsCheckingContext::Module"
                      |) in
                    let~ msg :=
                      M.alloc (|
                        M.call_closure (|
                          M.get_function (|
                            "core::hint::must_use",
                            [ Ty.path "alloc::string::String" ]
                          |),
                          [
                            M.read (|
                              let~ res :=
                                M.alloc (|
                                  M.call_closure (|
                                    M.get_function (| "alloc::fmt::format", [] |),
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "core::fmt::Arguments",
                                          "new_v1",
                                          []
                                        |),
                                        [
                                          M.alloc (|
                                            Value.Array
                                              [
                                                M.read (| Value.String "Indexing into bytecode " |);
                                                M.read (|
                                                  Value.String
                                                    " during bounds checking but 'current_function' was not set"
                                                |)
                                              ]
                                          |);
                                          M.alloc (|
                                            Value.Array
                                              [
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path "core::fmt::rt::Argument",
                                                    "new_display",
                                                    [ Ty.path "u16" ]
                                                  |),
                                                  [ cur_bytecode_offset ]
                                                |)
                                              ]
                                          |)
                                        ]
                                      |)
                                    ]
                                  |)
                                |) in
                              res
                            |)
                          ]
                        |)
                      |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "move_binary_format::errors::PartialVMError",
                          "with_message",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "move_binary_format::errors::PartialVMError",
                              "new",
                              []
                            |),
                            [
                              Value.StructTuple
                                "move_core_types::vm_status::StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR"
                                []
                            ]
                          |);
                          M.read (| msg |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ0_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "move_binary_format::check_bounds::BoundsCheckingContext::ModuleFunction",
                        0
                      |) in
                    let current_function_index := M.copy (| γ0_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_function (| "move_binary_format::errors::offset_out_of_bounds", [] |),
                        [
                          M.read (| status |);
                          M.read (| kind |);
                          M.read (| target_offset |);
                          M.read (| target_pool_len |);
                          M.read (| current_function_index |);
                          M.read (| cur_bytecode_offset |)
                        ]
                      |)
                    |)))
              ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom AssociatedFunction_offset_out_of_bounds :
      M.IsAssociatedFunction Self "offset_out_of_bounds" offset_out_of_bounds.
  End Impl_move_binary_format_check_bounds_BoundsChecker.
  
  (*
  fn check_bounds_impl<T, I>(pool: &[T], idx: I) -> PartialVMResult<()>
  where
      I: ModuleIndex,
  {
      let idx = idx.into_index();
      let len = pool.len();
      if idx >= len {
          Err(bounds_error(
              StatusCode::INDEX_OUT_OF_BOUNDS,
              I::KIND,
              idx as TableIndex,
              len,
          ))
      } else {
          Ok(())
      }
  }
  *)
  Definition check_bounds_impl (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
    match ε, τ, α with
    | [], [ T; _ as I ], [ pool; idx ] =>
      ltac:(M.monadic
        (let pool := M.alloc (| pool |) in
        let idx := M.alloc (| idx |) in
        M.read (|
          let~ idx :=
            M.alloc (|
              M.call_closure (|
                M.get_trait_method (|
                  "move_binary_format::internals::ModuleIndex",
                  I,
                  [],
                  "into_index",
                  []
                |),
                [ M.read (| idx |) ]
              |)
            |) in
          let~ len :=
            M.alloc (|
              M.call_closure (|
                M.get_associated_function (| Ty.apply (Ty.path "slice") [] [ T ], "len", [] |),
                [ M.read (| pool |) ]
              |)
            |) in
          M.match_operator (|
            M.alloc (| Value.Tuple [] |),
            [
              fun γ =>
                ltac:(M.monadic
                  (let γ :=
                    M.use (M.alloc (| BinOp.ge (| M.read (| idx |), M.read (| len |) |) |)) in
                  let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                  M.alloc (|
                    Value.StructTuple
                      "core::result::Result::Err"
                      [
                        M.call_closure (|
                          M.get_function (| "move_binary_format::errors::bounds_error", [] |),
                          [
                            Value.StructTuple
                              "move_core_types::vm_status::StatusCode::INDEX_OUT_OF_BOUNDS"
                              [];
                            M.read (|
                              M.get_constant (|
                                "move_binary_format::internals::ModuleIndex::KIND"
                              |)
                            |);
                            M.rust_cast (M.read (| idx |));
                            M.read (| len |)
                          ]
                        |)
                      ]
                  |)));
              fun γ =>
                ltac:(M.monadic
                  (M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)))
            ]
          |)
        |)))
    | _, _, _ => M.impossible "wrong number of arguments"
    end.
  
  Axiom Function_check_bounds_impl :
    M.IsFunction "move_binary_format::check_bounds::check_bounds_impl" check_bounds_impl.
End check_bounds.
