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

Module extension.
  Module transfer_fee.
    Module processor.
      (*
      fn process_initialize_transfer_fee_config(
          accounts: &[AccountInfo],
          transfer_fee_config_authority: COption<Pubkey>,
          withdraw_withheld_authority: COption<Pubkey>,
          transfer_fee_basis_points: u16,
          maximum_fee: u64,
      ) -> ProgramResult {
          let account_info_iter = &mut accounts.iter();
          let mint_account_info = next_account_info(account_info_iter)?;
      
          let mut mint_data = mint_account_info.data.borrow_mut();
          let mut mint = PodStateWithExtensionsMut::<PodMint>::unpack_uninitialized(&mut mint_data)?;
          let extension = mint.init_extension::<TransferFeeConfig>(true)?;
          extension.transfer_fee_config_authority = transfer_fee_config_authority.try_into()?;
          extension.withdraw_withheld_authority = withdraw_withheld_authority.try_into()?;
          extension.withheld_amount = 0u64.into();
      
          if transfer_fee_basis_points > MAX_FEE_BASIS_POINTS {
              return Err(TokenError::TransferFeeExceedsMaximum.into());
          }
          // To be safe, set newer and older transfer fees to the same thing on init,
          // but only newer will actually be used
          let epoch = Clock::get()?.epoch;
          let transfer_fee = TransferFee {
              epoch: epoch.into(),
              transfer_fee_basis_points: transfer_fee_basis_points.into(),
              maximum_fee: maximum_fee.into(),
          };
          extension.older_transfer_fee = transfer_fee;
          extension.newer_transfer_fee = transfer_fee;
      
          Ok(())
      }
      *)
      Definition process_initialize_transfer_fee_config (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [],
            [
              accounts;
              transfer_fee_config_authority;
              withdraw_withheld_authority;
              transfer_fee_basis_points;
              maximum_fee
            ] =>
          ltac:(M.monadic
            (let accounts := M.alloc (| accounts |) in
            let transfer_fee_config_authority := M.alloc (| transfer_fee_config_authority |) in
            let withdraw_withheld_authority := M.alloc (| withdraw_withheld_authority |) in
            let transfer_fee_basis_points := M.alloc (| transfer_fee_basis_points |) in
            let maximum_fee := M.alloc (| maximum_fee |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let account_info_iter :=
                    M.alloc (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.path "solana_program::account_info::AccountInfo" ],
                            "iter",
                            []
                          |),
                          [ M.read (| accounts |) ]
                        |)
                      |)
                    |) in
                  let mint_account_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 mint_data :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::cell::RefCell")
                            [
                              Ty.apply
                                (Ty.path "&mut")
                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                            ],
                          "borrow_mut",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::rc::Rc")
                                [
                                  Ty.apply
                                    (Ty.path "core::cell::RefCell")
                                    [
                                      Ty.apply
                                        (Ty.path "&mut")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| mint_account_info |),
                                "solana_program::account_info::AccountInfo",
                                "data"
                              |)
                            ]
                          |)
                        ]
                      |)
                    |) in
                  let mint :=
                    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 "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "unpack_uninitialized",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::DerefMut",
                                        Ty.apply
                                          (Ty.path "core::cell::RefMut")
                                          [
                                            Ty.apply
                                              (Ty.path "&mut")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        [],
                                        "deref_mut",
                                        []
                                      |),
                                      [ mint_data ]
                                    |)
                                  |)
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 extension :=
                    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 "&mut")
                                    [
                                      Ty.path
                                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                    ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "spl_token_2022::extension::BaseStateWithExtensionsMut",
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "init_extension",
                                  [
                                    Ty.path
                                      "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                  ]
                                |),
                                [ mint; Value.Bool true ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| extension |),
                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                        "transfer_fee_config_authority"
                      |),
                      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_pod::optional_keys::OptionalNonZeroPubkey";
                                    Ty.path "solana_program::program_error::ProgramError"
                                  ],
                                [],
                                "branch",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::convert::TryInto",
                                    Ty.apply
                                      (Ty.path "solana_program::program_option::COption")
                                      [ Ty.path "solana_program::pubkey::Pubkey" ],
                                    [ Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey" ],
                                    "try_into",
                                    []
                                  |),
                                  [ M.read (| transfer_fee_config_authority |) ]
                                |)
                              ]
                            |)
                          |),
                          [
                            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::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.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| extension |),
                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                        "withdraw_withheld_authority"
                      |),
                      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_pod::optional_keys::OptionalNonZeroPubkey";
                                    Ty.path "solana_program::program_error::ProgramError"
                                  ],
                                [],
                                "branch",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::convert::TryInto",
                                    Ty.apply
                                      (Ty.path "solana_program::program_option::COption")
                                      [ Ty.path "solana_program::pubkey::Pubkey" ],
                                    [ Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey" ],
                                    "try_into",
                                    []
                                  |),
                                  [ M.read (| withdraw_withheld_authority |) ]
                                |)
                              ]
                            |)
                          |),
                          [
                            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::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.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| extension |),
                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                        "withheld_amount"
                      |),
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::convert::Into",
                          Ty.path "u64",
                          [ Ty.path "spl_pod::primitives::PodU64" ],
                          "into",
                          []
                        |),
                        [ Value.Integer 0 ]
                      |)
                    |) in
                  let _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  BinOp.Pure.gt
                                    (M.read (| transfer_fee_basis_points |))
                                    (M.read (|
                                      M.get_constant (|
                                        "spl_token_2022::extension::transfer_fee::MAX_FEE_BASIS_POINTS"
                                      |)
                                    |))
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [
                                        M.call_closure (|
                                          M.get_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::TransferFeeExceedsMaximum"
                                              []
                                          ]
                                        |)
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let epoch :=
                    M.copy (|
                      M.SubPointer.get_struct_record_field (|
                        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::clock::Clock";
                                    Ty.path "solana_program::program_error::ProgramError"
                                  ],
                                [],
                                "branch",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "solana_program::sysvar::Sysvar",
                                    Ty.path "solana_program::clock::Clock",
                                    [],
                                    "get",
                                    []
                                  |),
                                  []
                                |)
                              ]
                            |)
                          |),
                          [
                            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::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))
                          ]
                        |),
                        "solana_program::clock::Clock",
                        "epoch"
                      |)
                    |) in
                  let transfer_fee :=
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::extension::transfer_fee::TransferFee"
                        [
                          ("epoch",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "u64",
                                [ Ty.path "spl_pod::primitives::PodU64" ],
                                "into",
                                []
                              |),
                              [ M.read (| epoch |) ]
                            |));
                          ("transfer_fee_basis_points",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "u16",
                                [ Ty.path "spl_pod::primitives::PodU16" ],
                                "into",
                                []
                              |),
                              [ M.read (| transfer_fee_basis_points |) ]
                            |));
                          ("maximum_fee",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "u64",
                                [ Ty.path "spl_pod::primitives::PodU64" ],
                                "into",
                                []
                              |),
                              [ M.read (| maximum_fee |) ]
                            |))
                        ]
                    |) in
                  let _ :=
                    M.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| extension |),
                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                        "older_transfer_fee"
                      |),
                      M.read (| transfer_fee |)
                    |) in
                  let _ :=
                    M.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| extension |),
                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                        "newer_transfer_fee"
                      |),
                      M.read (| transfer_fee |)
                    |) in
                  M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
                |)))
            |)))
        | _, _ => M.impossible
        end.
      
      (*
      fn process_set_transfer_fee(
          program_id: &Pubkey,
          accounts: &[AccountInfo],
          transfer_fee_basis_points: u16,
          maximum_fee: u64,
      ) -> ProgramResult {
          let account_info_iter = &mut accounts.iter();
          let mint_account_info = next_account_info(account_info_iter)?;
          let authority_info = next_account_info(account_info_iter)?;
          let authority_info_data_len = authority_info.data_len();
      
          let mut mint_data = mint_account_info.data.borrow_mut();
          let mut mint = PodStateWithExtensionsMut::<PodMint>::unpack(&mut mint_data)?;
          let extension = mint.get_extension_mut::<TransferFeeConfig>()?;
      
          let transfer_fee_config_authority =
              Option::<Pubkey>::from(extension.transfer_fee_config_authority)
                  .ok_or(TokenError::NoAuthorityExists)?;
          Processor::validate_owner(
              program_id,
              &transfer_fee_config_authority,
              authority_info,
              authority_info_data_len,
              account_info_iter.as_slice(),
          )?;
      
          if transfer_fee_basis_points > MAX_FEE_BASIS_POINTS {
              return Err(TokenError::TransferFeeExceedsMaximum.into());
          }
      
          // When setting the transfer fee, we have two situations:
          // * newer transfer fee epoch <= current epoch: newer transfer fee is the active
          //   one, so overwrite older transfer fee with newer, then overwrite newer
          //   transfer fee
          // * newer transfer fee epoch >= next epoch: it was never used, so just
          //   overwrite next transfer fee
          let epoch = Clock::get()?.epoch;
          if u64::from(extension.newer_transfer_fee.epoch) <= epoch {
              extension.older_transfer_fee = extension.newer_transfer_fee;
          }
          // set two epochs ahead to avoid rug pulls at the end of an epoch
          let newer_fee_start_epoch = epoch.saturating_add(2);
          let transfer_fee = TransferFee {
              epoch: newer_fee_start_epoch.into(),
              transfer_fee_basis_points: transfer_fee_basis_points.into(),
              maximum_fee: maximum_fee.into(),
          };
          extension.newer_transfer_fee = transfer_fee;
      
          Ok(())
      }
      *)
      Definition process_set_transfer_fee (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ program_id; accounts; transfer_fee_basis_points; maximum_fee ] =>
          ltac:(M.monadic
            (let program_id := M.alloc (| program_id |) in
            let accounts := M.alloc (| accounts |) in
            let transfer_fee_basis_points := M.alloc (| transfer_fee_basis_points |) in
            let maximum_fee := M.alloc (| maximum_fee |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let account_info_iter :=
                    M.alloc (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.path "solana_program::account_info::AccountInfo" ],
                            "iter",
                            []
                          |),
                          [ M.read (| accounts |) ]
                        |)
                      |)
                    |) in
                  let mint_account_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 authority_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 authority_info_data_len :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::account_info::AccountInfo",
                          "data_len",
                          []
                        |),
                        [ M.read (| authority_info |) ]
                      |)
                    |) in
                  let mint_data :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::cell::RefCell")
                            [
                              Ty.apply
                                (Ty.path "&mut")
                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                            ],
                          "borrow_mut",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::rc::Rc")
                                [
                                  Ty.apply
                                    (Ty.path "core::cell::RefCell")
                                    [
                                      Ty.apply
                                        (Ty.path "&mut")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| mint_account_info |),
                                "solana_program::account_info::AccountInfo",
                                "data"
                              |)
                            ]
                          |)
                        ]
                      |)
                    |) in
                  let mint :=
                    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 "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "unpack",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::DerefMut",
                                        Ty.apply
                                          (Ty.path "core::cell::RefMut")
                                          [
                                            Ty.apply
                                              (Ty.path "&mut")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        [],
                                        "deref_mut",
                                        []
                                      |),
                                      [ mint_data ]
                                    |)
                                  |)
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 extension :=
                    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 "&mut")
                                    [
                                      Ty.path
                                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                    ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "spl_token_2022::extension::BaseStateWithExtensionsMut",
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "get_extension_mut",
                                  [
                                    Ty.path
                                      "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                  ]
                                |),
                                [ mint ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 transfer_fee_config_authority :=
                    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_trait_method (|
                                      "core::convert::From",
                                      Ty.apply
                                        (Ty.path "core::option::Option")
                                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      [ Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey" ],
                                      "from",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| extension |),
                                          "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                                          "transfer_fee_config_authority"
                                        |)
                                      |)
                                    ]
                                  |);
                                  Value.StructTuple
                                    "spl_token_2022::error::TokenError::NoAuthorityExists"
                                    []
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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
                  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_associated_function (|
                                Ty.path "spl_token_2022::processor::Processor",
                                "validate_owner",
                                []
                              |),
                              [
                                M.read (| program_id |);
                                transfer_fee_config_authority;
                                M.read (| authority_info |);
                                M.read (| authority_info_data_len |);
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ],
                                    "as_slice",
                                    []
                                  |),
                                  [ M.read (| account_info_iter |) ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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::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 (|
                                  BinOp.Pure.gt
                                    (M.read (| transfer_fee_basis_points |))
                                    (M.read (|
                                      M.get_constant (|
                                        "spl_token_2022::extension::transfer_fee::MAX_FEE_BASIS_POINTS"
                                      |)
                                    |))
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [
                                        M.call_closure (|
                                          M.get_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::TransferFeeExceedsMaximum"
                                              []
                                          ]
                                        |)
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let epoch :=
                    M.copy (|
                      M.SubPointer.get_struct_record_field (|
                        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::clock::Clock";
                                    Ty.path "solana_program::program_error::ProgramError"
                                  ],
                                [],
                                "branch",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "solana_program::sysvar::Sysvar",
                                    Ty.path "solana_program::clock::Clock",
                                    [],
                                    "get",
                                    []
                                  |),
                                  []
                                |)
                              ]
                            |)
                          |),
                          [
                            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::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))
                          ]
                        |),
                        "solana_program::clock::Clock",
                        "epoch"
                      |)
                    |) in
                  let _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  BinOp.Pure.le
                                    (M.call_closure (|
                                      M.get_trait_method (|
                                        "core::convert::From",
                                        Ty.path "u64",
                                        [ Ty.path "spl_pod::primitives::PodU64" ],
                                        "from",
                                        []
                                      |),
                                      [
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| extension |),
                                              "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                                              "newer_transfer_fee"
                                            |),
                                            "spl_token_2022::extension::transfer_fee::TransferFee",
                                            "epoch"
                                          |)
                                        |)
                                      ]
                                    |))
                                    (M.read (| epoch |))
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            let _ :=
                              M.write (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| extension |),
                                  "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                                  "older_transfer_fee"
                                |),
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| extension |),
                                    "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                                    "newer_transfer_fee"
                                  |)
                                |)
                              |) in
                            M.alloc (| Value.Tuple [] |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let newer_fee_start_epoch :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (| Ty.path "u64", "saturating_add", [] |),
                        [ M.read (| epoch |); Value.Integer 2 ]
                      |)
                    |) in
                  let transfer_fee :=
                    M.alloc (|
                      Value.StructRecord
                        "spl_token_2022::extension::transfer_fee::TransferFee"
                        [
                          ("epoch",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "u64",
                                [ Ty.path "spl_pod::primitives::PodU64" ],
                                "into",
                                []
                              |),
                              [ M.read (| newer_fee_start_epoch |) ]
                            |));
                          ("transfer_fee_basis_points",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "u16",
                                [ Ty.path "spl_pod::primitives::PodU16" ],
                                "into",
                                []
                              |),
                              [ M.read (| transfer_fee_basis_points |) ]
                            |));
                          ("maximum_fee",
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "u64",
                                [ Ty.path "spl_pod::primitives::PodU64" ],
                                "into",
                                []
                              |),
                              [ M.read (| maximum_fee |) ]
                            |))
                        ]
                    |) in
                  let _ :=
                    M.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| extension |),
                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                        "newer_transfer_fee"
                      |),
                      M.read (| transfer_fee |)
                    |) in
                  M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
                |)))
            |)))
        | _, _ => M.impossible
        end.
      
      (*
      fn process_withdraw_withheld_tokens_from_mint(
          program_id: &Pubkey,
          accounts: &[AccountInfo],
      ) -> ProgramResult {
          let account_info_iter = &mut accounts.iter();
          let mint_account_info = next_account_info(account_info_iter)?;
          let destination_account_info = next_account_info(account_info_iter)?;
          let authority_info = next_account_info(account_info_iter)?;
          let authority_info_data_len = authority_info.data_len();
      
          // unnecessary check, but helps for clarity
          check_program_account(mint_account_info.owner)?;
      
          let mut mint_data = mint_account_info.data.borrow_mut();
          let mut mint = PodStateWithExtensionsMut::<PodMint>::unpack(&mut mint_data)?;
          let extension = mint.get_extension_mut::<TransferFeeConfig>()?;
      
          let withdraw_withheld_authority = Option::<Pubkey>::from(extension.withdraw_withheld_authority)
              .ok_or(TokenError::NoAuthorityExists)?;
          Processor::validate_owner(
              program_id,
              &withdraw_withheld_authority,
              authority_info,
              authority_info_data_len,
              account_info_iter.as_slice(),
          )?;
      
          let mut destination_account_data = destination_account_info.data.borrow_mut();
          let destination_account =
              PodStateWithExtensionsMut::<PodAccount>::unpack(&mut destination_account_data)?;
          if destination_account.base.mint != *mint_account_info.key {
              return Err(TokenError::MintMismatch.into());
          }
          if destination_account.base.is_frozen() {
              return Err(TokenError::AccountFrozen.into());
          }
          let withheld_amount = u64::from(extension.withheld_amount);
          extension.withheld_amount = 0.into();
          destination_account.base.amount = u64::from(destination_account.base.amount)
              .checked_add(withheld_amount)
              .ok_or(TokenError::Overflow)?
              .into();
      
          Ok(())
      }
      *)
      Definition process_withdraw_withheld_tokens_from_mint
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        match τ, α with
        | [], [ program_id; accounts ] =>
          ltac:(M.monadic
            (let program_id := M.alloc (| program_id |) in
            let accounts := M.alloc (| accounts |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let account_info_iter :=
                    M.alloc (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.path "solana_program::account_info::AccountInfo" ],
                            "iter",
                            []
                          |),
                          [ M.read (| accounts |) ]
                        |)
                      |)
                    |) in
                  let mint_account_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 destination_account_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 authority_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 authority_info_data_len :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::account_info::AccountInfo",
                          "data_len",
                          []
                        |),
                        [ M.read (| authority_info |) ]
                      |)
                    |) in
                  let _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::try_trait::Try",
                            Ty.apply
                              (Ty.path "core::result::Result")
                              [ Ty.tuple []; Ty.path "solana_program::program_error::ProgramError"
                              ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_function (| "spl_token_2022::check_program_account", [] |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| mint_account_info |),
                                    "solana_program::account_info::AccountInfo",
                                    "owner"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Break",
                                0
                              |) in
                            let residual := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::try_trait::FromResidual",
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          [
                                            Ty.tuple [];
                                            Ty.path "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 mint_data :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::cell::RefCell")
                            [
                              Ty.apply
                                (Ty.path "&mut")
                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                            ],
                          "borrow_mut",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::rc::Rc")
                                [
                                  Ty.apply
                                    (Ty.path "core::cell::RefCell")
                                    [
                                      Ty.apply
                                        (Ty.path "&mut")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| mint_account_info |),
                                "solana_program::account_info::AccountInfo",
                                "data"
                              |)
                            ]
                          |)
                        ]
                      |)
                    |) in
                  let mint :=
                    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 "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "unpack",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::DerefMut",
                                        Ty.apply
                                          (Ty.path "core::cell::RefMut")
                                          [
                                            Ty.apply
                                              (Ty.path "&mut")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        [],
                                        "deref_mut",
                                        []
                                      |),
                                      [ mint_data ]
                                    |)
                                  |)
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 extension :=
                    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 "&mut")
                                    [
                                      Ty.path
                                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                    ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "spl_token_2022::extension::BaseStateWithExtensionsMut",
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "get_extension_mut",
                                  [
                                    Ty.path
                                      "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                  ]
                                |),
                                [ mint ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 withdraw_withheld_authority :=
                    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_trait_method (|
                                      "core::convert::From",
                                      Ty.apply
                                        (Ty.path "core::option::Option")
                                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      [ Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey" ],
                                      "from",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| extension |),
                                          "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                                          "withdraw_withheld_authority"
                                        |)
                                      |)
                                    ]
                                  |);
                                  Value.StructTuple
                                    "spl_token_2022::error::TokenError::NoAuthorityExists"
                                    []
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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
                  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_associated_function (|
                                Ty.path "spl_token_2022::processor::Processor",
                                "validate_owner",
                                []
                              |),
                              [
                                M.read (| program_id |);
                                withdraw_withheld_authority;
                                M.read (| authority_info |);
                                M.read (| authority_info_data_len |);
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ],
                                    "as_slice",
                                    []
                                  |),
                                  [ M.read (| account_info_iter |) ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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::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 destination_account_data :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::cell::RefCell")
                            [
                              Ty.apply
                                (Ty.path "&mut")
                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                            ],
                          "borrow_mut",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::rc::Rc")
                                [
                                  Ty.apply
                                    (Ty.path "core::cell::RefCell")
                                    [
                                      Ty.apply
                                        (Ty.path "&mut")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| destination_account_info |),
                                "solana_program::account_info::AccountInfo",
                                "data"
                              |)
                            ]
                          |)
                        ]
                      |)
                    |) in
                  let destination_account :=
                    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 "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodAccount" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodAccount" ],
                                  "unpack",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::DerefMut",
                                        Ty.apply
                                          (Ty.path "core::cell::RefMut")
                                          [
                                            Ty.apply
                                              (Ty.path "&mut")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        [],
                                        "deref_mut",
                                        []
                                      |),
                                      [ destination_account_data ]
                                    |)
                                  |)
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.path "solana_program::pubkey::Pubkey",
                                      [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      "ne",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            destination_account,
                                            "spl_token_2022::extension::PodStateWithExtensionsMut",
                                            "base"
                                          |)
                                        |),
                                        "spl_token_2022::pod::PodAccount",
                                        "mint"
                                      |);
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| mint_account_info |),
                                          "solana_program::account_info::AccountInfo",
                                          "key"
                                        |)
                                      |)
                                    ]
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [
                                        M.call_closure (|
                                          M.get_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::MintMismatch"
                                              []
                                          ]
                                        |)
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "spl_token_2022::pod::PodAccount",
                                      "is_frozen",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          destination_account,
                                          "spl_token_2022::extension::PodStateWithExtensionsMut",
                                          "base"
                                        |)
                                      |)
                                    ]
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [
                                        M.call_closure (|
                                          M.get_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::AccountFrozen"
                                              []
                                          ]
                                        |)
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let withheld_amount :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::convert::From",
                          Ty.path "u64",
                          [ Ty.path "spl_pod::primitives::PodU64" ],
                          "from",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| extension |),
                              "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                              "withheld_amount"
                            |)
                          |)
                        ]
                      |)
                    |) in
                  let _ :=
                    M.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| extension |),
                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                        "withheld_amount"
                      |),
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::convert::Into",
                          Ty.path "u64",
                          [ Ty.path "spl_pod::primitives::PodU64" ],
                          "into",
                          []
                        |),
                        [ Value.Integer 0 ]
                      |)
                    |) in
                  let _ :=
                    M.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            destination_account,
                            "spl_token_2022::extension::PodStateWithExtensionsMut",
                            "base"
                          |)
                        |),
                        "spl_token_2022::pod::PodAccount",
                        "amount"
                      |),
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::convert::Into",
                          Ty.path "u64",
                          [ Ty.path "spl_pod::primitives::PodU64" ],
                          "into",
                          []
                        |),
                        [
                          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 "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.path "u64",
                                            "checked_add",
                                            []
                                          |),
                                          [
                                            M.call_closure (|
                                              M.get_trait_method (|
                                                "core::convert::From",
                                                Ty.path "u64",
                                                [ Ty.path "spl_pod::primitives::PodU64" ],
                                                "from",
                                                []
                                              |),
                                              [
                                                M.read (|
                                                  M.SubPointer.get_struct_record_field (|
                                                    M.read (|
                                                      M.SubPointer.get_struct_record_field (|
                                                        destination_account,
                                                        "spl_token_2022::extension::PodStateWithExtensionsMut",
                                                        "base"
                                                      |)
                                                    |),
                                                    "spl_token_2022::pod::PodAccount",
                                                    "amount"
                                                  |)
                                                |)
                                              ]
                                            |);
                                            M.read (| withheld_amount |)
                                          ]
                                        |);
                                        Value.StructTuple
                                          "spl_token_2022::error::TokenError::Overflow"
                                          []
                                      ]
                                    |)
                                  ]
                                |)
                              |),
                              [
                                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::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.impossible
        end.
      
      (*
      fn harvest_from_account<'b>(
          mint_key: &'b Pubkey,
          token_account_info: &'b AccountInfo<'_>,
      ) -> Result<u64, TokenError> {
          let mut token_account_data = token_account_info.data.borrow_mut();
          let mut token_account =
              PodStateWithExtensionsMut::<PodAccount>::unpack(&mut token_account_data)
                  .map_err(|_| TokenError::InvalidState)?;
          if token_account.base.mint != *mint_key {
              return Err(TokenError::MintMismatch);
          }
          check_program_account(token_account_info.owner).map_err(|_| TokenError::InvalidState)?;
          let token_account_extension = token_account
              .get_extension_mut::<TransferFeeAmount>()
              .map_err(|_| TokenError::InvalidState)?;
          let account_withheld_amount = u64::from(token_account_extension.withheld_amount);
          token_account_extension.withheld_amount = 0.into();
          Ok(account_withheld_amount)
      }
      *)
      Definition harvest_from_account (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ mint_key; token_account_info ] =>
          ltac:(M.monadic
            (let mint_key := M.alloc (| mint_key |) in
            let token_account_info := M.alloc (| token_account_info |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let token_account_data :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::cell::RefCell")
                            [
                              Ty.apply
                                (Ty.path "&mut")
                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                            ],
                          "borrow_mut",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::rc::Rc")
                                [
                                  Ty.apply
                                    (Ty.path "core::cell::RefCell")
                                    [
                                      Ty.apply
                                        (Ty.path "&mut")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| token_account_info |),
                                "solana_program::account_info::AccountInfo",
                                "data"
                              |)
                            ]
                          |)
                        ]
                      |)
                    |) in
                  let token_account :=
                    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 "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodAccount" ];
                                  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
                                          "spl_token_2022::extension::PodStateWithExtensionsMut")
                                        [ Ty.path "spl_token_2022::pod::PodAccount" ];
                                      Ty.path "solana_program::program_error::ProgramError"
                                    ],
                                  "map_err",
                                  [
                                    Ty.path "spl_token_2022::error::TokenError";
                                    Ty.function
                                      [
                                        Ty.tuple
                                          [ Ty.path "solana_program::program_error::ProgramError" ]
                                      ]
                                      (Ty.path "spl_token_2022::error::TokenError")
                                  ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path
                                          "spl_token_2022::extension::PodStateWithExtensionsMut")
                                        [ Ty.path "spl_token_2022::pod::PodAccount" ],
                                      "unpack",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::ops::deref::DerefMut",
                                            Ty.apply
                                              (Ty.path "core::cell::RefMut")
                                              [
                                                Ty.apply
                                                  (Ty.path "&mut")
                                                  [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                              ],
                                            [],
                                            "deref_mut",
                                            []
                                          |),
                                          [ token_account_data ]
                                        |)
                                      |)
                                    ]
                                  |);
                                  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::InvalidState"
                                                    []))
                                            ]
                                          |)
                                        | _ => 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 "u64";
                                              Ty.path "spl_token_2022::error::TokenError"
                                            ],
                                          [
                                            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
                  let _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.path "solana_program::pubkey::Pubkey",
                                      [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      "ne",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            token_account,
                                            "spl_token_2022::extension::PodStateWithExtensionsMut",
                                            "base"
                                          |)
                                        |),
                                        "spl_token_2022::pod::PodAccount",
                                        "mint"
                                      |);
                                      M.read (| mint_key |)
                                    ]
                                  |)
                                |)) 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
                                          "spl_token_2022::error::TokenError::MintMismatch"
                                          []
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::try_trait::Try",
                            Ty.apply
                              (Ty.path "core::result::Result")
                              [ Ty.tuple []; Ty.path "spl_token_2022::error::TokenError" ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "core::result::Result")
                                  [
                                    Ty.tuple [];
                                    Ty.path "solana_program::program_error::ProgramError"
                                  ],
                                "map_err",
                                [
                                  Ty.path "spl_token_2022::error::TokenError";
                                  Ty.function
                                    [
                                      Ty.tuple
                                        [ Ty.path "solana_program::program_error::ProgramError" ]
                                    ]
                                    (Ty.path "spl_token_2022::error::TokenError")
                                ]
                              |),
                              [
                                M.call_closure (|
                                  M.get_function (| "spl_token_2022::check_program_account", [] |),
                                  [
                                    M.read (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| token_account_info |),
                                        "solana_program::account_info::AccountInfo",
                                        "owner"
                                      |)
                                    |)
                                  ]
                                |);
                                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::InvalidState"
                                                  []))
                                          ]
                                        |)
                                      | _ => 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 "u64";
                                            Ty.path "spl_token_2022::error::TokenError"
                                          ],
                                        [
                                          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
                  let token_account_extension :=
                    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 "&mut")
                                    [
                                      Ty.path
                                        "spl_token_2022::extension::transfer_fee::TransferFeeAmount"
                                    ];
                                  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 "&mut")
                                        [
                                          Ty.path
                                            "spl_token_2022::extension::transfer_fee::TransferFeeAmount"
                                        ];
                                      Ty.path "solana_program::program_error::ProgramError"
                                    ],
                                  "map_err",
                                  [
                                    Ty.path "spl_token_2022::error::TokenError";
                                    Ty.function
                                      [
                                        Ty.tuple
                                          [ Ty.path "solana_program::program_error::ProgramError" ]
                                      ]
                                      (Ty.path "spl_token_2022::error::TokenError")
                                  ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "spl_token_2022::extension::BaseStateWithExtensionsMut",
                                      Ty.apply
                                        (Ty.path
                                          "spl_token_2022::extension::PodStateWithExtensionsMut")
                                        [ Ty.path "spl_token_2022::pod::PodAccount" ],
                                      [ Ty.path "spl_token_2022::pod::PodAccount" ],
                                      "get_extension_mut",
                                      [
                                        Ty.path
                                          "spl_token_2022::extension::transfer_fee::TransferFeeAmount"
                                      ]
                                    |),
                                    [ token_account ]
                                  |);
                                  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::InvalidState"
                                                    []))
                                            ]
                                          |)
                                        | _ => 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 "u64";
                                              Ty.path "spl_token_2022::error::TokenError"
                                            ],
                                          [
                                            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
                  let account_withheld_amount :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::convert::From",
                          Ty.path "u64",
                          [ Ty.path "spl_pod::primitives::PodU64" ],
                          "from",
                          []
                        |),
                        [
                          M.read (|
                            M.SubPointer.get_struct_record_field (|
                              M.read (| token_account_extension |),
                              "spl_token_2022::extension::transfer_fee::TransferFeeAmount",
                              "withheld_amount"
                            |)
                          |)
                        ]
                      |)
                    |) in
                  let _ :=
                    M.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| token_account_extension |),
                        "spl_token_2022::extension::transfer_fee::TransferFeeAmount",
                        "withheld_amount"
                      |),
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::convert::Into",
                          Ty.path "u64",
                          [ Ty.path "spl_pod::primitives::PodU64" ],
                          "into",
                          []
                        |),
                        [ Value.Integer 0 ]
                      |)
                    |) in
                  M.alloc (|
                    Value.StructTuple
                      "core::result::Result::Ok"
                      [ M.read (| account_withheld_amount |) ]
                  |)
                |)))
            |)))
        | _, _ => M.impossible
        end.
      
      (*
      fn process_harvest_withheld_tokens_to_mint(accounts: &[AccountInfo]) -> ProgramResult {
          let account_info_iter = &mut accounts.iter();
          let mint_account_info = next_account_info(account_info_iter)?;
          let token_account_infos = account_info_iter.as_slice();
      
          let mut mint_data = mint_account_info.data.borrow_mut();
          let mut mint = PodStateWithExtensionsMut::<PodMint>::unpack(&mut mint_data)?;
          let mint_extension = mint.get_extension_mut::<TransferFeeConfig>()?;
      
          for token_account_info in token_account_infos {
              match harvest_from_account(mint_account_info.key, token_account_info) {
                  Ok(amount) => {
                      let mint_withheld_amount = u64::from(mint_extension.withheld_amount);
                      mint_extension.withheld_amount = mint_withheld_amount
                          .checked_add(amount)
                          .ok_or(TokenError::Overflow)?
                          .into();
                  }
                  Err(e) => {
                      msg!("Error harvesting from {}: {}", token_account_info.key, e);
                  }
              }
          }
          Ok(())
      }
      *)
      Definition process_harvest_withheld_tokens_to_mint (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ accounts ] =>
          ltac:(M.monadic
            (let accounts := M.alloc (| accounts |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let account_info_iter :=
                    M.alloc (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.path "solana_program::account_info::AccountInfo" ],
                            "iter",
                            []
                          |),
                          [ M.read (| accounts |) ]
                        |)
                      |)
                    |) in
                  let mint_account_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 token_account_infos :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.path "solana_program::account_info::AccountInfo" ],
                          "as_slice",
                          []
                        |),
                        [ M.read (| account_info_iter |) ]
                      |)
                    |) in
                  let mint_data :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::cell::RefCell")
                            [
                              Ty.apply
                                (Ty.path "&mut")
                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                            ],
                          "borrow_mut",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::rc::Rc")
                                [
                                  Ty.apply
                                    (Ty.path "core::cell::RefCell")
                                    [
                                      Ty.apply
                                        (Ty.path "&mut")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| mint_account_info |),
                                "solana_program::account_info::AccountInfo",
                                "data"
                              |)
                            ]
                          |)
                        ]
                      |)
                    |) in
                  let mint :=
                    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 "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "unpack",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::DerefMut",
                                        Ty.apply
                                          (Ty.path "core::cell::RefMut")
                                          [
                                            Ty.apply
                                              (Ty.path "&mut")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        [],
                                        "deref_mut",
                                        []
                                      |),
                                      [ mint_data ]
                                    |)
                                  |)
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 mint_extension :=
                    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 "&mut")
                                    [
                                      Ty.path
                                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                    ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "spl_token_2022::extension::BaseStateWithExtensionsMut",
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "get_extension_mut",
                                  [
                                    Ty.path
                                      "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                  ]
                                |),
                                [ mint ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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.use
                      (M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::iter::traits::collect::IntoIterator",
                              Ty.apply
                                (Ty.path "&")
                                [
                                  Ty.apply
                                    (Ty.path "slice")
                                    [ Ty.path "solana_program::account_info::AccountInfo" ]
                                ],
                              [],
                              "into_iter",
                              []
                            |),
                            [ M.read (| token_account_infos |) ]
                          |)
                        |),
                        [
                          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 "solana_program::account_info::AccountInfo"
                                              ],
                                            [],
                                            "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 token_account_info := M.copy (| γ0_0 |) in
                                            M.match_operator (|
                                              M.alloc (|
                                                M.call_closure (|
                                                  M.get_function (|
                                                    "spl_token_2022::extension::transfer_fee::processor::harvest_from_account",
                                                    []
                                                  |),
                                                  [
                                                    M.read (|
                                                      M.SubPointer.get_struct_record_field (|
                                                        M.read (| mint_account_info |),
                                                        "solana_program::account_info::AccountInfo",
                                                        "key"
                                                      |)
                                                    |);
                                                    M.read (| token_account_info |)
                                                  ]
                                                |)
                                              |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ0_0 :=
                                                      M.SubPointer.get_struct_tuple_field (|
                                                        γ,
                                                        "core::result::Result::Ok",
                                                        0
                                                      |) in
                                                    let amount := M.copy (| γ0_0 |) in
                                                    let mint_withheld_amount :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::convert::From",
                                                            Ty.path "u64",
                                                            [ Ty.path "spl_pod::primitives::PodU64"
                                                            ],
                                                            "from",
                                                            []
                                                          |),
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| mint_extension |),
                                                                "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                                                                "withheld_amount"
                                                              |)
                                                            |)
                                                          ]
                                                        |)
                                                      |) in
                                                    let _ :=
                                                      M.write (|
                                                        M.SubPointer.get_struct_record_field (|
                                                          M.read (| mint_extension |),
                                                          "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                                                          "withheld_amount"
                                                        |),
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::convert::Into",
                                                            Ty.path "u64",
                                                            [ Ty.path "spl_pod::primitives::PodU64"
                                                            ],
                                                            "into",
                                                            []
                                                          |),
                                                          [
                                                            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 "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.path "u64",
                                                                              "checked_add",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.read (|
                                                                                mint_withheld_amount
                                                                              |);
                                                                              M.read (| amount |)
                                                                            ]
                                                                          |);
                                                                          Value.StructTuple
                                                                            "spl_token_2022::error::TokenError::Overflow"
                                                                            []
                                                                        ]
                                                                      |)
                                                                    ]
                                                                  |)
                                                                |),
                                                                [
                                                                  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::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.Tuple [] |)));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ0_0 :=
                                                      M.SubPointer.get_struct_tuple_field (|
                                                        γ,
                                                        "core::result::Result::Err",
                                                        0
                                                      |) in
                                                    let e := M.copy (| γ0_0 |) in
                                                    let _ :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "solana_program::log::sol_log",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_trait_method (|
                                                                "core::ops::deref::Deref",
                                                                Ty.path "alloc::string::String",
                                                                [],
                                                                "deref",
                                                                []
                                                              |),
                                                              [
                                                                let res :=
                                                                  M.alloc (|
                                                                    M.call_closure (|
                                                                      M.get_function (|
                                                                        "alloc::fmt::format",
                                                                        []
                                                                      |),
                                                                      [
                                                                        M.call_closure (|
                                                                          M.get_associated_function (|
                                                                            Ty.path
                                                                              "core::fmt::Arguments",
                                                                            "new_v1",
                                                                            []
                                                                          |),
                                                                          [
                                                                            (* Unsize *)
                                                                            M.pointer_coercion
                                                                              (M.alloc (|
                                                                                Value.Array
                                                                                  [
                                                                                    M.read (|
                                                                                      Value.String
                                                                                        "Error harvesting from "
                                                                                    |);
                                                                                    M.read (|
                                                                                      Value.String
                                                                                        ": "
                                                                                    |)
                                                                                  ]
                                                                              |));
                                                                            (* Unsize *)
                                                                            M.pointer_coercion
                                                                              (M.alloc (|
                                                                                Value.Array
                                                                                  [
                                                                                    M.call_closure (|
                                                                                      M.get_associated_function (|
                                                                                        Ty.path
                                                                                          "core::fmt::rt::Argument",
                                                                                        "new_display",
                                                                                        [
                                                                                          Ty.apply
                                                                                            (Ty.path
                                                                                              "&")
                                                                                            [
                                                                                              Ty.path
                                                                                                "solana_program::pubkey::Pubkey"
                                                                                            ]
                                                                                        ]
                                                                                      |),
                                                                                      [
                                                                                        M.SubPointer.get_struct_record_field (|
                                                                                          M.read (|
                                                                                            token_account_info
                                                                                          |),
                                                                                          "solana_program::account_info::AccountInfo",
                                                                                          "key"
                                                                                        |)
                                                                                      ]
                                                                                    |);
                                                                                    M.call_closure (|
                                                                                      M.get_associated_function (|
                                                                                        Ty.path
                                                                                          "core::fmt::rt::Argument",
                                                                                        "new_display",
                                                                                        [
                                                                                          Ty.path
                                                                                            "spl_token_2022::error::TokenError"
                                                                                        ]
                                                                                      |),
                                                                                      [ e ]
                                                                                    |)
                                                                                  ]
                                                                              |))
                                                                          ]
                                                                        |)
                                                                      ]
                                                                    |)
                                                                  |) in
                                                                res
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |) in
                                                    M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |)))
                                      ]
                                    |) in
                                  M.alloc (| Value.Tuple [] |)))
                              |)))
                        ]
                      |)) in
                  M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
                |)))
            |)))
        | _, _ => M.impossible
        end.
      
      (*
      fn process_withdraw_withheld_tokens_from_accounts(
          program_id: &Pubkey,
          accounts: &[AccountInfo],
          num_token_accounts: u8,
      ) -> ProgramResult {
          let account_info_iter = &mut accounts.iter();
          let mint_account_info = next_account_info(account_info_iter)?;
          let destination_account_info = next_account_info(account_info_iter)?;
          let authority_info = next_account_info(account_info_iter)?;
          let authority_info_data_len = authority_info.data_len();
          let account_infos = account_info_iter.as_slice();
          let num_signers = account_infos
              .len()
              .saturating_sub(num_token_accounts as usize);
      
          // unnecessary check, but helps for clarity
          check_program_account(mint_account_info.owner)?;
      
          let mint_data = mint_account_info.data.borrow();
          let mint = PodStateWithExtensions::<PodMint>::unpack(&mint_data)?;
          let extension = mint.get_extension::<TransferFeeConfig>()?;
      
          let withdraw_withheld_authority = Option::<Pubkey>::from(extension.withdraw_withheld_authority)
              .ok_or(TokenError::NoAuthorityExists)?;
          Processor::validate_owner(
              program_id,
              &withdraw_withheld_authority,
              authority_info,
              authority_info_data_len,
              &account_infos[..num_signers],
          )?;
      
          let mut destination_account_data = destination_account_info.data.borrow_mut();
          let mut destination_account =
              PodStateWithExtensionsMut::<PodAccount>::unpack(&mut destination_account_data)?;
          if destination_account.base.mint != *mint_account_info.key {
              return Err(TokenError::MintMismatch.into());
          }
          if destination_account.base.is_frozen() {
              return Err(TokenError::AccountFrozen.into());
          }
          for account_info in &account_infos[num_signers..] {
              // self-harvest, can't double-borrow the underlying data
              if account_info.key == destination_account_info.key {
                  let token_account_extension = destination_account
                      .get_extension_mut::<TransferFeeAmount>()
                      .map_err(|_| TokenError::InvalidState)?;
                  let account_withheld_amount = u64::from(token_account_extension.withheld_amount);
                  token_account_extension.withheld_amount = 0.into();
                  destination_account.base.amount = u64::from(destination_account.base.amount)
                      .checked_add(account_withheld_amount)
                      .ok_or(TokenError::Overflow)?
                      .into();
              } else {
                  match harvest_from_account(mint_account_info.key, account_info) {
                      Ok(amount) => {
                          destination_account.base.amount = u64::from(destination_account.base.amount)
                              .checked_add(amount)
                              .ok_or(TokenError::Overflow)?
                              .into();
                      }
                      Err(e) => {
                          msg!("Error harvesting from {}: {}", account_info.key, e);
                      }
                  }
              }
          }
      
          Ok(())
      }
      *)
      Definition process_withdraw_withheld_tokens_from_accounts
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        match τ, α with
        | [], [ program_id; accounts; num_token_accounts ] =>
          ltac:(M.monadic
            (let program_id := M.alloc (| program_id |) in
            let accounts := M.alloc (| accounts |) in
            let num_token_accounts := M.alloc (| num_token_accounts |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let account_info_iter :=
                    M.alloc (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply
                              (Ty.path "slice")
                              [ Ty.path "solana_program::account_info::AccountInfo" ],
                            "iter",
                            []
                          |),
                          [ M.read (| accounts |) ]
                        |)
                      |)
                    |) in
                  let mint_account_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 destination_account_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 authority_info :=
                    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 "solana_program::account_info::AccountInfo" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_function (|
                                  "solana_program::account_info::next_account_info",
                                  [
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ]
                                  ]
                                |),
                                [ M.read (| account_info_iter |) ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 authority_info_data_len :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "solana_program::account_info::AccountInfo",
                          "data_len",
                          []
                        |),
                        [ M.read (| authority_info |) ]
                      |)
                    |) in
                  let account_infos :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::slice::iter::Iter")
                            [ Ty.path "solana_program::account_info::AccountInfo" ],
                          "as_slice",
                          []
                        |),
                        [ M.read (| account_info_iter |) ]
                      |)
                    |) in
                  let num_signers :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (| Ty.path "usize", "saturating_sub", [] |),
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "slice")
                                [ Ty.path "solana_program::account_info::AccountInfo" ],
                              "len",
                              []
                            |),
                            [ M.read (| account_infos |) ]
                          |);
                          M.rust_cast (M.read (| num_token_accounts |))
                        ]
                      |)
                    |) in
                  let _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::try_trait::Try",
                            Ty.apply
                              (Ty.path "core::result::Result")
                              [ Ty.tuple []; Ty.path "solana_program::program_error::ProgramError"
                              ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_function (| "spl_token_2022::check_program_account", [] |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| mint_account_info |),
                                    "solana_program::account_info::AccountInfo",
                                    "owner"
                                  |)
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Break",
                                0
                              |) in
                            let residual := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::try_trait::FromResidual",
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          [
                                            Ty.tuple [];
                                            Ty.path "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 mint_data :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::cell::RefCell")
                            [
                              Ty.apply
                                (Ty.path "&mut")
                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                            ],
                          "borrow",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::rc::Rc")
                                [
                                  Ty.apply
                                    (Ty.path "core::cell::RefCell")
                                    [
                                      Ty.apply
                                        (Ty.path "&mut")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| mint_account_info |),
                                "solana_program::account_info::AccountInfo",
                                "data"
                              |)
                            ]
                          |)
                        ]
                      |)
                    |) in
                  let mint :=
                    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 "spl_token_2022::extension::PodStateWithExtensions")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensions")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "unpack",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::Deref",
                                        Ty.apply
                                          (Ty.path "core::cell::Ref")
                                          [
                                            Ty.apply
                                              (Ty.path "&mut")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        [],
                                        "deref",
                                        []
                                      |),
                                      [ mint_data ]
                                    |)
                                  |)
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 extension :=
                    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
                                        "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                    ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "spl_token_2022::extension::BaseStateWithExtensions",
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensions")
                                    [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  [ Ty.path "spl_token_2022::pod::PodMint" ],
                                  "get_extension",
                                  [
                                    Ty.path
                                      "spl_token_2022::extension::transfer_fee::TransferFeeConfig"
                                  ]
                                |),
                                [ mint ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 withdraw_withheld_authority :=
                    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_trait_method (|
                                      "core::convert::From",
                                      Ty.apply
                                        (Ty.path "core::option::Option")
                                        [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      [ Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey" ],
                                      "from",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| extension |),
                                          "spl_token_2022::extension::transfer_fee::TransferFeeConfig",
                                          "withdraw_withheld_authority"
                                        |)
                                      |)
                                    ]
                                  |);
                                  Value.StructTuple
                                    "spl_token_2022::error::TokenError::NoAuthorityExists"
                                    []
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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
                  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_associated_function (|
                                Ty.path "spl_token_2022::processor::Processor",
                                "validate_owner",
                                []
                              |),
                              [
                                M.read (| program_id |);
                                withdraw_withheld_authority;
                                M.read (| authority_info |);
                                M.read (| authority_info_data_len |);
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::ops::index::Index",
                                    Ty.apply
                                      (Ty.path "slice")
                                      [ Ty.path "solana_program::account_info::AccountInfo" ],
                                    [
                                      Ty.apply
                                        (Ty.path "core::ops::range::RangeTo")
                                        [ Ty.path "usize" ]
                                    ],
                                    "index",
                                    []
                                  |),
                                  [
                                    M.read (| account_infos |);
                                    Value.StructRecord
                                      "core::ops::range::RangeTo"
                                      [ ("end_", M.read (| num_signers |)) ]
                                  ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        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::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 destination_account_data :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "core::cell::RefCell")
                            [
                              Ty.apply
                                (Ty.path "&mut")
                                [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                            ],
                          "borrow_mut",
                          []
                        |),
                        [
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::deref::Deref",
                              Ty.apply
                                (Ty.path "alloc::rc::Rc")
                                [
                                  Ty.apply
                                    (Ty.path "core::cell::RefCell")
                                    [
                                      Ty.apply
                                        (Ty.path "&mut")
                                        [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                    ];
                                  Ty.path "alloc::alloc::Global"
                                ],
                              [],
                              "deref",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| destination_account_info |),
                                "solana_program::account_info::AccountInfo",
                                "data"
                              |)
                            ]
                          |)
                        ]
                      |)
                    |) in
                  let destination_account :=
                    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 "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodAccount" ];
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply
                                    (Ty.path "spl_token_2022::extension::PodStateWithExtensionsMut")
                                    [ Ty.path "spl_token_2022::pod::PodAccount" ],
                                  "unpack",
                                  []
                                |),
                                [
                                  M.read (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::deref::DerefMut",
                                        Ty.apply
                                          (Ty.path "core::cell::RefMut")
                                          [
                                            Ty.apply
                                              (Ty.path "&mut")
                                              [ Ty.apply (Ty.path "slice") [ Ty.path "u8" ] ]
                                          ],
                                        [],
                                        "deref_mut",
                                        []
                                      |),
                                      [ destination_account_data ]
                                    |)
                                  |)
                                ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::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 (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.path "solana_program::pubkey::Pubkey",
                                      [ Ty.path "solana_program::pubkey::Pubkey" ],
                                      "ne",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            destination_account,
                                            "spl_token_2022::extension::PodStateWithExtensionsMut",
                                            "base"
                                          |)
                                        |),
                                        "spl_token_2022::pod::PodAccount",
                                        "mint"
                                      |);
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| mint_account_info |),
                                          "solana_program::account_info::AccountInfo",
                                          "key"
                                        |)
                                      |)
                                    ]
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [
                                        M.call_closure (|
                                          M.get_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::MintMismatch"
                                              []
                                          ]
                                        |)
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "spl_token_2022::pod::PodAccount",
                                      "is_frozen",
                                      []
                                    |),
                                    [
                                      M.read (|
                                        M.SubPointer.get_struct_record_field (|
                                          destination_account,
                                          "spl_token_2022::extension::PodStateWithExtensionsMut",
                                          "base"
                                        |)
                                      |)
                                    ]
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::result::Result::Err"
                                      [
                                        M.call_closure (|
                                          M.get_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::AccountFrozen"
                                              []
                                          ]
                                        |)
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let _ :=
                    M.use
                      (M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::iter::traits::collect::IntoIterator",
                              Ty.apply
                                (Ty.path "&")
                                [
                                  Ty.apply
                                    (Ty.path "slice")
                                    [ Ty.path "solana_program::account_info::AccountInfo" ]
                                ],
                              [],
                              "into_iter",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::ops::index::Index",
                                  Ty.apply
                                    (Ty.path "slice")
                                    [ Ty.path "solana_program::account_info::AccountInfo" ],
                                  [
                                    Ty.apply
                                      (Ty.path "core::ops::range::RangeFrom")
                                      [ Ty.path "usize" ]
                                  ],
                                  "index",
                                  []
                                |),
                                [
                                  M.read (| account_infos |);
                                  Value.StructRecord
                                    "core::ops::range::RangeFrom"
                                    [ ("start", M.read (| num_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.path "solana_program::account_info::AccountInfo"
                                              ],
                                            [],
                                            "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 account_info := M.copy (| γ0_0 |) in
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::cmp::PartialEq",
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                [
                                                                  Ty.path
                                                                    "solana_program::pubkey::Pubkey"
                                                                ],
                                                              [
                                                                Ty.apply
                                                                  (Ty.path "&")
                                                                  [
                                                                    Ty.path
                                                                      "solana_program::pubkey::Pubkey"
                                                                  ]
                                                              ],
                                                              "eq",
                                                              []
                                                            |),
                                                            [
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| account_info |),
                                                                "solana_program::account_info::AccountInfo",
                                                                "key"
                                                              |);
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (|
                                                                  destination_account_info
                                                                |),
                                                                "solana_program::account_info::AccountInfo",
                                                                "key"
                                                              |)
                                                            ]
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    let token_account_extension :=
                                                      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 "&mut")
                                                                      [
                                                                        Ty.path
                                                                          "spl_token_2022::extension::transfer_fee::TransferFeeAmount"
                                                                      ];
                                                                    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 "&mut")
                                                                          [
                                                                            Ty.path
                                                                              "spl_token_2022::extension::transfer_fee::TransferFeeAmount"
                                                                          ];
                                                                        Ty.path
                                                                          "solana_program::program_error::ProgramError"
                                                                      ],
                                                                    "map_err",
                                                                    [
                                                                      Ty.path
                                                                        "spl_token_2022::error::TokenError";
                                                                      Ty.function
                                                                        [
                                                                          Ty.tuple
                                                                            [
                                                                              Ty.path
                                                                                "solana_program::program_error::ProgramError"
                                                                            ]
                                                                        ]
                                                                        (Ty.path
                                                                          "spl_token_2022::error::TokenError")
                                                                    ]
                                                                  |),
                                                                  [
                                                                    M.call_closure (|
                                                                      M.get_trait_method (|
                                                                        "spl_token_2022::extension::BaseStateWithExtensionsMut",
                                                                        Ty.apply
                                                                          (Ty.path
                                                                            "spl_token_2022::extension::PodStateWithExtensionsMut")
                                                                          [
                                                                            Ty.path
                                                                              "spl_token_2022::pod::PodAccount"
                                                                          ],
                                                                        [
                                                                          Ty.path
                                                                            "spl_token_2022::pod::PodAccount"
                                                                        ],
                                                                        "get_extension_mut",
                                                                        [
                                                                          Ty.path
                                                                            "spl_token_2022::extension::transfer_fee::TransferFeeAmount"
                                                                        ]
                                                                      |),
                                                                      [ destination_account ]
                                                                    |);
                                                                    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::InvalidState"
                                                                                      []))
                                                                              ]
                                                                            |)
                                                                          | _ => 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.tuple [];
                                                                                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
                                                    let account_withheld_amount :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::convert::From",
                                                            Ty.path "u64",
                                                            [ Ty.path "spl_pod::primitives::PodU64"
                                                            ],
                                                            "from",
                                                            []
                                                          |),
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (|
                                                                  token_account_extension
                                                                |),
                                                                "spl_token_2022::extension::transfer_fee::TransferFeeAmount",
                                                                "withheld_amount"
                                                              |)
                                                            |)
                                                          ]
                                                        |)
                                                      |) in
                                                    let _ :=
                                                      M.write (|
                                                        M.SubPointer.get_struct_record_field (|
                                                          M.read (| token_account_extension |),
                                                          "spl_token_2022::extension::transfer_fee::TransferFeeAmount",
                                                          "withheld_amount"
                                                        |),
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::convert::Into",
                                                            Ty.path "u64",
                                                            [ Ty.path "spl_pod::primitives::PodU64"
                                                            ],
                                                            "into",
                                                            []
                                                          |),
                                                          [ Value.Integer 0 ]
                                                        |)
                                                      |) in
                                                    let _ :=
                                                      M.write (|
                                                        M.SubPointer.get_struct_record_field (|
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              destination_account,
                                                              "spl_token_2022::extension::PodStateWithExtensionsMut",
                                                              "base"
                                                            |)
                                                          |),
                                                          "spl_token_2022::pod::PodAccount",
                                                          "amount"
                                                        |),
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::convert::Into",
                                                            Ty.path "u64",
                                                            [ Ty.path "spl_pod::primitives::PodU64"
                                                            ],
                                                            "into",
                                                            []
                                                          |),
                                                          [
                                                            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 "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.path "u64",
                                                                              "checked_add",
                                                                              []
                                                                            |),
                                                                            [
                                                                              M.call_closure (|
                                                                                M.get_trait_method (|
                                                                                  "core::convert::From",
                                                                                  Ty.path "u64",
                                                                                  [
                                                                                    Ty.path
                                                                                      "spl_pod::primitives::PodU64"
                                                                                  ],
                                                                                  "from",
                                                                                  []
                                                                                |),
                                                                                [
                                                                                  M.read (|
                                                                                    M.SubPointer.get_struct_record_field (|
                                                                                      M.read (|
                                                                                        M.SubPointer.get_struct_record_field (|
                                                                                          destination_account,
                                                                                          "spl_token_2022::extension::PodStateWithExtensionsMut",
                                                                                          "base"
                                                                                        |)
                                                                                      |),
                                                                                      "spl_token_2022::pod::PodAccount",
                                                                                      "amount"
                                                                                    |)
                                                                                  |)
                                                                                ]
                                                                              |);
                                                                              M.read (|
                                                                                account_withheld_amount
                                                                              |)
                                                                            ]
                                                                          |);
                                                                          Value.StructTuple
                                                                            "spl_token_2022::error::TokenError::Overflow"
                                                                            []
                                                                        ]
                                                                      |)
                                                                    ]
                                                                  |)
                                                                |),
                                                                [
                                                                  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::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.Tuple [] |)));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (M.match_operator (|
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "spl_token_2022::extension::transfer_fee::processor::harvest_from_account",
                                                            []
                                                          |),
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| mint_account_info |),
                                                                "solana_program::account_info::AccountInfo",
                                                                "key"
                                                              |)
                                                            |);
                                                            M.read (| account_info |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (let γ0_0 :=
                                                              M.SubPointer.get_struct_tuple_field (|
                                                                γ,
                                                                "core::result::Result::Ok",
                                                                0
                                                              |) in
                                                            let amount := M.copy (| γ0_0 |) in
                                                            let _ :=
                                                              M.write (|
                                                                M.SubPointer.get_struct_record_field (|
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      destination_account,
                                                                      "spl_token_2022::extension::PodStateWithExtensionsMut",
                                                                      "base"
                                                                    |)
                                                                  |),
                                                                  "spl_token_2022::pod::PodAccount",
                                                                  "amount"
                                                                |),
                                                                M.call_closure (|
                                                                  M.get_trait_method (|
                                                                    "core::convert::Into",
                                                                    Ty.path "u64",
                                                                    [
                                                                      Ty.path
                                                                        "spl_pod::primitives::PodU64"
                                                                    ],
                                                                    "into",
                                                                    []
                                                                  |),
                                                                  [
                                                                    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 "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.path "u64",
                                                                                      "checked_add",
                                                                                      []
                                                                                    |),
                                                                                    [
                                                                                      M.call_closure (|
                                                                                        M.get_trait_method (|
                                                                                          "core::convert::From",
                                                                                          Ty.path
                                                                                            "u64",
                                                                                          [
                                                                                            Ty.path
                                                                                              "spl_pod::primitives::PodU64"
                                                                                          ],
                                                                                          "from",
                                                                                          []
                                                                                        |),
                                                                                        [
                                                                                          M.read (|
                                                                                            M.SubPointer.get_struct_record_field (|
                                                                                              M.read (|
                                                                                                M.SubPointer.get_struct_record_field (|
                                                                                                  destination_account,
                                                                                                  "spl_token_2022::extension::PodStateWithExtensionsMut",
                                                                                                  "base"
                                                                                                |)
                                                                                              |),
                                                                                              "spl_token_2022::pod::PodAccount",
                                                                                              "amount"
                                                                                            |)
                                                                                          |)
                                                                                        ]
                                                                                      |);
                                                                                      M.read (|
                                                                                        amount
                                                                                      |)
                                                                                    ]
                                                                                  |);
                                                                                  Value.StructTuple
                                                                                    "spl_token_2022::error::TokenError::Overflow"
                                                                                    []
                                                                                ]
                                                                              |)
                                                                            ]
                                                                          |)
                                                                        |),
                                                                        [
                                                                          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::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.Tuple [] |)));
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (let γ0_0 :=
                                                              M.SubPointer.get_struct_tuple_field (|
                                                                γ,
                                                                "core::result::Result::Err",
                                                                0
                                                              |) in
                                                            let e := M.copy (| γ0_0 |) in
                                                            let _ :=
                                                              M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_function (|
                                                                    "solana_program::log::sol_log",
                                                                    []
                                                                  |),
                                                                  [
                                                                    M.call_closure (|
                                                                      M.get_trait_method (|
                                                                        "core::ops::deref::Deref",
                                                                        Ty.path
                                                                          "alloc::string::String",
                                                                        [],
                                                                        "deref",
                                                                        []
                                                                      |),
                                                                      [
                                                                        let res :=
                                                                          M.alloc (|
                                                                            M.call_closure (|
                                                                              M.get_function (|
                                                                                "alloc::fmt::format",
                                                                                []
                                                                              |),
                                                                              [
                                                                                M.call_closure (|
                                                                                  M.get_associated_function (|
                                                                                    Ty.path
                                                                                      "core::fmt::Arguments",
                                                                                    "new_v1",
                                                                                    []
                                                                                  |),
                                                                                  [
                                                                                    (* Unsize *)
                                                                                    M.pointer_coercion
                                                                                      (M.alloc (|
                                                                                        Value.Array
                                                                                          [
                                                                                            M.read (|
                                                                                              Value.String
                                                                                                "Error harvesting from "
                                                                                            |);
                                                                                            M.read (|
                                                                                              Value.String
                                                                                                ": "
                                                                                            |)
                                                                                          ]
                                                                                      |));
                                                                                    (* Unsize *)
                                                                                    M.pointer_coercion
                                                                                      (M.alloc (|
                                                                                        Value.Array
                                                                                          [
                                                                                            M.call_closure (|
                                                                                              M.get_associated_function (|
                                                                                                Ty.path
                                                                                                  "core::fmt::rt::Argument",
                                                                                                "new_display",
                                                                                                [
                                                                                                  Ty.apply
                                                                                                    (Ty.path
                                                                                                      "&")
                                                                                                    [
                                                                                                      Ty.path
                                                                                                        "solana_program::pubkey::Pubkey"
                                                                                                    ]
                                                                                                ]
                                                                                              |),
                                                                                              [
                                                                                                M.SubPointer.get_struct_record_field (|
                                                                                                  M.read (|
                                                                                                    account_info
                                                                                                  |),
                                                                                                  "solana_program::account_info::AccountInfo",
                                                                                                  "key"
                                                                                                |)
                                                                                              ]
                                                                                            |);
                                                                                            M.call_closure (|
                                                                                              M.get_associated_function (|
                                                                                                Ty.path
                                                                                                  "core::fmt::rt::Argument",
                                                                                                "new_display",
                                                                                                [
                                                                                                  Ty.path
                                                                                                    "spl_token_2022::error::TokenError"
                                                                                                ]
                                                                                              |),
                                                                                              [ e ]
                                                                                            |)
                                                                                          ]
                                                                                      |))
                                                                                  ]
                                                                                |)
                                                                              ]
                                                                            |)
                                                                          |) in
                                                                        res
                                                                      ]
                                                                    |)
                                                                  ]
                                                                |)
                                                              |) in
                                                            M.alloc (| Value.Tuple [] |)))
                                                      ]
                                                    |)))
                                              ]
                                            |)))
                                      ]
                                    |) in
                                  M.alloc (| Value.Tuple [] |)))
                              |)))
                        ]
                      |)) in
                  M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
                |)))
            |)))
        | _, _ => M.impossible
        end.
      
      (*
      pub(crate) fn process_instruction(
          program_id: &Pubkey,
          accounts: &[AccountInfo],
          input: &[u8],
      ) -> ProgramResult {
          let instruction = TransferFeeInstruction::unpack(input)?;
          check_program_account(program_id)?;
      
          match instruction {
              TransferFeeInstruction::InitializeTransferFeeConfig {
                  transfer_fee_config_authority,
                  withdraw_withheld_authority,
                  transfer_fee_basis_points,
                  maximum_fee,
              } => process_initialize_transfer_fee_config(
                  accounts,
                  transfer_fee_config_authority,
                  withdraw_withheld_authority,
                  transfer_fee_basis_points,
                  maximum_fee,
              ),
              TransferFeeInstruction::TransferCheckedWithFee {
                  amount,
                  decimals,
                  fee,
              } => {
                  msg!("TransferFeeInstruction: TransferCheckedWithFee");
                  Processor::process_transfer(program_id, accounts, amount, Some(decimals), Some(fee))
              }
              TransferFeeInstruction::WithdrawWithheldTokensFromMint => {
                  msg!("TransferFeeInstruction: WithdrawWithheldTokensFromMint");
                  process_withdraw_withheld_tokens_from_mint(program_id, accounts)
              }
              TransferFeeInstruction::WithdrawWithheldTokensFromAccounts { num_token_accounts } => {
                  msg!("TransferFeeInstruction: WithdrawWithheldTokensFromAccounts");
                  process_withdraw_withheld_tokens_from_accounts(program_id, accounts, num_token_accounts)
              }
              TransferFeeInstruction::HarvestWithheldTokensToMint => {
                  msg!("TransferFeeInstruction: HarvestWithheldTokensToMint");
                  process_harvest_withheld_tokens_to_mint(accounts)
              }
              TransferFeeInstruction::SetTransferFee {
                  transfer_fee_basis_points,
                  maximum_fee,
              } => {
                  msg!("TransferFeeInstruction: SetTransferFee");
                  process_set_transfer_fee(program_id, accounts, transfer_fee_basis_points, maximum_fee)
              }
          }
      }
      *)
      Definition process_instruction (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ program_id; accounts; input ] =>
          ltac:(M.monadic
            (let program_id := M.alloc (| program_id |) in
            let accounts := M.alloc (| accounts |) in
            let input := M.alloc (| input |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let instruction :=
                    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
                                    "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction";
                                  Ty.path "solana_program::program_error::ProgramError"
                                ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path
                                    "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction",
                                  "unpack",
                                  []
                                |),
                                [ 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 "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 (|
                        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 (| 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.tuple [];
                                            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.match_operator (|
                    instruction,
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::InitializeTransferFeeConfig",
                              "transfer_fee_config_authority"
                            |) in
                          let γ0_1 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::InitializeTransferFeeConfig",
                              "withdraw_withheld_authority"
                            |) in
                          let γ0_2 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::InitializeTransferFeeConfig",
                              "transfer_fee_basis_points"
                            |) in
                          let γ0_3 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::InitializeTransferFeeConfig",
                              "maximum_fee"
                            |) in
                          let transfer_fee_config_authority := M.copy (| γ0_0 |) in
                          let withdraw_withheld_authority := M.copy (| γ0_1 |) in
                          let transfer_fee_basis_points := M.copy (| γ0_2 |) in
                          let maximum_fee := M.copy (| γ0_3 |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_function (|
                                "spl_token_2022::extension::transfer_fee::processor::process_initialize_transfer_fee_config",
                                []
                              |),
                              [
                                M.read (| accounts |);
                                M.read (| transfer_fee_config_authority |);
                                M.read (| withdraw_withheld_authority |);
                                M.read (| transfer_fee_basis_points |);
                                M.read (| maximum_fee |)
                              ]
                            |)
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::TransferCheckedWithFee",
                              "amount"
                            |) in
                          let γ0_1 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::TransferCheckedWithFee",
                              "decimals"
                            |) in
                          let γ0_2 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::TransferCheckedWithFee",
                              "fee"
                            |) in
                          let amount := M.copy (| γ0_0 |) in
                          let decimals := M.copy (| γ0_1 |) in
                          let fee := M.copy (| γ0_2 |) in
                          let _ :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_function (| "solana_program::log::sol_log", [] |),
                                [
                                  M.read (|
                                    Value.String "TransferFeeInstruction: TransferCheckedWithFee"
                                  |)
                                ]
                              |)
                            |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "spl_token_2022::processor::Processor",
                                "process_transfer",
                                []
                              |),
                              [
                                M.read (| program_id |);
                                M.read (| accounts |);
                                M.read (| amount |);
                                Value.StructTuple
                                  "core::option::Option::Some"
                                  [ M.read (| decimals |) ];
                                Value.StructTuple "core::option::Option::Some" [ M.read (| fee |) ]
                              ]
                            |)
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let _ :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_function (| "solana_program::log::sol_log", [] |),
                                [
                                  M.read (|
                                    Value.String
                                      "TransferFeeInstruction: WithdrawWithheldTokensFromMint"
                                  |)
                                ]
                              |)
                            |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_function (|
                                "spl_token_2022::extension::transfer_fee::processor::process_withdraw_withheld_tokens_from_mint",
                                []
                              |),
                              [ M.read (| program_id |); M.read (| accounts |) ]
                            |)
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::WithdrawWithheldTokensFromAccounts",
                              "num_token_accounts"
                            |) in
                          let num_token_accounts := M.copy (| γ0_0 |) in
                          let _ :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_function (| "solana_program::log::sol_log", [] |),
                                [
                                  M.read (|
                                    Value.String
                                      "TransferFeeInstruction: WithdrawWithheldTokensFromAccounts"
                                  |)
                                ]
                              |)
                            |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_function (|
                                "spl_token_2022::extension::transfer_fee::processor::process_withdraw_withheld_tokens_from_accounts",
                                []
                              |),
                              [
                                M.read (| program_id |);
                                M.read (| accounts |);
                                M.read (| num_token_accounts |)
                              ]
                            |)
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let _ :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_function (| "solana_program::log::sol_log", [] |),
                                [
                                  M.read (|
                                    Value.String
                                      "TransferFeeInstruction: HarvestWithheldTokensToMint"
                                  |)
                                ]
                              |)
                            |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_function (|
                                "spl_token_2022::extension::transfer_fee::processor::process_harvest_withheld_tokens_to_mint",
                                []
                              |),
                              [ M.read (| accounts |) ]
                            |)
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::SetTransferFee",
                              "transfer_fee_basis_points"
                            |) in
                          let γ0_1 :=
                            M.SubPointer.get_struct_record_field (|
                              γ,
                              "spl_token_2022::extension::transfer_fee::instruction::TransferFeeInstruction::SetTransferFee",
                              "maximum_fee"
                            |) in
                          let transfer_fee_basis_points := M.copy (| γ0_0 |) in
                          let maximum_fee := M.copy (| γ0_1 |) in
                          let _ :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_function (| "solana_program::log::sol_log", [] |),
                                [ M.read (| Value.String "TransferFeeInstruction: SetTransferFee" |)
                                ]
                              |)
                            |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_function (|
                                "spl_token_2022::extension::transfer_fee::processor::process_set_transfer_fee",
                                []
                              |),
                              [
                                M.read (| program_id |);
                                M.read (| accounts |);
                                M.read (| transfer_fee_basis_points |);
                                M.read (| maximum_fee |)
                              ]
                            |)
                          |)))
                    ]
                  |)
                |)))
            |)))
        | _, _ => M.impossible
        end.
    End processor.
  End transfer_fee.
End extension.
