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

Module locals_safety.
  (*
  pub(crate) fn verify<'a>(
      module: &CompiledModule,
      function_context: &'a FunctionContext<'a>,
      meter: &mut (impl Meter + ?Sized),
  ) -> PartialVMResult<()> {
      let initial_state = AbstractState::new(module, function_context)?;
      LocalsSafetyAnalysis().analyze_function(initial_state, function_context, meter)
  }
  *)
  Definition verify (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
    match ε, τ, α with
    | [], [ impl_Meter__plus___Sized ], [ module; function_context; meter ] =>
      ltac:(M.monadic
        (let module := M.alloc (| module |) in
        let function_context := M.alloc (| function_context |) in
        let meter := M.alloc (| meter |) in
        M.catch_return (|
          ltac:(M.monadic
            (M.read (|
              let~ initial_state :=
                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.path
                                "move_bytecode_verifier::locals_safety::abstract_state::AbstractState";
                              Ty.path "move_binary_format::errors::PartialVMError"
                            ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path
                                "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                              "new",
                              []
                            |),
                            [ M.read (| module |); M.read (| function_context |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      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_trait_method (|
                    "move_bytecode_verifier::absint::AbstractInterpreter",
                    Ty.path "move_bytecode_verifier::locals_safety::LocalsSafetyAnalysis",
                    [],
                    "analyze_function",
                    [ impl_Meter__plus___Sized ]
                  |),
                  [
                    M.alloc (|
                      Value.StructTuple
                        "move_bytecode_verifier::locals_safety::LocalsSafetyAnalysis"
                        []
                    |);
                    M.read (| initial_state |);
                    M.read (| function_context |);
                    M.read (| meter |)
                  ]
                |)
              |)
            |)))
        |)))
    | _, _, _ => M.impossible "wrong number of arguments"
    end.
  
  Axiom Function_verify : M.IsFunction "move_bytecode_verifier::locals_safety::verify" verify.
  
  (*
  fn execute_inner(
      state: &mut AbstractState,
      bytecode: &Bytecode,
      offset: CodeOffset,
      meter: &mut (impl Meter + ?Sized),
  ) -> PartialVMResult<()> {
      meter.add(Scope::Function, STEP_BASE_COST)?;
      match bytecode {
          Bytecode::StLoc(idx) => match state.local_state( *idx) {
              LocalState::MaybeAvailable | LocalState::Available
                  if !state.local_abilities( *idx).has_drop() =>
              {
                  return Err(state.error(StatusCode::STLOC_UNSAFE_TO_DESTROY_ERROR, offset))
              }
              _ => state.set_available( *idx),
          },
  
          Bytecode::MoveLoc(idx) => match state.local_state( *idx) {
              LocalState::MaybeAvailable | LocalState::Unavailable => {
                  return Err(state.error(StatusCode::MOVELOC_UNAVAILABLE_ERROR, offset))
              }
              LocalState::Available => state.set_unavailable( *idx),
          },
  
          Bytecode::CopyLoc(idx) => match state.local_state( *idx) {
              LocalState::MaybeAvailable | LocalState::Unavailable => {
                  return Err(state.error(StatusCode::COPYLOC_UNAVAILABLE_ERROR, offset))
              }
              LocalState::Available => (),
          },
  
          Bytecode::MutBorrowLoc(idx) | Bytecode::ImmBorrowLoc(idx) => {
              match state.local_state( *idx) {
                  LocalState::Unavailable | LocalState::MaybeAvailable => {
                      return Err(state.error(StatusCode::BORROWLOC_UNAVAILABLE_ERROR, offset))
                  }
                  LocalState::Available => (),
              }
          }
  
          Bytecode::Ret => {
              let local_states = state.local_states();
              meter.add_items(Scope::Function, RET_PER_LOCAL_COST, local_states.len())?;
              let all_local_abilities = state.all_local_abilities();
              assert!(local_states.len() == all_local_abilities.len());
              for (local_state, local_abilities) in local_states.iter().zip(all_local_abilities) {
                  match local_state {
                      LocalState::MaybeAvailable | LocalState::Available
                          if !local_abilities.has_drop() =>
                      {
                          return Err(
                              state.error(StatusCode::UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP, offset)
                          )
                      }
                      _ => (),
                  }
              }
          }
  
          Bytecode::Pop
          | Bytecode::BrTrue(_)
          | Bytecode::BrFalse(_)
          | Bytecode::Abort
          | Bytecode::Branch(_)
          | Bytecode::Nop
          | Bytecode::FreezeRef
          | Bytecode::MutBorrowField(_)
          | Bytecode::MutBorrowFieldGeneric(_)
          | Bytecode::ImmBorrowField(_)
          | Bytecode::ImmBorrowFieldGeneric(_)
          | Bytecode::LdU8(_)
          | Bytecode::LdU16(_)
          | Bytecode::LdU32(_)
          | Bytecode::LdU64(_)
          | Bytecode::LdU128(_)
          | Bytecode::LdU256(_)
          | Bytecode::LdConst(_)
          | Bytecode::LdTrue
          | Bytecode::LdFalse
          | Bytecode::Call(_)
          | Bytecode::CallGeneric(_)
          | Bytecode::Pack(_)
          | Bytecode::PackGeneric(_)
          | Bytecode::Unpack(_)
          | Bytecode::UnpackGeneric(_)
          | Bytecode::ReadRef
          | Bytecode::WriteRef
          | Bytecode::CastU8
          | Bytecode::CastU16
          | Bytecode::CastU32
          | Bytecode::CastU64
          | Bytecode::CastU128
          | Bytecode::CastU256
          | Bytecode::Add
          | Bytecode::Sub
          | Bytecode::Mul
          | Bytecode::Mod
          | Bytecode::Div
          | Bytecode::BitOr
          | Bytecode::BitAnd
          | Bytecode::Xor
          | Bytecode::Shl
          | Bytecode::Shr
          | Bytecode::Or
          | Bytecode::And
          | Bytecode::Not
          | Bytecode::Eq
          | Bytecode::Neq
          | Bytecode::Lt
          | Bytecode::Gt
          | Bytecode::Le
          | Bytecode::Ge
          | Bytecode::MutBorrowGlobalDeprecated(_)
          | Bytecode::MutBorrowGlobalGenericDeprecated(_)
          | Bytecode::ImmBorrowGlobalDeprecated(_)
          | Bytecode::ImmBorrowGlobalGenericDeprecated(_)
          | Bytecode::ExistsDeprecated(_)
          | Bytecode::ExistsGenericDeprecated(_)
          | Bytecode::MoveFromDeprecated(_)
          | Bytecode::MoveFromGenericDeprecated(_)
          | Bytecode::MoveToDeprecated(_)
          | Bytecode::MoveToGenericDeprecated(_)
          | Bytecode::VecPack(..)
          | Bytecode::VecLen(_)
          | Bytecode::VecImmBorrow(_)
          | Bytecode::VecMutBorrow(_)
          | Bytecode::VecPushBack(_)
          | Bytecode::VecPopBack(_)
          | Bytecode::VecUnpack(..)
          | Bytecode::VecSwap(_) => (),
      };
      Ok(())
  }
  *)
  Definition execute_inner (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
    match ε, τ, α with
    | [], [ impl_Meter__plus___Sized ], [ state; bytecode; offset; meter ] =>
      ltac:(M.monadic
        (let state := M.alloc (| state |) in
        let bytecode := M.alloc (| bytecode |) in
        let offset := M.alloc (| offset |) in
        let meter := M.alloc (| meter |) 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_trait_method (|
                            "move_bytecode_verifier_meter::Meter",
                            impl_Meter__plus___Sized,
                            [],
                            "add",
                            []
                          |),
                          [
                            M.read (| meter |);
                            Value.StructTuple "move_bytecode_verifier_meter::Scope::Function" [];
                            M.read (|
                              M.get_constant (|
                                "move_bytecode_verifier::locals_safety::abstract_state::STEP_BASE_COST"
                              |)
                            |)
                          ]
                        |)
                      ]
                    |)
                  |),
                  [
                    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 (|
                  bytecode,
                  [
                    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
                        M.match_operator (|
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path
                                  "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                "local_state",
                                []
                              |),
                              [ M.read (| state |); M.read (| M.read (| idx |) |) ]
                            |)
                          |),
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (M.find_or_pattern (|
                                  γ,
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_struct_tuple (|
                                            γ,
                                            "move_bytecode_verifier::locals_safety::abstract_state::LocalState::MaybeAvailable"
                                          |) in
                                        Value.Tuple []));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_struct_tuple (|
                                            γ,
                                            "move_bytecode_verifier::locals_safety::abstract_state::LocalState::Available"
                                          |) in
                                        Value.Tuple []))
                                  ],
                                  M.closure
                                    (fun γ =>
                                      ltac:(M.monadic
                                        match γ with
                                        | [] =>
                                          ltac:(M.monadic
                                            (let γ :=
                                              M.alloc (|
                                                UnOp.not (|
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "move_binary_format::file_format::AbilitySet",
                                                      "has_drop",
                                                      []
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path
                                                            "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                                          "local_abilities",
                                                          []
                                                        |),
                                                        [
                                                          M.read (| state |);
                                                          M.read (| M.read (| idx |) |)
                                                        ]
                                                      |)
                                                    ]
                                                  |)
                                                |)
                                              |) 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_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                                            "error",
                                                            []
                                                          |),
                                                          [
                                                            M.read (| state |);
                                                            Value.StructTuple
                                                              "move_core_types::vm_status::StatusCode::STLOC_UNSAFE_TO_DESTROY_ERROR"
                                                              [];
                                                            M.read (| offset |)
                                                          ]
                                                        |)
                                                      ]
                                                  |)
                                                |)
                                              |)
                                            |)))
                                        | _ => M.impossible "wrong number of arguments"
                                        end))
                                |)));
                            fun γ =>
                              ltac:(M.monadic
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path
                                        "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                      "set_available",
                                      []
                                    |),
                                    [ M.read (| state |); M.read (| M.read (| 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
                        M.match_operator (|
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path
                                  "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                "local_state",
                                []
                              |),
                              [ M.read (| state |); M.read (| M.read (| idx |) |) ]
                            |)
                          |),
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (M.find_or_pattern (|
                                  γ,
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_struct_tuple (|
                                            γ,
                                            "move_bytecode_verifier::locals_safety::abstract_state::LocalState::MaybeAvailable"
                                          |) in
                                        Value.Tuple []));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_struct_tuple (|
                                            γ,
                                            "move_bytecode_verifier::locals_safety::abstract_state::LocalState::Unavailable"
                                          |) in
                                        Value.Tuple []))
                                  ],
                                  M.closure
                                    (fun γ =>
                                      ltac:(M.monadic
                                        match γ with
                                        | [] =>
                                          ltac:(M.monadic
                                            (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_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                                            "error",
                                                            []
                                                          |),
                                                          [
                                                            M.read (| state |);
                                                            Value.StructTuple
                                                              "move_core_types::vm_status::StatusCode::MOVELOC_UNAVAILABLE_ERROR"
                                                              [];
                                                            M.read (| offset |)
                                                          ]
                                                        |)
                                                      ]
                                                  |)
                                                |)
                                              |)
                                            |)))
                                        | _ => M.impossible "wrong number of arguments"
                                        end))
                                |)));
                            fun γ =>
                              ltac:(M.monadic
                                (let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_bytecode_verifier::locals_safety::abstract_state::LocalState::Available"
                                  |) in
                                M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path
                                        "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                      "set_unavailable",
                                      []
                                    |),
                                    [ M.read (| state |); M.read (| M.read (| idx |) |) ]
                                  |)
                                |)))
                          ]
                        |)));
                    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
                        M.match_operator (|
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path
                                  "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                "local_state",
                                []
                              |),
                              [ M.read (| state |); M.read (| M.read (| idx |) |) ]
                            |)
                          |),
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (M.find_or_pattern (|
                                  γ,
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_struct_tuple (|
                                            γ,
                                            "move_bytecode_verifier::locals_safety::abstract_state::LocalState::MaybeAvailable"
                                          |) in
                                        Value.Tuple []));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_struct_tuple (|
                                            γ,
                                            "move_bytecode_verifier::locals_safety::abstract_state::LocalState::Unavailable"
                                          |) in
                                        Value.Tuple []))
                                  ],
                                  M.closure
                                    (fun γ =>
                                      ltac:(M.monadic
                                        match γ with
                                        | [] =>
                                          ltac:(M.monadic
                                            (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_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                                            "error",
                                                            []
                                                          |),
                                                          [
                                                            M.read (| state |);
                                                            Value.StructTuple
                                                              "move_core_types::vm_status::StatusCode::COPYLOC_UNAVAILABLE_ERROR"
                                                              [];
                                                            M.read (| offset |)
                                                          ]
                                                        |)
                                                      ]
                                                  |)
                                                |)
                                              |)
                                            |)))
                                        | _ => M.impossible "wrong number of arguments"
                                        end))
                                |)));
                            fun γ =>
                              ltac:(M.monadic
                                (let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_bytecode_verifier::locals_safety::abstract_state::LocalState::Available"
                                  |) in
                                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::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
                                    (M.match_operator (|
                                      M.alloc (|
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path
                                              "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                            "local_state",
                                            []
                                          |),
                                          [ M.read (| state |); M.read (| M.read (| idx |) |) ]
                                        |)
                                      |),
                                      [
                                        fun γ =>
                                          ltac:(M.monadic
                                            (M.find_or_pattern (|
                                              γ,
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let _ :=
                                                      M.is_struct_tuple (|
                                                        γ,
                                                        "move_bytecode_verifier::locals_safety::abstract_state::LocalState::Unavailable"
                                                      |) in
                                                    Value.Tuple []));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let _ :=
                                                      M.is_struct_tuple (|
                                                        γ,
                                                        "move_bytecode_verifier::locals_safety::abstract_state::LocalState::MaybeAvailable"
                                                      |) in
                                                    Value.Tuple []))
                                              ],
                                              M.closure
                                                (fun γ =>
                                                  ltac:(M.monadic
                                                    match γ with
                                                    | [] =>
                                                      ltac:(M.monadic
                                                        (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_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                                                        "error",
                                                                        []
                                                                      |),
                                                                      [
                                                                        M.read (| state |);
                                                                        Value.StructTuple
                                                                          "move_core_types::vm_status::StatusCode::BORROWLOC_UNAVAILABLE_ERROR"
                                                                          [];
                                                                        M.read (| offset |)
                                                                      ]
                                                                    |)
                                                                  ]
                                                              |)
                                                            |)
                                                          |)
                                                        |)))
                                                    | _ => M.impossible "wrong number of arguments"
                                                    end))
                                            |)));
                                        fun γ =>
                                          ltac:(M.monadic
                                            (let _ :=
                                              M.is_struct_tuple (|
                                                γ,
                                                "move_bytecode_verifier::locals_safety::abstract_state::LocalState::Available"
                                              |) in
                                            M.alloc (| Value.Tuple [] |)))
                                      ]
                                    |)))
                                | _ => M.impossible "wrong number of arguments"
                                end))
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        let _ :=
                          M.is_struct_tuple (|
                            γ,
                            "move_binary_format::file_format::Bytecode::Ret"
                          |) in
                        let~ local_states :=
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path
                                  "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                "local_states",
                                []
                              |),
                              [ M.read (| state |) ]
                            |)
                          |) 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_trait_method (|
                                      "move_bytecode_verifier_meter::Meter",
                                      impl_Meter__plus___Sized,
                                      [],
                                      "add_items",
                                      []
                                    |),
                                    [
                                      M.read (| meter |);
                                      Value.StructTuple
                                        "move_bytecode_verifier_meter::Scope::Function"
                                        [];
                                      M.read (|
                                        M.get_constant (|
                                          "move_bytecode_verifier::locals_safety::abstract_state::RET_PER_LOCAL_COST"
                                        |)
                                      |);
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.apply
                                            (Ty.path "alloc::vec::Vec")
                                            []
                                            [
                                              Ty.path
                                                "move_bytecode_verifier::locals_safety::abstract_state::LocalState";
                                              Ty.path "alloc::alloc::Global"
                                            ],
                                          "len",
                                          []
                                        |),
                                        [ M.read (| local_states |) ]
                                      |)
                                    ]
                                  |)
                                ]
                              |)
                            |),
                            [
                              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~ all_local_abilities :=
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path
                                  "move_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                "all_local_abilities",
                                []
                              |),
                              [ M.read (| state |) ]
                            |)
                          |) in
                        let~ _ :=
                          M.match_operator (|
                            M.alloc (| Value.Tuple [] |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ :=
                                    M.use
                                      (M.alloc (|
                                        UnOp.not (|
                                          BinOp.eq (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  []
                                                  [
                                                    Ty.path
                                                      "move_bytecode_verifier::locals_safety::abstract_state::LocalState";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "len",
                                                []
                                              |),
                                              [ M.read (| local_states |) ]
                                            |),
                                            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.read (| all_local_abilities |) ]
                                            |)
                                          |)
                                        |)
                                      |)) in
                                  let _ :=
                                    M.is_constant_or_break_match (|
                                      M.read (| γ |),
                                      Value.Bool true
                                    |) in
                                  M.alloc (|
                                    M.never_to_any (|
                                      M.call_closure (|
                                        M.get_function (| "core::panicking::panic", [] |),
                                        [
                                          M.read (|
                                            Value.String
                                              "assertion failed: local_states.len() == all_local_abilities.len()"
                                          |)
                                        ]
                                      |)
                                    |)
                                  |)));
                              fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                            ]
                          |) in
                        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::zip::Zip")
                                    []
                                    [
                                      Ty.apply
                                        (Ty.path "core::slice::iter::Iter")
                                        []
                                        [
                                          Ty.path
                                            "move_bytecode_verifier::locals_safety::abstract_state::LocalState"
                                        ];
                                      Ty.apply
                                        (Ty.path "core::slice::iter::Iter")
                                        []
                                        [ Ty.path "move_binary_format::file_format::AbilitySet" ]
                                    ],
                                  [],
                                  "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_bytecode_verifier::locals_safety::abstract_state::LocalState"
                                        ],
                                      [],
                                      "zip",
                                      [
                                        Ty.apply
                                          (Ty.path "&")
                                          []
                                          [
                                            Ty.apply
                                              (Ty.path "alloc::vec::Vec")
                                              []
                                              [
                                                Ty.path
                                                  "move_binary_format::file_format::AbilitySet";
                                                Ty.path "alloc::alloc::Global"
                                              ]
                                          ]
                                      ]
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.apply
                                            (Ty.path "slice")
                                            []
                                            [
                                              Ty.path
                                                "move_bytecode_verifier::locals_safety::abstract_state::LocalState"
                                            ],
                                          "iter",
                                          []
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::ops::deref::Deref",
                                              Ty.apply
                                                (Ty.path "alloc::vec::Vec")
                                                []
                                                [
                                                  Ty.path
                                                    "move_bytecode_verifier::locals_safety::abstract_state::LocalState";
                                                  Ty.path "alloc::alloc::Global"
                                                ],
                                              [],
                                              "deref",
                                              []
                                            |),
                                            [ M.read (| local_states |) ]
                                          |)
                                        ]
                                      |);
                                      M.read (| all_local_abilities |)
                                    ]
                                  |)
                                ]
                              |)
                            |),
                            [
                              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::zip::Zip")
                                                  []
                                                  [
                                                    Ty.apply
                                                      (Ty.path "core::slice::iter::Iter")
                                                      []
                                                      [
                                                        Ty.path
                                                          "move_bytecode_verifier::locals_safety::abstract_state::LocalState"
                                                      ];
                                                    Ty.apply
                                                      (Ty.path "core::slice::iter::Iter")
                                                      []
                                                      [
                                                        Ty.path
                                                          "move_binary_format::file_format::AbilitySet"
                                                      ]
                                                  ],
                                                [],
                                                "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 local_state := M.copy (| γ1_0 |) in
                                                let local_abilities := M.copy (| γ1_1 |) in
                                                M.match_operator (|
                                                  local_state,
                                                  [
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (M.find_or_pattern (|
                                                          γ,
                                                          [
                                                            fun γ =>
                                                              ltac:(M.monadic
                                                                (let γ := M.read (| γ |) in
                                                                let _ :=
                                                                  M.is_struct_tuple (|
                                                                    γ,
                                                                    "move_bytecode_verifier::locals_safety::abstract_state::LocalState::MaybeAvailable"
                                                                  |) in
                                                                Value.Tuple []));
                                                            fun γ =>
                                                              ltac:(M.monadic
                                                                (let γ := M.read (| γ |) in
                                                                let _ :=
                                                                  M.is_struct_tuple (|
                                                                    γ,
                                                                    "move_bytecode_verifier::locals_safety::abstract_state::LocalState::Available"
                                                                  |) in
                                                                Value.Tuple []))
                                                          ],
                                                          M.closure
                                                            (fun γ =>
                                                              ltac:(M.monadic
                                                                match γ with
                                                                | [] =>
                                                                  ltac:(M.monadic
                                                                    (let γ :=
                                                                      M.alloc (|
                                                                        UnOp.not (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.path
                                                                                "move_binary_format::file_format::AbilitySet",
                                                                              "has_drop",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                M.read (|
                                                                                  local_abilities
                                                                                |)
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        |)
                                                                      |) 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_bytecode_verifier::locals_safety::abstract_state::AbstractState",
                                                                                    "error",
                                                                                    []
                                                                                  |),
                                                                                  [
                                                                                    M.read (|
                                                                                      state
                                                                                    |);
                                                                                    Value.StructTuple
                                                                                      "move_core_types::vm_status::StatusCode::UNSAFE_RET_UNUSED_VALUES_WITHOUT_DROP"
                                                                                      [];
                                                                                    M.read (|
                                                                                      offset
                                                                                    |)
                                                                                  ]
                                                                                |)
                                                                              ]
                                                                          |)
                                                                        |)
                                                                      |)
                                                                    |)))
                                                                | _ =>
                                                                  M.impossible
                                                                    "wrong number of arguments"
                                                                end))
                                                        |)));
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (M.alloc (| Value.Tuple [] |)))
                                                  ]
                                                |)))
                                          ]
                                        |) in
                                      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::Bytecode::Pop"
                                  |) 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::BrTrue",
                                    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::BrFalse",
                                    0
                                  |) 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 γ1_0 :=
                                  M.SubPointer.get_struct_tuple_field (|
                                    γ,
                                    "move_binary_format::file_format::Bytecode::Branch",
                                    0
                                  |) 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 []));
                            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 γ1_0 :=
                                  M.SubPointer.get_struct_tuple_field (|
                                    γ,
                                    "move_binary_format::file_format::Bytecode::MutBorrowField",
                                    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::MutBorrowFieldGeneric",
                                    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::ImmBorrowField",
                                    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::ImmBorrowFieldGeneric",
                                    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::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::LdU128",
                                    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::LdConst",
                                    0
                                  |) 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 γ1_0 :=
                                  M.SubPointer.get_struct_tuple_field (|
                                    γ,
                                    "move_binary_format::file_format::Bytecode::Call",
                                    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::CallGeneric",
                                    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::Pack",
                                    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::PackGeneric",
                                    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::Unpack",
                                    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::UnpackGeneric",
                                    0
                                  |) 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::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::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 γ1_0 :=
                                  M.SubPointer.get_struct_tuple_field (|
                                    γ,
                                    "move_binary_format::file_format::Bytecode::MutBorrowGlobalDeprecated",
                                    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::MutBorrowGlobalGenericDeprecated",
                                    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::ImmBorrowGlobalDeprecated",
                                    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::ImmBorrowGlobalGenericDeprecated",
                                    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::ExistsDeprecated",
                                    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::ExistsGenericDeprecated",
                                    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::MoveFromDeprecated",
                                    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::MoveFromGenericDeprecated",
                                    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::MoveToDeprecated",
                                    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::MoveToGenericDeprecated",
                                    0
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_binary_format::file_format::Bytecode::VecPack"
                                  |) 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::VecLen",
                                    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::VecImmBorrow",
                                    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::VecMutBorrow",
                                    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::VecPushBack",
                                    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::VecPopBack",
                                    0
                                  |) in
                                Value.Tuple []));
                            fun γ =>
                              ltac:(M.monadic
                                (let γ := M.read (| γ |) in
                                let _ :=
                                  M.is_struct_tuple (|
                                    γ,
                                    "move_binary_format::file_format::Bytecode::VecUnpack"
                                  |) 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::VecSwap",
                                    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.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
            |)))
        |)))
    | _, _, _ => M.impossible "wrong number of arguments"
    end.
  
  Axiom Function_execute_inner :
    M.IsFunction "move_bytecode_verifier::locals_safety::execute_inner" execute_inner.
  
  (* StructTuple
    {
      name := "LocalsSafetyAnalysis";
      const_params := [];
      ty_params := [];
      fields := [];
    } *)
  
  Module Impl_move_bytecode_verifier_absint_TransferFunctions_for_move_bytecode_verifier_locals_safety_LocalsSafetyAnalysis.
    Definition Self : Ty.t := Ty.path "move_bytecode_verifier::locals_safety::LocalsSafetyAnalysis".
    
    (*     type State = AbstractState; *)
    Definition _State : Ty.t :=
      Ty.path "move_bytecode_verifier::locals_safety::abstract_state::AbstractState".
    
    (*     type Error = PartialVMError; *)
    Definition _Error : Ty.t := Ty.path "move_binary_format::errors::PartialVMError".
    
    (*
        fn execute(
            &mut self,
            state: &mut Self::State,
            bytecode: &Bytecode,
            index: CodeOffset,
            _last_index: CodeOffset,
            meter: &mut (impl Meter + ?Sized),
        ) -> PartialVMResult<()> {
            execute_inner(state, bytecode, index, meter)
        }
    *)
    Definition execute (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [ impl_Meter__plus___Sized ], [ self; state; bytecode; index; _last_index; meter ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let state := M.alloc (| state |) in
          let bytecode := M.alloc (| bytecode |) in
          let index := M.alloc (| index |) in
          let _last_index := M.alloc (| _last_index |) in
          let meter := M.alloc (| meter |) in
          M.call_closure (|
            M.get_function (|
              "move_bytecode_verifier::locals_safety::execute_inner",
              [ impl_Meter__plus___Sized ]
            |),
            [ M.read (| state |); M.read (| bytecode |); M.read (| index |); M.read (| meter |) ]
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "move_bytecode_verifier::absint::TransferFunctions"
        Self
        (* Trait polymorphic types *) []
        (* Instance *)
        [
          ("State", InstanceField.Ty _State);
          ("Error", InstanceField.Ty _Error);
          ("execute", InstanceField.Method execute)
        ].
  End Impl_move_bytecode_verifier_absint_TransferFunctions_for_move_bytecode_verifier_locals_safety_LocalsSafetyAnalysis.
  
  Module Impl_move_bytecode_verifier_absint_AbstractInterpreter_for_move_bytecode_verifier_locals_safety_LocalsSafetyAnalysis.
    Definition Self : Ty.t := Ty.path "move_bytecode_verifier::locals_safety::LocalsSafetyAnalysis".
    
    Axiom Implements :
      M.IsTraitInstance
        "move_bytecode_verifier::absint::AbstractInterpreter"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [].
  End Impl_move_bytecode_verifier_absint_AbstractInterpreter_for_move_bytecode_verifier_locals_safety_LocalsSafetyAnalysis.
End locals_safety.
