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

Module extension.
  Module confidential_transfer.
    Definition value_MAXIMUM_DEPOSIT_TRANSFER_AMOUNT : Value.t :=
      M.run
        ltac:(M.monadic
          (M.alloc (|
            BinOp.Panic.add (|
              Integer.U64,
              M.rust_cast (M.read (| M.get_constant (| "core::num::MAX" |) |)),
              BinOp.Panic.mul (|
                Integer.U64,
                BinOp.Panic.shl (| Value.Integer 1, Value.Integer 16 |),
                M.rust_cast (M.read (| M.get_constant (| "core::num::MAX" |) |))
              |)
            |)
          |))).
    
    Definition value_PENDING_BALANCE_LO_BIT_LENGTH : Value.t :=
      M.run ltac:(M.monadic (M.alloc (| Value.Integer 16 |))).
    
    Axiom EncryptedBalance :
      (Ty.path "spl_token_2022::extension::confidential_transfer::EncryptedBalance") =
        (Ty.path "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext").
    
    Axiom DecryptableBalance :
      (Ty.path "spl_token_2022::extension::confidential_transfer::DecryptableBalance") =
        (Ty.path "solana_zk_token_sdk::zk_token_elgamal::pod::auth_encryption::AeCiphertext").
    
    (* StructRecord
      {
        name := "ConfidentialTransferMint";
        ty_params := [];
        fields :=
          [
            ("authority", Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey");
            ("auto_approve_new_accounts", Ty.path "spl_pod::primitives::PodBool");
            ("auditor_elgamal_pubkey",
              Ty.path "spl_pod::optional_keys::OptionalNonZeroElGamalPubkey")
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      (* Clone *)
      Definition clone (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        Value.DeclaredButUndefined,
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (M.match_operator (|
                                Value.DeclaredButUndefined,
                                [ fun γ => ltac:(M.monadic (M.read (| self |))) ]
                              |)))
                        ]
                      |)))
                ]
              |)
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    Module Impl_core_marker_Copy_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::Copy"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_Copy_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    Module Impl_core_fmt_Debug_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      (* Debug *)
      Definition fmt (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::fmt::Formatter",
                "debug_struct_field3_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "ConfidentialTransferMint" |);
                M.read (| Value.String "authority" |);
                (* Unsize *)
                M.pointer_coercion
                  (M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                    "authority"
                  |));
                M.read (| Value.String "auto_approve_new_accounts" |);
                (* Unsize *)
                M.pointer_coercion
                  (M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                    "auto_approve_new_accounts"
                  |));
                M.read (| Value.String "auditor_elgamal_pubkey" |);
                (* Unsize *)
                M.pointer_coercion
                  (M.alloc (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                      "auditor_elgamal_pubkey"
                    |)
                  |))
              ]
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    Module Impl_core_default_Default_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      (* Default *)
      Definition default (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [] =>
          ltac:(M.monadic
            (Value.StructRecord
              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint"
              [
                ("authority",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("auto_approve_new_accounts",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::primitives::PodBool",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("auditor_elgamal_pubkey",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::optional_keys::OptionalNonZeroElGamalPubkey",
                      [],
                      "default",
                      []
                    |),
                    []
                  |))
              ]))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::default::Default"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("default", InstanceField.Method default) ].
    End Impl_core_default_Default_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    Module Impl_core_marker_StructuralPartialEq_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    Module Impl_core_cmp_PartialEq_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      (* PartialEq *)
      Definition eq (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            LogicalOp.and (|
              LogicalOp.and (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey",
                    [ Ty.path "spl_pod::optional_keys::OptionalNonZeroPubkey" ],
                    "eq",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                      "authority"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                      "authority"
                    |)
                  ]
                |),
                ltac:(M.monadic
                  (M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::PartialEq",
                      Ty.path "spl_pod::primitives::PodBool",
                      [ Ty.path "spl_pod::primitives::PodBool" ],
                      "eq",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                        "auto_approve_new_accounts"
                      |);
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                        "auto_approve_new_accounts"
                      |)
                    ]
                  |)))
              |),
              ltac:(M.monadic
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.path "spl_pod::optional_keys::OptionalNonZeroElGamalPubkey",
                    [ Ty.path "spl_pod::optional_keys::OptionalNonZeroElGamalPubkey" ],
                    "eq",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                      "auditor_elgamal_pubkey"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint",
                      "auditor_elgamal_pubkey"
                    |)
                  ]
                |)))
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    Module Impl_bytemuck_pod_Pod_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      Axiom Implements :
        M.IsTraitInstance
          "bytemuck::pod::Pod"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_bytemuck_pod_Pod_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    Module Impl_bytemuck_zeroable_Zeroable_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      Axiom Implements :
        M.IsTraitInstance
          "bytemuck::zeroable::Zeroable"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_bytemuck_zeroable_Zeroable_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    Module Impl_spl_token_2022_extension_Extension_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferMint".
      
      (*     const TYPE: ExtensionType = ExtensionType::ConfidentialTransferMint; *)
      (* Ty.path "spl_token_2022::extension::ExtensionType" *)
      Definition value_TYPE : Value.t :=
        M.run
          ltac:(M.monadic
            (M.alloc (|
              Value.StructTuple
                "spl_token_2022::extension::ExtensionType::ConfidentialTransferMint"
                []
            |))).
      
      Axiom Implements :
        M.IsTraitInstance
          "spl_token_2022::extension::Extension"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("value_TYPE", InstanceField.Constant value_TYPE) ].
    End Impl_spl_token_2022_extension_Extension_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferMint.
    
    (* StructRecord
      {
        name := "ConfidentialTransferAccount";
        ty_params := [];
        fields :=
          [
            ("approved", Ty.path "spl_pod::primitives::PodBool");
            ("elgamal_pubkey",
              Ty.path "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalPubkey");
            ("pending_balance_lo",
              Ty.path "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext");
            ("pending_balance_hi",
              Ty.path "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext");
            ("available_balance",
              Ty.path "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext");
            ("decryptable_available_balance",
              Ty.path "solana_zk_token_sdk::zk_token_elgamal::pod::auth_encryption::AeCiphertext");
            ("allow_confidential_credits", Ty.path "spl_pod::primitives::PodBool");
            ("allow_non_confidential_credits", Ty.path "spl_pod::primitives::PodBool");
            ("pending_balance_credit_counter", Ty.path "spl_pod::primitives::PodU64");
            ("maximum_pending_balance_credit_counter", Ty.path "spl_pod::primitives::PodU64");
            ("expected_pending_balance_credit_counter", Ty.path "spl_pod::primitives::PodU64");
            ("actual_pending_balance_credit_counter", Ty.path "spl_pod::primitives::PodU64")
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      (* Clone *)
      Definition clone (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        Value.DeclaredButUndefined,
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (M.match_operator (|
                                Value.DeclaredButUndefined,
                                [
                                  fun γ =>
                                    ltac:(M.monadic
                                      (M.match_operator (|
                                        Value.DeclaredButUndefined,
                                        [
                                          fun γ =>
                                            ltac:(M.monadic
                                              (M.match_operator (|
                                                Value.DeclaredButUndefined,
                                                [ fun γ => ltac:(M.monadic (M.read (| self |))) ]
                                              |)))
                                        ]
                                      |)))
                                ]
                              |)))
                        ]
                      |)))
                ]
              |)
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_core_marker_Copy_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::Copy"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_Copy_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_core_fmt_Debug_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      (* Debug *)
      Definition fmt (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.read (|
              let names :=
                M.alloc (|
                  M.alloc (|
                    Value.Array
                      [
                        M.read (| Value.String "approved" |);
                        M.read (| Value.String "elgamal_pubkey" |);
                        M.read (| Value.String "pending_balance_lo" |);
                        M.read (| Value.String "pending_balance_hi" |);
                        M.read (| Value.String "available_balance" |);
                        M.read (| Value.String "decryptable_available_balance" |);
                        M.read (| Value.String "allow_confidential_credits" |);
                        M.read (| Value.String "allow_non_confidential_credits" |);
                        M.read (| Value.String "pending_balance_credit_counter" |);
                        M.read (| Value.String "maximum_pending_balance_credit_counter" |);
                        M.read (| Value.String "expected_pending_balance_credit_counter" |);
                        M.read (| Value.String "actual_pending_balance_credit_counter" |)
                      ]
                  |)
                |) in
              let values :=
                M.alloc (|
                  (* Unsize *)
                  M.pointer_coercion
                    (M.alloc (|
                      Value.Array
                        [
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "approved"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "elgamal_pubkey"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "pending_balance_lo"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "pending_balance_hi"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "available_balance"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "decryptable_available_balance"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "allow_confidential_credits"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "allow_non_confidential_credits"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "pending_balance_credit_counter"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "maximum_pending_balance_credit_counter"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "expected_pending_balance_credit_counter"
                            |));
                          (* Unsize *)
                          M.pointer_coercion
                            (M.alloc (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                "actual_pending_balance_credit_counter"
                              |)
                            |))
                        ]
                    |))
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::Formatter",
                    "debug_struct_fields_finish",
                    []
                  |),
                  [
                    M.read (| f |);
                    M.read (| Value.String "ConfidentialTransferAccount" |);
                    (* Unsize *) M.pointer_coercion (M.read (| names |));
                    M.read (| values |)
                  ]
                |)
              |)
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_core_default_Default_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      (* Default *)
      Definition default (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [] =>
          ltac:(M.monadic
            (Value.StructRecord
              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount"
              [
                ("approved",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::primitives::PodBool",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("elgamal_pubkey",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalPubkey",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("pending_balance_lo",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path
                        "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("pending_balance_hi",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path
                        "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("available_balance",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path
                        "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("decryptable_available_balance",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path
                        "solana_zk_token_sdk::zk_token_elgamal::pod::auth_encryption::AeCiphertext",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("allow_confidential_credits",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::primitives::PodBool",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("allow_non_confidential_credits",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::primitives::PodBool",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("pending_balance_credit_counter",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::primitives::PodU64",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("maximum_pending_balance_credit_counter",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::primitives::PodU64",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("expected_pending_balance_credit_counter",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::primitives::PodU64",
                      [],
                      "default",
                      []
                    |),
                    []
                  |));
                ("actual_pending_balance_credit_counter",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.path "spl_pod::primitives::PodU64",
                      [],
                      "default",
                      []
                    |),
                    []
                  |))
              ]))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::default::Default"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("default", InstanceField.Method default) ].
    End Impl_core_default_Default_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_core_marker_StructuralPartialEq_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_core_cmp_PartialEq_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      (* PartialEq *)
      Definition eq (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            LogicalOp.and (|
              LogicalOp.and (|
                LogicalOp.and (|
                  LogicalOp.and (|
                    LogicalOp.and (|
                      LogicalOp.and (|
                        LogicalOp.and (|
                          LogicalOp.and (|
                            LogicalOp.and (|
                              LogicalOp.and (|
                                LogicalOp.and (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.path "spl_pod::primitives::PodBool",
                                      [ Ty.path "spl_pod::primitives::PodBool" ],
                                      "eq",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                        "approved"
                                      |);
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| other |),
                                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                        "approved"
                                      |)
                                    ]
                                  |),
                                  ltac:(M.monadic
                                    (M.call_closure (|
                                      M.get_trait_method (|
                                        "core::cmp::PartialEq",
                                        Ty.path
                                          "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalPubkey",
                                        [
                                          Ty.path
                                            "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalPubkey"
                                        ],
                                        "eq",
                                        []
                                      |),
                                      [
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| self |),
                                          "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                          "elgamal_pubkey"
                                        |);
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| other |),
                                          "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                          "elgamal_pubkey"
                                        |)
                                      ]
                                    |)))
                                |),
                                ltac:(M.monadic
                                  (M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.path
                                        "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                      [
                                        Ty.path
                                          "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext"
                                      ],
                                      "eq",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                        "pending_balance_lo"
                                      |);
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| other |),
                                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                        "pending_balance_lo"
                                      |)
                                    ]
                                  |)))
                              |),
                              ltac:(M.monadic
                                (M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::PartialEq",
                                    Ty.path
                                      "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                    [
                                      Ty.path
                                        "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext"
                                    ],
                                    "eq",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                      "pending_balance_hi"
                                    |);
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| other |),
                                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                      "pending_balance_hi"
                                    |)
                                  ]
                                |)))
                            |),
                            ltac:(M.monadic
                              (M.call_closure (|
                                M.get_trait_method (|
                                  "core::cmp::PartialEq",
                                  Ty.path
                                    "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                  [
                                    Ty.path
                                      "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext"
                                  ],
                                  "eq",
                                  []
                                |),
                                [
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                    "available_balance"
                                  |);
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| other |),
                                    "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                    "available_balance"
                                  |)
                                ]
                              |)))
                          |),
                          ltac:(M.monadic
                            (M.call_closure (|
                              M.get_trait_method (|
                                "core::cmp::PartialEq",
                                Ty.path
                                  "solana_zk_token_sdk::zk_token_elgamal::pod::auth_encryption::AeCiphertext",
                                [
                                  Ty.path
                                    "solana_zk_token_sdk::zk_token_elgamal::pod::auth_encryption::AeCiphertext"
                                ],
                                "eq",
                                []
                              |),
                              [
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                  "decryptable_available_balance"
                                |);
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| other |),
                                  "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                  "decryptable_available_balance"
                                |)
                              ]
                            |)))
                        |),
                        ltac:(M.monadic
                          (M.call_closure (|
                            M.get_trait_method (|
                              "core::cmp::PartialEq",
                              Ty.path "spl_pod::primitives::PodBool",
                              [ Ty.path "spl_pod::primitives::PodBool" ],
                              "eq",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                "allow_confidential_credits"
                              |);
                              M.SubPointer.get_struct_record_field (|
                                M.read (| other |),
                                "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                "allow_confidential_credits"
                              |)
                            ]
                          |)))
                      |),
                      ltac:(M.monadic
                        (M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::PartialEq",
                            Ty.path "spl_pod::primitives::PodBool",
                            [ Ty.path "spl_pod::primitives::PodBool" ],
                            "eq",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "allow_non_confidential_credits"
                            |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| other |),
                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                              "allow_non_confidential_credits"
                            |)
                          ]
                        |)))
                    |),
                    ltac:(M.monadic
                      (M.call_closure (|
                        M.get_trait_method (|
                          "core::cmp::PartialEq",
                          Ty.path "spl_pod::primitives::PodU64",
                          [ Ty.path "spl_pod::primitives::PodU64" ],
                          "eq",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                            "pending_balance_credit_counter"
                          |);
                          M.SubPointer.get_struct_record_field (|
                            M.read (| other |),
                            "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                            "pending_balance_credit_counter"
                          |)
                        ]
                      |)))
                  |),
                  ltac:(M.monadic
                    (M.call_closure (|
                      M.get_trait_method (|
                        "core::cmp::PartialEq",
                        Ty.path "spl_pod::primitives::PodU64",
                        [ Ty.path "spl_pod::primitives::PodU64" ],
                        "eq",
                        []
                      |),
                      [
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                          "maximum_pending_balance_credit_counter"
                        |);
                        M.SubPointer.get_struct_record_field (|
                          M.read (| other |),
                          "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                          "maximum_pending_balance_credit_counter"
                        |)
                      ]
                    |)))
                |),
                ltac:(M.monadic
                  (M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::PartialEq",
                      Ty.path "spl_pod::primitives::PodU64",
                      [ Ty.path "spl_pod::primitives::PodU64" ],
                      "eq",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                        "expected_pending_balance_credit_counter"
                      |);
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                        "expected_pending_balance_credit_counter"
                      |)
                    ]
                  |)))
              |),
              ltac:(M.monadic
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.path "spl_pod::primitives::PodU64",
                    [ Ty.path "spl_pod::primitives::PodU64" ],
                    "eq",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                      "actual_pending_balance_credit_counter"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                      "actual_pending_balance_credit_counter"
                    |)
                  ]
                |)))
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_bytemuck_pod_Pod_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      Axiom Implements :
        M.IsTraitInstance
          "bytemuck::pod::Pod"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_bytemuck_pod_Pod_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_bytemuck_zeroable_Zeroable_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      Axiom Implements :
        M.IsTraitInstance
          "bytemuck::zeroable::Zeroable"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_bytemuck_zeroable_Zeroable_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_spl_token_2022_extension_Extension_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      (*     const TYPE: ExtensionType = ExtensionType::ConfidentialTransferAccount; *)
      (* Ty.path "spl_token_2022::extension::ExtensionType" *)
      Definition value_TYPE : Value.t :=
        M.run
          ltac:(M.monadic
            (M.alloc (|
              Value.StructTuple
                "spl_token_2022::extension::ExtensionType::ConfidentialTransferAccount"
                []
            |))).
      
      Axiom Implements :
        M.IsTraitInstance
          "spl_token_2022::extension::Extension"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("value_TYPE", InstanceField.Constant value_TYPE) ].
    End Impl_spl_token_2022_extension_Extension_for_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
    
    Module Impl_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
      Definition Self : Ty.t :=
        Ty.path "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount".
      
      (*
          pub fn approved(&self) -> ProgramResult {
              if bool::from(&self.approved) {
                  Ok(())
              } else {
                  Err(TokenError::ConfidentialTransferAccountNotApproved.into())
              }
          }
      *)
      Definition approved (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.alloc (| Value.Tuple [] |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ :=
                        M.use
                          (M.alloc (|
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::From",
                                Ty.path "bool",
                                [ Ty.apply (Ty.path "&") [ Ty.path "spl_pod::primitives::PodBool" ]
                                ],
                                "from",
                                []
                              |),
                              [
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                  "approved"
                                |)
                              ]
                            |)
                          |)) in
                      let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                      M.alloc (|
                        Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (M.alloc (|
                        Value.StructTuple
                          "core::result::Result::Err"
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "spl_token_2022::error::TokenError",
                                [ Ty.path "solana_program::program_error::ProgramError" ],
                                "into",
                                []
                              |),
                              [
                                Value.StructTuple
                                  "spl_token_2022::error::TokenError::ConfidentialTransferAccountNotApproved"
                                  []
                              ]
                            |)
                          ]
                      |)))
                ]
              |)
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom AssociatedFunction_approved : M.IsAssociatedFunction Self "approved" approved.
      
      (*
          pub fn closable(&self) -> ProgramResult {
              if self.pending_balance_lo == EncryptedBalance::zeroed()
                  && self.pending_balance_hi == EncryptedBalance::zeroed()
                  && self.available_balance == EncryptedBalance::zeroed()
              {
                  Ok(())
              } else {
                  Err(TokenError::ConfidentialTransferAccountHasBalance.into())
              }
          }
      *)
      Definition closable (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.alloc (| Value.Tuple [] |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ :=
                        M.use
                          (M.alloc (|
                            LogicalOp.and (|
                              LogicalOp.and (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::PartialEq",
                                    Ty.path
                                      "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                    [
                                      Ty.path
                                        "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext"
                                    ],
                                    "eq",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                      "pending_balance_lo"
                                    |);
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "bytemuck::zeroable::Zeroable",
                                          Ty.path
                                            "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                          [],
                                          "zeroed",
                                          []
                                        |),
                                        []
                                      |)
                                    |)
                                  ]
                                |),
                                ltac:(M.monadic
                                  (M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialEq",
                                      Ty.path
                                        "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                      [
                                        Ty.path
                                          "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext"
                                      ],
                                      "eq",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                        "pending_balance_hi"
                                      |);
                                      M.alloc (|
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "bytemuck::zeroable::Zeroable",
                                            Ty.path
                                              "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                            [],
                                            "zeroed",
                                            []
                                          |),
                                          []
                                        |)
                                      |)
                                    ]
                                  |)))
                              |),
                              ltac:(M.monadic
                                (M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::PartialEq",
                                    Ty.path
                                      "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                    [
                                      Ty.path
                                        "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext"
                                    ],
                                    "eq",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                      "available_balance"
                                    |);
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "bytemuck::zeroable::Zeroable",
                                          Ty.path
                                            "solana_zk_token_sdk::zk_token_elgamal::pod::elgamal::ElGamalCiphertext",
                                          [],
                                          "zeroed",
                                          []
                                        |),
                                        []
                                      |)
                                    |)
                                  ]
                                |)))
                            |)
                          |)) in
                      let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                      M.alloc (|
                        Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (M.alloc (|
                        Value.StructTuple
                          "core::result::Result::Err"
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "spl_token_2022::error::TokenError",
                                [ Ty.path "solana_program::program_error::ProgramError" ],
                                "into",
                                []
                              |),
                              [
                                Value.StructTuple
                                  "spl_token_2022::error::TokenError::ConfidentialTransferAccountHasBalance"
                                  []
                              ]
                            |)
                          ]
                      |)))
                ]
              |)
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom AssociatedFunction_closable : M.IsAssociatedFunction Self "closable" closable.
      
      (*
          pub fn non_confidential_transfer_allowed(&self) -> ProgramResult {
              if bool::from(&self.allow_non_confidential_credits) {
                  Ok(())
              } else {
                  Err(TokenError::NonConfidentialTransfersDisabled.into())
              }
          }
      *)
      Definition non_confidential_transfer_allowed (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.alloc (| Value.Tuple [] |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ :=
                        M.use
                          (M.alloc (|
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::From",
                                Ty.path "bool",
                                [ Ty.apply (Ty.path "&") [ Ty.path "spl_pod::primitives::PodBool" ]
                                ],
                                "from",
                                []
                              |),
                              [
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                  "allow_non_confidential_credits"
                                |)
                              ]
                            |)
                          |)) in
                      let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                      M.alloc (|
                        Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (M.alloc (|
                        Value.StructTuple
                          "core::result::Result::Err"
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::convert::Into",
                                Ty.path "spl_token_2022::error::TokenError",
                                [ Ty.path "solana_program::program_error::ProgramError" ],
                                "into",
                                []
                              |),
                              [
                                Value.StructTuple
                                  "spl_token_2022::error::TokenError::NonConfidentialTransfersDisabled"
                                  []
                              ]
                            |)
                          ]
                      |)))
                ]
              |)
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom AssociatedFunction_non_confidential_transfer_allowed :
        M.IsAssociatedFunction
          Self
          "non_confidential_transfer_allowed"
          non_confidential_transfer_allowed.
      
      (*
          pub fn valid_as_source(&self) -> ProgramResult {
              self.approved()
          }
      *)
      Definition valid_as_source (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path
                  "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                "approved",
                []
              |),
              [ M.read (| self |) ]
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom AssociatedFunction_valid_as_source :
        M.IsAssociatedFunction Self "valid_as_source" valid_as_source.
      
      (*
          pub fn valid_as_destination(&self) -> ProgramResult {
              self.approved()?;
      
              if !bool::from(self.allow_confidential_credits) {
                  return Err(TokenError::ConfidentialTransferDepositsAndTransfersDisabled.into());
              }
      
              let new_destination_pending_balance_credit_counter =
                  u64::from(self.pending_balance_credit_counter)
                      .checked_add(1)
                      .ok_or(TokenError::Overflow)?;
              if new_destination_pending_balance_credit_counter
                  > u64::from(self.maximum_pending_balance_credit_counter)
              {
                  return Err(TokenError::MaximumPendingBalanceCreditCounterExceeded.into());
              }
      
              Ok(())
          }
      *)
      Definition valid_as_destination (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::try_trait::Try",
                            Ty.apply
                              (Ty.path "core::result::Result")
                              [ Ty.tuple []; Ty.path "solana_program::program_error::ProgramError"
                              ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path
                                  "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                "approved",
                                []
                              |),
                              [ M.read (| self |) ]
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Break",
                                0
                              |) in
                            let residual := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::try_trait::FromResidual",
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          [
                                            Ty.tuple [];
                                            Ty.path "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 (|
                                  UnOp.Pure.not
                                    (M.call_closure (|
                                      M.get_trait_method (|
                                        "core::convert::From",
                                        Ty.path "bool",
                                        [ Ty.path "spl_pod::primitives::PodBool" ],
                                        "from",
                                        []
                                      |),
                                      [
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                            "allow_confidential_credits"
                                          |)
                                        |)
                                      ]
                                    |))
                                |)) 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::ConfidentialTransferDepositsAndTransfersDisabled"
                                              []
                                          ]
                                        |)
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let new_destination_pending_balance_credit_counter :=
                    M.copy (|
                      M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::ops::try_trait::Try",
                              Ty.apply
                                (Ty.path "core::result::Result")
                                [ Ty.path "u64"; Ty.path "spl_token_2022::error::TokenError" ],
                              [],
                              "branch",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply (Ty.path "core::option::Option") [ Ty.path "u64" ],
                                  "ok_or",
                                  [ Ty.path "spl_token_2022::error::TokenError" ]
                                |),
                                [
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.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 (| self |),
                                              "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                              "pending_balance_credit_counter"
                                            |)
                                          |)
                                        ]
                                      |);
                                      Value.Integer 1
                                    ]
                                  |);
                                  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
                  let _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  BinOp.Pure.gt
                                    (M.read (| new_destination_pending_balance_credit_counter |))
                                    (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 (| self |),
                                            "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                            "maximum_pending_balance_credit_counter"
                                          |)
                                        |)
                                      ]
                                    |))
                                |)) 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::MaximumPendingBalanceCreditCounterExceeded"
                                              []
                                          ]
                                        |)
                                      ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
                |)))
            |)))
        | _, _ => M.impossible
        end.
      
      Axiom AssociatedFunction_valid_as_destination :
        M.IsAssociatedFunction Self "valid_as_destination" valid_as_destination.
      
      (*
          pub fn increment_pending_balance_credit_counter(&mut self) -> ProgramResult {
              self.pending_balance_credit_counter = (u64::from(self.pending_balance_credit_counter)
                  .checked_add(1)
                  .ok_or(TokenError::Overflow)?)
              .into();
              Ok(())
          }
      *)
      Definition increment_pending_balance_credit_counter (τ : list Ty.t) (α : list Value.t) : M :=
        match τ, α with
        | [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let _ :=
                    M.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                        "pending_balance_credit_counter"
                      |),
                      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 (| self |),
                                                    "spl_token_2022::extension::confidential_transfer::ConfidentialTransferAccount",
                                                    "pending_balance_credit_counter"
                                                  |)
                                                |)
                                              ]
                                            |);
                                            Value.Integer 1
                                          ]
                                        |);
                                        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.
      
      Axiom AssociatedFunction_increment_pending_balance_credit_counter :
        M.IsAssociatedFunction
          Self
          "increment_pending_balance_credit_counter"
          increment_pending_balance_credit_counter.
    End Impl_spl_token_2022_extension_confidential_transfer_ConfidentialTransferAccount.
  End confidential_transfer.
End extension.
