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

Module instruction.
  Definition value_MIN_SIGNERS : Value.t := M.run ltac:(M.monadic (M.alloc (| Value.Integer 1 |))).
  
  Definition value_MAX_SIGNERS : Value.t := M.run ltac:(M.monadic (M.alloc (| Value.Integer 11 |))).
  
  Definition value_U16_BYTES : Value.t := M.run ltac:(M.monadic (M.alloc (| Value.Integer 2 |))).
  
  Definition value_U64_BYTES : Value.t := M.run ltac:(M.monadic (M.alloc (| Value.Integer 8 |))).
  
  (*
  Enum TokenInstruction
  {
    ty_params := [];
    variants :=
      [
        {
          name := "InitializeMint";
          item :=
            StructRecord
              [
                ("decimals", Ty.path "u8");
                ("mint_authority", Ty.path "solana_program::pubkey::Pubkey");
                ("freeze_authority",
                  Ty.apply
                    (Ty.path "solana_program::program_option::COption")
                    [ Ty.path "solana_program::pubkey::Pubkey" ])
              ];
          discriminant := None;
        };
        {
          name := "InitializeAccount";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "InitializeMultisig";
          item := StructRecord [ ("m", Ty.path "u8") ];
          discriminant := None;
        };
        {
          name := "Transfer";
          item := StructRecord [ ("amount", Ty.path "u64") ];
          discriminant := None;
        };
        {
          name := "Approve";
          item := StructRecord [ ("amount", Ty.path "u64") ];
          discriminant := None;
        };
        {
          name := "Revoke";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "SetAuthority";
          item :=
            StructRecord
              [
                ("authority_type", Ty.path "spl_token_2022::instruction::AuthorityType");
                ("new_authority",
                  Ty.apply
                    (Ty.path "solana_program::program_option::COption")
                    [ Ty.path "solana_program::pubkey::Pubkey" ])
              ];
          discriminant := None;
        };
        {
          name := "MintTo";
          item := StructRecord [ ("amount", Ty.path "u64") ];
          discriminant := None;
        };
        {
          name := "Burn";
          item := StructRecord [ ("amount", Ty.path "u64") ];
          discriminant := None;
        };
        {
          name := "CloseAccount";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "FreezeAccount";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "ThawAccount";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "TransferChecked";
          item := StructRecord [ ("amount", Ty.path "u64"); ("decimals", Ty.path "u8") ];
          discriminant := None;
        };
        {
          name := "ApproveChecked";
          item := StructRecord [ ("amount", Ty.path "u64"); ("decimals", Ty.path "u8") ];
          discriminant := None;
        };
        {
          name := "MintToChecked";
          item := StructRecord [ ("amount", Ty.path "u64"); ("decimals", Ty.path "u8") ];
          discriminant := None;
        };
        {
          name := "BurnChecked";
          item := StructRecord [ ("amount", Ty.path "u64"); ("decimals", Ty.path "u8") ];
          discriminant := None;
        };
        {
          name := "InitializeAccount2";
          item := StructRecord [ ("owner", Ty.path "solana_program::pubkey::Pubkey") ];
          discriminant := None;
        };
        {
          name := "SyncNative";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "InitializeAccount3";
          item := StructRecord [ ("owner", Ty.path "solana_program::pubkey::Pubkey") ];
          discriminant := None;
        };
        {
          name := "InitializeMultisig2";
          item := StructRecord [ ("m", Ty.path "u8") ];
          discriminant := None;
        };
        {
          name := "InitializeMint2";
          item :=
            StructRecord
              [
                ("decimals", Ty.path "u8");
                ("mint_authority", Ty.path "solana_program::pubkey::Pubkey");
                ("freeze_authority",
                  Ty.apply
                    (Ty.path "solana_program::program_option::COption")
                    [ Ty.path "solana_program::pubkey::Pubkey" ])
              ];
          discriminant := None;
        };
        {
          name := "GetAccountDataSize";
          item :=
            StructRecord
              [
                ("extension_types",
                  Ty.apply
                    (Ty.path "alloc::vec::Vec")
                    [
                      Ty.path "spl_token_2022::extension::ExtensionType";
                      Ty.path "alloc::alloc::Global"
                    ])
              ];
          discriminant := None;
        };
        {
          name := "InitializeImmutableOwner";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "AmountToUiAmount";
          item := StructRecord [ ("amount", Ty.path "u64") ];
          discriminant := None;
        };
        {
          name := "UiAmountToAmount";
          item := StructRecord [ ("ui_amount", Ty.apply (Ty.path "&") [ Ty.path "str" ]) ];
          discriminant := None;
        };
        {
          name := "InitializeMintCloseAuthority";
          item :=
            StructRecord
              [
                ("close_authority",
                  Ty.apply
                    (Ty.path "solana_program::program_option::COption")
                    [ Ty.path "solana_program::pubkey::Pubkey" ])
              ];
          discriminant := None;
        };
        {
          name := "TransferFeeExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "ConfidentialTransferExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "DefaultAccountStateExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "Reallocate";
          item :=
            StructRecord
              [
                ("extension_types",
                  Ty.apply
                    (Ty.path "alloc::vec::Vec")
                    [
                      Ty.path "spl_token_2022::extension::ExtensionType";
                      Ty.path "alloc::alloc::Global"
                    ])
              ];
          discriminant := None;
        };
        {
          name := "MemoTransferExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "CreateNativeMint";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "InitializeNonTransferableMint";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "InterestBearingMintExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "CpiGuardExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "InitializePermanentDelegate";
          item := StructRecord [ ("delegate", Ty.path "solana_program::pubkey::Pubkey") ];
          discriminant := None;
        };
        {
          name := "TransferHookExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "ConfidentialTransferFeeExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "WithdrawExcessLamports";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "MetadataPointerExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "GroupPointerExtension";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "GroupMemberPointerExtension";
          item := StructTuple [];
          discriminant := None;
        }
      ];
  }
  *)
  
  Module Impl_core_clone_Clone_for_spl_token_2022_instruction_TokenInstruction.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::TokenInstruction".
    
    (* Clone *)
    Definition clone (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.match_operator (|
              self,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                        "decimals"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                        "mint_authority"
                      |) in
                    let γ1_2 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                        "freeze_authority"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    let __self_2 := M.alloc (| γ1_2 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint"
                        [
                          ("decimals",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u8",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |));
                          ("mint_authority",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "solana_program::pubkey::Pubkey",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_1 |) ]
                            |));
                          ("freeze_authority",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.apply
                                  (Ty.path "solana_program::program_option::COption")
                                  [ Ty.path "solana_program::pubkey::Pubkey" ],
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_2 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::InitializeAccount"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMultisig",
                        "m"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::InitializeMultisig"
                        [
                          ("m",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u8",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::Transfer",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::Transfer"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::Approve",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::Approve"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple "spl_token_2022::instruction::TokenInstruction::Revoke" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                        "authority_type"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                        "new_authority"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::SetAuthority"
                        [
                          ("authority_type",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "spl_token_2022::instruction::AuthorityType",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |));
                          ("new_authority",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.apply
                                  (Ty.path "solana_program::program_option::COption")
                                  [ Ty.path "solana_program::pubkey::Pubkey" ],
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_1 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::MintTo",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::MintTo"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::Burn",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::Burn"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::CloseAccount"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::FreezeAccount"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::ThawAccount"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                        "amount"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                        "decimals"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::TransferChecked"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |));
                          ("decimals",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u8",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_1 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                        "amount"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                        "decimals"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::ApproveChecked"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |));
                          ("decimals",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u8",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_1 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                        "amount"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                        "decimals"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::MintToChecked"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |));
                          ("decimals",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u8",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_1 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                        "amount"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                        "decimals"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::BurnChecked"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |));
                          ("decimals",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u8",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_1 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeAccount2",
                        "owner"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::InitializeAccount2"
                        [
                          ("owner",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "solana_program::pubkey::Pubkey",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::SyncNative"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeAccount3",
                        "owner"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::InitializeAccount3"
                        [
                          ("owner",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "solana_program::pubkey::Pubkey",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMultisig2",
                        "m"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::InitializeMultisig2"
                        [
                          ("m",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u8",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                        "decimals"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                        "mint_authority"
                      |) in
                    let γ1_2 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                        "freeze_authority"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    let __self_2 := M.alloc (| γ1_2 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint2"
                        [
                          ("decimals",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u8",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |));
                          ("mint_authority",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "solana_program::pubkey::Pubkey",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_1 |) ]
                            |));
                          ("freeze_authority",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.apply
                                  (Ty.path "solana_program::program_option::COption")
                                  [ Ty.path "solana_program::pubkey::Pubkey" ],
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_2 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::GetAccountDataSize",
                        "extension_types"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::GetAccountDataSize"
                        [
                          ("extension_types",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  [
                                    Ty.path "spl_token_2022::extension::ExtensionType";
                                    Ty.path "alloc::alloc::Global"
                                  ],
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::InitializeImmutableOwner"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::AmountToUiAmount",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::AmountToUiAmount"
                        [
                          ("amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "u64",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::UiAmountToAmount",
                        "ui_amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::UiAmountToAmount"
                        [
                          ("ui_amount",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.apply (Ty.path "&") [ Ty.path "str" ],
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMintCloseAuthority",
                        "close_authority"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::InitializeMintCloseAuthority"
                        [
                          ("close_authority",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.apply
                                  (Ty.path "solana_program::program_option::COption")
                                  [ Ty.path "solana_program::pubkey::Pubkey" ],
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::TransferFeeExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::ConfidentialTransferExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::DefaultAccountStateExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::Reallocate",
                        "extension_types"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::Reallocate"
                        [
                          ("extension_types",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  [
                                    Ty.path "spl_token_2022::extension::ExtensionType";
                                    Ty.path "alloc::alloc::Global"
                                  ],
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::MemoTransferExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::CreateNativeMint"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::InitializeNonTransferableMint"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::InterestBearingMintExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::CpiGuardExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializePermanentDelegate",
                        "delegate"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::instruction::TokenInstruction::InitializePermanentDelegate"
                        [
                          ("delegate",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "solana_program::pubkey::Pubkey",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |))
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::TransferHookExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::ConfidentialTransferFeeExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::WithdrawExcessLamports"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::MetadataPointerExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::GroupPointerExtension"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::TokenInstruction::GroupMemberPointerExtension"
                        []
                    |)))
              ]
            |)
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::clone::Clone"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("clone", InstanceField.Method clone) ].
  End Impl_core_clone_Clone_for_spl_token_2022_instruction_TokenInstruction.
  
  Module Impl_core_fmt_Debug_for_spl_token_2022_instruction_TokenInstruction.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::TokenInstruction".
    
    (* Debug *)
    Definition fmt (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.read (|
            M.match_operator (|
              self,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                        "decimals"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                        "mint_authority"
                      |) in
                    let γ1_2 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                        "freeze_authority"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    let __self_2 := M.alloc (| γ1_2 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field3_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "InitializeMint" |);
                          M.read (| Value.String "decimals" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_0 |));
                          M.read (| Value.String "mint_authority" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_1 |));
                          M.read (| Value.String "freeze_authority" |);
                          (* Unsize *) M.pointer_coercion __self_2
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "InitializeAccount" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMultisig",
                        "m"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "InitializeMultisig" |);
                          M.read (| Value.String "m" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::Transfer",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "Transfer" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::Approve",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "Approve" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "Revoke" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                        "authority_type"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                        "new_authority"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field2_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "SetAuthority" |);
                          M.read (| Value.String "authority_type" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_0 |));
                          M.read (| Value.String "new_authority" |);
                          (* Unsize *) M.pointer_coercion __self_1
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::MintTo",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "MintTo" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::Burn",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "Burn" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "CloseAccount" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "FreezeAccount" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "ThawAccount" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                        "amount"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                        "decimals"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field2_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "TransferChecked" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_0 |));
                          M.read (| Value.String "decimals" |);
                          (* Unsize *) M.pointer_coercion __self_1
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                        "amount"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                        "decimals"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field2_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "ApproveChecked" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_0 |));
                          M.read (| Value.String "decimals" |);
                          (* Unsize *) M.pointer_coercion __self_1
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                        "amount"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                        "decimals"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field2_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "MintToChecked" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_0 |));
                          M.read (| Value.String "decimals" |);
                          (* Unsize *) M.pointer_coercion __self_1
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                        "amount"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                        "decimals"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field2_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "BurnChecked" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_0 |));
                          M.read (| Value.String "decimals" |);
                          (* Unsize *) M.pointer_coercion __self_1
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeAccount2",
                        "owner"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "InitializeAccount2" |);
                          M.read (| Value.String "owner" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "SyncNative" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeAccount3",
                        "owner"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "InitializeAccount3" |);
                          M.read (| Value.String "owner" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMultisig2",
                        "m"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "InitializeMultisig2" |);
                          M.read (| Value.String "m" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                        "decimals"
                      |) in
                    let γ1_1 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                        "mint_authority"
                      |) in
                    let γ1_2 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                        "freeze_authority"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    let __self_1 := M.alloc (| γ1_1 |) in
                    let __self_2 := M.alloc (| γ1_2 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field3_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "InitializeMint2" |);
                          M.read (| Value.String "decimals" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_0 |));
                          M.read (| Value.String "mint_authority" |);
                          (* Unsize *) M.pointer_coercion (M.read (| __self_1 |));
                          M.read (| Value.String "freeze_authority" |);
                          (* Unsize *) M.pointer_coercion __self_2
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::GetAccountDataSize",
                        "extension_types"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "GetAccountDataSize" |);
                          M.read (| Value.String "extension_types" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "InitializeImmutableOwner" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::AmountToUiAmount",
                        "amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "AmountToUiAmount" |);
                          M.read (| Value.String "amount" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::UiAmountToAmount",
                        "ui_amount"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "UiAmountToAmount" |);
                          M.read (| Value.String "ui_amount" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializeMintCloseAuthority",
                        "close_authority"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "InitializeMintCloseAuthority" |);
                          M.read (| Value.String "close_authority" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "TransferFeeExtension" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "ConfidentialTransferExtension" |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "DefaultAccountStateExtension" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::Reallocate",
                        "extension_types"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "Reallocate" |);
                          M.read (| Value.String "extension_types" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "MemoTransferExtension" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "CreateNativeMint" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "InitializeNonTransferableMint" |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "InterestBearingMintExtension" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "CpiGuardExtension" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    let γ1_0 :=
                      M.SubPointer.get_struct_record_field (|
                        γ,
                        "spl_token_2022::instruction::TokenInstruction::InitializePermanentDelegate",
                        "delegate"
                      |) in
                    let __self_0 := M.alloc (| γ1_0 |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct_field1_finish",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "InitializePermanentDelegate" |);
                          M.read (| Value.String "delegate" |);
                          (* Unsize *) M.pointer_coercion __self_0
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "TransferHookExtension" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [
                          M.read (| f |);
                          M.read (| Value.String "ConfidentialTransferFeeExtension" |)
                        ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "WithdrawExcessLamports" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "MetadataPointerExtension" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "GroupPointerExtension" |) ]
                      |)
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "write_str",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "GroupMemberPointerExtension" |) ]
                      |)
                    |)))
              ]
            |)
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Debug"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Debug_for_spl_token_2022_instruction_TokenInstruction.
  
  Module Impl_core_marker_StructuralPartialEq_for_spl_token_2022_instruction_TokenInstruction.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::TokenInstruction".
    
    Axiom Implements :
      M.IsTraitInstance
        "core::marker::StructuralPartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [].
  End Impl_core_marker_StructuralPartialEq_for_spl_token_2022_instruction_TokenInstruction.
  
  Module Impl_core_cmp_PartialEq_for_spl_token_2022_instruction_TokenInstruction.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::TokenInstruction".
    
    (* PartialEq *)
    Definition eq (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            let __self_tag :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "spl_token_2022::instruction::TokenInstruction" ]
                  |),
                  [ M.read (| self |) ]
                |)
              |) in
            let __arg1_tag :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "spl_token_2022::instruction::TokenInstruction" ]
                  |),
                  [ M.read (| other |) ]
                |)
              |) in
            M.alloc (|
              LogicalOp.and (|
                BinOp.Pure.eq (M.read (| __self_tag |)) (M.read (| __arg1_tag |)),
                ltac:(M.monadic
                  (M.read (|
                    M.match_operator (|
                      M.alloc (| Value.Tuple [ M.read (| self |); M.read (| other |) ] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                                "decimals"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                                "mint_authority"
                              |) in
                            let γ2_2 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                                "freeze_authority"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let __self_1 := M.alloc (| γ2_1 |) in
                            let __self_2 := M.alloc (| γ2_2 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                                "decimals"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                                "mint_authority"
                              |) in
                            let γ2_2 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                                "freeze_authority"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            let __arg1_1 := M.alloc (| γ2_1 |) in
                            let __arg1_2 := M.alloc (| γ2_2 |) in
                            M.alloc (|
                              LogicalOp.and (|
                                LogicalOp.and (|
                                  BinOp.Pure.eq
                                    (M.read (| M.read (| __self_0 |) |))
                                    (M.read (| M.read (| __arg1_0 |) |)),
                                  ltac:(M.monadic
                                    (M.call_closure (|
                                      M.get_trait_method (|
                                        "core::cmp::PartialEq",
                                        Ty.path "solana_program::pubkey::Pubkey",
                                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                                        "eq",
                                        []
                                      |),
                                      [ M.read (| __self_1 |); M.read (| __arg1_1 |) ]
                                    |)))
                                |),
                                ltac:(M.monadic
                                  (M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.apply
                                        (Ty.path "solana_program::program_option::COption")
                                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      [
                                        Ty.apply
                                          (Ty.path "solana_program::program_option::COption")
                                          [ Ty.path "solana_program::pubkey::Pubkey" ]
                                      ],
                                      "eq",
                                      []
                                    |),
                                    [ M.read (| __self_2 |); M.read (| __arg1_2 |) ]
                                  |)))
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMultisig",
                                "m"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMultisig",
                                "m"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              BinOp.Pure.eq
                                (M.read (| M.read (| __self_0 |) |))
                                (M.read (| M.read (| __arg1_0 |) |))
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::Transfer",
                                "amount"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::Transfer",
                                "amount"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              BinOp.Pure.eq
                                (M.read (| M.read (| __self_0 |) |))
                                (M.read (| M.read (| __arg1_0 |) |))
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::Approve",
                                "amount"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::Approve",
                                "amount"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              BinOp.Pure.eq
                                (M.read (| M.read (| __self_0 |) |))
                                (M.read (| M.read (| __arg1_0 |) |))
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                                "authority_type"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                                "new_authority"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let __self_1 := M.alloc (| γ2_1 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                                "authority_type"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                                "new_authority"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            let __arg1_1 := M.alloc (| γ2_1 |) in
                            M.alloc (|
                              LogicalOp.and (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::PartialEq",
                                    Ty.path "spl_token_2022::instruction::AuthorityType",
                                    [ Ty.path "spl_token_2022::instruction::AuthorityType" ],
                                    "eq",
                                    []
                                  |),
                                  [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                                |),
                                ltac:(M.monadic
                                  (M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.apply
                                        (Ty.path "solana_program::program_option::COption")
                                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      [
                                        Ty.apply
                                          (Ty.path "solana_program::program_option::COption")
                                          [ Ty.path "solana_program::pubkey::Pubkey" ]
                                      ],
                                      "eq",
                                      []
                                    |),
                                    [ M.read (| __self_1 |); M.read (| __arg1_1 |) ]
                                  |)))
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::MintTo",
                                "amount"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::MintTo",
                                "amount"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              BinOp.Pure.eq
                                (M.read (| M.read (| __self_0 |) |))
                                (M.read (| M.read (| __arg1_0 |) |))
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::Burn",
                                "amount"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::Burn",
                                "amount"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              BinOp.Pure.eq
                                (M.read (| M.read (| __self_0 |) |))
                                (M.read (| M.read (| __arg1_0 |) |))
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                                "amount"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                                "decimals"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let __self_1 := M.alloc (| γ2_1 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                                "amount"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                                "decimals"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            let __arg1_1 := M.alloc (| γ2_1 |) in
                            M.alloc (|
                              LogicalOp.and (|
                                BinOp.Pure.eq
                                  (M.read (| M.read (| __self_0 |) |))
                                  (M.read (| M.read (| __arg1_0 |) |)),
                                ltac:(M.monadic
                                  (BinOp.Pure.eq
                                    (M.read (| M.read (| __self_1 |) |))
                                    (M.read (| M.read (| __arg1_1 |) |))))
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                                "amount"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                                "decimals"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let __self_1 := M.alloc (| γ2_1 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                                "amount"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                                "decimals"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            let __arg1_1 := M.alloc (| γ2_1 |) in
                            M.alloc (|
                              LogicalOp.and (|
                                BinOp.Pure.eq
                                  (M.read (| M.read (| __self_0 |) |))
                                  (M.read (| M.read (| __arg1_0 |) |)),
                                ltac:(M.monadic
                                  (BinOp.Pure.eq
                                    (M.read (| M.read (| __self_1 |) |))
                                    (M.read (| M.read (| __arg1_1 |) |))))
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                                "amount"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                                "decimals"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let __self_1 := M.alloc (| γ2_1 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                                "amount"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                                "decimals"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            let __arg1_1 := M.alloc (| γ2_1 |) in
                            M.alloc (|
                              LogicalOp.and (|
                                BinOp.Pure.eq
                                  (M.read (| M.read (| __self_0 |) |))
                                  (M.read (| M.read (| __arg1_0 |) |)),
                                ltac:(M.monadic
                                  (BinOp.Pure.eq
                                    (M.read (| M.read (| __self_1 |) |))
                                    (M.read (| M.read (| __arg1_1 |) |))))
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                                "amount"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                                "decimals"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let __self_1 := M.alloc (| γ2_1 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                                "amount"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                                "decimals"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            let __arg1_1 := M.alloc (| γ2_1 |) in
                            M.alloc (|
                              LogicalOp.and (|
                                BinOp.Pure.eq
                                  (M.read (| M.read (| __self_0 |) |))
                                  (M.read (| M.read (| __arg1_0 |) |)),
                                ltac:(M.monadic
                                  (BinOp.Pure.eq
                                    (M.read (| M.read (| __self_1 |) |))
                                    (M.read (| M.read (| __arg1_1 |) |))))
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeAccount2",
                                "owner"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeAccount2",
                                "owner"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.path "solana_program::pubkey::Pubkey",
                                  [ Ty.path "solana_program::pubkey::Pubkey" ],
                                  "eq",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeAccount3",
                                "owner"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeAccount3",
                                "owner"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.path "solana_program::pubkey::Pubkey",
                                  [ Ty.path "solana_program::pubkey::Pubkey" ],
                                  "eq",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMultisig2",
                                "m"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMultisig2",
                                "m"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              BinOp.Pure.eq
                                (M.read (| M.read (| __self_0 |) |))
                                (M.read (| M.read (| __arg1_0 |) |))
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                                "decimals"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                                "mint_authority"
                              |) in
                            let γ2_2 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                                "freeze_authority"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let __self_1 := M.alloc (| γ2_1 |) in
                            let __self_2 := M.alloc (| γ2_2 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                                "decimals"
                              |) in
                            let γ2_1 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                                "mint_authority"
                              |) in
                            let γ2_2 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                                "freeze_authority"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            let __arg1_1 := M.alloc (| γ2_1 |) in
                            let __arg1_2 := M.alloc (| γ2_2 |) in
                            M.alloc (|
                              LogicalOp.and (|
                                LogicalOp.and (|
                                  BinOp.Pure.eq
                                    (M.read (| M.read (| __self_0 |) |))
                                    (M.read (| M.read (| __arg1_0 |) |)),
                                  ltac:(M.monadic
                                    (M.call_closure (|
                                      M.get_trait_method (|
                                        "core::cmp::PartialEq",
                                        Ty.path "solana_program::pubkey::Pubkey",
                                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                                        "eq",
                                        []
                                      |),
                                      [ M.read (| __self_1 |); M.read (| __arg1_1 |) ]
                                    |)))
                                |),
                                ltac:(M.monadic
                                  (M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.apply
                                        (Ty.path "solana_program::program_option::COption")
                                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      [
                                        Ty.apply
                                          (Ty.path "solana_program::program_option::COption")
                                          [ Ty.path "solana_program::pubkey::Pubkey" ]
                                      ],
                                      "eq",
                                      []
                                    |),
                                    [ M.read (| __self_2 |); M.read (| __arg1_2 |) ]
                                  |)))
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::GetAccountDataSize",
                                "extension_types"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::GetAccountDataSize",
                                "extension_types"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.apply
                                    (Ty.path "alloc::vec::Vec")
                                    [
                                      Ty.path "spl_token_2022::extension::ExtensionType";
                                      Ty.path "alloc::alloc::Global"
                                    ],
                                  [
                                    Ty.apply
                                      (Ty.path "alloc::vec::Vec")
                                      [
                                        Ty.path "spl_token_2022::extension::ExtensionType";
                                        Ty.path "alloc::alloc::Global"
                                      ]
                                  ],
                                  "eq",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::AmountToUiAmount",
                                "amount"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::AmountToUiAmount",
                                "amount"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              BinOp.Pure.eq
                                (M.read (| M.read (| __self_0 |) |))
                                (M.read (| M.read (| __arg1_0 |) |))
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::UiAmountToAmount",
                                "ui_amount"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::UiAmountToAmount",
                                "ui_amount"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.apply (Ty.path "&") [ Ty.path "str" ],
                                  [ Ty.apply (Ty.path "&") [ Ty.path "str" ] ],
                                  "eq",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMintCloseAuthority",
                                "close_authority"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializeMintCloseAuthority",
                                "close_authority"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.apply
                                    (Ty.path "solana_program::program_option::COption")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ],
                                  [
                                    Ty.apply
                                      (Ty.path "solana_program::program_option::COption")
                                      [ Ty.path "solana_program::pubkey::Pubkey" ]
                                  ],
                                  "eq",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::Reallocate",
                                "extension_types"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::Reallocate",
                                "extension_types"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.apply
                                    (Ty.path "alloc::vec::Vec")
                                    [
                                      Ty.path "spl_token_2022::extension::ExtensionType";
                                      Ty.path "alloc::alloc::Global"
                                    ],
                                  [
                                    Ty.apply
                                      (Ty.path "alloc::vec::Vec")
                                      [
                                        Ty.path "spl_token_2022::extension::ExtensionType";
                                        Ty.path "alloc::alloc::Global"
                                      ]
                                  ],
                                  "eq",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                            let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                            let γ0_0 := M.read (| γ0_0 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_0,
                                "spl_token_2022::instruction::TokenInstruction::InitializePermanentDelegate",
                                "delegate"
                              |) in
                            let __self_0 := M.alloc (| γ2_0 |) in
                            let γ0_1 := M.read (| γ0_1 |) in
                            let γ2_0 :=
                              M.SubPointer.get_struct_record_field (|
                                γ0_1,
                                "spl_token_2022::instruction::TokenInstruction::InitializePermanentDelegate",
                                "delegate"
                              |) in
                            let __arg1_0 := M.alloc (| γ2_0 |) in
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.path "solana_program::pubkey::Pubkey",
                                  [ Ty.path "solana_program::pubkey::Pubkey" ],
                                  "eq",
                                  []
                                |),
                                [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Bool true |)))
                      ]
                    |)
                  |)))
              |)
            |)
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("eq", InstanceField.Method eq) ].
  End Impl_core_cmp_PartialEq_for_spl_token_2022_instruction_TokenInstruction.
  
  Module Impl_spl_token_2022_instruction_TokenInstruction.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::TokenInstruction".
    
    (*
        pub fn unpack(input: &'a [u8]) -> Result<Self, ProgramError> {
            use TokenError::InvalidInstruction;
    
            let (&tag, rest) = input.split_first().ok_or(InvalidInstruction)?;
            Ok(match tag {
                0 => {
                    let (&decimals, rest) = rest.split_first().ok_or(InvalidInstruction)?;
                    let (mint_authority, rest) = Self::unpack_pubkey(rest)?;
                    let (freeze_authority, _rest) = Self::unpack_pubkey_option(rest)?;
                    Self::InitializeMint {
                        mint_authority,
                        freeze_authority,
                        decimals,
                    }
                }
                1 => Self::InitializeAccount,
                2 => {
                    let &m = rest.first().ok_or(InvalidInstruction)?;
                    Self::InitializeMultisig { m }
                }
                3 | 4 | 7 | 8 => {
                    let amount = rest
                        .get(..U64_BYTES)
                        .and_then(|slice| slice.try_into().ok())
                        .map(u64::from_le_bytes)
                        .ok_or(InvalidInstruction)?;
                    match tag {
                        #[allow(deprecated)]
                        3 => Self::Transfer { amount },
                        4 => Self::Approve { amount },
                        7 => Self::MintTo { amount },
                        8 => Self::Burn { amount },
                        _ => unreachable!(),
                    }
                }
                5 => Self::Revoke,
                6 => {
                    let (authority_type, rest) = rest
                        .split_first()
                        .ok_or_else(|| ProgramError::from(InvalidInstruction))
                        .and_then(|(&t, rest)| Ok((AuthorityType::from(t)?, rest)))?;
                    let (new_authority, _rest) = Self::unpack_pubkey_option(rest)?;
    
                    Self::SetAuthority {
                        authority_type,
                        new_authority,
                    }
                }
                9 => Self::CloseAccount,
                10 => Self::FreezeAccount,
                11 => Self::ThawAccount,
                12 => {
                    let (amount, decimals, _rest) = Self::unpack_amount_decimals(rest)?;
                    Self::TransferChecked { amount, decimals }
                }
                13 => {
                    let (amount, decimals, _rest) = Self::unpack_amount_decimals(rest)?;
                    Self::ApproveChecked { amount, decimals }
                }
                14 => {
                    let (amount, decimals, _rest) = Self::unpack_amount_decimals(rest)?;
                    Self::MintToChecked { amount, decimals }
                }
                15 => {
                    let (amount, decimals, _rest) = Self::unpack_amount_decimals(rest)?;
                    Self::BurnChecked { amount, decimals }
                }
                16 => {
                    let (owner, _rest) = Self::unpack_pubkey(rest)?;
                    Self::InitializeAccount2 { owner }
                }
                17 => Self::SyncNative,
                18 => {
                    let (owner, _rest) = Self::unpack_pubkey(rest)?;
                    Self::InitializeAccount3 { owner }
                }
                19 => {
                    let &m = rest.first().ok_or(InvalidInstruction)?;
                    Self::InitializeMultisig2 { m }
                }
                20 => {
                    let (&decimals, rest) = rest.split_first().ok_or(InvalidInstruction)?;
                    let (mint_authority, rest) = Self::unpack_pubkey(rest)?;
                    let (freeze_authority, _rest) = Self::unpack_pubkey_option(rest)?;
                    Self::InitializeMint2 {
                        mint_authority,
                        freeze_authority,
                        decimals,
                    }
                }
                21 => {
                    let mut extension_types = vec![];
                    for chunk in rest.chunks(size_of::<ExtensionType>()) {
                        extension_types.push(chunk.try_into()?);
                    }
                    Self::GetAccountDataSize { extension_types }
                }
                22 => Self::InitializeImmutableOwner,
                23 => {
                    let (amount, _rest) = Self::unpack_u64(rest)?;
                    Self::AmountToUiAmount { amount }
                }
                24 => {
                    let ui_amount = std::str::from_utf8(rest).map_err(|_| InvalidInstruction)?;
                    Self::UiAmountToAmount { ui_amount }
                }
                25 => {
                    let (close_authority, _rest) = Self::unpack_pubkey_option(rest)?;
                    Self::InitializeMintCloseAuthority { close_authority }
                }
                26 => Self::TransferFeeExtension,
                27 => Self::ConfidentialTransferExtension,
                28 => Self::DefaultAccountStateExtension,
                29 => {
                    let mut extension_types = vec![];
                    for chunk in rest.chunks(size_of::<ExtensionType>()) {
                        extension_types.push(chunk.try_into()?);
                    }
                    Self::Reallocate { extension_types }
                }
                30 => Self::MemoTransferExtension,
                31 => Self::CreateNativeMint,
                32 => Self::InitializeNonTransferableMint,
                33 => Self::InterestBearingMintExtension,
                34 => Self::CpiGuardExtension,
                35 => {
                    let (delegate, _rest) = Self::unpack_pubkey(rest)?;
                    Self::InitializePermanentDelegate { delegate }
                }
                36 => Self::TransferHookExtension,
                37 => Self::ConfidentialTransferFeeExtension,
                38 => Self::WithdrawExcessLamports,
                39 => Self::MetadataPointerExtension,
                40 => Self::GroupPointerExtension,
                41 => Self::GroupMemberPointerExtension,
                _ => return Err(TokenError::InvalidInstruction.into()),
            })
        }
    *)
    Definition unpack (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ input ] =>
        ltac:(M.monadic
          (let input := M.alloc (| input |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                M.match_operator (|
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::try_trait::Try",
                          Ty.apply
                            (Ty.path "core::result::Result")
                            [
                              Ty.tuple
                                [
                                  Ty.apply (Ty.path "&") [ Ty.path "u8" ];
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                ];
                              Ty.path "spl_token_2022::error::TokenError"
                            ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "core::option::Option")
                                [
                                  Ty.tuple
                                    [
                                      Ty.apply (Ty.path "&") [ Ty.path "u8" ];
                                      Ty.apply
                                        (Ty.path "&")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ]
                                ],
                              "ok_or",
                              [ Ty.path "spl_token_2022::error::TokenError" ]
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                                  "split_first",
                                  []
                                |),
                                [ M.read (| input |) ]
                              |);
                              Value.StructTuple
                                "spl_token_2022::error::TokenError::InvalidInstruction"
                                []
                            ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::ops::control_flow::ControlFlow::Break",
                              0
                            |) in
                          let residual := M.copy (| γ0_0 |) in
                          M.alloc (|
                            M.never_to_any (|
                              M.read (|
                                M.return_ (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::ops::try_trait::FromResidual",
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "spl_token_2022::instruction::TokenInstruction";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "spl_token_2022::error::TokenError"
                                          ]
                                      ],
                                      "from_residual",
                                      []
                                    |),
                                    [ M.read (| residual |) ]
                                  |)
                                |)
                              |)
                            |)
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::ops::control_flow::ControlFlow::Continue",
                              0
                            |) in
                          let val := M.copy (| γ0_0 |) in
                          val))
                    ]
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                        let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                        let γ0_0 := M.read (| γ0_0 |) in
                        let tag := M.copy (| γ0_0 |) in
                        let rest := M.copy (| γ0_1 |) in
                        M.alloc (|
                          Value.StructTuple
                            "core::result::Result::Ok"
                            [
                              M.read (|
                                M.match_operator (|
                                  tag,
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 0
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.apply (Ty.path "&") [ Ty.path "u8" ];
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path "spl_token_2022::error::TokenError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "core::option::Option")
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                [ Ty.path "u8" ];
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "slice")
                                                                    [ Ty.path "u8" ]
                                                                ]
                                                            ]
                                                        ],
                                                      "ok_or",
                                                      [ Ty.path "spl_token_2022::error::TokenError"
                                                      ]
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.apply
                                                            (Ty.path "slice")
                                                            [ Ty.path "u8" ],
                                                          "split_first",
                                                          []
                                                        |),
                                                        [ M.read (| rest |) ]
                                                      |);
                                                      Value.StructTuple
                                                        "spl_token_2022::error::TokenError::InvalidInstruction"
                                                        []
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "spl_token_2022::error::TokenError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let γ0_0 := M.read (| γ0_0 |) in
                                                let decimals := M.copy (| γ0_0 |) in
                                                let rest := M.copy (| γ0_1 |) in
                                                M.match_operator (|
                                                  M.match_operator (|
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::ops::try_trait::Try",
                                                          Ty.apply
                                                            (Ty.path "core::result::Result")
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.path
                                                                    "solana_program::pubkey::Pubkey";
                                                                  Ty.apply
                                                                    (Ty.path "&")
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "slice")
                                                                        [ Ty.path "u8" ]
                                                                    ]
                                                                ];
                                                              Ty.path
                                                                "solana_program::program_error::ProgramError"
                                                            ],
                                                          [],
                                                          "branch",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "spl_token_2022::instruction::TokenInstruction",
                                                              "unpack_pubkey",
                                                              []
                                                            |),
                                                            [ M.read (| rest |) ]
                                                          |)
                                                        ]
                                                      |)
                                                    |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ0_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "core::ops::control_flow::ControlFlow::Break",
                                                              0
                                                            |) in
                                                          let residual := M.copy (| γ0_0 |) in
                                                          M.alloc (|
                                                            M.never_to_any (|
                                                              M.read (|
                                                                M.return_ (|
                                                                  M.call_closure (|
                                                                    M.get_trait_method (|
                                                                      "core::ops::try_trait::FromResidual",
                                                                      Ty.apply
                                                                        (Ty.path
                                                                          "core::result::Result")
                                                                        [
                                                                          Ty.path
                                                                            "spl_token_2022::instruction::TokenInstruction";
                                                                          Ty.path
                                                                            "solana_program::program_error::ProgramError"
                                                                        ],
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "core::result::Result")
                                                                          [
                                                                            Ty.path
                                                                              "core::convert::Infallible";
                                                                            Ty.path
                                                                              "solana_program::program_error::ProgramError"
                                                                          ]
                                                                      ],
                                                                      "from_residual",
                                                                      []
                                                                    |),
                                                                    [ M.read (| residual |) ]
                                                                  |)
                                                                |)
                                                              |)
                                                            |)
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ0_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "core::ops::control_flow::ControlFlow::Continue",
                                                              0
                                                            |) in
                                                          let val := M.copy (| γ0_0 |) in
                                                          val))
                                                    ]
                                                  |),
                                                  [
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let γ0_0 :=
                                                          M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                        let γ0_1 :=
                                                          M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                        let mint_authority := M.copy (| γ0_0 |) in
                                                        let rest := M.copy (| γ0_1 |) in
                                                        M.match_operator (|
                                                          M.match_operator (|
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::ops::try_trait::Try",
                                                                  Ty.apply
                                                                    (Ty.path "core::result::Result")
                                                                    [
                                                                      Ty.tuple
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "solana_program::program_option::COption")
                                                                            [
                                                                              Ty.path
                                                                                "solana_program::pubkey::Pubkey"
                                                                            ];
                                                                          Ty.apply
                                                                            (Ty.path "&")
                                                                            [
                                                                              Ty.apply
                                                                                (Ty.path "slice")
                                                                                [ Ty.path "u8" ]
                                                                            ]
                                                                        ];
                                                                      Ty.path
                                                                        "solana_program::program_error::ProgramError"
                                                                    ],
                                                                  [],
                                                                  "branch",
                                                                  []
                                                                |),
                                                                [
                                                                  M.call_closure (|
                                                                    M.get_associated_function (|
                                                                      Ty.path
                                                                        "spl_token_2022::instruction::TokenInstruction",
                                                                      "unpack_pubkey_option",
                                                                      []
                                                                    |),
                                                                    [ M.read (| rest |) ]
                                                                  |)
                                                                ]
                                                              |)
                                                            |),
                                                            [
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (let γ0_0 :=
                                                                    M.SubPointer.get_struct_tuple_field (|
                                                                      γ,
                                                                      "core::ops::control_flow::ControlFlow::Break",
                                                                      0
                                                                    |) in
                                                                  let residual :=
                                                                    M.copy (| γ0_0 |) in
                                                                  M.alloc (|
                                                                    M.never_to_any (|
                                                                      M.read (|
                                                                        M.return_ (|
                                                                          M.call_closure (|
                                                                            M.get_trait_method (|
                                                                              "core::ops::try_trait::FromResidual",
                                                                              Ty.apply
                                                                                (Ty.path
                                                                                  "core::result::Result")
                                                                                [
                                                                                  Ty.path
                                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                                  Ty.path
                                                                                    "solana_program::program_error::ProgramError"
                                                                                ],
                                                                              [
                                                                                Ty.apply
                                                                                  (Ty.path
                                                                                    "core::result::Result")
                                                                                  [
                                                                                    Ty.path
                                                                                      "core::convert::Infallible";
                                                                                    Ty.path
                                                                                      "solana_program::program_error::ProgramError"
                                                                                  ]
                                                                              ],
                                                                              "from_residual",
                                                                              []
                                                                            |),
                                                                            [ M.read (| residual |)
                                                                            ]
                                                                          |)
                                                                        |)
                                                                      |)
                                                                    |)
                                                                  |)));
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (let γ0_0 :=
                                                                    M.SubPointer.get_struct_tuple_field (|
                                                                      γ,
                                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                                      0
                                                                    |) in
                                                                  let val := M.copy (| γ0_0 |) in
                                                                  val))
                                                            ]
                                                          |),
                                                          [
                                                            fun γ =>
                                                              ltac:(M.monadic
                                                                (let γ0_0 :=
                                                                  M.SubPointer.get_tuple_field (|
                                                                    γ,
                                                                    0
                                                                  |) in
                                                                let γ0_1 :=
                                                                  M.SubPointer.get_tuple_field (|
                                                                    γ,
                                                                    1
                                                                  |) in
                                                                let freeze_authority :=
                                                                  M.copy (| γ0_0 |) in
                                                                let _rest := M.copy (| γ0_1 |) in
                                                                M.alloc (|
                                                                  Value.StructRecord
                                                                    "spl_token_2022::instruction::TokenInstruction::InitializeMint"
                                                                    [
                                                                      ("mint_authority",
                                                                        M.read (|
                                                                          mint_authority
                                                                        |));
                                                                      ("freeze_authority",
                                                                        M.read (|
                                                                          freeze_authority
                                                                        |));
                                                                      ("decimals",
                                                                        M.read (| decimals |))
                                                                    ]
                                                                |)))
                                                          ]
                                                        |)))
                                                  ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 1
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::InitializeAccount"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 2
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.apply (Ty.path "&") [ Ty.path "u8" ];
                                                      Ty.path "spl_token_2022::error::TokenError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "core::option::Option")
                                                        [ Ty.apply (Ty.path "&") [ Ty.path "u8" ] ],
                                                      "ok_or",
                                                      [ Ty.path "spl_token_2022::error::TokenError"
                                                      ]
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.apply
                                                            (Ty.path "slice")
                                                            [ Ty.path "u8" ],
                                                          "first",
                                                          []
                                                        |),
                                                        [ M.read (| rest |) ]
                                                      |);
                                                      Value.StructTuple
                                                        "spl_token_2022::error::TokenError::InvalidInstruction"
                                                        []
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "spl_token_2022::error::TokenError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ := M.read (| γ |) in
                                                let m := M.copy (| γ |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::InitializeMultisig"
                                                    [ ("m", M.read (| m |)) ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.find_or_pattern (|
                                          γ,
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let _ :=
                                                  M.is_constant_or_break_match (|
                                                    M.read (| γ |),
                                                    Value.Integer 3
                                                  |) in
                                                Value.Tuple []));
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let _ :=
                                                  M.is_constant_or_break_match (|
                                                    M.read (| γ |),
                                                    Value.Integer 4
                                                  |) in
                                                Value.Tuple []));
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let _ :=
                                                  M.is_constant_or_break_match (|
                                                    M.read (| γ |),
                                                    Value.Integer 7
                                                  |) in
                                                Value.Tuple []));
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let _ :=
                                                  M.is_constant_or_break_match (|
                                                    M.read (| γ |),
                                                    Value.Integer 8
                                                  |) in
                                                Value.Tuple []))
                                          ],
                                          M.closure
                                            (fun γ =>
                                              ltac:(M.monadic
                                                match γ with
                                                | [] =>
                                                  let amount :=
                                                    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 "u64";
                                                                  Ty.path
                                                                    "spl_token_2022::error::TokenError"
                                                                ],
                                                              [],
                                                              "branch",
                                                              []
                                                            |),
                                                            [
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.apply
                                                                    (Ty.path "core::option::Option")
                                                                    [ Ty.path "u64" ],
                                                                  "ok_or",
                                                                  [
                                                                    Ty.path
                                                                      "spl_token_2022::error::TokenError"
                                                                  ]
                                                                |),
                                                                [
                                                                  M.call_closure (|
                                                                    M.get_associated_function (|
                                                                      Ty.apply
                                                                        (Ty.path
                                                                          "core::option::Option")
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path "array")
                                                                            [ Ty.path "u8" ]
                                                                        ],
                                                                      "map",
                                                                      [
                                                                        Ty.path "u64";
                                                                        Ty.function
                                                                          [
                                                                            Ty.apply
                                                                              (Ty.path "array")
                                                                              [ Ty.path "u8" ]
                                                                          ]
                                                                          (Ty.path "u64")
                                                                      ]
                                                                    |),
                                                                    [
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "core::option::Option")
                                                                            [
                                                                              Ty.apply
                                                                                (Ty.path "&")
                                                                                [
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "slice")
                                                                                    [ Ty.path "u8" ]
                                                                                ]
                                                                            ],
                                                                          "and_then",
                                                                          [
                                                                            Ty.apply
                                                                              (Ty.path "array")
                                                                              [ Ty.path "u8" ];
                                                                            Ty.function
                                                                              [
                                                                                Ty.tuple
                                                                                  [
                                                                                    Ty.apply
                                                                                      (Ty.path "&")
                                                                                      [
                                                                                        Ty.apply
                                                                                          (Ty.path
                                                                                            "slice")
                                                                                          [
                                                                                            Ty.path
                                                                                              "u8"
                                                                                          ]
                                                                                      ]
                                                                                  ]
                                                                              ]
                                                                              (Ty.apply
                                                                                (Ty.path
                                                                                  "core::option::Option")
                                                                                [
                                                                                  Ty.apply
                                                                                    (Ty.path
                                                                                      "array")
                                                                                    [ Ty.path "u8" ]
                                                                                ])
                                                                          ]
                                                                        |),
                                                                        [
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.apply
                                                                                (Ty.path "slice")
                                                                                [ Ty.path "u8" ],
                                                                              "get",
                                                                              [
                                                                                Ty.apply
                                                                                  (Ty.path
                                                                                    "core::ops::range::RangeTo")
                                                                                  [ Ty.path "usize"
                                                                                  ]
                                                                              ]
                                                                            |),
                                                                            [
                                                                              M.read (| rest |);
                                                                              Value.StructRecord
                                                                                "core::ops::range::RangeTo"
                                                                                [
                                                                                  ("end_",
                                                                                    M.read (|
                                                                                      M.get_constant (|
                                                                                        "spl_token_2022::instruction::U64_BYTES"
                                                                                      |)
                                                                                    |))
                                                                                ]
                                                                            ]
                                                                          |);
                                                                          M.closure
                                                                            (fun γ =>
                                                                              ltac:(M.monadic
                                                                                match γ with
                                                                                | [ α0 ] =>
                                                                                  M.match_operator (|
                                                                                    M.alloc (|
                                                                                      α0
                                                                                    |),
                                                                                    [
                                                                                      fun γ =>
                                                                                        ltac:(M.monadic
                                                                                          (let
                                                                                                slice :=
                                                                                            M.copy (|
                                                                                              γ
                                                                                            |) in
                                                                                          M.call_closure (|
                                                                                            M.get_associated_function (|
                                                                                              Ty.apply
                                                                                                (Ty.path
                                                                                                  "core::result::Result")
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "array")
                                                                                                    [
                                                                                                      Ty.path
                                                                                                        "u8"
                                                                                                    ];
                                                                                                  Ty.path
                                                                                                    "core::array::TryFromSliceError"
                                                                                                ],
                                                                                              "ok",
                                                                                              []
                                                                                            |),
                                                                                            [
                                                                                              M.call_closure (|
                                                                                                M.get_trait_method (|
                                                                                                  "core::convert::TryInto",
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "&")
                                                                                                    [
                                                                                                      Ty.apply
                                                                                                        (Ty.path
                                                                                                          "slice")
                                                                                                        [
                                                                                                          Ty.path
                                                                                                            "u8"
                                                                                                        ]
                                                                                                    ],
                                                                                                  [
                                                                                                    Ty.apply
                                                                                                      (Ty.path
                                                                                                        "array")
                                                                                                      [
                                                                                                        Ty.path
                                                                                                          "u8"
                                                                                                      ]
                                                                                                  ],
                                                                                                  "try_into",
                                                                                                  []
                                                                                                |),
                                                                                                [
                                                                                                  M.read (|
                                                                                                    slice
                                                                                                  |)
                                                                                                ]
                                                                                              |)
                                                                                            ]
                                                                                          |)))
                                                                                    ]
                                                                                  |)
                                                                                | _ =>
                                                                                  M.impossible (||)
                                                                                end))
                                                                        ]
                                                                      |);
                                                                      M.get_associated_function (|
                                                                        Ty.path "u64",
                                                                        "from_le_bytes",
                                                                        []
                                                                      |)
                                                                    ]
                                                                  |);
                                                                  Value.StructTuple
                                                                    "spl_token_2022::error::TokenError::InvalidInstruction"
                                                                    []
                                                                ]
                                                              |)
                                                            ]
                                                          |)
                                                        |),
                                                        [
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ0_0 :=
                                                                M.SubPointer.get_struct_tuple_field (|
                                                                  γ,
                                                                  "core::ops::control_flow::ControlFlow::Break",
                                                                  0
                                                                |) in
                                                              let residual := M.copy (| γ0_0 |) in
                                                              M.alloc (|
                                                                M.never_to_any (|
                                                                  M.read (|
                                                                    M.return_ (|
                                                                      M.call_closure (|
                                                                        M.get_trait_method (|
                                                                          "core::ops::try_trait::FromResidual",
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "core::result::Result")
                                                                            [
                                                                              Ty.path
                                                                                "spl_token_2022::instruction::TokenInstruction";
                                                                              Ty.path
                                                                                "solana_program::program_error::ProgramError"
                                                                            ],
                                                                          [
                                                                            Ty.apply
                                                                              (Ty.path
                                                                                "core::result::Result")
                                                                              [
                                                                                Ty.path
                                                                                  "core::convert::Infallible";
                                                                                Ty.path
                                                                                  "spl_token_2022::error::TokenError"
                                                                              ]
                                                                          ],
                                                                          "from_residual",
                                                                          []
                                                                        |),
                                                                        [ M.read (| residual |) ]
                                                                      |)
                                                                    |)
                                                                  |)
                                                                |)
                                                              |)));
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ0_0 :=
                                                                M.SubPointer.get_struct_tuple_field (|
                                                                  γ,
                                                                  "core::ops::control_flow::ControlFlow::Continue",
                                                                  0
                                                                |) in
                                                              let val := M.copy (| γ0_0 |) in
                                                              val))
                                                        ]
                                                      |)
                                                    |) in
                                                  M.match_operator (|
                                                    tag,
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Integer 3
                                                            |) in
                                                          M.alloc (|
                                                            Value.StructRecord
                                                              "spl_token_2022::instruction::TokenInstruction::Transfer"
                                                              [ ("amount", M.read (| amount |)) ]
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Integer 4
                                                            |) in
                                                          M.alloc (|
                                                            Value.StructRecord
                                                              "spl_token_2022::instruction::TokenInstruction::Approve"
                                                              [ ("amount", M.read (| amount |)) ]
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Integer 7
                                                            |) in
                                                          M.alloc (|
                                                            Value.StructRecord
                                                              "spl_token_2022::instruction::TokenInstruction::MintTo"
                                                              [ ("amount", M.read (| amount |)) ]
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Integer 8
                                                            |) in
                                                          M.alloc (|
                                                            Value.StructRecord
                                                              "spl_token_2022::instruction::TokenInstruction::Burn"
                                                              [ ("amount", M.read (| amount |)) ]
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.alloc (|
                                                            M.never_to_any (|
                                                              M.call_closure (|
                                                                M.get_function (|
                                                                  "core::panicking::panic",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    Value.String
                                                                      "internal error: entered unreachable code"
                                                                  |)
                                                                ]
                                                              |)
                                                            |)
                                                          |)))
                                                    ]
                                                  |)
                                                | _ => M.impossible (||)
                                                end))
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 5
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::Revoke"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 6
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path
                                                            "spl_token_2022::instruction::AuthorityType";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "core::result::Result")
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                [ Ty.path "u8" ];
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "slice")
                                                                    [ Ty.path "u8" ]
                                                                ]
                                                            ];
                                                          Ty.path
                                                            "solana_program::program_error::ProgramError"
                                                        ],
                                                      "and_then",
                                                      [
                                                        Ty.tuple
                                                          [
                                                            Ty.path
                                                              "spl_token_2022::instruction::AuthorityType";
                                                            Ty.apply
                                                              (Ty.path "&")
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "slice")
                                                                  [ Ty.path "u8" ]
                                                              ]
                                                          ];
                                                        Ty.function
                                                          [
                                                            Ty.tuple
                                                              [
                                                                Ty.tuple
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "&")
                                                                      [ Ty.path "u8" ];
                                                                    Ty.apply
                                                                      (Ty.path "&")
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "slice")
                                                                          [ Ty.path "u8" ]
                                                                      ]
                                                                  ]
                                                              ]
                                                          ]
                                                          (Ty.apply
                                                            (Ty.path "core::result::Result")
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::AuthorityType";
                                                                  Ty.apply
                                                                    (Ty.path "&")
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "slice")
                                                                        [ Ty.path "u8" ]
                                                                    ]
                                                                ];
                                                              Ty.path
                                                                "solana_program::program_error::ProgramError"
                                                            ])
                                                      ]
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.apply
                                                            (Ty.path "core::option::Option")
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "&")
                                                                    [ Ty.path "u8" ];
                                                                  Ty.apply
                                                                    (Ty.path "&")
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "slice")
                                                                        [ Ty.path "u8" ]
                                                                    ]
                                                                ]
                                                            ],
                                                          "ok_or_else",
                                                          [
                                                            Ty.path
                                                              "solana_program::program_error::ProgramError";
                                                            Ty.function
                                                              [ Ty.tuple [] ]
                                                              (Ty.path
                                                                "solana_program::program_error::ProgramError")
                                                          ]
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ],
                                                              "split_first",
                                                              []
                                                            |),
                                                            [ M.read (| rest |) ]
                                                          |);
                                                          M.closure
                                                            (fun γ =>
                                                              ltac:(M.monadic
                                                                match γ with
                                                                | [ α0 ] =>
                                                                  M.match_operator (|
                                                                    M.alloc (| α0 |),
                                                                    [
                                                                      fun γ =>
                                                                        ltac:(M.monadic
                                                                          (M.call_closure (|
                                                                            M.get_trait_method (|
                                                                              "core::convert::From",
                                                                              Ty.path
                                                                                "solana_program::program_error::ProgramError",
                                                                              [
                                                                                Ty.path
                                                                                  "spl_token_2022::error::TokenError"
                                                                              ],
                                                                              "from",
                                                                              []
                                                                            |),
                                                                            [
                                                                              Value.StructTuple
                                                                                "spl_token_2022::error::TokenError::InvalidInstruction"
                                                                                []
                                                                            ]
                                                                          |)))
                                                                    ]
                                                                  |)
                                                                | _ => M.impossible (||)
                                                                end))
                                                        ]
                                                      |);
                                                      M.closure
                                                        (fun γ =>
                                                          ltac:(M.monadic
                                                            match γ with
                                                            | [ α0 ] =>
                                                              M.match_operator (|
                                                                M.alloc (| α0 |),
                                                                [
                                                                  fun γ =>
                                                                    ltac:(M.monadic
                                                                      (let γ0_0 :=
                                                                        M.SubPointer.get_tuple_field (|
                                                                          γ,
                                                                          0
                                                                        |) in
                                                                      let γ0_1 :=
                                                                        M.SubPointer.get_tuple_field (|
                                                                          γ,
                                                                          1
                                                                        |) in
                                                                      let γ0_0 :=
                                                                        M.read (| γ0_0 |) in
                                                                      let t := M.copy (| γ0_0 |) in
                                                                      let rest :=
                                                                        M.copy (| γ0_1 |) in
                                                                      Value.StructTuple
                                                                        "core::result::Result::Ok"
                                                                        [
                                                                          Value.Tuple
                                                                            [
                                                                              M.read (|
                                                                                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
                                                                                              "spl_token_2022::instruction::AuthorityType";
                                                                                            Ty.path
                                                                                              "solana_program::program_error::ProgramError"
                                                                                          ],
                                                                                        [],
                                                                                        "branch",
                                                                                        []
                                                                                      |),
                                                                                      [
                                                                                        M.call_closure (|
                                                                                          M.get_associated_function (|
                                                                                            Ty.path
                                                                                              "spl_token_2022::instruction::AuthorityType",
                                                                                            "from",
                                                                                            []
                                                                                          |),
                                                                                          [
                                                                                            M.read (|
                                                                                              t
                                                                                            |)
                                                                                          ]
                                                                                        |)
                                                                                      ]
                                                                                    |)
                                                                                  |),
                                                                                  [
                                                                                    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
                                                                                                              "spl_token_2022::instruction::AuthorityType";
                                                                                                            Ty.apply
                                                                                                              (Ty.path
                                                                                                                "&")
                                                                                                              [
                                                                                                                Ty.apply
                                                                                                                  (Ty.path
                                                                                                                    "slice")
                                                                                                                  [
                                                                                                                    Ty.path
                                                                                                                      "u8"
                                                                                                                  ]
                                                                                                              ]
                                                                                                          ];
                                                                                                        Ty.path
                                                                                                          "solana_program::program_error::ProgramError"
                                                                                                      ],
                                                                                                    [
                                                                                                      Ty.apply
                                                                                                        (Ty.path
                                                                                                          "core::result::Result")
                                                                                                        [
                                                                                                          Ty.path
                                                                                                            "core::convert::Infallible";
                                                                                                          Ty.path
                                                                                                            "solana_program::program_error::ProgramError"
                                                                                                        ]
                                                                                                    ],
                                                                                                    "from_residual",
                                                                                                    []
                                                                                                  |),
                                                                                                  [
                                                                                                    M.read (|
                                                                                                      residual
                                                                                                    |)
                                                                                                  ]
                                                                                                |)
                                                                                              |)
                                                                                            |)
                                                                                          |)
                                                                                        |)));
                                                                                    fun γ =>
                                                                                      ltac:(M.monadic
                                                                                        (let γ0_0 :=
                                                                                          M.SubPointer.get_struct_tuple_field (|
                                                                                            γ,
                                                                                            "core::ops::control_flow::ControlFlow::Continue",
                                                                                            0
                                                                                          |) in
                                                                                        let val :=
                                                                                          M.copy (|
                                                                                            γ0_0
                                                                                          |) in
                                                                                        val))
                                                                                  ]
                                                                                |)
                                                                              |);
                                                                              M.read (| rest |)
                                                                            ]
                                                                        ]))
                                                                ]
                                                              |)
                                                            | _ => M.impossible (||)
                                                            end))
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let authority_type := M.copy (| γ0_0 |) in
                                                let rest := M.copy (| γ0_1 |) in
                                                M.match_operator (|
                                                  M.match_operator (|
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::ops::try_trait::Try",
                                                          Ty.apply
                                                            (Ty.path "core::result::Result")
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path
                                                                      "solana_program::program_option::COption")
                                                                    [
                                                                      Ty.path
                                                                        "solana_program::pubkey::Pubkey"
                                                                    ];
                                                                  Ty.apply
                                                                    (Ty.path "&")
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "slice")
                                                                        [ Ty.path "u8" ]
                                                                    ]
                                                                ];
                                                              Ty.path
                                                                "solana_program::program_error::ProgramError"
                                                            ],
                                                          [],
                                                          "branch",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "spl_token_2022::instruction::TokenInstruction",
                                                              "unpack_pubkey_option",
                                                              []
                                                            |),
                                                            [ M.read (| rest |) ]
                                                          |)
                                                        ]
                                                      |)
                                                    |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ0_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "core::ops::control_flow::ControlFlow::Break",
                                                              0
                                                            |) in
                                                          let residual := M.copy (| γ0_0 |) in
                                                          M.alloc (|
                                                            M.never_to_any (|
                                                              M.read (|
                                                                M.return_ (|
                                                                  M.call_closure (|
                                                                    M.get_trait_method (|
                                                                      "core::ops::try_trait::FromResidual",
                                                                      Ty.apply
                                                                        (Ty.path
                                                                          "core::result::Result")
                                                                        [
                                                                          Ty.path
                                                                            "spl_token_2022::instruction::TokenInstruction";
                                                                          Ty.path
                                                                            "solana_program::program_error::ProgramError"
                                                                        ],
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "core::result::Result")
                                                                          [
                                                                            Ty.path
                                                                              "core::convert::Infallible";
                                                                            Ty.path
                                                                              "solana_program::program_error::ProgramError"
                                                                          ]
                                                                      ],
                                                                      "from_residual",
                                                                      []
                                                                    |),
                                                                    [ M.read (| residual |) ]
                                                                  |)
                                                                |)
                                                              |)
                                                            |)
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ0_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "core::ops::control_flow::ControlFlow::Continue",
                                                              0
                                                            |) in
                                                          let val := M.copy (| γ0_0 |) in
                                                          val))
                                                    ]
                                                  |),
                                                  [
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let γ0_0 :=
                                                          M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                        let γ0_1 :=
                                                          M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                        let new_authority := M.copy (| γ0_0 |) in
                                                        let _rest := M.copy (| γ0_1 |) in
                                                        M.alloc (|
                                                          Value.StructRecord
                                                            "spl_token_2022::instruction::TokenInstruction::SetAuthority"
                                                            [
                                                              ("authority_type",
                                                                M.read (| authority_type |));
                                                              ("new_authority",
                                                                M.read (| new_authority |))
                                                            ]
                                                        |)))
                                                  ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 9
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::CloseAccount"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 10
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::FreezeAccount"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 11
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::ThawAccount"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 12
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path "u64";
                                                          Ty.path "u8";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_amount_decimals",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let γ0_2 :=
                                                  M.SubPointer.get_tuple_field (| γ, 2 |) in
                                                let amount := M.copy (| γ0_0 |) in
                                                let decimals := M.copy (| γ0_1 |) in
                                                let _rest := M.copy (| γ0_2 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::TransferChecked"
                                                    [
                                                      ("amount", M.read (| amount |));
                                                      ("decimals", M.read (| decimals |))
                                                    ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 13
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path "u64";
                                                          Ty.path "u8";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_amount_decimals",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let γ0_2 :=
                                                  M.SubPointer.get_tuple_field (| γ, 2 |) in
                                                let amount := M.copy (| γ0_0 |) in
                                                let decimals := M.copy (| γ0_1 |) in
                                                let _rest := M.copy (| γ0_2 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::ApproveChecked"
                                                    [
                                                      ("amount", M.read (| amount |));
                                                      ("decimals", M.read (| decimals |))
                                                    ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 14
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path "u64";
                                                          Ty.path "u8";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_amount_decimals",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let γ0_2 :=
                                                  M.SubPointer.get_tuple_field (| γ, 2 |) in
                                                let amount := M.copy (| γ0_0 |) in
                                                let decimals := M.copy (| γ0_1 |) in
                                                let _rest := M.copy (| γ0_2 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::MintToChecked"
                                                    [
                                                      ("amount", M.read (| amount |));
                                                      ("decimals", M.read (| decimals |))
                                                    ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 15
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path "u64";
                                                          Ty.path "u8";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_amount_decimals",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let γ0_2 :=
                                                  M.SubPointer.get_tuple_field (| γ, 2 |) in
                                                let amount := M.copy (| γ0_0 |) in
                                                let decimals := M.copy (| γ0_1 |) in
                                                let _rest := M.copy (| γ0_2 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::BurnChecked"
                                                    [
                                                      ("amount", M.read (| amount |));
                                                      ("decimals", M.read (| decimals |))
                                                    ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 16
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path "solana_program::pubkey::Pubkey";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_pubkey",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let owner := M.copy (| γ0_0 |) in
                                                let _rest := M.copy (| γ0_1 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::InitializeAccount2"
                                                    [ ("owner", M.read (| owner |)) ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 17
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::SyncNative"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 18
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path "solana_program::pubkey::Pubkey";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_pubkey",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let owner := M.copy (| γ0_0 |) in
                                                let _rest := M.copy (| γ0_1 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::InitializeAccount3"
                                                    [ ("owner", M.read (| owner |)) ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 19
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.apply (Ty.path "&") [ Ty.path "u8" ];
                                                      Ty.path "spl_token_2022::error::TokenError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "core::option::Option")
                                                        [ Ty.apply (Ty.path "&") [ Ty.path "u8" ] ],
                                                      "ok_or",
                                                      [ Ty.path "spl_token_2022::error::TokenError"
                                                      ]
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.apply
                                                            (Ty.path "slice")
                                                            [ Ty.path "u8" ],
                                                          "first",
                                                          []
                                                        |),
                                                        [ M.read (| rest |) ]
                                                      |);
                                                      Value.StructTuple
                                                        "spl_token_2022::error::TokenError::InvalidInstruction"
                                                        []
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "spl_token_2022::error::TokenError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ := M.read (| γ |) in
                                                let m := M.copy (| γ |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::InitializeMultisig2"
                                                    [ ("m", M.read (| m |)) ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 20
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.apply (Ty.path "&") [ Ty.path "u8" ];
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path "spl_token_2022::error::TokenError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "core::option::Option")
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                [ Ty.path "u8" ];
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "slice")
                                                                    [ Ty.path "u8" ]
                                                                ]
                                                            ]
                                                        ],
                                                      "ok_or",
                                                      [ Ty.path "spl_token_2022::error::TokenError"
                                                      ]
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.apply
                                                            (Ty.path "slice")
                                                            [ Ty.path "u8" ],
                                                          "split_first",
                                                          []
                                                        |),
                                                        [ M.read (| rest |) ]
                                                      |);
                                                      Value.StructTuple
                                                        "spl_token_2022::error::TokenError::InvalidInstruction"
                                                        []
                                                    ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "spl_token_2022::error::TokenError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let γ0_0 := M.read (| γ0_0 |) in
                                                let decimals := M.copy (| γ0_0 |) in
                                                let rest := M.copy (| γ0_1 |) in
                                                M.match_operator (|
                                                  M.match_operator (|
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::ops::try_trait::Try",
                                                          Ty.apply
                                                            (Ty.path "core::result::Result")
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.path
                                                                    "solana_program::pubkey::Pubkey";
                                                                  Ty.apply
                                                                    (Ty.path "&")
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "slice")
                                                                        [ Ty.path "u8" ]
                                                                    ]
                                                                ];
                                                              Ty.path
                                                                "solana_program::program_error::ProgramError"
                                                            ],
                                                          [],
                                                          "branch",
                                                          []
                                                        |),
                                                        [
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "spl_token_2022::instruction::TokenInstruction",
                                                              "unpack_pubkey",
                                                              []
                                                            |),
                                                            [ M.read (| rest |) ]
                                                          |)
                                                        ]
                                                      |)
                                                    |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ0_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "core::ops::control_flow::ControlFlow::Break",
                                                              0
                                                            |) in
                                                          let residual := M.copy (| γ0_0 |) in
                                                          M.alloc (|
                                                            M.never_to_any (|
                                                              M.read (|
                                                                M.return_ (|
                                                                  M.call_closure (|
                                                                    M.get_trait_method (|
                                                                      "core::ops::try_trait::FromResidual",
                                                                      Ty.apply
                                                                        (Ty.path
                                                                          "core::result::Result")
                                                                        [
                                                                          Ty.path
                                                                            "spl_token_2022::instruction::TokenInstruction";
                                                                          Ty.path
                                                                            "solana_program::program_error::ProgramError"
                                                                        ],
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "core::result::Result")
                                                                          [
                                                                            Ty.path
                                                                              "core::convert::Infallible";
                                                                            Ty.path
                                                                              "solana_program::program_error::ProgramError"
                                                                          ]
                                                                      ],
                                                                      "from_residual",
                                                                      []
                                                                    |),
                                                                    [ M.read (| residual |) ]
                                                                  |)
                                                                |)
                                                              |)
                                                            |)
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ0_0 :=
                                                            M.SubPointer.get_struct_tuple_field (|
                                                              γ,
                                                              "core::ops::control_flow::ControlFlow::Continue",
                                                              0
                                                            |) in
                                                          let val := M.copy (| γ0_0 |) in
                                                          val))
                                                    ]
                                                  |),
                                                  [
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let γ0_0 :=
                                                          M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                        let γ0_1 :=
                                                          M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                        let mint_authority := M.copy (| γ0_0 |) in
                                                        let rest := M.copy (| γ0_1 |) in
                                                        M.match_operator (|
                                                          M.match_operator (|
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::ops::try_trait::Try",
                                                                  Ty.apply
                                                                    (Ty.path "core::result::Result")
                                                                    [
                                                                      Ty.tuple
                                                                        [
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "solana_program::program_option::COption")
                                                                            [
                                                                              Ty.path
                                                                                "solana_program::pubkey::Pubkey"
                                                                            ];
                                                                          Ty.apply
                                                                            (Ty.path "&")
                                                                            [
                                                                              Ty.apply
                                                                                (Ty.path "slice")
                                                                                [ Ty.path "u8" ]
                                                                            ]
                                                                        ];
                                                                      Ty.path
                                                                        "solana_program::program_error::ProgramError"
                                                                    ],
                                                                  [],
                                                                  "branch",
                                                                  []
                                                                |),
                                                                [
                                                                  M.call_closure (|
                                                                    M.get_associated_function (|
                                                                      Ty.path
                                                                        "spl_token_2022::instruction::TokenInstruction",
                                                                      "unpack_pubkey_option",
                                                                      []
                                                                    |),
                                                                    [ M.read (| rest |) ]
                                                                  |)
                                                                ]
                                                              |)
                                                            |),
                                                            [
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (let γ0_0 :=
                                                                    M.SubPointer.get_struct_tuple_field (|
                                                                      γ,
                                                                      "core::ops::control_flow::ControlFlow::Break",
                                                                      0
                                                                    |) in
                                                                  let residual :=
                                                                    M.copy (| γ0_0 |) in
                                                                  M.alloc (|
                                                                    M.never_to_any (|
                                                                      M.read (|
                                                                        M.return_ (|
                                                                          M.call_closure (|
                                                                            M.get_trait_method (|
                                                                              "core::ops::try_trait::FromResidual",
                                                                              Ty.apply
                                                                                (Ty.path
                                                                                  "core::result::Result")
                                                                                [
                                                                                  Ty.path
                                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                                  Ty.path
                                                                                    "solana_program::program_error::ProgramError"
                                                                                ],
                                                                              [
                                                                                Ty.apply
                                                                                  (Ty.path
                                                                                    "core::result::Result")
                                                                                  [
                                                                                    Ty.path
                                                                                      "core::convert::Infallible";
                                                                                    Ty.path
                                                                                      "solana_program::program_error::ProgramError"
                                                                                  ]
                                                                              ],
                                                                              "from_residual",
                                                                              []
                                                                            |),
                                                                            [ M.read (| residual |)
                                                                            ]
                                                                          |)
                                                                        |)
                                                                      |)
                                                                    |)
                                                                  |)));
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (let γ0_0 :=
                                                                    M.SubPointer.get_struct_tuple_field (|
                                                                      γ,
                                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                                      0
                                                                    |) in
                                                                  let val := M.copy (| γ0_0 |) in
                                                                  val))
                                                            ]
                                                          |),
                                                          [
                                                            fun γ =>
                                                              ltac:(M.monadic
                                                                (let γ0_0 :=
                                                                  M.SubPointer.get_tuple_field (|
                                                                    γ,
                                                                    0
                                                                  |) in
                                                                let γ0_1 :=
                                                                  M.SubPointer.get_tuple_field (|
                                                                    γ,
                                                                    1
                                                                  |) in
                                                                let freeze_authority :=
                                                                  M.copy (| γ0_0 |) in
                                                                let _rest := M.copy (| γ0_1 |) in
                                                                M.alloc (|
                                                                  Value.StructRecord
                                                                    "spl_token_2022::instruction::TokenInstruction::InitializeMint2"
                                                                    [
                                                                      ("mint_authority",
                                                                        M.read (|
                                                                          mint_authority
                                                                        |));
                                                                      ("freeze_authority",
                                                                        M.read (|
                                                                          freeze_authority
                                                                        |));
                                                                      ("decimals",
                                                                        M.read (| decimals |))
                                                                    ]
                                                                |)))
                                                          ]
                                                        |)))
                                                  ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 21
                                          |) in
                                        let extension_types :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "spl_token_2022::extension::ExtensionType";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "new",
                                                []
                                              |),
                                              []
                                            |)
                                          |) in
                                        let _ :=
                                          M.use
                                            (M.match_operator (|
                                              M.alloc (|
                                                M.call_closure (|
                                                  M.get_trait_method (|
                                                    "core::iter::traits::collect::IntoIterator",
                                                    Ty.apply
                                                      (Ty.path "core::slice::iter::Chunks")
                                                      [ Ty.path "u8" ],
                                                    [],
                                                    "into_iter",
                                                    []
                                                  |),
                                                  [
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                                                        "chunks",
                                                        []
                                                      |),
                                                      [
                                                        M.read (| rest |);
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "core::mem::size_of",
                                                            [
                                                              Ty.path
                                                                "spl_token_2022::extension::ExtensionType"
                                                            ]
                                                          |),
                                                          []
                                                        |)
                                                      ]
                                                    |)
                                                  ]
                                                |)
                                              |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let iter := M.copy (| γ |) in
                                                    M.loop (|
                                                      ltac:(M.monadic
                                                        (let _ :=
                                                          M.match_operator (|
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::iter::traits::iterator::Iterator",
                                                                  Ty.apply
                                                                    (Ty.path
                                                                      "core::slice::iter::Chunks")
                                                                    [ Ty.path "u8" ],
                                                                  [],
                                                                  "next",
                                                                  []
                                                                |),
                                                                [ iter ]
                                                              |)
                                                            |),
                                                            [
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (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 chunk := M.copy (| γ0_0 |) in
                                                                  let _ :=
                                                                    M.alloc (|
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "alloc::vec::Vec")
                                                                            [
                                                                              Ty.path
                                                                                "spl_token_2022::extension::ExtensionType";
                                                                              Ty.path
                                                                                "alloc::alloc::Global"
                                                                            ],
                                                                          "push",
                                                                          []
                                                                        |),
                                                                        [
                                                                          extension_types;
                                                                          M.read (|
                                                                            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
                                                                                          "spl_token_2022::extension::ExtensionType";
                                                                                        Ty.path
                                                                                          "solana_program::program_error::ProgramError"
                                                                                      ],
                                                                                    [],
                                                                                    "branch",
                                                                                    []
                                                                                  |),
                                                                                  [
                                                                                    M.call_closure (|
                                                                                      M.get_trait_method (|
                                                                                        "core::convert::TryInto",
                                                                                        Ty.apply
                                                                                          (Ty.path
                                                                                            "&")
                                                                                          [
                                                                                            Ty.apply
                                                                                              (Ty.path
                                                                                                "slice")
                                                                                              [
                                                                                                Ty.path
                                                                                                  "u8"
                                                                                              ]
                                                                                          ],
                                                                                        [
                                                                                          Ty.path
                                                                                            "spl_token_2022::extension::ExtensionType"
                                                                                        ],
                                                                                        "try_into",
                                                                                        []
                                                                                      |),
                                                                                      [
                                                                                        M.read (|
                                                                                          chunk
                                                                                        |)
                                                                                      ]
                                                                                    |)
                                                                                  ]
                                                                                |)
                                                                              |),
                                                                              [
                                                                                fun γ =>
                                                                                  ltac:(M.monadic
                                                                                    (let γ0_0 :=
                                                                                      M.SubPointer.get_struct_tuple_field (|
                                                                                        γ,
                                                                                        "core::ops::control_flow::ControlFlow::Break",
                                                                                        0
                                                                                      |) in
                                                                                    let residual :=
                                                                                      M.copy (|
                                                                                        γ0_0
                                                                                      |) in
                                                                                    M.alloc (|
                                                                                      M.never_to_any (|
                                                                                        M.read (|
                                                                                          M.return_ (|
                                                                                            M.call_closure (|
                                                                                              M.get_trait_method (|
                                                                                                "core::ops::try_trait::FromResidual",
                                                                                                Ty.apply
                                                                                                  (Ty.path
                                                                                                    "core::result::Result")
                                                                                                  [
                                                                                                    Ty.path
                                                                                                      "spl_token_2022::instruction::TokenInstruction";
                                                                                                    Ty.path
                                                                                                      "solana_program::program_error::ProgramError"
                                                                                                  ],
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "core::result::Result")
                                                                                                    [
                                                                                                      Ty.path
                                                                                                        "core::convert::Infallible";
                                                                                                      Ty.path
                                                                                                        "solana_program::program_error::ProgramError"
                                                                                                    ]
                                                                                                ],
                                                                                                "from_residual",
                                                                                                []
                                                                                              |),
                                                                                              [
                                                                                                M.read (|
                                                                                                  residual
                                                                                                |)
                                                                                              ]
                                                                                            |)
                                                                                          |)
                                                                                        |)
                                                                                      |)
                                                                                    |)));
                                                                                fun γ =>
                                                                                  ltac:(M.monadic
                                                                                    (let γ0_0 :=
                                                                                      M.SubPointer.get_struct_tuple_field (|
                                                                                        γ,
                                                                                        "core::ops::control_flow::ControlFlow::Continue",
                                                                                        0
                                                                                      |) in
                                                                                    let val :=
                                                                                      M.copy (|
                                                                                        γ0_0
                                                                                      |) in
                                                                                    val))
                                                                              ]
                                                                            |)
                                                                          |)
                                                                        ]
                                                                      |)
                                                                    |) in
                                                                  M.alloc (| Value.Tuple [] |)))
                                                            ]
                                                          |) in
                                                        M.alloc (| Value.Tuple [] |)))
                                                    |)))
                                              ]
                                            |)) in
                                        M.alloc (|
                                          Value.StructRecord
                                            "spl_token_2022::instruction::TokenInstruction::GetAccountDataSize"
                                            [ ("extension_types", M.read (| extension_types |)) ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 22
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::InitializeImmutableOwner"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 23
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path "u64";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_u64",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let amount := M.copy (| γ0_0 |) in
                                                let _rest := M.copy (| γ0_1 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::AmountToUiAmount"
                                                    [ ("amount", M.read (| amount |)) ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 24
                                          |) in
                                        let ui_amount :=
                                          M.copy (|
                                            M.match_operator (|
                                              M.alloc (|
                                                M.call_closure (|
                                                  M.get_trait_method (|
                                                    "core::ops::try_trait::Try",
                                                    Ty.apply
                                                      (Ty.path "core::result::Result")
                                                      [
                                                        Ty.apply (Ty.path "&") [ Ty.path "str" ];
                                                        Ty.path "spl_token_2022::error::TokenError"
                                                      ],
                                                    [],
                                                    "branch",
                                                    []
                                                  |),
                                                  [
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path "core::result::Result")
                                                          [
                                                            Ty.apply
                                                              (Ty.path "&")
                                                              [ Ty.path "str" ];
                                                            Ty.path "core::str::error::Utf8Error"
                                                          ],
                                                        "map_err",
                                                        [
                                                          Ty.path
                                                            "spl_token_2022::error::TokenError";
                                                          Ty.function
                                                            [
                                                              Ty.tuple
                                                                [
                                                                  Ty.path
                                                                    "core::str::error::Utf8Error"
                                                                ]
                                                            ]
                                                            (Ty.path
                                                              "spl_token_2022::error::TokenError")
                                                        ]
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "core::str::converts::from_utf8",
                                                            []
                                                          |),
                                                          [ M.read (| rest |) ]
                                                        |);
                                                        M.closure
                                                          (fun γ =>
                                                            ltac:(M.monadic
                                                              match γ with
                                                              | [ α0 ] =>
                                                                M.match_operator (|
                                                                  M.alloc (| α0 |),
                                                                  [
                                                                    fun γ =>
                                                                      ltac:(M.monadic
                                                                        (Value.StructTuple
                                                                          "spl_token_2022::error::TokenError::InvalidInstruction"
                                                                          []))
                                                                  ]
                                                                |)
                                                              | _ => M.impossible (||)
                                                              end))
                                                      ]
                                                    |)
                                                  ]
                                                |)
                                              |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ0_0 :=
                                                      M.SubPointer.get_struct_tuple_field (|
                                                        γ,
                                                        "core::ops::control_flow::ControlFlow::Break",
                                                        0
                                                      |) in
                                                    let residual := M.copy (| γ0_0 |) in
                                                    M.alloc (|
                                                      M.never_to_any (|
                                                        M.read (|
                                                          M.return_ (|
                                                            M.call_closure (|
                                                              M.get_trait_method (|
                                                                "core::ops::try_trait::FromResidual",
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "spl_token_2022::instruction::TokenInstruction";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ],
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "core::result::Result")
                                                                    [
                                                                      Ty.path
                                                                        "core::convert::Infallible";
                                                                      Ty.path
                                                                        "spl_token_2022::error::TokenError"
                                                                    ]
                                                                ],
                                                                "from_residual",
                                                                []
                                                              |),
                                                              [ M.read (| residual |) ]
                                                            |)
                                                          |)
                                                        |)
                                                      |)
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ0_0 :=
                                                      M.SubPointer.get_struct_tuple_field (|
                                                        γ,
                                                        "core::ops::control_flow::ControlFlow::Continue",
                                                        0
                                                      |) in
                                                    let val := M.copy (| γ0_0 |) in
                                                    val))
                                              ]
                                            |)
                                          |) in
                                        M.alloc (|
                                          Value.StructRecord
                                            "spl_token_2022::instruction::TokenInstruction::UiAmountToAmount"
                                            [ ("ui_amount", M.read (| ui_amount |)) ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 25
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.apply
                                                            (Ty.path
                                                              "solana_program::program_option::COption")
                                                            [
                                                              Ty.path
                                                                "solana_program::pubkey::Pubkey"
                                                            ];
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_pubkey_option",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let close_authority := M.copy (| γ0_0 |) in
                                                let _rest := M.copy (| γ0_1 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::InitializeMintCloseAuthority"
                                                    [
                                                      ("close_authority",
                                                        M.read (| close_authority |))
                                                    ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 26
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::TransferFeeExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 27
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::ConfidentialTransferExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 28
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::DefaultAccountStateExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 29
                                          |) in
                                        let extension_types :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "spl_token_2022::extension::ExtensionType";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "new",
                                                []
                                              |),
                                              []
                                            |)
                                          |) in
                                        let _ :=
                                          M.use
                                            (M.match_operator (|
                                              M.alloc (|
                                                M.call_closure (|
                                                  M.get_trait_method (|
                                                    "core::iter::traits::collect::IntoIterator",
                                                    Ty.apply
                                                      (Ty.path "core::slice::iter::Chunks")
                                                      [ Ty.path "u8" ],
                                                    [],
                                                    "into_iter",
                                                    []
                                                  |),
                                                  [
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                                                        "chunks",
                                                        []
                                                      |),
                                                      [
                                                        M.read (| rest |);
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "core::mem::size_of",
                                                            [
                                                              Ty.path
                                                                "spl_token_2022::extension::ExtensionType"
                                                            ]
                                                          |),
                                                          []
                                                        |)
                                                      ]
                                                    |)
                                                  ]
                                                |)
                                              |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let iter := M.copy (| γ |) in
                                                    M.loop (|
                                                      ltac:(M.monadic
                                                        (let _ :=
                                                          M.match_operator (|
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::iter::traits::iterator::Iterator",
                                                                  Ty.apply
                                                                    (Ty.path
                                                                      "core::slice::iter::Chunks")
                                                                    [ Ty.path "u8" ],
                                                                  [],
                                                                  "next",
                                                                  []
                                                                |),
                                                                [ iter ]
                                                              |)
                                                            |),
                                                            [
                                                              fun γ =>
                                                                ltac:(M.monadic
                                                                  (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 chunk := M.copy (| γ0_0 |) in
                                                                  let _ :=
                                                                    M.alloc (|
                                                                      M.call_closure (|
                                                                        M.get_associated_function (|
                                                                          Ty.apply
                                                                            (Ty.path
                                                                              "alloc::vec::Vec")
                                                                            [
                                                                              Ty.path
                                                                                "spl_token_2022::extension::ExtensionType";
                                                                              Ty.path
                                                                                "alloc::alloc::Global"
                                                                            ],
                                                                          "push",
                                                                          []
                                                                        |),
                                                                        [
                                                                          extension_types;
                                                                          M.read (|
                                                                            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
                                                                                          "spl_token_2022::extension::ExtensionType";
                                                                                        Ty.path
                                                                                          "solana_program::program_error::ProgramError"
                                                                                      ],
                                                                                    [],
                                                                                    "branch",
                                                                                    []
                                                                                  |),
                                                                                  [
                                                                                    M.call_closure (|
                                                                                      M.get_trait_method (|
                                                                                        "core::convert::TryInto",
                                                                                        Ty.apply
                                                                                          (Ty.path
                                                                                            "&")
                                                                                          [
                                                                                            Ty.apply
                                                                                              (Ty.path
                                                                                                "slice")
                                                                                              [
                                                                                                Ty.path
                                                                                                  "u8"
                                                                                              ]
                                                                                          ],
                                                                                        [
                                                                                          Ty.path
                                                                                            "spl_token_2022::extension::ExtensionType"
                                                                                        ],
                                                                                        "try_into",
                                                                                        []
                                                                                      |),
                                                                                      [
                                                                                        M.read (|
                                                                                          chunk
                                                                                        |)
                                                                                      ]
                                                                                    |)
                                                                                  ]
                                                                                |)
                                                                              |),
                                                                              [
                                                                                fun γ =>
                                                                                  ltac:(M.monadic
                                                                                    (let γ0_0 :=
                                                                                      M.SubPointer.get_struct_tuple_field (|
                                                                                        γ,
                                                                                        "core::ops::control_flow::ControlFlow::Break",
                                                                                        0
                                                                                      |) in
                                                                                    let residual :=
                                                                                      M.copy (|
                                                                                        γ0_0
                                                                                      |) in
                                                                                    M.alloc (|
                                                                                      M.never_to_any (|
                                                                                        M.read (|
                                                                                          M.return_ (|
                                                                                            M.call_closure (|
                                                                                              M.get_trait_method (|
                                                                                                "core::ops::try_trait::FromResidual",
                                                                                                Ty.apply
                                                                                                  (Ty.path
                                                                                                    "core::result::Result")
                                                                                                  [
                                                                                                    Ty.path
                                                                                                      "spl_token_2022::instruction::TokenInstruction";
                                                                                                    Ty.path
                                                                                                      "solana_program::program_error::ProgramError"
                                                                                                  ],
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "core::result::Result")
                                                                                                    [
                                                                                                      Ty.path
                                                                                                        "core::convert::Infallible";
                                                                                                      Ty.path
                                                                                                        "solana_program::program_error::ProgramError"
                                                                                                    ]
                                                                                                ],
                                                                                                "from_residual",
                                                                                                []
                                                                                              |),
                                                                                              [
                                                                                                M.read (|
                                                                                                  residual
                                                                                                |)
                                                                                              ]
                                                                                            |)
                                                                                          |)
                                                                                        |)
                                                                                      |)
                                                                                    |)));
                                                                                fun γ =>
                                                                                  ltac:(M.monadic
                                                                                    (let γ0_0 :=
                                                                                      M.SubPointer.get_struct_tuple_field (|
                                                                                        γ,
                                                                                        "core::ops::control_flow::ControlFlow::Continue",
                                                                                        0
                                                                                      |) in
                                                                                    let val :=
                                                                                      M.copy (|
                                                                                        γ0_0
                                                                                      |) in
                                                                                    val))
                                                                              ]
                                                                            |)
                                                                          |)
                                                                        ]
                                                                      |)
                                                                    |) in
                                                                  M.alloc (| Value.Tuple [] |)))
                                                            ]
                                                          |) in
                                                        M.alloc (| Value.Tuple [] |)))
                                                    |)))
                                              ]
                                            |)) in
                                        M.alloc (|
                                          Value.StructRecord
                                            "spl_token_2022::instruction::TokenInstruction::Reallocate"
                                            [ ("extension_types", M.read (| extension_types |)) ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 30
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::MemoTransferExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 31
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::CreateNativeMint"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 32
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::InitializeNonTransferableMint"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 33
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::InterestBearingMintExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 34
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::CpiGuardExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 35
                                          |) in
                                        M.match_operator (|
                                          M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::ops::try_trait::Try",
                                                  Ty.apply
                                                    (Ty.path "core::result::Result")
                                                    [
                                                      Ty.tuple
                                                        [
                                                          Ty.path "solana_program::pubkey::Pubkey";
                                                          Ty.apply
                                                            (Ty.path "&")
                                                            [
                                                              Ty.apply
                                                                (Ty.path "slice")
                                                                [ Ty.path "u8" ]
                                                            ]
                                                        ];
                                                      Ty.path
                                                        "solana_program::program_error::ProgramError"
                                                    ],
                                                  [],
                                                  "branch",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "spl_token_2022::instruction::TokenInstruction",
                                                      "unpack_pubkey",
                                                      []
                                                    |),
                                                    [ M.read (| rest |) ]
                                                  |)
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Break",
                                                      0
                                                    |) in
                                                  let residual := M.copy (| γ0_0 |) in
                                                  M.alloc (|
                                                    M.never_to_any (|
                                                      M.read (|
                                                        M.return_ (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::FromResidual",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                [
                                                                  Ty.path
                                                                    "spl_token_2022::instruction::TokenInstruction";
                                                                  Ty.path
                                                                    "solana_program::program_error::ProgramError"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "core::result::Result")
                                                                  [
                                                                    Ty.path
                                                                      "core::convert::Infallible";
                                                                    Ty.path
                                                                      "solana_program::program_error::ProgramError"
                                                                  ]
                                                              ],
                                                              "from_residual",
                                                              []
                                                            |),
                                                            [ M.read (| residual |) ]
                                                          |)
                                                        |)
                                                      |)
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ0_0 :=
                                                    M.SubPointer.get_struct_tuple_field (|
                                                      γ,
                                                      "core::ops::control_flow::ControlFlow::Continue",
                                                      0
                                                    |) in
                                                  let val := M.copy (| γ0_0 |) in
                                                  val))
                                            ]
                                          |),
                                          [
                                            fun γ =>
                                              ltac:(M.monadic
                                                (let γ0_0 :=
                                                  M.SubPointer.get_tuple_field (| γ, 0 |) in
                                                let γ0_1 :=
                                                  M.SubPointer.get_tuple_field (| γ, 1 |) in
                                                let delegate := M.copy (| γ0_0 |) in
                                                let _rest := M.copy (| γ0_1 |) in
                                                M.alloc (|
                                                  Value.StructRecord
                                                    "spl_token_2022::instruction::TokenInstruction::InitializePermanentDelegate"
                                                    [ ("delegate", M.read (| delegate |)) ]
                                                |)))
                                          ]
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 36
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::TransferHookExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 37
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::ConfidentialTransferFeeExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 38
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::WithdrawExcessLamports"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 39
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::MetadataPointerExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 40
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::GroupPointerExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer 41
                                          |) in
                                        M.alloc (|
                                          Value.StructTuple
                                            "spl_token_2022::instruction::TokenInstruction::GroupMemberPointerExtension"
                                            []
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.alloc (|
                                          M.never_to_any (|
                                            M.read (|
                                              M.return_ (|
                                                Value.StructTuple
                                                  "core::result::Result::Err"
                                                  [
                                                    M.call_closure (|
                                                      M.get_trait_method (|
                                                        "core::convert::Into",
                                                        Ty.path "spl_token_2022::error::TokenError",
                                                        [
                                                          Ty.path
                                                            "solana_program::program_error::ProgramError"
                                                        ],
                                                        "into",
                                                        []
                                                      |),
                                                      [
                                                        Value.StructTuple
                                                          "spl_token_2022::error::TokenError::InvalidInstruction"
                                                          []
                                                      ]
                                                    |)
                                                  ]
                                              |)
                                            |)
                                          |)
                                        |)))
                                  ]
                                |)
                              |)
                            ]
                        |)))
                  ]
                |)
              |)))
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_unpack : M.IsAssociatedFunction Self "unpack" unpack.
    
    (*
        pub fn pack(&self) -> Vec<u8> {
            let mut buf = Vec::with_capacity(size_of::<Self>());
            match self {
                &Self::InitializeMint {
                    ref mint_authority,
                    ref freeze_authority,
                    decimals,
                } => {
                    buf.push(0);
                    buf.push(decimals);
                    buf.extend_from_slice(mint_authority.as_ref());
                    Self::pack_pubkey_option(freeze_authority, &mut buf);
                }
                Self::InitializeAccount => buf.push(1),
                &Self::InitializeMultisig { m } => {
                    buf.push(2);
                    buf.push(m);
                }
                #[allow(deprecated)]
                &Self::Transfer { amount } => {
                    buf.push(3);
                    buf.extend_from_slice(&amount.to_le_bytes());
                }
                &Self::Approve { amount } => {
                    buf.push(4);
                    buf.extend_from_slice(&amount.to_le_bytes());
                }
                &Self::MintTo { amount } => {
                    buf.push(7);
                    buf.extend_from_slice(&amount.to_le_bytes());
                }
                &Self::Burn { amount } => {
                    buf.push(8);
                    buf.extend_from_slice(&amount.to_le_bytes());
                }
                Self::Revoke => buf.push(5),
                Self::SetAuthority {
                    authority_type,
                    ref new_authority,
                } => {
                    buf.push(6);
                    buf.push(authority_type.into());
                    Self::pack_pubkey_option(new_authority, &mut buf);
                }
                Self::CloseAccount => buf.push(9),
                Self::FreezeAccount => buf.push(10),
                Self::ThawAccount => buf.push(11),
                &Self::TransferChecked { amount, decimals } => {
                    buf.push(12);
                    buf.extend_from_slice(&amount.to_le_bytes());
                    buf.push(decimals);
                }
                &Self::ApproveChecked { amount, decimals } => {
                    buf.push(13);
                    buf.extend_from_slice(&amount.to_le_bytes());
                    buf.push(decimals);
                }
                &Self::MintToChecked { amount, decimals } => {
                    buf.push(14);
                    buf.extend_from_slice(&amount.to_le_bytes());
                    buf.push(decimals);
                }
                &Self::BurnChecked { amount, decimals } => {
                    buf.push(15);
                    buf.extend_from_slice(&amount.to_le_bytes());
                    buf.push(decimals);
                }
                &Self::InitializeAccount2 { owner } => {
                    buf.push(16);
                    buf.extend_from_slice(owner.as_ref());
                }
                &Self::SyncNative => {
                    buf.push(17);
                }
                &Self::InitializeAccount3 { owner } => {
                    buf.push(18);
                    buf.extend_from_slice(owner.as_ref());
                }
                &Self::InitializeMultisig2 { m } => {
                    buf.push(19);
                    buf.push(m);
                }
                &Self::InitializeMint2 {
                    ref mint_authority,
                    ref freeze_authority,
                    decimals,
                } => {
                    buf.push(20);
                    buf.push(decimals);
                    buf.extend_from_slice(mint_authority.as_ref());
                    Self::pack_pubkey_option(freeze_authority, &mut buf);
                }
                Self::GetAccountDataSize { extension_types } => {
                    buf.push(21);
                    for extension_type in extension_types {
                        buf.extend_from_slice(&<[u8; 2]>::from( *extension_type));
                    }
                }
                &Self::InitializeImmutableOwner => {
                    buf.push(22);
                }
                &Self::AmountToUiAmount { amount } => {
                    buf.push(23);
                    buf.extend_from_slice(&amount.to_le_bytes());
                }
                Self::UiAmountToAmount { ui_amount } => {
                    buf.push(24);
                    buf.extend_from_slice(ui_amount.as_bytes());
                }
                Self::InitializeMintCloseAuthority { close_authority } => {
                    buf.push(25);
                    Self::pack_pubkey_option(close_authority, &mut buf);
                }
                Self::TransferFeeExtension => {
                    buf.push(26);
                }
                &Self::ConfidentialTransferExtension => {
                    buf.push(27);
                }
                &Self::DefaultAccountStateExtension => {
                    buf.push(28);
                }
                Self::Reallocate { extension_types } => {
                    buf.push(29);
                    for extension_type in extension_types {
                        buf.extend_from_slice(&<[u8; 2]>::from( *extension_type));
                    }
                }
                &Self::MemoTransferExtension => {
                    buf.push(30);
                }
                &Self::CreateNativeMint => {
                    buf.push(31);
                }
                &Self::InitializeNonTransferableMint => {
                    buf.push(32);
                }
                &Self::InterestBearingMintExtension => {
                    buf.push(33);
                }
                &Self::CpiGuardExtension => {
                    buf.push(34);
                }
                Self::InitializePermanentDelegate { delegate } => {
                    buf.push(35);
                    buf.extend_from_slice(delegate.as_ref());
                }
                &Self::TransferHookExtension => {
                    buf.push(36);
                }
                &Self::ConfidentialTransferFeeExtension => {
                    buf.push(37);
                }
                &Self::WithdrawExcessLamports => {
                    buf.push(38);
                }
                &Self::MetadataPointerExtension => {
                    buf.push(39);
                }
                &Self::GroupPointerExtension => {
                    buf.push(40);
                }
                &Self::GroupMemberPointerExtension => {
                    buf.push(41);
                }
            };
            buf
        }
    *)
    Definition pack (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            let buf :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                    "with_capacity",
                    []
                  |),
                  [
                    M.call_closure (|
                      M.get_function (|
                        "core::mem::size_of",
                        [ Ty.path "spl_token_2022::instruction::TokenInstruction" ]
                      |),
                      []
                    |)
                  ]
                |)
              |) in
            let _ :=
              M.match_operator (|
                self,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                          "mint_authority"
                        |) in
                      let γ1_1 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                          "freeze_authority"
                        |) in
                      let γ1_2 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMint",
                          "decimals"
                        |) in
                      let mint_authority := M.alloc (| γ1_0 |) in
                      let freeze_authority := M.alloc (| γ1_1 |) in
                      let decimals := M.copy (| γ1_2 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 0 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; M.read (| decimals |) ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::convert::AsRef",
                                  Ty.path "solana_program::pubkey::Pubkey",
                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ],
                                  "as_ref",
                                  []
                                |),
                                [ M.read (| mint_authority |) ]
                              |)
                            ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack_pubkey_option",
                              []
                            |),
                            [ M.read (| freeze_authority |); buf ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                            "push",
                            []
                          |),
                          [ buf; Value.Integer 1 ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMultisig",
                          "m"
                        |) in
                      let m := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 2 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; M.read (| m |) ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::Transfer",
                          "amount"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 3 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::Approve",
                          "amount"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 4 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::MintTo",
                          "amount"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 7 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::Burn",
                          "amount"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 8 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                            "push",
                            []
                          |),
                          [ buf; Value.Integer 5 ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                          "authority_type"
                        |) in
                      let γ1_1 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::SetAuthority",
                          "new_authority"
                        |) in
                      let authority_type := M.alloc (| γ1_0 |) in
                      let new_authority := M.alloc (| γ1_1 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 6 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [
                              buf;
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "spl_token_2022::instruction::AuthorityType",
                                  "into",
                                  []
                                |),
                                [ M.read (| authority_type |) ]
                              |)
                            ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack_pubkey_option",
                              []
                            |),
                            [ M.read (| new_authority |); buf ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                            "push",
                            []
                          |),
                          [ buf; Value.Integer 9 ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                            "push",
                            []
                          |),
                          [ buf; Value.Integer 10 ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                            "push",
                            []
                          |),
                          [ buf; Value.Integer 11 ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                          "amount"
                        |) in
                      let γ1_1 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::TransferChecked",
                          "decimals"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let decimals := M.copy (| γ1_1 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 12 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; M.read (| decimals |) ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                          "amount"
                        |) in
                      let γ1_1 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::ApproveChecked",
                          "decimals"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let decimals := M.copy (| γ1_1 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 13 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; M.read (| decimals |) ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                          "amount"
                        |) in
                      let γ1_1 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::MintToChecked",
                          "decimals"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let decimals := M.copy (| γ1_1 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 14 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; M.read (| decimals |) ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                          "amount"
                        |) in
                      let γ1_1 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::BurnChecked",
                          "decimals"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let decimals := M.copy (| γ1_1 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 15 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; M.read (| decimals |) ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeAccount2",
                          "owner"
                        |) in
                      let owner := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 16 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::convert::AsRef",
                                  Ty.path "solana_program::pubkey::Pubkey",
                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ],
                                  "as_ref",
                                  []
                                |),
                                [ owner ]
                              |)
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 17 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeAccount3",
                          "owner"
                        |) in
                      let owner := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 18 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::convert::AsRef",
                                  Ty.path "solana_program::pubkey::Pubkey",
                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ],
                                  "as_ref",
                                  []
                                |),
                                [ owner ]
                              |)
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMultisig2",
                          "m"
                        |) in
                      let m := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 19 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; M.read (| m |) ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                          "mint_authority"
                        |) in
                      let γ1_1 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                          "freeze_authority"
                        |) in
                      let γ1_2 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMint2",
                          "decimals"
                        |) in
                      let mint_authority := M.alloc (| γ1_0 |) in
                      let freeze_authority := M.alloc (| γ1_1 |) in
                      let decimals := M.copy (| γ1_2 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 20 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; M.read (| decimals |) ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::convert::AsRef",
                                  Ty.path "solana_program::pubkey::Pubkey",
                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ],
                                  "as_ref",
                                  []
                                |),
                                [ M.read (| mint_authority |) ]
                              |)
                            ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack_pubkey_option",
                              []
                            |),
                            [ M.read (| freeze_authority |); buf ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::GetAccountDataSize",
                          "extension_types"
                        |) in
                      let extension_types := M.alloc (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 21 ]
                          |)
                        |) in
                      M.use
                        (M.match_operator (|
                          M.alloc (|
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::collect::IntoIterator",
                                Ty.apply
                                  (Ty.path "&")
                                  [
                                    Ty.apply
                                      (Ty.path "alloc::vec::Vec")
                                      [
                                        Ty.path "spl_token_2022::extension::ExtensionType";
                                        Ty.path "alloc::alloc::Global"
                                      ]
                                  ],
                                [],
                                "into_iter",
                                []
                              |),
                              [ M.read (| extension_types |) ]
                            |)
                          |),
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (let iter := M.copy (| γ |) in
                                M.loop (|
                                  ltac:(M.monadic
                                    (let _ :=
                                      M.match_operator (|
                                        M.alloc (|
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::iter::traits::iterator::Iterator",
                                              Ty.apply
                                                (Ty.path "core::slice::iter::Iter")
                                                [ Ty.path "spl_token_2022::extension::ExtensionType"
                                                ],
                                              [],
                                              "next",
                                              []
                                            |),
                                            [ iter ]
                                          |)
                                        |),
                                        [
                                          fun γ =>
                                            ltac:(M.monadic
                                              (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 extension_type := M.copy (| γ0_0 |) in
                                              let _ :=
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "alloc::vec::Vec")
                                                        [
                                                          Ty.path "u8";
                                                          Ty.path "alloc::alloc::Global"
                                                        ],
                                                      "extend_from_slice",
                                                      []
                                                    |),
                                                    [
                                                      buf;
                                                      (* Unsize *)
                                                      M.pointer_coercion
                                                        (M.alloc (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::convert::From",
                                                              Ty.apply
                                                                (Ty.path "array")
                                                                [ Ty.path "u8" ],
                                                              [
                                                                Ty.path
                                                                  "spl_token_2022::extension::ExtensionType"
                                                              ],
                                                              "from",
                                                              []
                                                            |),
                                                            [
                                                              M.read (|
                                                                M.read (| extension_type |)
                                                              |)
                                                            ]
                                                          |)
                                                        |))
                                                    ]
                                                  |)
                                                |) in
                                              M.alloc (| Value.Tuple [] |)))
                                        ]
                                      |) in
                                    M.alloc (| Value.Tuple [] |)))
                                |)))
                          ]
                        |))));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 22 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::AmountToUiAmount",
                          "amount"
                        |) in
                      let amount := M.copy (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 23 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              (* Unsize *)
                              M.pointer_coercion
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "to_le_bytes",
                                      []
                                    |),
                                    [ M.read (| amount |) ]
                                  |)
                                |))
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::UiAmountToAmount",
                          "ui_amount"
                        |) in
                      let ui_amount := M.alloc (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 24 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              M.call_closure (|
                                M.get_associated_function (| Ty.path "str", "as_bytes", [] |),
                                [ M.read (| M.read (| ui_amount |) |) ]
                              |)
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializeMintCloseAuthority",
                          "close_authority"
                        |) in
                      let close_authority := M.alloc (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 25 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack_pubkey_option",
                              []
                            |),
                            [ M.read (| close_authority |); buf ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 26 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 27 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 28 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::Reallocate",
                          "extension_types"
                        |) in
                      let extension_types := M.alloc (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 29 ]
                          |)
                        |) in
                      M.use
                        (M.match_operator (|
                          M.alloc (|
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::iter::traits::collect::IntoIterator",
                                Ty.apply
                                  (Ty.path "&")
                                  [
                                    Ty.apply
                                      (Ty.path "alloc::vec::Vec")
                                      [
                                        Ty.path "spl_token_2022::extension::ExtensionType";
                                        Ty.path "alloc::alloc::Global"
                                      ]
                                  ],
                                [],
                                "into_iter",
                                []
                              |),
                              [ M.read (| extension_types |) ]
                            |)
                          |),
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (let iter := M.copy (| γ |) in
                                M.loop (|
                                  ltac:(M.monadic
                                    (let _ :=
                                      M.match_operator (|
                                        M.alloc (|
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::iter::traits::iterator::Iterator",
                                              Ty.apply
                                                (Ty.path "core::slice::iter::Iter")
                                                [ Ty.path "spl_token_2022::extension::ExtensionType"
                                                ],
                                              [],
                                              "next",
                                              []
                                            |),
                                            [ iter ]
                                          |)
                                        |),
                                        [
                                          fun γ =>
                                            ltac:(M.monadic
                                              (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 extension_type := M.copy (| γ0_0 |) in
                                              let _ :=
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.apply
                                                        (Ty.path "alloc::vec::Vec")
                                                        [
                                                          Ty.path "u8";
                                                          Ty.path "alloc::alloc::Global"
                                                        ],
                                                      "extend_from_slice",
                                                      []
                                                    |),
                                                    [
                                                      buf;
                                                      (* Unsize *)
                                                      M.pointer_coercion
                                                        (M.alloc (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::convert::From",
                                                              Ty.apply
                                                                (Ty.path "array")
                                                                [ Ty.path "u8" ],
                                                              [
                                                                Ty.path
                                                                  "spl_token_2022::extension::ExtensionType"
                                                              ],
                                                              "from",
                                                              []
                                                            |),
                                                            [
                                                              M.read (|
                                                                M.read (| extension_type |)
                                                              |)
                                                            ]
                                                          |)
                                                        |))
                                                    ]
                                                  |)
                                                |) in
                                              M.alloc (| Value.Tuple [] |)))
                                        ]
                                      |) in
                                    M.alloc (| Value.Tuple [] |)))
                                |)))
                          ]
                        |))));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 30 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 31 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 32 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 33 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 34 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_record_field (|
                          γ,
                          "spl_token_2022::instruction::TokenInstruction::InitializePermanentDelegate",
                          "delegate"
                        |) in
                      let delegate := M.alloc (| γ1_0 |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 35 ]
                          |)
                        |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "extend_from_slice",
                              []
                            |),
                            [
                              buf;
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::convert::AsRef",
                                  Ty.path "solana_program::pubkey::Pubkey",
                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ],
                                  "as_ref",
                                  []
                                |),
                                [ M.read (| delegate |) ]
                              |)
                            ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 36 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 37 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 38 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 39 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 40 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::vec::Vec")
                                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                              "push",
                              []
                            |),
                            [ buf; Value.Integer 41 ]
                          |)
                        |) in
                      M.alloc (| Value.Tuple [] |)))
                ]
              |) in
            buf
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_pack : M.IsAssociatedFunction Self "pack" pack.
    
    (*
        pub(crate) fn unpack_pubkey(input: &[u8]) -> Result<(Pubkey, &[u8]), ProgramError> {
            let pk = input
                .get(..PUBKEY_BYTES)
                .and_then(|x| Pubkey::try_from(x).ok())
                .ok_or(TokenError::InvalidInstruction)?;
            Ok((pk, &input[PUBKEY_BYTES..]))
        }
    *)
    Definition unpack_pubkey (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ input ] =>
        ltac:(M.monadic
          (let input := M.alloc (| input |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let pk :=
                  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 "solana_program::pubkey::Pubkey";
                                Ty.path "spl_token_2022::error::TokenError"
                              ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "core::option::Option")
                                  [ Ty.path "solana_program::pubkey::Pubkey" ],
                                "ok_or",
                                [ Ty.path "spl_token_2022::error::TokenError" ]
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::option::Option")
                                      [
                                        Ty.apply
                                          (Ty.path "&")
                                          [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                      ],
                                    "and_then",
                                    [
                                      Ty.path "solana_program::pubkey::Pubkey";
                                      Ty.function
                                        [
                                          Ty.tuple
                                            [
                                              Ty.apply
                                                (Ty.path "&")
                                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                            ]
                                        ]
                                        (Ty.apply
                                          (Ty.path "core::option::Option")
                                          [ Ty.path "solana_program::pubkey::Pubkey" ])
                                    ]
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                                        "get",
                                        [
                                          Ty.apply
                                            (Ty.path "core::ops::range::RangeTo")
                                            [ Ty.path "usize" ]
                                        ]
                                      |),
                                      [
                                        M.read (| input |);
                                        Value.StructRecord
                                          "core::ops::range::RangeTo"
                                          [
                                            ("end_",
                                              M.read (|
                                                M.get_constant (|
                                                  "solana_program::pubkey::PUBKEY_BYTES"
                                                |)
                                              |))
                                          ]
                                      ]
                                    |);
                                    M.closure
                                      (fun γ =>
                                        ltac:(M.monadic
                                          match γ with
                                          | [ α0 ] =>
                                            M.match_operator (|
                                              M.alloc (| α0 |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let x := M.copy (| γ |) in
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.apply
                                                          (Ty.path "core::result::Result")
                                                          [
                                                            Ty.path
                                                              "solana_program::pubkey::Pubkey";
                                                            Ty.path "core::array::TryFromSliceError"
                                                          ],
                                                        "ok",
                                                        []
                                                      |),
                                                      [
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::convert::TryFrom",
                                                            Ty.path
                                                              "solana_program::pubkey::Pubkey",
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "slice")
                                                                    [ Ty.path "u8" ]
                                                                ]
                                                            ],
                                                            "try_from",
                                                            []
                                                          |),
                                                          [ M.read (| x |) ]
                                                        |)
                                                      ]
                                                    |)))
                                              ]
                                            |)
                                          | _ => M.impossible (||)
                                          end))
                                  ]
                                |);
                                Value.StructTuple
                                  "spl_token_2022::error::TokenError::InvalidInstruction"
                                  []
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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 "solana_program::pubkey::Pubkey";
                                                Ty.apply
                                                  (Ty.path "&")
                                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                              ];
                                            Ty.path "solana_program::program_error::ProgramError"
                                          ],
                                        [
                                          Ty.apply
                                            (Ty.path "core::result::Result")
                                            [
                                              Ty.path "core::convert::Infallible";
                                              Ty.path "spl_token_2022::error::TokenError"
                                            ]
                                        ],
                                        "from_residual",
                                        []
                                      |),
                                      [ M.read (| residual |) ]
                                    |)
                                  |)
                                |)
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Continue",
                                0
                              |) in
                            let val := M.copy (| γ0_0 |) in
                            val))
                      ]
                    |)
                  |) in
                M.alloc (|
                  Value.StructTuple
                    "core::result::Result::Ok"
                    [
                      Value.Tuple
                        [
                          M.read (| pk |);
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::index::Index",
                              Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                              [ Ty.apply (Ty.path "core::ops::range::RangeFrom") [ Ty.path "usize" ]
                              ],
                              "index",
                              []
                            |),
                            [
                              M.read (| input |);
                              Value.StructRecord
                                "core::ops::range::RangeFrom"
                                [
                                  ("start",
                                    M.read (|
                                      M.get_constant (| "solana_program::pubkey::PUBKEY_BYTES" |)
                                    |))
                                ]
                            ]
                          |)
                        ]
                    ]
                |)
              |)))
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_unpack_pubkey :
      M.IsAssociatedFunction Self "unpack_pubkey" unpack_pubkey.
    
    (*
        pub(crate) fn unpack_pubkey_option(
            input: &[u8],
        ) -> Result<(COption<Pubkey>, &[u8]), ProgramError> {
            match input.split_first() {
                Option::Some((&0, rest)) => Ok((COption::None, rest)),
                Option::Some((&1, rest)) => {
                    let (pk, rest) = Self::unpack_pubkey(rest)?;
                    Ok((COption::Some(pk), rest))
                }
                _ => Err(TokenError::InvalidInstruction.into()),
            }
        }
    *)
    Definition unpack_pubkey_option (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ input ] =>
        ltac:(M.monadic
          (let input := M.alloc (| input |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                M.match_operator (|
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                        "split_first",
                        []
                      |),
                      [ M.read (| input |) ]
                    |)
                  |),
                  [
                    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 γ1_0 := M.read (| γ1_0 |) in
                        let _ :=
                          M.is_constant_or_break_match (| M.read (| γ1_0 |), Value.Integer 0 |) in
                        let rest := M.copy (| γ1_1 |) in
                        M.alloc (|
                          Value.StructTuple
                            "core::result::Result::Ok"
                            [
                              Value.Tuple
                                [
                                  Value.StructTuple
                                    "solana_program::program_option::COption::None"
                                    [];
                                  M.read (| rest |)
                                ]
                            ]
                        |)));
                    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 γ1_0 := M.read (| γ1_0 |) in
                        let _ :=
                          M.is_constant_or_break_match (| M.read (| γ1_0 |), Value.Integer 1 |) in
                        let rest := M.copy (| γ1_1 |) in
                        M.match_operator (|
                          M.match_operator (|
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::ops::try_trait::Try",
                                  Ty.apply
                                    (Ty.path "core::result::Result")
                                    [
                                      Ty.tuple
                                        [
                                          Ty.path "solana_program::pubkey::Pubkey";
                                          Ty.apply
                                            (Ty.path "&")
                                            [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                        ];
                                      Ty.path "solana_program::program_error::ProgramError"
                                    ],
                                  [],
                                  "branch",
                                  []
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                                      "unpack_pubkey",
                                      []
                                    |),
                                    [ M.read (| rest |) ]
                                  |)
                                ]
                              |)
                            |),
                            [
                              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.apply
                                                        (Ty.path
                                                          "solana_program::program_option::COption")
                                                        [ Ty.path "solana_program::pubkey::Pubkey"
                                                        ];
                                                      Ty.apply
                                                        (Ty.path "&")
                                                        [
                                                          Ty.apply
                                                            (Ty.path "slice")
                                                            [ Ty.path "u8" ]
                                                        ]
                                                    ];
                                                  Ty.path
                                                    "solana_program::program_error::ProgramError"
                                                ],
                                              [
                                                Ty.apply
                                                  (Ty.path "core::result::Result")
                                                  [
                                                    Ty.path "core::convert::Infallible";
                                                    Ty.path
                                                      "solana_program::program_error::ProgramError"
                                                  ]
                                              ],
                                              "from_residual",
                                              []
                                            |),
                                            [ M.read (| residual |) ]
                                          |)
                                        |)
                                      |)
                                    |)
                                  |)));
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ0_0 :=
                                    M.SubPointer.get_struct_tuple_field (|
                                      γ,
                                      "core::ops::control_flow::ControlFlow::Continue",
                                      0
                                    |) in
                                  let val := M.copy (| γ0_0 |) in
                                  val))
                            ]
                          |),
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                let pk := M.copy (| γ0_0 |) in
                                let rest := M.copy (| γ0_1 |) in
                                M.alloc (|
                                  Value.StructTuple
                                    "core::result::Result::Ok"
                                    [
                                      Value.Tuple
                                        [
                                          Value.StructTuple
                                            "solana_program::program_option::COption::Some"
                                            [ M.read (| pk |) ];
                                          M.read (| rest |)
                                        ]
                                    ]
                                |)))
                          ]
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (M.alloc (|
                          Value.StructTuple
                            "core::result::Result::Err"
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::convert::Into",
                                  Ty.path "spl_token_2022::error::TokenError",
                                  [ Ty.path "solana_program::program_error::ProgramError" ],
                                  "into",
                                  []
                                |),
                                [
                                  Value.StructTuple
                                    "spl_token_2022::error::TokenError::InvalidInstruction"
                                    []
                                ]
                              |)
                            ]
                        |)))
                  ]
                |)
              |)))
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_unpack_pubkey_option :
      M.IsAssociatedFunction Self "unpack_pubkey_option" unpack_pubkey_option.
    
    (*
        pub(crate) fn pack_pubkey_option(value: &COption<Pubkey>, buf: &mut Vec<u8>) {
            match *value {
                COption::Some(ref key) => {
                    buf.push(1);
                    buf.extend_from_slice(&key.to_bytes());
                }
                COption::None => buf.push(0),
            }
        }
    *)
    Definition pack_pubkey_option (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ value; buf ] =>
        ltac:(M.monadic
          (let value := M.alloc (| value |) in
          let buf := M.alloc (| buf |) in
          M.read (|
            M.match_operator (|
              M.read (| value |),
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ0_0 :=
                      M.SubPointer.get_struct_tuple_field (|
                        γ,
                        "solana_program::program_option::COption::Some",
                        0
                      |) in
                    let key := M.alloc (| γ0_0 |) in
                    let _ :=
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                            "push",
                            []
                          |),
                          [ M.read (| buf |); Value.Integer 1 ]
                        |)
                      |) in
                    let _ :=
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "alloc::vec::Vec")
                              [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                            "extend_from_slice",
                            []
                          |),
                          [
                            M.read (| buf |);
                            (* Unsize *)
                            M.pointer_coercion
                              (M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "solana_program::pubkey::Pubkey",
                                    "to_bytes",
                                    []
                                  |),
                                  [ M.read (| M.read (| key |) |) ]
                                |)
                              |))
                          ]
                        |)
                      |) in
                    M.alloc (| Value.Tuple [] |)));
                fun γ =>
                  ltac:(M.monadic
                    (M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                          "push",
                          []
                        |),
                        [ M.read (| buf |); Value.Integer 0 ]
                      |)
                    |)))
              ]
            |)
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_pack_pubkey_option :
      M.IsAssociatedFunction Self "pack_pubkey_option" pack_pubkey_option.
    
    (*
        pub(crate) fn unpack_u16(input: &[u8]) -> Result<(u16, &[u8]), ProgramError> {
            let value = input
                .get(..U16_BYTES)
                .and_then(|slice| slice.try_into().ok())
                .map(u16::from_le_bytes)
                .ok_or(TokenError::InvalidInstruction)?;
            Ok((value, &input[U16_BYTES..]))
        }
    *)
    Definition unpack_u16 (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ input ] =>
        ltac:(M.monadic
          (let input := M.alloc (| input |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let value :=
                  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 "u16"; Ty.path "spl_token_2022::error::TokenError" ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply (Ty.path "core::option::Option") [ Ty.path "u16" ],
                                "ok_or",
                                [ Ty.path "spl_token_2022::error::TokenError" ]
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::option::Option")
                                      [ Ty.apply (Ty.path "array") [ Ty.path "u8" ] ],
                                    "map",
                                    [
                                      Ty.path "u16";
                                      Ty.function
                                        [ Ty.apply (Ty.path "array") [ Ty.path "u8" ] ]
                                        (Ty.path "u16")
                                    ]
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply
                                          (Ty.path "core::option::Option")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        "and_then",
                                        [
                                          Ty.apply (Ty.path "array") [ Ty.path "u8" ];
                                          Ty.function
                                            [
                                              Ty.tuple
                                                [
                                                  Ty.apply
                                                    (Ty.path "&")
                                                    [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                                ]
                                            ]
                                            (Ty.apply
                                              (Ty.path "core::option::Option")
                                              [ Ty.apply (Ty.path "array") [ Ty.path "u8" ] ])
                                        ]
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                                            "get",
                                            [
                                              Ty.apply
                                                (Ty.path "core::ops::range::RangeTo")
                                                [ Ty.path "usize" ]
                                            ]
                                          |),
                                          [
                                            M.read (| input |);
                                            Value.StructRecord
                                              "core::ops::range::RangeTo"
                                              [
                                                ("end_",
                                                  M.read (|
                                                    M.get_constant (|
                                                      "spl_token_2022::instruction::U16_BYTES"
                                                    |)
                                                  |))
                                              ]
                                          ]
                                        |);
                                        M.closure
                                          (fun γ =>
                                            ltac:(M.monadic
                                              match γ with
                                              | [ α0 ] =>
                                                M.match_operator (|
                                                  M.alloc (| α0 |),
                                                  [
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let slice := M.copy (| γ |) in
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path "core::result::Result")
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "array")
                                                                  [ Ty.path "u8" ];
                                                                Ty.path
                                                                  "core::array::TryFromSliceError"
                                                              ],
                                                            "ok",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_trait_method (|
                                                                "core::convert::TryInto",
                                                                Ty.apply
                                                                  (Ty.path "&")
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "slice")
                                                                      [ Ty.path "u8" ]
                                                                  ],
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "array")
                                                                    [ Ty.path "u8" ]
                                                                ],
                                                                "try_into",
                                                                []
                                                              |),
                                                              [ M.read (| slice |) ]
                                                            |)
                                                          ]
                                                        |)))
                                                  ]
                                                |)
                                              | _ => M.impossible (||)
                                              end))
                                      ]
                                    |);
                                    M.get_associated_function (|
                                      Ty.path "u16",
                                      "from_le_bytes",
                                      []
                                    |)
                                  ]
                                |);
                                Value.StructTuple
                                  "spl_token_2022::error::TokenError::InvalidInstruction"
                                  []
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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 "u16";
                                                Ty.apply
                                                  (Ty.path "&")
                                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                              ];
                                            Ty.path "solana_program::program_error::ProgramError"
                                          ],
                                        [
                                          Ty.apply
                                            (Ty.path "core::result::Result")
                                            [
                                              Ty.path "core::convert::Infallible";
                                              Ty.path "spl_token_2022::error::TokenError"
                                            ]
                                        ],
                                        "from_residual",
                                        []
                                      |),
                                      [ M.read (| residual |) ]
                                    |)
                                  |)
                                |)
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Continue",
                                0
                              |) in
                            let val := M.copy (| γ0_0 |) in
                            val))
                      ]
                    |)
                  |) in
                M.alloc (|
                  Value.StructTuple
                    "core::result::Result::Ok"
                    [
                      Value.Tuple
                        [
                          M.read (| value |);
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::index::Index",
                              Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                              [ Ty.apply (Ty.path "core::ops::range::RangeFrom") [ Ty.path "usize" ]
                              ],
                              "index",
                              []
                            |),
                            [
                              M.read (| input |);
                              Value.StructRecord
                                "core::ops::range::RangeFrom"
                                [
                                  ("start",
                                    M.read (|
                                      M.get_constant (| "spl_token_2022::instruction::U16_BYTES" |)
                                    |))
                                ]
                            ]
                          |)
                        ]
                    ]
                |)
              |)))
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_unpack_u16 : M.IsAssociatedFunction Self "unpack_u16" unpack_u16.
    
    (*
        pub(crate) fn unpack_u64(input: &[u8]) -> Result<(u64, &[u8]), ProgramError> {
            let value = input
                .get(..U64_BYTES)
                .and_then(|slice| slice.try_into().ok())
                .map(u64::from_le_bytes)
                .ok_or(TokenError::InvalidInstruction)?;
            Ok((value, &input[U64_BYTES..]))
        }
    *)
    Definition unpack_u64 (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ input ] =>
        ltac:(M.monadic
          (let input := M.alloc (| input |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                let value :=
                  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 "u64"; Ty.path "spl_token_2022::error::TokenError" ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply (Ty.path "core::option::Option") [ Ty.path "u64" ],
                                "ok_or",
                                [ Ty.path "spl_token_2022::error::TokenError" ]
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::option::Option")
                                      [ Ty.apply (Ty.path "array") [ Ty.path "u8" ] ],
                                    "map",
                                    [
                                      Ty.path "u64";
                                      Ty.function
                                        [ Ty.apply (Ty.path "array") [ Ty.path "u8" ] ]
                                        (Ty.path "u64")
                                    ]
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply
                                          (Ty.path "core::option::Option")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        "and_then",
                                        [
                                          Ty.apply (Ty.path "array") [ Ty.path "u8" ];
                                          Ty.function
                                            [
                                              Ty.tuple
                                                [
                                                  Ty.apply
                                                    (Ty.path "&")
                                                    [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                                ]
                                            ]
                                            (Ty.apply
                                              (Ty.path "core::option::Option")
                                              [ Ty.apply (Ty.path "array") [ Ty.path "u8" ] ])
                                        ]
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                                            "get",
                                            [
                                              Ty.apply
                                                (Ty.path "core::ops::range::RangeTo")
                                                [ Ty.path "usize" ]
                                            ]
                                          |),
                                          [
                                            M.read (| input |);
                                            Value.StructRecord
                                              "core::ops::range::RangeTo"
                                              [
                                                ("end_",
                                                  M.read (|
                                                    M.get_constant (|
                                                      "spl_token_2022::instruction::U64_BYTES"
                                                    |)
                                                  |))
                                              ]
                                          ]
                                        |);
                                        M.closure
                                          (fun γ =>
                                            ltac:(M.monadic
                                              match γ with
                                              | [ α0 ] =>
                                                M.match_operator (|
                                                  M.alloc (| α0 |),
                                                  [
                                                    fun γ =>
                                                      ltac:(M.monadic
                                                        (let slice := M.copy (| γ |) in
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.apply
                                                              (Ty.path "core::result::Result")
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "array")
                                                                  [ Ty.path "u8" ];
                                                                Ty.path
                                                                  "core::array::TryFromSliceError"
                                                              ],
                                                            "ok",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_trait_method (|
                                                                "core::convert::TryInto",
                                                                Ty.apply
                                                                  (Ty.path "&")
                                                                  [
                                                                    Ty.apply
                                                                      (Ty.path "slice")
                                                                      [ Ty.path "u8" ]
                                                                  ],
                                                                [
                                                                  Ty.apply
                                                                    (Ty.path "array")
                                                                    [ Ty.path "u8" ]
                                                                ],
                                                                "try_into",
                                                                []
                                                              |),
                                                              [ M.read (| slice |) ]
                                                            |)
                                                          ]
                                                        |)))
                                                  ]
                                                |)
                                              | _ => M.impossible (||)
                                              end))
                                      ]
                                    |);
                                    M.get_associated_function (|
                                      Ty.path "u64",
                                      "from_le_bytes",
                                      []
                                    |)
                                  ]
                                |);
                                Value.StructTuple
                                  "spl_token_2022::error::TokenError::InvalidInstruction"
                                  []
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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 "u64";
                                                Ty.apply
                                                  (Ty.path "&")
                                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                              ];
                                            Ty.path "solana_program::program_error::ProgramError"
                                          ],
                                        [
                                          Ty.apply
                                            (Ty.path "core::result::Result")
                                            [
                                              Ty.path "core::convert::Infallible";
                                              Ty.path "spl_token_2022::error::TokenError"
                                            ]
                                        ],
                                        "from_residual",
                                        []
                                      |),
                                      [ M.read (| residual |) ]
                                    |)
                                  |)
                                |)
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Continue",
                                0
                              |) in
                            let val := M.copy (| γ0_0 |) in
                            val))
                      ]
                    |)
                  |) in
                M.alloc (|
                  Value.StructTuple
                    "core::result::Result::Ok"
                    [
                      Value.Tuple
                        [
                          M.read (| value |);
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::index::Index",
                              Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                              [ Ty.apply (Ty.path "core::ops::range::RangeFrom") [ Ty.path "usize" ]
                              ],
                              "index",
                              []
                            |),
                            [
                              M.read (| input |);
                              Value.StructRecord
                                "core::ops::range::RangeFrom"
                                [
                                  ("start",
                                    M.read (|
                                      M.get_constant (| "spl_token_2022::instruction::U64_BYTES" |)
                                    |))
                                ]
                            ]
                          |)
                        ]
                    ]
                |)
              |)))
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_unpack_u64 : M.IsAssociatedFunction Self "unpack_u64" unpack_u64.
    
    (*
        pub(crate) fn unpack_amount_decimals(input: &[u8]) -> Result<(u64, u8, &[u8]), ProgramError> {
            let (amount, rest) = Self::unpack_u64(input)?;
            let (&decimals, rest) = rest.split_first().ok_or(TokenError::InvalidInstruction)?;
            Ok((amount, decimals, rest))
        }
    *)
    Definition unpack_amount_decimals (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ input ] =>
        ltac:(M.monadic
          (let input := M.alloc (| input |) in
          M.catch_return (|
            ltac:(M.monadic
              (M.read (|
                M.match_operator (|
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::try_trait::Try",
                          Ty.apply
                            (Ty.path "core::result::Result")
                            [
                              Ty.tuple
                                [
                                  Ty.path "u64";
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                ];
                              Ty.path "solana_program::program_error::ProgramError"
                            ],
                          [],
                          "branch",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "unpack_u64",
                              []
                            |),
                            [ M.read (| input |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::ops::control_flow::ControlFlow::Break",
                              0
                            |) in
                          let residual := M.copy (| γ0_0 |) in
                          M.alloc (|
                            M.never_to_any (|
                              M.read (|
                                M.return_ (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::ops::try_trait::FromResidual",
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.tuple
                                            [
                                              Ty.path "u64";
                                              Ty.path "u8";
                                              Ty.apply
                                                (Ty.path "&")
                                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                            ];
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ],
                                      [
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          [
                                            Ty.path "core::convert::Infallible";
                                            Ty.path "solana_program::program_error::ProgramError"
                                          ]
                                      ],
                                      "from_residual",
                                      []
                                    |),
                                    [ M.read (| residual |) ]
                                  |)
                                |)
                              |)
                            |)
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::ops::control_flow::ControlFlow::Continue",
                              0
                            |) in
                          let val := M.copy (| γ0_0 |) in
                          val))
                    ]
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                        let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                        let amount := M.copy (| γ0_0 |) in
                        let rest := M.copy (| γ0_1 |) in
                        M.match_operator (|
                          M.match_operator (|
                            M.alloc (|
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::ops::try_trait::Try",
                                  Ty.apply
                                    (Ty.path "core::result::Result")
                                    [
                                      Ty.tuple
                                        [
                                          Ty.apply (Ty.path "&") [ Ty.path "u8" ];
                                          Ty.apply
                                            (Ty.path "&")
                                            [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                        ];
                                      Ty.path "spl_token_2022::error::TokenError"
                                    ],
                                  [],
                                  "branch",
                                  []
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "core::option::Option")
                                        [
                                          Ty.tuple
                                            [
                                              Ty.apply (Ty.path "&") [ Ty.path "u8" ];
                                              Ty.apply
                                                (Ty.path "&")
                                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                            ]
                                        ],
                                      "ok_or",
                                      [ Ty.path "spl_token_2022::error::TokenError" ]
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                                          "split_first",
                                          []
                                        |),
                                        [ M.read (| rest |) ]
                                      |);
                                      Value.StructTuple
                                        "spl_token_2022::error::TokenError::InvalidInstruction"
                                        []
                                    ]
                                  |)
                                ]
                              |)
                            |),
                            [
                              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 "u64";
                                                      Ty.path "u8";
                                                      Ty.apply
                                                        (Ty.path "&")
                                                        [
                                                          Ty.apply
                                                            (Ty.path "slice")
                                                            [ Ty.path "u8" ]
                                                        ]
                                                    ];
                                                  Ty.path
                                                    "solana_program::program_error::ProgramError"
                                                ],
                                              [
                                                Ty.apply
                                                  (Ty.path "core::result::Result")
                                                  [
                                                    Ty.path "core::convert::Infallible";
                                                    Ty.path "spl_token_2022::error::TokenError"
                                                  ]
                                              ],
                                              "from_residual",
                                              []
                                            |),
                                            [ M.read (| residual |) ]
                                          |)
                                        |)
                                      |)
                                    |)
                                  |)));
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ0_0 :=
                                    M.SubPointer.get_struct_tuple_field (|
                                      γ,
                                      "core::ops::control_flow::ControlFlow::Continue",
                                      0
                                    |) in
                                  let val := M.copy (| γ0_0 |) in
                                  val))
                            ]
                          |),
                          [
                            fun γ =>
                              ltac:(M.monadic
                                (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                let γ0_0 := M.read (| γ0_0 |) in
                                let decimals := M.copy (| γ0_0 |) in
                                let rest := M.copy (| γ0_1 |) in
                                M.alloc (|
                                  Value.StructTuple
                                    "core::result::Result::Ok"
                                    [
                                      Value.Tuple
                                        [
                                          M.read (| amount |);
                                          M.read (| decimals |);
                                          M.read (| rest |)
                                        ]
                                    ]
                                |)))
                          ]
                        |)))
                  ]
                |)
              |)))
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_unpack_amount_decimals :
      M.IsAssociatedFunction Self "unpack_amount_decimals" unpack_amount_decimals.
  End Impl_spl_token_2022_instruction_TokenInstruction.
  
  (*
  Enum AuthorityType
  {
    ty_params := [];
    variants :=
      [
        {
          name := "MintTokens";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "FreezeAccount";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "AccountOwner";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "CloseAccount";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "TransferFeeConfig";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "WithheldWithdraw";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "CloseMint";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "InterestRate";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "PermanentDelegate";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "ConfidentialTransferMint";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "TransferHookProgramId";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "ConfidentialTransferFeeConfig";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "MetadataPointer";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "GroupPointer";
          item := StructTuple [];
          discriminant := None;
        };
        {
          name := "GroupMemberPointer";
          item := StructTuple [];
          discriminant := None;
        }
      ];
  }
  *)
  
  Module Impl_core_clone_Clone_for_spl_token_2022_instruction_AuthorityType.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::AuthorityType".
    
    (* Clone *)
    Definition clone (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.match_operator (|
              self,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple "spl_token_2022::instruction::AuthorityType::MintTokens" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::FreezeAccount"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::AccountOwner"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::CloseAccount"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::TransferFeeConfig"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::WithheldWithdraw"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple "spl_token_2022::instruction::AuthorityType::CloseMint" []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::InterestRate"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::PermanentDelegate"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::ConfidentialTransferMint"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::TransferHookProgramId"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::ConfidentialTransferFeeConfig"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::MetadataPointer"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::GroupPointer"
                        []
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (|
                      Value.StructTuple
                        "spl_token_2022::instruction::AuthorityType::GroupMemberPointer"
                        []
                    |)))
              ]
            |)
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::clone::Clone"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("clone", InstanceField.Method clone) ].
  End Impl_core_clone_Clone_for_spl_token_2022_instruction_AuthorityType.
  
  Module Impl_core_fmt_Debug_for_spl_token_2022_instruction_AuthorityType.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::AuthorityType".
    
    (* Debug *)
    Definition fmt (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ self; f ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let f := M.alloc (| f |) in
          M.call_closure (|
            M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [] |),
            [
              M.read (| f |);
              M.read (|
                M.match_operator (|
                  self,
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "MintTokens" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "FreezeAccount" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "AccountOwner" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "CloseAccount" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "TransferFeeConfig" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "WithheldWithdraw" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "CloseMint" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "InterestRate" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "PermanentDelegate" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "ConfidentialTransferMint" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "TransferHookProgramId" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "ConfidentialTransferFeeConfig" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "MetadataPointer" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "GroupPointer" |) |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.read (| γ |) in
                        M.alloc (| M.read (| Value.String "GroupMemberPointer" |) |)))
                  ]
                |)
              |)
            ]
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::fmt::Debug"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
  End Impl_core_fmt_Debug_for_spl_token_2022_instruction_AuthorityType.
  
  Module Impl_core_marker_StructuralPartialEq_for_spl_token_2022_instruction_AuthorityType.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::AuthorityType".
    
    Axiom Implements :
      M.IsTraitInstance
        "core::marker::StructuralPartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [].
  End Impl_core_marker_StructuralPartialEq_for_spl_token_2022_instruction_AuthorityType.
  
  Module Impl_core_cmp_PartialEq_for_spl_token_2022_instruction_AuthorityType.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::AuthorityType".
    
    (* PartialEq *)
    Definition eq (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ self; other ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          let other := M.alloc (| other |) in
          M.read (|
            let __self_tag :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "spl_token_2022::instruction::AuthorityType" ]
                  |),
                  [ M.read (| self |) ]
                |)
              |) in
            let __arg1_tag :=
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::intrinsics::discriminant_value",
                    [ Ty.path "spl_token_2022::instruction::AuthorityType" ]
                  |),
                  [ M.read (| other |) ]
                |)
              |) in
            M.alloc (| BinOp.Pure.eq (M.read (| __self_tag |)) (M.read (| __arg1_tag |)) |)
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom Implements :
      M.IsTraitInstance
        "core::cmp::PartialEq"
        Self
        (* Trait polymorphic types *) []
        (* Instance *) [ ("eq", InstanceField.Method eq) ].
  End Impl_core_cmp_PartialEq_for_spl_token_2022_instruction_AuthorityType.
  
  Module Impl_spl_token_2022_instruction_AuthorityType.
    Definition Self : Ty.t := Ty.path "spl_token_2022::instruction::AuthorityType".
    
    (*
        fn into(&self) -> u8 {
            match self {
                AuthorityType::MintTokens => 0,
                AuthorityType::FreezeAccount => 1,
                AuthorityType::AccountOwner => 2,
                AuthorityType::CloseAccount => 3,
                AuthorityType::TransferFeeConfig => 4,
                AuthorityType::WithheldWithdraw => 5,
                AuthorityType::CloseMint => 6,
                AuthorityType::InterestRate => 7,
                AuthorityType::PermanentDelegate => 8,
                AuthorityType::ConfidentialTransferMint => 9,
                AuthorityType::TransferHookProgramId => 10,
                AuthorityType::ConfidentialTransferFeeConfig => 11,
                AuthorityType::MetadataPointer => 12,
                AuthorityType::GroupPointer => 13,
                AuthorityType::GroupMemberPointer => 14,
            }
        }
    *)
    Definition into (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ self ] =>
        ltac:(M.monadic
          (let self := M.alloc (| self |) in
          M.read (|
            M.match_operator (|
              self,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 0 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 1 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 2 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 3 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 4 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 5 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 6 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 7 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 8 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 9 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 10 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 11 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 12 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 13 |)));
                fun γ =>
                  ltac:(M.monadic
                    (let γ := M.read (| γ |) in
                    M.alloc (| Value.Integer 14 |)))
              ]
            |)
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_into : M.IsAssociatedFunction Self "into" into.
    
    (*
        pub(crate) fn from(index: u8) -> Result<Self, ProgramError> {
            match index {
                0 => Ok(AuthorityType::MintTokens),
                1 => Ok(AuthorityType::FreezeAccount),
                2 => Ok(AuthorityType::AccountOwner),
                3 => Ok(AuthorityType::CloseAccount),
                4 => Ok(AuthorityType::TransferFeeConfig),
                5 => Ok(AuthorityType::WithheldWithdraw),
                6 => Ok(AuthorityType::CloseMint),
                7 => Ok(AuthorityType::InterestRate),
                8 => Ok(AuthorityType::PermanentDelegate),
                9 => Ok(AuthorityType::ConfidentialTransferMint),
                10 => Ok(AuthorityType::TransferHookProgramId),
                11 => Ok(AuthorityType::ConfidentialTransferFeeConfig),
                12 => Ok(AuthorityType::MetadataPointer),
                13 => Ok(AuthorityType::GroupPointer),
                14 => Ok(AuthorityType::GroupMemberPointer),
                _ => Err(TokenError::InvalidInstruction.into()),
            }
        }
    *)
    Definition from (τ : list Ty.t) (α : list Value.t) : M :=
      match τ, α with
      | [], [ index ] =>
        ltac:(M.monadic
          (let index := M.alloc (| index |) in
          M.read (|
            M.match_operator (|
              index,
              [
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 0 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::MintTokens"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 1 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::FreezeAccount"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 2 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::AccountOwner"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 3 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::CloseAccount"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 4 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::TransferFeeConfig"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 5 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::WithheldWithdraw"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 6 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::CloseMint"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 7 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::InterestRate"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 8 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::PermanentDelegate"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 9 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::ConfidentialTransferMint"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 10 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::TransferHookProgramId"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 11 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::ConfidentialTransferFeeConfig"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 12 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::MetadataPointer"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 13 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::GroupPointer"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Integer 14 |) in
                    M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Ok"
                        [
                          Value.StructTuple
                            "spl_token_2022::instruction::AuthorityType::GroupMemberPointer"
                            []
                        ]
                    |)));
                fun γ =>
                  ltac:(M.monadic
                    (M.alloc (|
                      Value.StructTuple
                        "core::result::Result::Err"
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::convert::Into",
                              Ty.path "spl_token_2022::error::TokenError",
                              [ Ty.path "solana_program::program_error::ProgramError" ],
                              "into",
                              []
                            |),
                            [
                              Value.StructTuple
                                "spl_token_2022::error::TokenError::InvalidInstruction"
                                []
                            ]
                          |)
                        ]
                    |)))
              ]
            |)
          |)))
      | _, _ => M.impossible
      end.
    
    Axiom AssociatedFunction_from : M.IsAssociatedFunction Self "from" from.
  End Impl_spl_token_2022_instruction_AuthorityType.
  
  (*
  pub fn initialize_mint(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      mint_authority_pubkey: &Pubkey,
      freeze_authority_pubkey: Option<&Pubkey>,
      decimals: u8,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let freeze_authority = freeze_authority_pubkey.cloned().into();
      let data = TokenInstruction::InitializeMint {
          mint_authority: *mint_authority_pubkey,
          freeze_authority,
          decimals,
      }
      .pack();
  
      let accounts = vec![
          AccountMeta::new( *mint_pubkey, false),
          AccountMeta::new_readonly(sysvar::rent::id(), false),
      ];
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition initialize_mint (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [ token_program_id; mint_pubkey; mint_authority_pubkey; freeze_authority_pubkey; decimals
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let mint_authority_pubkey := M.alloc (| mint_authority_pubkey |) in
        let freeze_authority_pubkey := M.alloc (| freeze_authority_pubkey |) in
        let decimals := M.alloc (| decimals |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 freeze_authority :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::Into",
                      Ty.apply
                        (Ty.path "core::option::Option")
                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                      [
                        Ty.apply
                          (Ty.path "solana_program::program_option::COption")
                          [ Ty.path "solana_program::pubkey::Pubkey" ]
                      ],
                      "into",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::option::Option")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          "cloned",
                          []
                        |),
                        [ M.read (| freeze_authority_pubkey |) ]
                      |)
                    ]
                  |)
                |) in
              let data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::InitializeMint"
                          [
                            ("mint_authority", M.read (| M.read (| mint_authority_pubkey |) |));
                            ("freeze_authority", M.read (| freeze_authority |));
                            ("decimals", M.read (| decimals |))
                          ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "slice")
                        [ Ty.path "solana_program::instruction::AccountMeta" ],
                      "into_vec",
                      [ Ty.path "alloc::alloc::Global" ]
                    |),
                    [
                      (* Unsize *)
                      M.pointer_coercion
                        (M.read (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                [
                                  Ty.apply
                                    (Ty.path "array")
                                    [ Ty.path "solana_program::instruction::AccountMeta" ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              "new",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.Array
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new",
                                        []
                                      |),
                                      [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new_readonly",
                                        []
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_function (|
                                            "solana_program::sysvar::rent::id",
                                            []
                                          |),
                                          []
                                        |);
                                        Value.Bool false
                                      ]
                                    |)
                                  ]
                              |)
                            ]
                          |)
                        |))
                    ]
                  |)
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_mint2(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      mint_authority_pubkey: &Pubkey,
      freeze_authority_pubkey: Option<&Pubkey>,
      decimals: u8,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let freeze_authority = freeze_authority_pubkey.cloned().into();
      let data = TokenInstruction::InitializeMint2 {
          mint_authority: *mint_authority_pubkey,
          freeze_authority,
          decimals,
      }
      .pack();
  
      let accounts = vec![AccountMeta::new( *mint_pubkey, false)];
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition initialize_mint2 (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [ token_program_id; mint_pubkey; mint_authority_pubkey; freeze_authority_pubkey; decimals
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let mint_authority_pubkey := M.alloc (| mint_authority_pubkey |) in
        let freeze_authority_pubkey := M.alloc (| freeze_authority_pubkey |) in
        let decimals := M.alloc (| decimals |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 freeze_authority :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::Into",
                      Ty.apply
                        (Ty.path "core::option::Option")
                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                      [
                        Ty.apply
                          (Ty.path "solana_program::program_option::COption")
                          [ Ty.path "solana_program::pubkey::Pubkey" ]
                      ],
                      "into",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::option::Option")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          "cloned",
                          []
                        |),
                        [ M.read (| freeze_authority_pubkey |) ]
                      |)
                    ]
                  |)
                |) in
              let data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::InitializeMint2"
                          [
                            ("mint_authority", M.read (| M.read (| mint_authority_pubkey |) |));
                            ("freeze_authority", M.read (| freeze_authority |));
                            ("decimals", M.read (| decimals |))
                          ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "slice")
                        [ Ty.path "solana_program::instruction::AccountMeta" ],
                      "into_vec",
                      [ Ty.path "alloc::alloc::Global" ]
                    |),
                    [
                      (* Unsize *)
                      M.pointer_coercion
                        (M.read (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                [
                                  Ty.apply
                                    (Ty.path "array")
                                    [ Ty.path "solana_program::instruction::AccountMeta" ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              "new",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.Array
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new",
                                        []
                                      |),
                                      [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                                    |)
                                  ]
                              |)
                            ]
                          |)
                        |))
                    ]
                  |)
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_account(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::InitializeAccount.pack();
  
      let accounts = vec![
          AccountMeta::new( *account_pubkey, false),
          AccountMeta::new_readonly( *mint_pubkey, false),
          AccountMeta::new_readonly( *owner_pubkey, false),
          AccountMeta::new_readonly(sysvar::rent::id(), false),
      ];
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition initialize_account (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; account_pubkey; mint_pubkey; owner_pubkey ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructTuple
                          "spl_token_2022::instruction::TokenInstruction::InitializeAccount"
                          []
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "slice")
                        [ Ty.path "solana_program::instruction::AccountMeta" ],
                      "into_vec",
                      [ Ty.path "alloc::alloc::Global" ]
                    |),
                    [
                      (* Unsize *)
                      M.pointer_coercion
                        (M.read (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                [
                                  Ty.apply
                                    (Ty.path "array")
                                    [ Ty.path "solana_program::instruction::AccountMeta" ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              "new",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.Array
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new",
                                        []
                                      |),
                                      [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new_readonly",
                                        []
                                      |),
                                      [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new_readonly",
                                        []
                                      |),
                                      [ M.read (| M.read (| owner_pubkey |) |); Value.Bool false ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new_readonly",
                                        []
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_function (|
                                            "solana_program::sysvar::rent::id",
                                            []
                                          |),
                                          []
                                        |);
                                        Value.Bool false
                                      ]
                                    |)
                                  ]
                              |)
                            ]
                          |)
                        |))
                    ]
                  |)
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_account2(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::InitializeAccount2 {
          owner: *owner_pubkey,
      }
      .pack();
  
      let accounts = vec![
          AccountMeta::new( *account_pubkey, false),
          AccountMeta::new_readonly( *mint_pubkey, false),
          AccountMeta::new_readonly(sysvar::rent::id(), false),
      ];
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition initialize_account2 (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; account_pubkey; mint_pubkey; owner_pubkey ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::InitializeAccount2"
                          [ ("owner", M.read (| M.read (| owner_pubkey |) |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "slice")
                        [ Ty.path "solana_program::instruction::AccountMeta" ],
                      "into_vec",
                      [ Ty.path "alloc::alloc::Global" ]
                    |),
                    [
                      (* Unsize *)
                      M.pointer_coercion
                        (M.read (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                [
                                  Ty.apply
                                    (Ty.path "array")
                                    [ Ty.path "solana_program::instruction::AccountMeta" ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              "new",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.Array
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new",
                                        []
                                      |),
                                      [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new_readonly",
                                        []
                                      |),
                                      [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new_readonly",
                                        []
                                      |),
                                      [
                                        M.call_closure (|
                                          M.get_function (|
                                            "solana_program::sysvar::rent::id",
                                            []
                                          |),
                                          []
                                        |);
                                        Value.Bool false
                                      ]
                                    |)
                                  ]
                              |)
                            ]
                          |)
                        |))
                    ]
                  |)
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_account3(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::InitializeAccount3 {
          owner: *owner_pubkey,
      }
      .pack();
  
      let accounts = vec![
          AccountMeta::new( *account_pubkey, false),
          AccountMeta::new_readonly( *mint_pubkey, false),
      ];
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition initialize_account3 (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; account_pubkey; mint_pubkey; owner_pubkey ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::InitializeAccount3"
                          [ ("owner", M.read (| M.read (| owner_pubkey |) |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "slice")
                        [ Ty.path "solana_program::instruction::AccountMeta" ],
                      "into_vec",
                      [ Ty.path "alloc::alloc::Global" ]
                    |),
                    [
                      (* Unsize *)
                      M.pointer_coercion
                        (M.read (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                [
                                  Ty.apply
                                    (Ty.path "array")
                                    [ Ty.path "solana_program::instruction::AccountMeta" ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              "new",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.Array
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new",
                                        []
                                      |),
                                      [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new_readonly",
                                        []
                                      |),
                                      [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                                    |)
                                  ]
                              |)
                            ]
                          |)
                        |))
                    ]
                  |)
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_multisig(
      token_program_id: &Pubkey,
      multisig_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      m: u8,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      if !is_valid_signer_index(m as usize)
          || !is_valid_signer_index(signer_pubkeys.len())
          || m as usize > signer_pubkeys.len()
      {
          return Err(ProgramError::MissingRequiredSignature);
      }
      let data = TokenInstruction::InitializeMultisig { m }.pack();
  
      let mut accounts = Vec::with_capacity(1 + 1 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *multisig_pubkey, false));
      accounts.push(AccountMeta::new_readonly(sysvar::rent::id(), false));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, false));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition initialize_multisig (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; multisig_pubkey; signer_pubkeys; m ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let multisig_pubkey := M.alloc (| multisig_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let m := M.alloc (| m |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              let _ :=
                M.match_operator (|
                  M.alloc (| Value.Tuple [] |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ :=
                          M.use
                            (M.alloc (|
                              LogicalOp.or (|
                                LogicalOp.or (|
                                  UnOp.Pure.not
                                    (M.call_closure (|
                                      M.get_function (|
                                        "spl_token_2022::instruction::is_valid_signer_index",
                                        []
                                      |),
                                      [ M.rust_cast (M.read (| m |)) ]
                                    |)),
                                  ltac:(M.monadic
                                    (UnOp.Pure.not
                                      (M.call_closure (|
                                        M.get_function (|
                                          "spl_token_2022::instruction::is_valid_signer_index",
                                          []
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_associated_function (|
                                              Ty.apply
                                                (Ty.path "slice")
                                                [
                                                  Ty.apply
                                                    (Ty.path "&")
                                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                                ],
                                              "len",
                                              []
                                            |),
                                            [ M.read (| signer_pubkeys |) ]
                                          |)
                                        ]
                                      |))))
                                |),
                                ltac:(M.monadic
                                  (BinOp.Pure.gt
                                    (M.rust_cast (M.read (| m |)))
                                    (M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply
                                          (Ty.path "slice")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        "len",
                                        []
                                      |),
                                      [ M.read (| signer_pubkeys |) ]
                                    |))))
                              |)
                            |)) in
                        let _ :=
                          M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                Value.StructTuple
                                  "core::result::Result::Err"
                                  [
                                    Value.StructTuple
                                      "solana_program::program_error::ProgramError::MissingRequiredSignature"
                                      []
                                  ]
                              |)
                            |)
                          |)
                        |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                  ]
                |) in
              let data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::InitializeMultisig"
                          [ ("m", M.read (| m |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        BinOp.Panic.add (| Integer.Usize, Value.Integer 1, Value.Integer 1 |),
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| multisig_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (| "solana_program::sysvar::rent::id", [] |),
                            []
                          |);
                          Value.Bool false
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool false
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_multisig2(
      token_program_id: &Pubkey,
      multisig_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      m: u8,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      if !is_valid_signer_index(m as usize)
          || !is_valid_signer_index(signer_pubkeys.len())
          || m as usize > signer_pubkeys.len()
      {
          return Err(ProgramError::MissingRequiredSignature);
      }
      let data = TokenInstruction::InitializeMultisig2 { m }.pack();
  
      let mut accounts = Vec::with_capacity(1 + 1 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *multisig_pubkey, false));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, false));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition initialize_multisig2 (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; multisig_pubkey; signer_pubkeys; m ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let multisig_pubkey := M.alloc (| multisig_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let m := M.alloc (| m |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              let _ :=
                M.match_operator (|
                  M.alloc (| Value.Tuple [] |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ :=
                          M.use
                            (M.alloc (|
                              LogicalOp.or (|
                                LogicalOp.or (|
                                  UnOp.Pure.not
                                    (M.call_closure (|
                                      M.get_function (|
                                        "spl_token_2022::instruction::is_valid_signer_index",
                                        []
                                      |),
                                      [ M.rust_cast (M.read (| m |)) ]
                                    |)),
                                  ltac:(M.monadic
                                    (UnOp.Pure.not
                                      (M.call_closure (|
                                        M.get_function (|
                                          "spl_token_2022::instruction::is_valid_signer_index",
                                          []
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_associated_function (|
                                              Ty.apply
                                                (Ty.path "slice")
                                                [
                                                  Ty.apply
                                                    (Ty.path "&")
                                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                                ],
                                              "len",
                                              []
                                            |),
                                            [ M.read (| signer_pubkeys |) ]
                                          |)
                                        ]
                                      |))))
                                |),
                                ltac:(M.monadic
                                  (BinOp.Pure.gt
                                    (M.rust_cast (M.read (| m |)))
                                    (M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.apply
                                          (Ty.path "slice")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        "len",
                                        []
                                      |),
                                      [ M.read (| signer_pubkeys |) ]
                                    |))))
                              |)
                            |)) in
                        let _ :=
                          M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                Value.StructTuple
                                  "core::result::Result::Err"
                                  [
                                    Value.StructTuple
                                      "solana_program::program_error::ProgramError::MissingRequiredSignature"
                                      []
                                  ]
                              |)
                            |)
                          |)
                        |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                  ]
                |) in
              let data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::InitializeMultisig2"
                          [ ("m", M.read (| m |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        BinOp.Panic.add (| Integer.Usize, Value.Integer 1, Value.Integer 1 |),
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| multisig_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool false
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn transfer(
      token_program_id: &Pubkey,
      source_pubkey: &Pubkey,
      destination_pubkey: &Pubkey,
      authority_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      amount: u64,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      #[allow(deprecated)]
      let data = TokenInstruction::Transfer { amount }.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *source_pubkey, false));
      accounts.push(AccountMeta::new( *destination_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *authority_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition transfer (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [
          token_program_id;
          source_pubkey;
          destination_pubkey;
          authority_pubkey;
          signer_pubkeys;
          amount
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let source_pubkey := M.alloc (| source_pubkey |) in
        let destination_pubkey := M.alloc (| destination_pubkey |) in
        let authority_pubkey := M.alloc (| authority_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let amount := M.alloc (| amount |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::Transfer"
                          [ ("amount", M.read (| amount |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| source_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| destination_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| authority_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn approve(
      token_program_id: &Pubkey,
      source_pubkey: &Pubkey,
      delegate_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      amount: u64,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::Approve { amount }.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *source_pubkey, false));
      accounts.push(AccountMeta::new_readonly( *delegate_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition approve (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [ token_program_id; source_pubkey; delegate_pubkey; owner_pubkey; signer_pubkeys; amount
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let source_pubkey := M.alloc (| source_pubkey |) in
        let delegate_pubkey := M.alloc (| delegate_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let amount := M.alloc (| amount |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::Approve"
                          [ ("amount", M.read (| amount |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| source_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [ M.read (| M.read (| delegate_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn revoke(
      token_program_id: &Pubkey,
      source_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::Revoke.pack();
  
      let mut accounts = Vec::with_capacity(2 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *source_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition revoke (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; source_pubkey; owner_pubkey; signer_pubkeys ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let source_pubkey := M.alloc (| source_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructTuple "spl_token_2022::instruction::TokenInstruction::Revoke" []
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 2,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| source_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn set_authority(
      token_program_id: &Pubkey,
      owned_pubkey: &Pubkey,
      new_authority_pubkey: Option<&Pubkey>,
      authority_type: AuthorityType,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let new_authority = new_authority_pubkey.cloned().into();
      let data = TokenInstruction::SetAuthority {
          authority_type,
          new_authority,
      }
      .pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *owned_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition set_authority (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [
          token_program_id;
          owned_pubkey;
          new_authority_pubkey;
          authority_type;
          owner_pubkey;
          signer_pubkeys
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let owned_pubkey := M.alloc (| owned_pubkey |) in
        let new_authority_pubkey := M.alloc (| new_authority_pubkey |) in
        let authority_type := M.alloc (| authority_type |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 new_authority :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::Into",
                      Ty.apply
                        (Ty.path "core::option::Option")
                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                      [
                        Ty.apply
                          (Ty.path "solana_program::program_option::COption")
                          [ Ty.path "solana_program::pubkey::Pubkey" ]
                      ],
                      "into",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::option::Option")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          "cloned",
                          []
                        |),
                        [ M.read (| new_authority_pubkey |) ]
                      |)
                    ]
                  |)
                |) in
              let data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::SetAuthority"
                          [
                            ("authority_type", M.read (| authority_type |));
                            ("new_authority", M.read (| new_authority |))
                          ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| owned_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn mint_to(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      account_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      amount: u64,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::MintTo { amount }.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *mint_pubkey, false));
      accounts.push(AccountMeta::new( *account_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition mint_to (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; mint_pubkey; account_pubkey; owner_pubkey; signer_pubkeys; amount ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let amount := M.alloc (| amount |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::MintTo"
                          [ ("amount", M.read (| amount |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn burn(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      authority_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      amount: u64,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::Burn { amount }.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *account_pubkey, false));
      accounts.push(AccountMeta::new( *mint_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *authority_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition burn (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [ token_program_id; account_pubkey; mint_pubkey; authority_pubkey; signer_pubkeys; amount
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let authority_pubkey := M.alloc (| authority_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let amount := M.alloc (| amount |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::Burn"
                          [ ("amount", M.read (| amount |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| authority_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn close_account(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      destination_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::CloseAccount.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *account_pubkey, false));
      accounts.push(AccountMeta::new( *destination_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition close_account (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; account_pubkey; destination_pubkey; owner_pubkey; signer_pubkeys ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let destination_pubkey := M.alloc (| destination_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructTuple
                          "spl_token_2022::instruction::TokenInstruction::CloseAccount"
                          []
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| destination_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn freeze_account(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::FreezeAccount.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *account_pubkey, false));
      accounts.push(AccountMeta::new_readonly( *mint_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition freeze_account (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; account_pubkey; mint_pubkey; owner_pubkey; signer_pubkeys ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructTuple
                          "spl_token_2022::instruction::TokenInstruction::FreezeAccount"
                          []
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn thaw_account(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::ThawAccount.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *account_pubkey, false));
      accounts.push(AccountMeta::new_readonly( *mint_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition thaw_account (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; account_pubkey; mint_pubkey; owner_pubkey; signer_pubkeys ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructTuple
                          "spl_token_2022::instruction::TokenInstruction::ThawAccount"
                          []
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn transfer_checked(
      token_program_id: &Pubkey,
      source_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      destination_pubkey: &Pubkey,
      authority_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      amount: u64,
      decimals: u8,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::TransferChecked { amount, decimals }.pack();
  
      let mut accounts = Vec::with_capacity(4 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *source_pubkey, false));
      accounts.push(AccountMeta::new_readonly( *mint_pubkey, false));
      accounts.push(AccountMeta::new( *destination_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *authority_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition transfer_checked (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [
          token_program_id;
          source_pubkey;
          mint_pubkey;
          destination_pubkey;
          authority_pubkey;
          signer_pubkeys;
          amount;
          decimals
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let source_pubkey := M.alloc (| source_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let destination_pubkey := M.alloc (| destination_pubkey |) in
        let authority_pubkey := M.alloc (| authority_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let amount := M.alloc (| amount |) in
        let decimals := M.alloc (| decimals |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::TransferChecked"
                          [ ("amount", M.read (| amount |)); ("decimals", M.read (| decimals |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 4,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| source_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| destination_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| authority_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn approve_checked(
      token_program_id: &Pubkey,
      source_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      delegate_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      amount: u64,
      decimals: u8,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::ApproveChecked { amount, decimals }.pack();
  
      let mut accounts = Vec::with_capacity(4 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *source_pubkey, false));
      accounts.push(AccountMeta::new_readonly( *mint_pubkey, false));
      accounts.push(AccountMeta::new_readonly( *delegate_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition approve_checked (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [
          token_program_id;
          source_pubkey;
          mint_pubkey;
          delegate_pubkey;
          owner_pubkey;
          signer_pubkeys;
          amount;
          decimals
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let source_pubkey := M.alloc (| source_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let delegate_pubkey := M.alloc (| delegate_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let amount := M.alloc (| amount |) in
        let decimals := M.alloc (| decimals |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::ApproveChecked"
                          [ ("amount", M.read (| amount |)); ("decimals", M.read (| decimals |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 4,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| source_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [ M.read (| M.read (| delegate_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn mint_to_checked(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      account_pubkey: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      amount: u64,
      decimals: u8,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::MintToChecked { amount, decimals }.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *mint_pubkey, false));
      accounts.push(AccountMeta::new( *account_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition mint_to_checked (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [
          token_program_id;
          mint_pubkey;
          account_pubkey;
          owner_pubkey;
          signer_pubkeys;
          amount;
          decimals
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let amount := M.alloc (| amount |) in
        let decimals := M.alloc (| decimals |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::MintToChecked"
                          [ ("amount", M.read (| amount |)); ("decimals", M.read (| decimals |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn burn_checked(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      mint_pubkey: &Pubkey,
      authority_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      amount: u64,
      decimals: u8,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      let data = TokenInstruction::BurnChecked { amount, decimals }.pack();
  
      let mut accounts = Vec::with_capacity(3 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *account_pubkey, false));
      accounts.push(AccountMeta::new( *mint_pubkey, false));
      accounts.push(AccountMeta::new_readonly(
          *authority_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      })
  }
  *)
  Definition burn_checked (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [
          token_program_id;
          account_pubkey;
          mint_pubkey;
          authority_pubkey;
          signer_pubkeys;
          amount;
          decimals
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let authority_pubkey := M.alloc (| authority_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let amount := M.alloc (| amount |) in
        let decimals := M.alloc (| decimals |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 data :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "spl_token_2022::instruction::TokenInstruction",
                      "pack",
                      []
                    |),
                    [
                      M.alloc (|
                        Value.StructRecord
                          "spl_token_2022::instruction::TokenInstruction::BurnChecked"
                          [ ("amount", M.read (| amount |)); ("decimals", M.read (| decimals |)) ]
                      |)
                    ]
                  |)
                |) in
              let accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 3,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| mint_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| authority_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data", M.read (| data |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn sync_native(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![AccountMeta::new( *account_pubkey, false)],
          data: TokenInstruction::SyncNative.pack(),
      })
  }
  *)
  Definition sync_native (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; account_pubkey ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new",
                                                []
                                              |),
                                              [
                                                M.read (| M.read (| account_pubkey |) |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructTuple
                                  "spl_token_2022::instruction::TokenInstruction::SyncNative"
                                  []
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn get_account_data_size(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      extension_types: &[ExtensionType],
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![AccountMeta::new_readonly( *mint_pubkey, false)],
          data: TokenInstruction::GetAccountDataSize {
              extension_types: extension_types.to_vec(),
          }
          .pack(),
      })
  }
  *)
  Definition get_account_data_size (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; mint_pubkey; extension_types ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let extension_types := M.alloc (| extension_types |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new_readonly",
                                                []
                                              |),
                                              [
                                                M.read (| M.read (| mint_pubkey |) |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructRecord
                                  "spl_token_2022::instruction::TokenInstruction::GetAccountDataSize"
                                  [
                                    ("extension_types",
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.apply
                                            (Ty.path "slice")
                                            [ Ty.path "spl_token_2022::extension::ExtensionType" ],
                                          "to_vec",
                                          []
                                        |),
                                        [ M.read (| extension_types |) ]
                                      |))
                                  ]
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_mint_close_authority(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      close_authority: Option<&Pubkey>,
  ) -> Result<Instruction, ProgramError> {
      check_program_account(token_program_id)?;
      let close_authority = close_authority.cloned().into();
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![AccountMeta::new( *mint_pubkey, false)],
          data: TokenInstruction::InitializeMintCloseAuthority { close_authority }.pack(),
      })
  }
  *)
  Definition initialize_mint_close_authority (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; mint_pubkey; close_authority ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let close_authority := M.alloc (| close_authority |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (| "spl_token_2022::check_program_account", [] |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 close_authority :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::Into",
                      Ty.apply
                        (Ty.path "core::option::Option")
                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                      [
                        Ty.apply
                          (Ty.path "solana_program::program_option::COption")
                          [ Ty.path "solana_program::pubkey::Pubkey" ]
                      ],
                      "into",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::option::Option")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          "cloned",
                          []
                        |),
                        [ M.read (| close_authority |) ]
                      |)
                    ]
                  |)
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new",
                                                []
                                              |),
                                              [
                                                M.read (| M.read (| mint_pubkey |) |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructRecord
                                  "spl_token_2022::instruction::TokenInstruction::InitializeMintCloseAuthority"
                                  [ ("close_authority", M.read (| close_authority |)) ]
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_immutable_owner(
      token_program_id: &Pubkey,
      token_account: &Pubkey,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![AccountMeta::new( *token_account, false)],
          data: TokenInstruction::InitializeImmutableOwner.pack(),
      })
  }
  *)
  Definition initialize_immutable_owner (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; token_account ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let token_account := M.alloc (| token_account |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new",
                                                []
                                              |),
                                              [
                                                M.read (| M.read (| token_account |) |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructTuple
                                  "spl_token_2022::instruction::TokenInstruction::InitializeImmutableOwner"
                                  []
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn amount_to_ui_amount(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      amount: u64,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![AccountMeta::new_readonly( *mint_pubkey, false)],
          data: TokenInstruction::AmountToUiAmount { amount }.pack(),
      })
  }
  *)
  Definition amount_to_ui_amount (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; mint_pubkey; amount ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let amount := M.alloc (| amount |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new_readonly",
                                                []
                                              |),
                                              [
                                                M.read (| M.read (| mint_pubkey |) |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructRecord
                                  "spl_token_2022::instruction::TokenInstruction::AmountToUiAmount"
                                  [ ("amount", M.read (| amount |)) ]
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn ui_amount_to_amount(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      ui_amount: &str,
  ) -> Result<Instruction, ProgramError> {
      check_spl_token_program_account(token_program_id)?;
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![AccountMeta::new_readonly( *mint_pubkey, false)],
          data: TokenInstruction::UiAmountToAmount { ui_amount }.pack(),
      })
  }
  *)
  Definition ui_amount_to_amount (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; mint_pubkey; ui_amount ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let ui_amount := M.alloc (| ui_amount |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (|
                            "spl_token_2022::check_spl_token_program_account",
                            []
                          |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new_readonly",
                                                []
                                              |),
                                              [
                                                M.read (| M.read (| mint_pubkey |) |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructRecord
                                  "spl_token_2022::instruction::TokenInstruction::UiAmountToAmount"
                                  [ ("ui_amount", M.read (| ui_amount |)) ]
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn reallocate(
      token_program_id: &Pubkey,
      account_pubkey: &Pubkey,
      payer: &Pubkey,
      owner_pubkey: &Pubkey,
      signer_pubkeys: &[&Pubkey],
      extension_types: &[ExtensionType],
  ) -> Result<Instruction, ProgramError> {
      check_program_account(token_program_id)?;
  
      let mut accounts = Vec::with_capacity(4 + signer_pubkeys.len());
      accounts.push(AccountMeta::new( *account_pubkey, false));
      accounts.push(AccountMeta::new( *payer, true));
      accounts.push(AccountMeta::new_readonly(system_program::id(), false));
      accounts.push(AccountMeta::new_readonly(
          *owner_pubkey,
          signer_pubkeys.is_empty(),
      ));
      for signer_pubkey in signer_pubkeys.iter() {
          accounts.push(AccountMeta::new_readonly( **signer_pubkey, true));
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data: TokenInstruction::Reallocate {
              extension_types: extension_types.to_vec(),
          }
          .pack(),
      })
  }
  *)
  Definition reallocate (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [],
        [ token_program_id; account_pubkey; payer; owner_pubkey; signer_pubkeys; extension_types
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let account_pubkey := M.alloc (| account_pubkey |) in
        let payer := M.alloc (| payer |) in
        let owner_pubkey := M.alloc (| owner_pubkey |) in
        let signer_pubkeys := M.alloc (| signer_pubkeys |) in
        let extension_types := M.alloc (| extension_types |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (| "spl_token_2022::check_program_account", [] |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "with_capacity",
                      []
                    |),
                    [
                      BinOp.Panic.add (|
                        Integer.Usize,
                        Value.Integer 4,
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ]
                              ],
                            "len",
                            []
                          |),
                          [ M.read (| signer_pubkeys |) ]
                        |)
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| account_pubkey |) |); Value.Bool false ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new",
                          []
                        |),
                        [ M.read (| M.read (| payer |) |); Value.Bool true ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_function (| "solana_program::system_program::id", [] |),
                            []
                          |);
                          Value.Bool false
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        [
                          Ty.path "solana_program::instruction::AccountMeta";
                          Ty.path "alloc::alloc::Global"
                        ],
                      "push",
                      []
                    |),
                    [
                      accounts;
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::instruction::AccountMeta",
                          "new_readonly",
                          []
                        |),
                        [
                          M.read (| M.read (| owner_pubkey |) |);
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "is_empty",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.apply (Ty.path "&") [ Ty.path "solana_program::pubkey::Pubkey" ] ],
                          [],
                          "into_iter",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ],
                              "iter",
                              []
                            |),
                            [ M.read (| signer_pubkeys |) ]
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer_pubkey := M.copy (| γ0_0 |) in
                                        let _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  [
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta";
                                                    Ty.path "alloc::alloc::Global"
                                                  ],
                                                "push",
                                                []
                                              |),
                                              [
                                                accounts;
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path
                                                      "solana_program::instruction::AccountMeta",
                                                    "new_readonly",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.read (| M.read (| signer_pubkey |) |)
                                                    |);
                                                    Value.Bool true
                                                  ]
                                                |)
                                              ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructRecord
                                  "spl_token_2022::instruction::TokenInstruction::Reallocate"
                                  [
                                    ("extension_types",
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.apply
                                            (Ty.path "slice")
                                            [ Ty.path "spl_token_2022::extension::ExtensionType" ],
                                          "to_vec",
                                          []
                                        |),
                                        [ M.read (| extension_types |) ]
                                      |))
                                  ]
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn create_native_mint(
      token_program_id: &Pubkey,
      payer: &Pubkey,
  ) -> Result<Instruction, ProgramError> {
      check_program_account(token_program_id)?;
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![
              AccountMeta::new( *payer, true),
              AccountMeta::new(crate::native_mint::id(), false),
              AccountMeta::new_readonly(system_program::id(), false),
          ],
          data: TokenInstruction::CreateNativeMint.pack(),
      })
  }
  *)
  Definition create_native_mint (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; payer ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let payer := M.alloc (| payer |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (| "spl_token_2022::check_program_account", [] |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new",
                                                []
                                              |),
                                              [ M.read (| M.read (| payer |) |); Value.Bool true ]
                                            |);
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new",
                                                []
                                              |),
                                              [
                                                M.call_closure (|
                                                  M.get_function (|
                                                    "spl_token_2022::native_mint::id",
                                                    []
                                                  |),
                                                  []
                                                |);
                                                Value.Bool false
                                              ]
                                            |);
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new_readonly",
                                                []
                                              |),
                                              [
                                                M.call_closure (|
                                                  M.get_function (|
                                                    "solana_program::system_program::id",
                                                    []
                                                  |),
                                                  []
                                                |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructTuple
                                  "spl_token_2022::instruction::TokenInstruction::CreateNativeMint"
                                  []
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_non_transferable_mint(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
  ) -> Result<Instruction, ProgramError> {
      check_program_account(token_program_id)?;
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![AccountMeta::new( *mint_pubkey, false)],
          data: TokenInstruction::InitializeNonTransferableMint.pack(),
      })
  }
  *)
  Definition initialize_non_transferable_mint (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; mint_pubkey ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (| "spl_token_2022::check_program_account", [] |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new",
                                                []
                                              |),
                                              [
                                                M.read (| M.read (| mint_pubkey |) |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructTuple
                                  "spl_token_2022::instruction::TokenInstruction::InitializeNonTransferableMint"
                                  []
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn initialize_permanent_delegate(
      token_program_id: &Pubkey,
      mint_pubkey: &Pubkey,
      delegate: &Pubkey,
  ) -> Result<Instruction, ProgramError> {
      check_program_account(token_program_id)?;
      Ok(Instruction {
          program_id: *token_program_id,
          accounts: vec![AccountMeta::new( *mint_pubkey, false)],
          data: TokenInstruction::InitializePermanentDelegate {
              delegate: *delegate,
          }
          .pack(),
      })
  }
  *)
  Definition initialize_permanent_delegate (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; mint_pubkey; delegate ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let mint_pubkey := M.alloc (| mint_pubkey |) in
        let delegate := M.alloc (| delegate |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (| "spl_token_2022::check_program_account", [] |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "from_residual",
                                    []
                                  |),
                                  [ M.read (| residual |) ]
                                |)
                              |)
                            |)
                          |)
                        |)));
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Continue",
                            0
                          |) in
                        let val := M.copy (| γ0_0 |) in
                        val))
                  ]
                |) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::instruction::AccountMeta" ],
                              "into_vec",
                              [ Ty.path "alloc::alloc::Global" ]
                            |),
                            [
                              (* Unsize *)
                              M.pointer_coercion
                                (M.read (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "alloc::boxed::Box")
                                        [
                                          Ty.apply
                                            (Ty.path "array")
                                            [ Ty.path "solana_program::instruction::AccountMeta" ];
                                          Ty.path "alloc::alloc::Global"
                                        ],
                                      "new",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "solana_program::instruction::AccountMeta",
                                                "new",
                                                []
                                              |),
                                              [
                                                M.read (| M.read (| mint_pubkey |) |);
                                                Value.Bool false
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                |))
                            ]
                          |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructRecord
                                  "spl_token_2022::instruction::TokenInstruction::InitializePermanentDelegate"
                                  [ ("delegate", M.read (| M.read (| delegate |) |)) ]
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn is_valid_signer_index(index: usize) -> bool {
      (MIN_SIGNERS..=MAX_SIGNERS).contains(&index)
  }
  *)
  Definition is_valid_signer_index (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ index ] =>
      ltac:(M.monadic
        (let index := M.alloc (| index |) in
        M.call_closure (|
          M.get_associated_function (|
            Ty.apply (Ty.path "core::ops::range::RangeInclusive") [ Ty.path "usize" ],
            "contains",
            [ Ty.path "usize" ]
          |),
          [
            M.alloc (|
              M.call_closure (|
                M.get_associated_function (|
                  Ty.apply (Ty.path "core::ops::range::RangeInclusive") [ Ty.path "usize" ],
                  "new",
                  []
                |),
                [
                  M.read (| M.get_constant (| "spl_token_2022::instruction::MIN_SIGNERS" |) |);
                  M.read (| M.get_constant (| "spl_token_2022::instruction::MAX_SIGNERS" |) |)
                ]
              |)
            |);
            index
          ]
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn decode_instruction_type<T: TryFrom<u8>>(input: &[u8]) -> Result<T, ProgramError> {
      if input.is_empty() {
          Err(ProgramError::InvalidInstructionData)
      } else {
          T::try_from(input[0]).map_err(|_| TokenError::InvalidInstruction.into())
      }
  }
  *)
  Definition decode_instruction_type (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [ T ], [ input ] =>
      ltac:(M.monadic
        (let input := M.alloc (| input |) in
        M.read (|
          M.match_operator (|
            M.alloc (| Value.Tuple [] |),
            [
              fun γ =>
                ltac:(M.monadic
                  (let γ :=
                    M.use
                      (M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                            "is_empty",
                            []
                          |),
                          [ M.read (| input |) ]
                        |)
                      |)) in
                  let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                  M.alloc (|
                    Value.StructTuple
                      "core::result::Result::Err"
                      [
                        Value.StructTuple
                          "solana_program::program_error::ProgramError::InvalidInstructionData"
                          []
                      ]
                  |)));
              fun γ =>
                ltac:(M.monadic
                  (M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply (Ty.path "core::result::Result") [ T; Ty.associated ],
                        "map_err",
                        [
                          Ty.path "solana_program::program_error::ProgramError";
                          Ty.function
                            [ Ty.tuple [ Ty.associated ] ]
                            (Ty.path "solana_program::program_error::ProgramError")
                        ]
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::convert::TryFrom",
                            T,
                            [ Ty.path "u8" ],
                            "try_from",
                            []
                          |),
                          [
                            M.read (|
                              M.SubPointer.get_array_field (|
                                M.read (| input |),
                                M.alloc (| Value.Integer 0 |)
                              |)
                            |)
                          ]
                        |);
                        M.closure
                          (fun γ =>
                            ltac:(M.monadic
                              match γ with
                              | [ α0 ] =>
                                M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.call_closure (|
                                          M.get_trait_method (|
                                            "core::convert::Into",
                                            Ty.path "spl_token_2022::error::TokenError",
                                            [ Ty.path "solana_program::program_error::ProgramError"
                                            ],
                                            "into",
                                            []
                                          |),
                                          [
                                            Value.StructTuple
                                              "spl_token_2022::error::TokenError::InvalidInstruction"
                                              []
                                          ]
                                        |)))
                                  ]
                                |)
                              | _ => M.impossible (||)
                              end))
                      ]
                    |)
                  |)))
            ]
          |)
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn decode_instruction_data<T: Pod>(input_with_type: &[u8]) -> Result<&T, ProgramError> {
      if input_with_type.len() != pod_get_packed_len::<T>().saturating_add(1) {
          Err(ProgramError::InvalidInstructionData)
      } else {
          pod_from_bytes(&input_with_type[1..])
      }
  }
  *)
  Definition decode_instruction_data (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [ T ], [ input_with_type ] =>
      ltac:(M.monadic
        (let input_with_type := M.alloc (| input_with_type |) in
        M.read (|
          M.match_operator (|
            M.alloc (| Value.Tuple [] |),
            [
              fun γ =>
                ltac:(M.monadic
                  (let γ :=
                    M.use
                      (M.alloc (|
                        BinOp.Pure.ne
                          (M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                              "len",
                              []
                            |),
                            [ M.read (| input_with_type |) ]
                          |))
                          (M.call_closure (|
                            M.get_associated_function (| Ty.path "usize", "saturating_add", [] |),
                            [
                              M.call_closure (|
                                M.get_function (| "spl_pod::bytemuck::pod_get_packed_len", [ T ] |),
                                []
                              |);
                              Value.Integer 1
                            ]
                          |))
                      |)) in
                  let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                  M.alloc (|
                    Value.StructTuple
                      "core::result::Result::Err"
                      [
                        Value.StructTuple
                          "solana_program::program_error::ProgramError::InvalidInstructionData"
                          []
                      ]
                  |)));
              fun γ =>
                ltac:(M.monadic
                  (M.alloc (|
                    M.call_closure (|
                      M.get_function (| "spl_pod::bytemuck::pod_from_bytes", [ T ] |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::index::Index",
                            Ty.apply (Ty.path "slice") [ Ty.path "u8" ],
                            [ Ty.apply (Ty.path "core::ops::range::RangeFrom") [ Ty.path "usize" ]
                            ],
                            "index",
                            []
                          |),
                          [
                            M.read (| input_with_type |);
                            Value.StructRecord
                              "core::ops::range::RangeFrom"
                              [ ("start", Value.Integer 1) ]
                          ]
                        |)
                      ]
                    |)
                  |)))
            ]
          |)
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub(crate) fn encode_instruction<T: Into<u8>, D: Pod>(
      token_program_id: &Pubkey,
      accounts: Vec<AccountMeta>,
      token_instruction_type: TokenInstruction,
      instruction_type: T,
      instruction_data: &D,
  ) -> Instruction {
      let mut data = token_instruction_type.pack();
      data.push(T::into(instruction_type));
      data.extend_from_slice(bytemuck::bytes_of(instruction_data));
      Instruction {
          program_id: *token_program_id,
          accounts,
          data,
      }
  }
  *)
  Definition encode_instruction (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [ T; D ],
        [ token_program_id; accounts; token_instruction_type; instruction_type; instruction_data
        ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let accounts := M.alloc (| accounts |) in
        let token_instruction_type := M.alloc (| token_instruction_type |) in
        let instruction_type := M.alloc (| instruction_type |) in
        let instruction_data := M.alloc (| instruction_data |) in
        M.read (|
          let data :=
            M.alloc (|
              M.call_closure (|
                M.get_associated_function (|
                  Ty.path "spl_token_2022::instruction::TokenInstruction",
                  "pack",
                  []
                |),
                [ token_instruction_type ]
              |)
            |) in
          let _ :=
            M.alloc (|
              M.call_closure (|
                M.get_associated_function (|
                  Ty.apply
                    (Ty.path "alloc::vec::Vec")
                    [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                  "push",
                  []
                |),
                [
                  data;
                  M.call_closure (|
                    M.get_trait_method (| "core::convert::Into", T, [ Ty.path "u8" ], "into", [] |),
                    [ M.read (| instruction_type |) ]
                  |)
                ]
              |)
            |) in
          let _ :=
            M.alloc (|
              M.call_closure (|
                M.get_associated_function (|
                  Ty.apply
                    (Ty.path "alloc::vec::Vec")
                    [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                  "extend_from_slice",
                  []
                |),
                [
                  data;
                  M.call_closure (|
                    M.get_function (| "bytemuck::bytes_of", [ D ] |),
                    [ M.read (| instruction_data |) ]
                  |)
                ]
              |)
            |) in
          M.alloc (|
            Value.StructRecord
              "solana_program::instruction::Instruction"
              [
                ("program_id", M.read (| M.read (| token_program_id |) |));
                ("accounts", M.read (| accounts |));
                ("data", M.read (| data |))
              ]
          |)
        |)))
    | _, _ => M.impossible
    end.
  
  (*
  pub fn withdraw_excess_lamports(
      token_program_id: &Pubkey,
      source_account: &Pubkey,
      destination_account: &Pubkey,
      authority: &Pubkey,
      signers: &[&Pubkey],
  ) -> Result<Instruction, ProgramError> {
      check_program_account(token_program_id)?;
  
      let mut accounts = vec![
          AccountMeta::new( *source_account, false),
          AccountMeta::new( *destination_account, false),
          AccountMeta::new_readonly( *authority, signers.is_empty()),
      ];
  
      for signer in signers {
          accounts.push(AccountMeta::new_readonly( **signer, true))
      }
  
      Ok(Instruction {
          program_id: *token_program_id,
          accounts,
          data: TokenInstruction::WithdrawExcessLamports.pack(),
      })
  }
  *)
  Definition withdraw_excess_lamports (τ : list Ty.t) (α : list Value.t) : M :=
    match τ, α with
    | [], [ token_program_id; source_account; destination_account; authority; signers ] =>
      ltac:(M.monadic
        (let token_program_id := M.alloc (| token_program_id |) in
        let source_account := M.alloc (| source_account |) in
        let destination_account := M.alloc (| destination_account |) in
        let authority := M.alloc (| authority |) in
        let signers := M.alloc (| signers |) 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 "solana_program::program_error::ProgramError" ],
                        [],
                        "branch",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_function (| "spl_token_2022::check_program_account", [] |),
                          [ M.read (| token_program_id |) ]
                        |)
                      ]
                    |)
                  |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ0_0 :=
                          M.SubPointer.get_struct_tuple_field (|
                            γ,
                            "core::ops::control_flow::ControlFlow::Break",
                            0
                          |) in
                        let residual := M.copy (| γ0_0 |) in
                        M.alloc (|
                          M.never_to_any (|
                            M.read (|
                              M.return_ (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::try_trait::FromResidual",
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      [
                                        Ty.path "solana_program::instruction::Instruction";
                                        Ty.path "solana_program::program_error::ProgramError"
                                      ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::result::Result")
                                        [
                                          Ty.path "core::convert::Infallible";
                                          Ty.path "solana_program::program_error::ProgramError"
                                        ]
                                    ],
                                    "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 accounts :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "slice")
                        [ Ty.path "solana_program::instruction::AccountMeta" ],
                      "into_vec",
                      [ Ty.path "alloc::alloc::Global" ]
                    |),
                    [
                      (* Unsize *)
                      M.pointer_coercion
                        (M.read (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "alloc::boxed::Box")
                                [
                                  Ty.apply
                                    (Ty.path "array")
                                    [ Ty.path "solana_program::instruction::AccountMeta" ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              "new",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.Array
                                  [
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new",
                                        []
                                      |),
                                      [ M.read (| M.read (| source_account |) |); Value.Bool false ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new",
                                        []
                                      |),
                                      [
                                        M.read (| M.read (| destination_account |) |);
                                        Value.Bool false
                                      ]
                                    |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "solana_program::instruction::AccountMeta",
                                        "new_readonly",
                                        []
                                      |),
                                      [
                                        M.read (| M.read (| authority |) |);
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.apply
                                              (Ty.path "slice")
                                              [
                                                Ty.apply
                                                  (Ty.path "&")
                                                  [ Ty.path "solana_program::pubkey::Pubkey" ]
                                              ],
                                            "is_empty",
                                            []
                                          |),
                                          [ M.read (| signers |) ]
                                        |)
                                      ]
                                    |)
                                  ]
                              |)
                            ]
                          |)
                        |))
                    ]
                  |)
                |) in
              let _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          Ty.apply
                            (Ty.path "&")
                            [
                              Ty.apply
                                (Ty.path "slice")
                                [
                                  Ty.apply
                                    (Ty.path "&")
                                    [ Ty.path "solana_program::pubkey::Pubkey" ]
                                ]
                            ],
                          [],
                          "into_iter",
                          []
                        |),
                        [ M.read (| signers |) ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let iter := M.copy (| γ |) in
                          M.loop (|
                            ltac:(M.monadic
                              (let _ :=
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              [ Ty.path "solana_program::pubkey::Pubkey" ]
                                          ],
                                        [],
                                        "next",
                                        []
                                      |),
                                      [ iter ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (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 signer := M.copy (| γ0_0 |) in
                                        M.alloc (|
                                          M.call_closure (|
                                            M.get_associated_function (|
                                              Ty.apply
                                                (Ty.path "alloc::vec::Vec")
                                                [
                                                  Ty.path
                                                    "solana_program::instruction::AccountMeta";
                                                  Ty.path "alloc::alloc::Global"
                                                ],
                                              "push",
                                              []
                                            |),
                                            [
                                              accounts;
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path
                                                    "solana_program::instruction::AccountMeta",
                                                  "new_readonly",
                                                  []
                                                |),
                                                [
                                                  M.read (| M.read (| M.read (| signer |) |) |);
                                                  Value.Bool true
                                                ]
                                              |)
                                            ]
                                          |)
                                        |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (|
                Value.StructTuple
                  "core::result::Result::Ok"
                  [
                    Value.StructRecord
                      "solana_program::instruction::Instruction"
                      [
                        ("program_id", M.read (| M.read (| token_program_id |) |));
                        ("accounts", M.read (| accounts |));
                        ("data",
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "spl_token_2022::instruction::TokenInstruction",
                              "pack",
                              []
                            |),
                            [
                              M.alloc (|
                                Value.StructTuple
                                  "spl_token_2022::instruction::TokenInstruction::WithdrawExcessLamports"
                                  []
                              |)
                            ]
                          |))
                      ]
                  ]
              |)
            |)))
        |)))
    | _, _ => M.impossible
    end.
End instruction.
