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

Module ffi.
  Module c_str.
    (* StructRecord
      {
        name := "CString";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("inner",
              Ty.apply
                (Ty.path "alloc::boxed::Box")
                []
                [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ]; Ty.path "alloc::alloc::Global" ])
          ];
      } *)
    
    Module Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (* PartialEq *)
      Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::cmp::PartialEq",
                Ty.apply
                  (Ty.path "alloc::boxed::Box")
                  []
                  [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ]; Ty.path "alloc::alloc::Global"
                  ],
                [
                  Ty.apply
                    (Ty.path "alloc::boxed::Box")
                    []
                    [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ]; Ty.path "alloc::alloc::Global"
                    ]
                ],
                "eq",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::CString",
                  "inner"
                |);
                M.SubPointer.get_struct_record_field (|
                  M.read (| other |),
                  "alloc::ffi::c_str::CString",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_cmp_PartialOrd_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (* PartialOrd *)
      Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::cmp::PartialOrd",
                Ty.apply
                  (Ty.path "alloc::boxed::Box")
                  []
                  [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ]; Ty.path "alloc::alloc::Global"
                  ],
                [
                  Ty.apply
                    (Ty.path "alloc::boxed::Box")
                    []
                    [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ]; Ty.path "alloc::alloc::Global"
                    ]
                ],
                "partial_cmp",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::CString",
                  "inner"
                |);
                M.SubPointer.get_struct_record_field (|
                  M.read (| other |),
                  "alloc::ffi::c_str::CString",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialOrd"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
    End Impl_core_cmp_PartialOrd_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_cmp_Eq_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (* Eq *)
      Definition assert_receiver_is_total_eq
          (ε : list Value.t)
          (τ : 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.alloc (| Value.Tuple [] |))) ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Eq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
    End Impl_core_cmp_Eq_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_cmp_Ord_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (* Ord *)
      Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::cmp::Ord",
                Ty.apply
                  (Ty.path "alloc::boxed::Box")
                  []
                  [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ]; Ty.path "alloc::alloc::Global"
                  ],
                [],
                "cmp",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::CString",
                  "inner"
                |);
                M.SubPointer.get_struct_record_field (|
                  M.read (| other |),
                  "alloc::ffi::c_str::CString",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Ord"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
    End Impl_core_cmp_Ord_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_hash_Hash_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (* Hash *)
      Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __H ], [ self; state ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let state := M.alloc (| state |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::hash::Hash",
                Ty.apply
                  (Ty.path "alloc::boxed::Box")
                  []
                  [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ]; Ty.path "alloc::alloc::Global"
                  ],
                [],
                "hash",
                [ __H ]
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::CString",
                  "inner"
                |);
                M.read (| state |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::hash::Hash"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("hash", InstanceField.Method hash) ].
    End Impl_core_hash_Hash_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_clone_Clone_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (* Clone *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructRecord
              "alloc::ffi::c_str::CString"
              [
                ("inner",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.apply
                        (Ty.path "alloc::boxed::Box")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ],
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "alloc::ffi::c_str::CString",
                        "inner"
                      |)
                    ]
                  |))
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_alloc_ffi_c_str_CString.
    
    (* StructTuple
      {
        name := "NulError";
        const_params := [];
        ty_params := [];
        fields :=
          [
            Ty.path "usize";
            Ty.apply (Ty.path "alloc::vec::Vec") [] [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ]
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_alloc_ffi_c_str_NulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::NulError".
      
      (* Clone *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "alloc::ffi::c_str::NulError"
              [
                M.call_closure (|
                  M.get_trait_method (| "core::clone::Clone", Ty.path "usize", [], "clone", [] |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "alloc::ffi::c_str::NulError",
                      0
                    |)
                  ]
                |);
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      []
                      [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "alloc::ffi::c_str::NulError",
                      1
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_alloc_ffi_c_str_NulError.
    
    Module Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_NulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::NulError".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_NulError.
    
    Module Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_NulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::NulError".
      
      (* PartialEq *)
      Definition eq (ε : list Value.t) (τ : 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 (|
              BinOp.eq (|
                M.read (|
                  M.SubPointer.get_struct_tuple_field (|
                    M.read (| self |),
                    "alloc::ffi::c_str::NulError",
                    0
                  |)
                |),
                M.read (|
                  M.SubPointer.get_struct_tuple_field (|
                    M.read (| other |),
                    "alloc::ffi::c_str::NulError",
                    0
                  |)
                |)
              |),
              ltac:(M.monadic
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      []
                      [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                    [
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ]
                    ],
                    "eq",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "alloc::ffi::c_str::NulError",
                      1
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| other |),
                      "alloc::ffi::c_str::NulError",
                      1
                    |)
                  ]
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_NulError.
    
    Module Impl_core_cmp_Eq_for_alloc_ffi_c_str_NulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::NulError".
      
      (* Eq *)
      Definition assert_receiver_is_total_eq
          (ε : list Value.t)
          (τ : 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.alloc (| Value.Tuple [] |))) ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Eq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
    End Impl_core_cmp_Eq_for_alloc_ffi_c_str_NulError.
    
    Module Impl_core_fmt_Debug_for_alloc_ffi_c_str_NulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::NulError".
      
      (* Debug *)
      Definition fmt (ε : list Value.t) (τ : 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_tuple_field2_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "NulError" |);
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::NulError",
                  0
                |);
                M.alloc (|
                  M.SubPointer.get_struct_tuple_field (|
                    M.read (| self |),
                    "alloc::ffi::c_str::NulError",
                    1
                  |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_alloc_ffi_c_str_NulError.
    
    (*
    Enum FromBytesWithNulErrorKind
    {
      const_params := [];
      ty_params := [];
      variants :=
        [
          {
            name := "InteriorNul";
            item := StructTuple [ Ty.path "usize" ];
            discriminant := None;
          };
          {
            name := "NotNulTerminated";
            item := StructTuple [];
            discriminant := None;
          }
        ];
    }
    *)
    
    Module Impl_core_clone_Clone_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind".
      
      (* Clone *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                self,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "alloc::ffi::c_str::FromBytesWithNulErrorKind::InteriorNul",
                          0
                        |) in
                      let __self_0 := M.alloc (| γ1_0 |) in
                      M.alloc (|
                        Value.StructTuple
                          "alloc::ffi::c_str::FromBytesWithNulErrorKind::InteriorNul"
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::clone::Clone",
                                Ty.path "usize",
                                [],
                                "clone",
                                []
                              |),
                              [ M.read (| __self_0 |) ]
                            |)
                          ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "alloc::ffi::c_str::FromBytesWithNulErrorKind::NotNulTerminated"
                        |) in
                      M.alloc (|
                        Value.StructTuple
                          "alloc::ffi::c_str::FromBytesWithNulErrorKind::NotNulTerminated"
                          []
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
    
    Module Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
    
    Module Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind".
      
      (* PartialEq *)
      Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.read (|
              let~ __self_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind" ]
                    |),
                    [ M.read (| self |) ]
                  |)
                |) in
              let~ __arg1_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind" ]
                    |),
                    [ M.read (| other |) ]
                  |)
                |) in
              M.alloc (|
                LogicalOp.and (|
                  BinOp.eq (| M.read (| __self_discr |), M.read (| __arg1_discr |) |),
                  ltac:(M.monadic
                    (M.read (|
                      M.match_operator (|
                        M.alloc (| Value.Tuple [ M.read (| self |); M.read (| other |) ] |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                              let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                              let γ0_0 := M.read (| γ0_0 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_0,
                                  "alloc::ffi::c_str::FromBytesWithNulErrorKind::InteriorNul",
                                  0
                                |) in
                              let __self_0 := M.alloc (| γ2_0 |) in
                              let γ0_1 := M.read (| γ0_1 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_1,
                                  "alloc::ffi::c_str::FromBytesWithNulErrorKind::InteriorNul",
                                  0
                                |) in
                              let __arg1_0 := M.alloc (| γ2_0 |) in
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::PartialEq",
                                    Ty.apply (Ty.path "&") [] [ Ty.path "usize" ],
                                    [ Ty.apply (Ty.path "&") [] [ Ty.path "usize" ] ],
                                    "eq",
                                    []
                                  |),
                                  [ __self_0; __arg1_0 ]
                                |)
                              |)));
                          fun γ => ltac:(M.monadic (M.alloc (| Value.Bool true |)))
                        ]
                      |)
                    |)))
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
    
    Module Impl_core_cmp_Eq_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind".
      
      (* Eq *)
      Definition assert_receiver_is_total_eq
          (ε : list Value.t)
          (τ : 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.alloc (| Value.Tuple [] |))) ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Eq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
    End Impl_core_cmp_Eq_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
    
    Module Impl_core_fmt_Debug_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind".
      
      (* Debug *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.read (|
              M.match_operator (|
                self,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "alloc::ffi::c_str::FromBytesWithNulErrorKind::InteriorNul",
                          0
                        |) in
                      let __self_0 := M.alloc (| γ1_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::Formatter",
                            "debug_tuple_field1_finish",
                            []
                          |),
                          [ M.read (| f |); M.read (| Value.String "InteriorNul" |); __self_0 ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "alloc::ffi::c_str::FromBytesWithNulErrorKind::NotNulTerminated"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::Formatter",
                            "write_str",
                            []
                          |),
                          [ M.read (| f |); M.read (| Value.String "NotNulTerminated" |) ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_alloc_ffi_c_str_FromBytesWithNulErrorKind.
    
    (* StructRecord
      {
        name := "FromVecWithNulError";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("error_kind", Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind");
            ("bytes",
              Ty.apply
                (Ty.path "alloc::vec::Vec")
                []
                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ])
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_alloc_ffi_c_str_FromVecWithNulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromVecWithNulError".
      
      (* Clone *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructRecord
              "alloc::ffi::c_str::FromVecWithNulError"
              [
                ("error_kind",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind",
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "alloc::ffi::c_str::FromVecWithNulError",
                        "error_kind"
                      |)
                    ]
                  |));
                ("bytes",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "alloc::ffi::c_str::FromVecWithNulError",
                        "bytes"
                      |)
                    ]
                  |))
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_alloc_ffi_c_str_FromVecWithNulError.
    
    Module Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_FromVecWithNulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromVecWithNulError".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_FromVecWithNulError.
    
    Module Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_FromVecWithNulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromVecWithNulError".
      
      (* PartialEq *)
      Definition eq (ε : list Value.t) (τ : 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 (|
              M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind",
                  [ Ty.path "alloc::ffi::c_str::FromBytesWithNulErrorKind" ],
                  "eq",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "alloc::ffi::c_str::FromVecWithNulError",
                    "error_kind"
                  |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| other |),
                    "alloc::ffi::c_str::FromVecWithNulError",
                    "error_kind"
                  |)
                ]
              |),
              ltac:(M.monadic
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.apply
                      (Ty.path "alloc::vec::Vec")
                      []
                      [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                    [
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ]
                    ],
                    "eq",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "alloc::ffi::c_str::FromVecWithNulError",
                      "bytes"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "alloc::ffi::c_str::FromVecWithNulError",
                      "bytes"
                    |)
                  ]
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_FromVecWithNulError.
    
    Module Impl_core_cmp_Eq_for_alloc_ffi_c_str_FromVecWithNulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromVecWithNulError".
      
      (* Eq *)
      Definition assert_receiver_is_total_eq
          (ε : list Value.t)
          (τ : 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.alloc (| Value.Tuple [] |))) ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Eq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
    End Impl_core_cmp_Eq_for_alloc_ffi_c_str_FromVecWithNulError.
    
    Module Impl_core_fmt_Debug_for_alloc_ffi_c_str_FromVecWithNulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromVecWithNulError".
      
      (* Debug *)
      Definition fmt (ε : list Value.t) (τ : 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_field2_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "FromVecWithNulError" |);
                M.read (| Value.String "error_kind" |);
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::FromVecWithNulError",
                  "error_kind"
                |);
                M.read (| Value.String "bytes" |);
                M.alloc (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "alloc::ffi::c_str::FromVecWithNulError",
                    "bytes"
                  |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_alloc_ffi_c_str_FromVecWithNulError.
    
    Module Impl_alloc_ffi_c_str_FromVecWithNulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromVecWithNulError".
      
      (*
          pub fn as_bytes(&self) -> &[u8] {
              &self.bytes[..]
          }
      *)
      Definition as_bytes (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::ops::index::Index",
                Ty.apply
                  (Ty.path "alloc::vec::Vec")
                  []
                  [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                [ Ty.path "core::ops::range::RangeFull" ],
                "index",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::FromVecWithNulError",
                  "bytes"
                |);
                Value.StructTuple "core::ops::range::RangeFull" []
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_as_bytes : M.IsAssociatedFunction Self "as_bytes" as_bytes.
      
      (*
          pub fn into_bytes(self) -> Vec<u8> {
              self.bytes
          }
      *)
      Definition into_bytes (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_record_field (|
                self,
                "alloc::ffi::c_str::FromVecWithNulError",
                "bytes"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_bytes : M.IsAssociatedFunction Self "into_bytes" into_bytes.
    End Impl_alloc_ffi_c_str_FromVecWithNulError.
    
    (* StructRecord
      {
        name := "IntoStringError";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("inner", Ty.path "alloc::ffi::c_str::CString");
            ("error", Ty.path "core::str::error::Utf8Error")
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_alloc_ffi_c_str_IntoStringError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::IntoStringError".
      
      (* Clone *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructRecord
              "alloc::ffi::c_str::IntoStringError"
              [
                ("inner",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.path "alloc::ffi::c_str::CString",
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "alloc::ffi::c_str::IntoStringError",
                        "inner"
                      |)
                    ]
                  |));
                ("error",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.path "core::str::error::Utf8Error",
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "alloc::ffi::c_str::IntoStringError",
                        "error"
                      |)
                    ]
                  |))
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_alloc_ffi_c_str_IntoStringError.
    
    Module Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_IntoStringError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::IntoStringError".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_alloc_ffi_c_str_IntoStringError.
    
    Module Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_IntoStringError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::IntoStringError".
      
      (* PartialEq *)
      Definition eq (ε : list Value.t) (τ : 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 (|
              M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "alloc::ffi::c_str::CString",
                  [ Ty.path "alloc::ffi::c_str::CString" ],
                  "eq",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "alloc::ffi::c_str::IntoStringError",
                    "inner"
                  |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| other |),
                    "alloc::ffi::c_str::IntoStringError",
                    "inner"
                  |)
                ]
              |),
              ltac:(M.monadic
                (M.call_closure (|
                  M.get_trait_method (|
                    "core::cmp::PartialEq",
                    Ty.path "core::str::error::Utf8Error",
                    [ Ty.path "core::str::error::Utf8Error" ],
                    "eq",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "alloc::ffi::c_str::IntoStringError",
                      "error"
                    |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "alloc::ffi::c_str::IntoStringError",
                      "error"
                    |)
                  ]
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_alloc_ffi_c_str_IntoStringError.
    
    Module Impl_core_cmp_Eq_for_alloc_ffi_c_str_IntoStringError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::IntoStringError".
      
      (* Eq *)
      Definition assert_receiver_is_total_eq
          (ε : list Value.t)
          (τ : 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.alloc (| Value.Tuple [] |))) ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Eq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
    End Impl_core_cmp_Eq_for_alloc_ffi_c_str_IntoStringError.
    
    Module Impl_core_fmt_Debug_for_alloc_ffi_c_str_IntoStringError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::IntoStringError".
      
      (* Debug *)
      Definition fmt (ε : list Value.t) (τ : 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_field2_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "IntoStringError" |);
                M.read (| Value.String "inner" |);
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::IntoStringError",
                  "inner"
                |);
                M.read (| Value.String "error" |);
                M.alloc (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "alloc::ffi::c_str::IntoStringError",
                    "error"
                  |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_alloc_ffi_c_str_IntoStringError.
    
    Module Impl_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          pub fn new<T: Into<Vec<u8>>>(t: T) -> Result<CString, NulError> {
              trait SpecNewImpl {
                  fn spec_new_impl(self) -> Result<CString, NulError>;
              }
      
              impl<T: Into<Vec<u8>>> SpecNewImpl for T {
                  default fn spec_new_impl(self) -> Result<CString, NulError> {
                      let bytes: Vec<u8> = self.into();
                      match memchr::memchr(0, &bytes) {
                          Some(i) => Err(NulError(i, bytes)),
                          None => Ok(unsafe { CString::_from_vec_unchecked(bytes) }),
                      }
                  }
              }
      
              // Specialization for avoiding reallocation
              #[inline(always)] // Without that it is not inlined into specializations
              fn spec_new_impl_bytes(bytes: &[u8]) -> Result<CString, NulError> {
                  // We cannot have such large slice that we would overflow here
                  // but using `checked_add` allows LLVM to assume that capacity never overflows
                  // and generate twice shorter code.
                  // `saturating_add` doesn't help for some reason.
                  let capacity = bytes.len().checked_add(1).unwrap();
      
                  // Allocate before validation to avoid duplication of allocation code.
                  // We still need to allocate and copy memory even if we get an error.
                  let mut buffer = Vec::with_capacity(capacity);
                  buffer.extend(bytes);
      
                  // Check memory of self instead of new buffer.
                  // This allows better optimizations if lto enabled.
                  match memchr::memchr(0, bytes) {
                      Some(i) => Err(NulError(i, buffer)),
                      None => Ok(unsafe { CString::_from_vec_unchecked(buffer) }),
                  }
              }
      
              impl SpecNewImpl for &'_ [u8] {
                  fn spec_new_impl(self) -> Result<CString, NulError> {
                      spec_new_impl_bytes(self)
                  }
              }
      
              impl SpecNewImpl for &'_ str {
                  fn spec_new_impl(self) -> Result<CString, NulError> {
                      spec_new_impl_bytes(self.as_bytes())
                  }
              }
      
              impl SpecNewImpl for &'_ mut [u8] {
                  fn spec_new_impl(self) -> Result<CString, NulError> {
                      spec_new_impl_bytes(self)
                  }
              }
      
              t.spec_new_impl()
          }
      *)
      Definition new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ T ], [ t ] =>
          ltac:(M.monadic
            (let t := M.alloc (| t |) in
            M.call_closure (|
              M.get_trait_method (|
                "alloc::ffi::c_str::new::SpecNewImpl",
                T,
                [],
                "spec_new_impl",
                []
              |),
              [ M.read (| t |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
      
      (*
          pub unsafe fn from_vec_unchecked(v: Vec<u8>) -> Self {
              debug_assert!(memchr::memchr(0, &v).is_none());
              unsafe { Self::_from_vec_unchecked(v) }
          }
      *)
      Definition from_vec_unchecked (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ v ] =>
          ltac:(M.monadic
            (let v := M.alloc (| v |) in
            M.read (|
              let~ _ :=
                M.match_operator (|
                  M.alloc (| Value.Tuple [] |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.use (M.alloc (| Value.Bool true |)) in
                        let _ :=
                          M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                        let~ _ :=
                          M.match_operator (|
                            M.alloc (| Value.Tuple [] |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ :=
                                    M.use
                                      (M.alloc (|
                                        UnOp.not (|
                                          M.call_closure (|
                                            M.get_associated_function (|
                                              Ty.apply
                                                (Ty.path "core::option::Option")
                                                []
                                                [ Ty.path "usize" ],
                                              "is_none",
                                              []
                                            |),
                                            [
                                              M.alloc (|
                                                M.call_closure (|
                                                  M.get_function (|
                                                    "core::slice::memchr::memchr",
                                                    []
                                                  |),
                                                  [
                                                    Value.Integer IntegerKind.U8 0;
                                                    M.call_closure (|
                                                      M.get_trait_method (|
                                                        "core::ops::deref::Deref",
                                                        Ty.apply
                                                          (Ty.path "alloc::vec::Vec")
                                                          []
                                                          [
                                                            Ty.path "u8";
                                                            Ty.path "alloc::alloc::Global"
                                                          ],
                                                        [],
                                                        "deref",
                                                        []
                                                      |),
                                                      [ v ]
                                                    |)
                                                  ]
                                                |)
                                              |)
                                            ]
                                          |)
                                        |)
                                      |)) in
                                  let _ :=
                                    M.is_constant_or_break_match (|
                                      M.read (| γ |),
                                      Value.Bool true
                                    |) in
                                  M.alloc (|
                                    M.never_to_any (|
                                      M.call_closure (|
                                        M.get_function (| "core::panicking::panic", [] |),
                                        [
                                          M.read (|
                                            Value.String
                                              "assertion failed: memchr::memchr(0, &v).is_none()"
                                          |)
                                        ]
                                      |)
                                    |)
                                  |)));
                              fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                            ]
                          |) in
                        M.alloc (| Value.Tuple [] |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                  ]
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "alloc::ffi::c_str::CString",
                    "_from_vec_unchecked",
                    []
                  |),
                  [ M.read (| v |) ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_from_vec_unchecked :
        M.IsAssociatedFunction Self "from_vec_unchecked" from_vec_unchecked.
      
      (*
          unsafe fn _from_vec_unchecked(mut v: Vec<u8>) -> Self {
              v.reserve_exact(1);
              v.push(0);
              Self { inner: v.into_boxed_slice() }
          }
      *)
      Definition _from_vec_unchecked (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ v ] =>
          ltac:(M.monadic
            (let v := M.alloc (| v |) in
            M.read (|
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                      "reserve_exact",
                      []
                    |),
                    [ v; Value.Integer IntegerKind.Usize 1 ]
                  |)
                |) in
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                      "push",
                      []
                    |),
                    [ v; Value.Integer IntegerKind.U8 0 ]
                  |)
                |) in
              M.alloc (|
                Value.StructRecord
                  "alloc::ffi::c_str::CString"
                  [
                    ("inner",
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            []
                            [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                          "into_boxed_slice",
                          []
                        |),
                        [ M.read (| v |) ]
                      |))
                  ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction__from_vec_unchecked :
        M.IsAssociatedFunction Self "_from_vec_unchecked" _from_vec_unchecked.
      
      (*
          pub unsafe fn from_raw(ptr: *mut c_char) -> CString {
              // SAFETY: This is called with a pointer that was obtained from a call
              // to `CString::into_raw` and the length has not been modified. As such,
              // we know there is a NUL byte (and only one) at the end and that the
              // information about the size of the allocation is correct on Rust's
              // side.
              unsafe {
                  extern "C" {
                      /// Provided by libc or compiler_builtins.
                      fn strlen(s: *const c_char) -> usize;
                  }
                  let len = strlen(ptr) + 1; // Including the NUL byte
                  let slice = slice::from_raw_parts_mut(ptr, len);
                  CString { inner: Box::from_raw(slice as *mut [c_char] as *mut [u8]) }
              }
          }
      *)
      Definition from_raw (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ ptr ] =>
          ltac:(M.monadic
            (let ptr := M.alloc (| ptr |) in
            M.read (|
              let~ len :=
                M.alloc (|
                  BinOp.Wrap.add (|
                    M.call_closure (|
                      M.get_function (| "alloc::ffi::c_str::from_raw::strlen", [] |),
                      [ (* MutToConstPointer *) M.pointer_coercion (M.read (| ptr |)) ]
                    |),
                    Value.Integer IntegerKind.Usize 1
                  |)
                |) in
              let~ slice :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (| "core::slice::raw::from_raw_parts_mut", [ Ty.path "i8" ] |),
                    [ M.read (| ptr |); M.read (| len |) ]
                  |)
                |) in
              M.alloc (|
                Value.StructRecord
                  "alloc::ffi::c_str::CString"
                  [
                    ("inner",
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "from_raw",
                          []
                        |),
                        [ M.rust_cast (M.read (| M.use (M.alloc (| M.read (| slice |) |)) |)) ]
                      |))
                  ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_from_raw : M.IsAssociatedFunction Self "from_raw" from_raw.
      
      (*
          pub fn into_raw(self) -> *mut c_char {
              Box::into_raw(self.into_inner()) as *mut c_char
          }
      *)
      Definition into_raw (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.rust_cast
              (M.call_closure (|
                M.get_associated_function (|
                  Ty.apply
                    (Ty.path "alloc::boxed::Box")
                    []
                    [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ]; Ty.path "alloc::alloc::Global"
                    ],
                  "into_raw",
                  []
                |),
                [
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "alloc::ffi::c_str::CString",
                      "into_inner",
                      []
                    |),
                    [ M.read (| self |) ]
                  |)
                ]
              |))))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_raw : M.IsAssociatedFunction Self "into_raw" into_raw.
      
      (*
          pub fn into_string(self) -> Result<String, IntoStringError> {
              String::from_utf8(self.into_bytes()).map_err(|e| IntoStringError {
                  error: e.utf8_error(),
                  inner: unsafe { Self::_from_vec_unchecked(e.into_bytes()) },
              })
          }
      *)
      Definition into_string (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply
                  (Ty.path "core::result::Result")
                  []
                  [ Ty.path "alloc::string::String"; Ty.path "alloc::string::FromUtf8Error" ],
                "map_err",
                [
                  Ty.path "alloc::ffi::c_str::IntoStringError";
                  Ty.function
                    [ Ty.tuple [ Ty.path "alloc::string::FromUtf8Error" ] ]
                    (Ty.path "alloc::ffi::c_str::IntoStringError")
                ]
              |),
              [
                M.call_closure (|
                  M.get_associated_function (| Ty.path "alloc::string::String", "from_utf8", [] |),
                  [
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "alloc::ffi::c_str::CString",
                        "into_bytes",
                        []
                      |),
                      [ M.read (| self |) ]
                    |)
                  ]
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let e := M.copy (| γ |) in
                                  Value.StructRecord
                                    "alloc::ffi::c_str::IntoStringError"
                                    [
                                      ("error",
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "alloc::string::FromUtf8Error",
                                            "utf8_error",
                                            []
                                          |),
                                          [ e ]
                                        |));
                                      ("inner",
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "alloc::ffi::c_str::CString",
                                            "_from_vec_unchecked",
                                            []
                                          |),
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "alloc::string::FromUtf8Error",
                                                "into_bytes",
                                                []
                                              |),
                                              [ M.read (| e |) ]
                                            |)
                                          ]
                                        |))
                                    ]))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_string : M.IsAssociatedFunction Self "into_string" into_string.
      
      (*
          pub fn into_bytes(self) -> Vec<u8> {
              let mut vec = into_vec(self.into_inner());
              let _nul = vec.pop();
              debug_assert_eq!(_nul, Some(0u8));
              vec
          }
      *)
      Definition into_bytes (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ vec :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "alloc::slice::hack::into_vec",
                      [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ]
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "alloc::ffi::c_str::CString",
                          "into_inner",
                          []
                        |),
                        [ M.read (| self |) ]
                      |)
                    ]
                  |)
                |) in
              let~ _nul :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                      "pop",
                      []
                    |),
                    [ vec ]
                  |)
                |) in
              let~ _ :=
                M.match_operator (|
                  M.alloc (| Value.Tuple [] |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.use (M.alloc (| Value.Bool true |)) in
                        let _ :=
                          M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                        let~ _ :=
                          M.match_operator (|
                            M.alloc (|
                              Value.Tuple
                                [
                                  _nul;
                                  M.alloc (|
                                    Value.StructTuple
                                      "core::option::Option::Some"
                                      [ Value.Integer IntegerKind.U8 0 ]
                                  |)
                                ]
                            |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                  let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                  let left_val := M.copy (| γ0_0 |) in
                                  let right_val := M.copy (| γ0_1 |) in
                                  M.match_operator (|
                                    M.alloc (| Value.Tuple [] |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let γ :=
                                            M.use
                                              (M.alloc (|
                                                UnOp.not (|
                                                  M.call_closure (|
                                                    M.get_trait_method (|
                                                      "core::cmp::PartialEq",
                                                      Ty.apply
                                                        (Ty.path "core::option::Option")
                                                        []
                                                        [ Ty.path "u8" ],
                                                      [
                                                        Ty.apply
                                                          (Ty.path "core::option::Option")
                                                          []
                                                          [ Ty.path "u8" ]
                                                      ],
                                                      "eq",
                                                      []
                                                    |),
                                                    [ M.read (| left_val |); M.read (| right_val |)
                                                    ]
                                                  |)
                                                |)
                                              |)) in
                                          let _ :=
                                            M.is_constant_or_break_match (|
                                              M.read (| γ |),
                                              Value.Bool true
                                            |) in
                                          M.alloc (|
                                            M.never_to_any (|
                                              M.read (|
                                                let~ kind :=
                                                  M.alloc (|
                                                    Value.StructTuple
                                                      "core::panicking::AssertKind::Eq"
                                                      []
                                                  |) in
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_function (|
                                                      "core::panicking::assert_failed",
                                                      [
                                                        Ty.apply
                                                          (Ty.path "core::option::Option")
                                                          []
                                                          [ Ty.path "u8" ];
                                                        Ty.apply
                                                          (Ty.path "core::option::Option")
                                                          []
                                                          [ Ty.path "u8" ]
                                                      ]
                                                    |),
                                                    [
                                                      M.read (| kind |);
                                                      M.read (| left_val |);
                                                      M.read (| right_val |);
                                                      Value.StructTuple
                                                        "core::option::Option::None"
                                                        []
                                                    ]
                                                  |)
                                                |)
                                              |)
                                            |)
                                          |)));
                                      fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                    ]
                                  |)))
                            ]
                          |) in
                        M.alloc (| Value.Tuple [] |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                  ]
                |) in
              vec
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_bytes : M.IsAssociatedFunction Self "into_bytes" into_bytes.
      
      (*
          pub fn into_bytes_with_nul(self) -> Vec<u8> {
              into_vec(self.into_inner())
          }
      *)
      Definition into_bytes_with_nul (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_function (|
                "alloc::slice::hack::into_vec",
                [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ]
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "alloc::ffi::c_str::CString",
                    "into_inner",
                    []
                  |),
                  [ M.read (| self |) ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_bytes_with_nul :
        M.IsAssociatedFunction Self "into_bytes_with_nul" into_bytes_with_nul.
      
      (*
          pub fn as_bytes(&self) -> &[u8] {
              // SAFETY: CString has a length at least 1
              unsafe { self.inner.get_unchecked(..self.inner.len() - 1) }
          }
      *)
      Definition as_bytes (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ],
                "get_unchecked",
                [ Ty.apply (Ty.path "core::ops::range::RangeTo") [] [ Ty.path "usize" ] ]
              |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "alloc::ffi::c_str::CString",
                    "inner"
                  |)
                |);
                Value.StructRecord
                  "core::ops::range::RangeTo"
                  [
                    ("end_",
                      BinOp.Wrap.sub (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ],
                            "len",
                            []
                          |),
                          [
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "alloc::ffi::c_str::CString",
                                "inner"
                              |)
                            |)
                          ]
                        |),
                        Value.Integer IntegerKind.Usize 1
                      |))
                  ]
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_as_bytes : M.IsAssociatedFunction Self "as_bytes" as_bytes.
      
      (*
          pub fn as_bytes_with_nul(&self) -> &[u8] {
              &self.inner
          }
      *)
      Definition as_bytes_with_nul (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "alloc::ffi::c_str::CString",
                "inner"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_as_bytes_with_nul :
        M.IsAssociatedFunction Self "as_bytes_with_nul" as_bytes_with_nul.
      
      (*
          pub fn as_c_str(&self) -> &CStr {
              &*self
          }
      *)
      Definition as_c_str (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::ops::deref::Deref",
                Ty.path "alloc::ffi::c_str::CString",
                [],
                "deref",
                []
              |),
              [ M.read (| self |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_as_c_str : M.IsAssociatedFunction Self "as_c_str" as_c_str.
      
      (*
          pub fn into_boxed_c_str(self) -> Box<CStr> {
              unsafe { Box::from_raw(Box::into_raw(self.into_inner()) as *mut CStr) }
          }
      *)
      Definition into_boxed_c_str (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply
                  (Ty.path "alloc::boxed::Box")
                  []
                  [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                "from_raw",
                []
              |),
              [
                M.rust_cast
                  (M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::boxed::Box")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ],
                      "into_raw",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "alloc::ffi::c_str::CString",
                          "into_inner",
                          []
                        |),
                        [ M.read (| self |) ]
                      |)
                    ]
                  |))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_boxed_c_str :
        M.IsAssociatedFunction Self "into_boxed_c_str" into_boxed_c_str.
      
      (*
          fn into_inner(self) -> Box<[u8]> {
              // Rationale: `mem::forget(self)` invalidates the previous call to `ptr::read(&self.inner)`
              // so we use `ManuallyDrop` to ensure `self` is not dropped.
              // Then we can return the box directly without invalidating it.
              // See https://github.com/rust-lang/rust/issues/62553.
              let this = mem::ManuallyDrop::new(self);
              unsafe { ptr::read(&this.inner) }
          }
      *)
      Definition into_inner (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ this :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::mem::manually_drop::ManuallyDrop")
                        []
                        [ Ty.path "alloc::ffi::c_str::CString" ],
                      "new",
                      []
                    |),
                    [ M.read (| self |) ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_function (|
                    "core::ptr::read",
                    [
                      Ty.apply
                        (Ty.path "alloc::boxed::Box")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ]
                    ]
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::deref::Deref",
                          Ty.apply
                            (Ty.path "core::mem::manually_drop::ManuallyDrop")
                            []
                            [ Ty.path "alloc::ffi::c_str::CString" ],
                          [],
                          "deref",
                          []
                        |),
                        [ this ]
                      |),
                      "alloc::ffi::c_str::CString",
                      "inner"
                    |)
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_inner : M.IsAssociatedFunction Self "into_inner" into_inner.
      
      (*
          pub unsafe fn from_vec_with_nul_unchecked(v: Vec<u8>) -> Self {
              debug_assert!(memchr::memchr(0, &v).unwrap() + 1 == v.len());
              unsafe { Self::_from_vec_with_nul_unchecked(v) }
          }
      *)
      Definition from_vec_with_nul_unchecked
          (ε : list Value.t)
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        match ε, τ, α with
        | [], [], [ v ] =>
          ltac:(M.monadic
            (let v := M.alloc (| v |) in
            M.read (|
              let~ _ :=
                M.match_operator (|
                  M.alloc (| Value.Tuple [] |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ := M.use (M.alloc (| Value.Bool true |)) in
                        let _ :=
                          M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                        let~ _ :=
                          M.match_operator (|
                            M.alloc (| Value.Tuple [] |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ :=
                                    M.use
                                      (M.alloc (|
                                        UnOp.not (|
                                          BinOp.eq (|
                                            BinOp.Wrap.add (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.apply
                                                    (Ty.path "core::option::Option")
                                                    []
                                                    [ Ty.path "usize" ],
                                                  "unwrap",
                                                  []
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_function (|
                                                      "core::slice::memchr::memchr",
                                                      []
                                                    |),
                                                    [
                                                      Value.Integer IntegerKind.U8 0;
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::ops::deref::Deref",
                                                          Ty.apply
                                                            (Ty.path "alloc::vec::Vec")
                                                            []
                                                            [
                                                              Ty.path "u8";
                                                              Ty.path "alloc::alloc::Global"
                                                            ],
                                                          [],
                                                          "deref",
                                                          []
                                                        |),
                                                        [ v ]
                                                      |)
                                                    ]
                                                  |)
                                                ]
                                              |),
                                              Value.Integer IntegerKind.Usize 1
                                            |),
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.apply
                                                  (Ty.path "alloc::vec::Vec")
                                                  []
                                                  [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                                                "len",
                                                []
                                              |),
                                              [ v ]
                                            |)
                                          |)
                                        |)
                                      |)) in
                                  let _ :=
                                    M.is_constant_or_break_match (|
                                      M.read (| γ |),
                                      Value.Bool true
                                    |) in
                                  M.alloc (|
                                    M.never_to_any (|
                                      M.call_closure (|
                                        M.get_function (| "core::panicking::panic", [] |),
                                        [
                                          M.read (|
                                            Value.String
                                              "assertion failed: memchr::memchr(0, &v).unwrap() + 1 == v.len()"
                                          |)
                                        ]
                                      |)
                                    |)
                                  |)));
                              fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                            ]
                          |) in
                        M.alloc (| Value.Tuple [] |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                  ]
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "alloc::ffi::c_str::CString",
                    "_from_vec_with_nul_unchecked",
                    []
                  |),
                  [ M.read (| v |) ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_from_vec_with_nul_unchecked :
        M.IsAssociatedFunction Self "from_vec_with_nul_unchecked" from_vec_with_nul_unchecked.
      
      (*
          unsafe fn _from_vec_with_nul_unchecked(v: Vec<u8>) -> Self {
              Self { inner: v.into_boxed_slice() }
          }
      *)
      Definition _from_vec_with_nul_unchecked
          (ε : list Value.t)
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        match ε, τ, α with
        | [], [], [ v ] =>
          ltac:(M.monadic
            (let v := M.alloc (| v |) in
            Value.StructRecord
              "alloc::ffi::c_str::CString"
              [
                ("inner",
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                      "into_boxed_slice",
                      []
                    |),
                    [ M.read (| v |) ]
                  |))
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction__from_vec_with_nul_unchecked :
        M.IsAssociatedFunction Self "_from_vec_with_nul_unchecked" _from_vec_with_nul_unchecked.
      
      (*
          pub fn from_vec_with_nul(v: Vec<u8>) -> Result<Self, FromVecWithNulError> {
              let nul_pos = memchr::memchr(0, &v);
              match nul_pos {
                  Some(nul_pos) if nul_pos + 1 == v.len() => {
                      // SAFETY: We know there is only one nul byte, at the end
                      // of the vec.
                      Ok(unsafe { Self::_from_vec_with_nul_unchecked(v) })
                  }
                  Some(nul_pos) => Err(FromVecWithNulError {
                      error_kind: FromBytesWithNulErrorKind::InteriorNul(nul_pos),
                      bytes: v,
                  }),
                  None => Err(FromVecWithNulError {
                      error_kind: FromBytesWithNulErrorKind::NotNulTerminated,
                      bytes: v,
                  }),
              }
          }
      *)
      Definition from_vec_with_nul (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ v ] =>
          ltac:(M.monadic
            (let v := M.alloc (| v |) in
            M.read (|
              let~ nul_pos :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (| "core::slice::memchr::memchr", [] |),
                    [
                      Value.Integer IntegerKind.U8 0;
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::ops::deref::Deref",
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            []
                            [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                          [],
                          "deref",
                          []
                        |),
                        [ v ]
                      |)
                    ]
                  |)
                |) in
              M.match_operator (|
                nul_pos,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::option::Option::Some",
                          0
                        |) in
                      let nul_pos := M.copy (| γ0_0 |) in
                      let γ :=
                        M.alloc (|
                          BinOp.eq (|
                            BinOp.Wrap.add (|
                              M.read (| nul_pos |),
                              Value.Integer IntegerKind.Usize 1
                            |),
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                                "len",
                                []
                              |),
                              [ v ]
                            |)
                          |)
                        |) in
                      let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                      M.alloc (|
                        Value.StructTuple
                          "core::result::Result::Ok"
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "alloc::ffi::c_str::CString",
                                "_from_vec_with_nul_unchecked",
                                []
                              |),
                              [ M.read (| v |) ]
                            |)
                          ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::option::Option::Some",
                          0
                        |) in
                      let nul_pos := M.copy (| γ0_0 |) in
                      M.alloc (|
                        Value.StructTuple
                          "core::result::Result::Err"
                          [
                            Value.StructRecord
                              "alloc::ffi::c_str::FromVecWithNulError"
                              [
                                ("error_kind",
                                  Value.StructTuple
                                    "alloc::ffi::c_str::FromBytesWithNulErrorKind::InteriorNul"
                                    [ M.read (| nul_pos |) ]);
                                ("bytes", M.read (| v |))
                              ]
                          ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ := M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                      M.alloc (|
                        Value.StructTuple
                          "core::result::Result::Err"
                          [
                            Value.StructRecord
                              "alloc::ffi::c_str::FromVecWithNulError"
                              [
                                ("error_kind",
                                  Value.StructTuple
                                    "alloc::ffi::c_str::FromBytesWithNulErrorKind::NotNulTerminated"
                                    []);
                                ("bytes", M.read (| v |))
                              ]
                          ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_from_vec_with_nul :
        M.IsAssociatedFunction Self "from_vec_with_nul" from_vec_with_nul.
    End Impl_alloc_ffi_c_str_CString.
    
    Module Impl_core_ops_drop_Drop_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn drop(&mut self) {
              unsafe {
                  *self.inner.get_unchecked_mut(0) = 0;
              }
          }
      *)
      Definition drop (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ],
                      "get_unchecked_mut",
                      [ Ty.path "usize" ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "alloc::ffi::c_str::CString",
                          "inner"
                        |)
                      |);
                      Value.Integer IntegerKind.Usize 0
                    ]
                  |),
                  Value.Integer IntegerKind.U8 0
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::ops::drop::Drop"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("drop", InstanceField.Method drop) ].
    End Impl_core_ops_drop_Drop_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_ops_deref_Deref_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*     type Target = CStr; *)
      Definition _Target : Ty.t := Ty.path "core::ffi::c_str::CStr".
      
      (*
          fn deref(&self) -> &CStr {
              unsafe { CStr::from_bytes_with_nul_unchecked(self.as_bytes_with_nul()) }
          }
      *)
      Definition deref (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::ffi::c_str::CStr",
                "from_bytes_with_nul_unchecked",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "alloc::ffi::c_str::CString",
                    "as_bytes_with_nul",
                    []
                  |),
                  [ M.read (| self |) ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::ops::deref::Deref"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Target", InstanceField.Ty _Target); ("deref", InstanceField.Method deref) ].
    End Impl_core_ops_deref_Deref_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_fmt_Debug_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              fmt::Debug::fmt(&**self, f)
          }
      *)
      Definition fmt (ε : list Value.t) (τ : 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_trait_method (|
                "core::fmt::Debug",
                Ty.path "core::ffi::c_str::CStr",
                [],
                "fmt",
                []
              |),
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::ops::deref::Deref",
                    Ty.path "alloc::ffi::c_str::CString",
                    [],
                    "deref",
                    []
                  |),
                  [ M.read (| self |) ]
                |);
                M.read (| f |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_vec_Vec_u8_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply (Ty.path "alloc::vec::Vec") [] [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn from(s: CString) -> Vec<u8> {
              s.into_bytes()
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "alloc::ffi::c_str::CString",
                "into_bytes",
                []
              |),
              [ M.read (| s |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *) [ (* T *) Ty.path "alloc::ffi::c_str::CString" ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_vec_Vec_u8_alloc_alloc_Global.
    
    Module Impl_core_default_Default_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn default() -> CString {
              let a: &CStr = Default::default();
              a.to_owned()
          }
      *)
      Definition default (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [] =>
          ltac:(M.monadic
            (M.read (|
              let~ a :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ],
                      [],
                      "default",
                      []
                    |),
                    []
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "alloc::borrow::ToOwned",
                    Ty.path "core::ffi::c_str::CStr",
                    [],
                    "to_owned",
                    []
                  |),
                  [ M.read (| a |) ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::default::Default"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("default", InstanceField.Method default) ].
    End Impl_core_default_Default_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_borrow_Borrow_core_ffi_c_str_CStr_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn borrow(&self) -> &CStr {
              self
          }
      *)
      Definition borrow (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::ops::deref::Deref",
                Ty.path "alloc::ffi::c_str::CString",
                [],
                "deref",
                []
              |),
              [ M.read (| self |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::borrow::Borrow"
          Self
          (* Trait polymorphic types *) [ (* Borrowed *) Ty.path "core::ffi::c_str::CStr" ]
          (* Instance *) [ ("borrow", InstanceField.Method borrow) ].
    End Impl_core_borrow_Borrow_core_ffi_c_str_CStr_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_convert_From_alloc_borrow_Cow_core_ffi_c_str_CStr_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn from(s: Cow<'a, CStr>) -> Self {
              s.into_owned()
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "alloc::borrow::Cow") [] [ Ty.path "core::ffi::c_str::CStr" ],
                "into_owned",
                []
              |),
              [ M.read (| s |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [ (* T *) Ty.apply (Ty.path "alloc::borrow::Cow") [] [ Ty.path "core::ffi::c_str::CStr" ]
          ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_borrow_Cow_core_ffi_c_str_CStr_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::boxed::Box")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn from(s: &CStr) -> Box<CStr> {
              let boxed: Box<[u8]> = Box::from(s.to_bytes_with_nul());
              unsafe { Box::from_raw(Box::into_raw(boxed) as *mut CStr) }
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.read (|
              let~ boxed :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::From",
                      Ty.apply
                        (Ty.path "alloc::boxed::Box")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ],
                      [ Ty.apply (Ty.path "&") [] [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ] ]
                      ],
                      "from",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::ffi::c_str::CStr",
                          "to_bytes_with_nul",
                          []
                        |),
                        [ M.read (| s |) ]
                      |)
                    ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::boxed::Box")
                      []
                      [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                    "from_raw",
                    []
                  |),
                  [
                    M.rust_cast
                      (M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "into_raw",
                          []
                        |),
                        [ M.read (| boxed |) ]
                      |))
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [ (* T *) Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ] ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_convert_From_alloc_borrow_Cow_core_ffi_c_str_CStr_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::boxed::Box")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn from(cow: Cow<'_, CStr>) -> Box<CStr> {
              match cow {
                  Cow::Borrowed(s) => Box::from(s),
                  Cow::Owned(s) => Box::from(s),
              }
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ cow ] =>
          ltac:(M.monadic
            (let cow := M.alloc (| cow |) in
            M.read (|
              M.match_operator (|
                cow,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "alloc::borrow::Cow::Borrowed",
                          0
                        |) in
                      let s := M.copy (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::convert::From",
                            Ty.apply
                              (Ty.path "alloc::boxed::Box")
                              []
                              [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                            [ Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ] ],
                            "from",
                            []
                          |),
                          [ M.read (| s |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "alloc::borrow::Cow::Owned",
                          0
                        |) in
                      let s := M.copy (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::convert::From",
                            Ty.apply
                              (Ty.path "alloc::boxed::Box")
                              []
                              [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                            [ Ty.path "alloc::ffi::c_str::CString" ],
                            "from",
                            []
                          |),
                          [ M.read (| s |) ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [ (* T *) Ty.apply (Ty.path "alloc::borrow::Cow") [] [ Ty.path "core::ffi::c_str::CStr" ]
          ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_borrow_Cow_core_ffi_c_str_CStr_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_convert_From_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn from(s: Box<CStr>) -> CString {
              let raw = Box::into_raw(s) as *mut [u8];
              CString { inner: unsafe { Box::from_raw(raw) } }
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.read (|
              let~ raw :=
                M.alloc (|
                  M.rust_cast
                    (M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply
                          (Ty.path "alloc::boxed::Box")
                          []
                          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                        "into_raw",
                        []
                      |),
                      [ M.read (| s |) ]
                    |))
                |) in
              M.alloc (|
                Value.StructRecord
                  "alloc::ffi::c_str::CString"
                  [
                    ("inner",
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "from_raw",
                          []
                        |),
                        [ M.read (| raw |) ]
                      |))
                  ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [
            (* T *)
            Ty.apply
              (Ty.path "alloc::boxed::Box")
              []
              [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ]
          ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_convert_From_alloc_vec_Vec_core_num_nonzero_NonZero_u8_alloc_alloc_Global_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn from(v: Vec<NonZero<u8>>) -> CString {
              unsafe {
                  // Transmute `Vec<NonZero<u8>>` to `Vec<u8>`.
                  let v: Vec<u8> = {
                      // SAFETY:
                      //   - transmuting between `NonZero<u8>` and `u8` is sound;
                      //   - `alloc::Layout<NonZero<u8>> == alloc::Layout<u8>`.
                      let (ptr, len, cap): ( *mut NonZero<u8>, _, _) = Vec::into_raw_parts(v);
                      Vec::from_raw_parts(ptr.cast::<u8>(), len, cap)
                  };
                  // SAFETY: `v` cannot contain nul bytes, given the type-level
                  // invariant of `NonZero<u8>`.
                  Self::_from_vec_unchecked(v)
              }
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ v ] =>
          ltac:(M.monadic
            (let v := M.alloc (| v |) in
            M.read (|
              let~ v :=
                M.copy (|
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::vec::Vec")
                            []
                            [
                              Ty.apply (Ty.path "core::num::nonzero::NonZero") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "into_raw_parts",
                          []
                        |),
                        [ M.read (| v |) ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                          let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                          let γ0_2 := M.SubPointer.get_tuple_field (| γ, 2 |) in
                          let ptr := M.copy (| γ0_0 |) in
                          let len := M.copy (| γ0_1 |) in
                          let cap := M.copy (| γ0_2 |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "alloc::vec::Vec")
                                  []
                                  [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                                "from_raw_parts",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "*mut")
                                      []
                                      [
                                        Ty.apply
                                          (Ty.path "core::num::nonzero::NonZero")
                                          []
                                          [ Ty.path "u8" ]
                                      ],
                                    "cast",
                                    [ Ty.path "u8" ]
                                  |),
                                  [ M.read (| ptr |) ]
                                |);
                                M.read (| len |);
                                M.read (| cap |)
                              ]
                            |)
                          |)))
                    ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "alloc::ffi::c_str::CString",
                    "_from_vec_unchecked",
                    []
                  |),
                  [ M.read (| v |) ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [
            (* T *)
            Ty.apply
              (Ty.path "alloc::vec::Vec")
              []
              [
                Ty.apply (Ty.path "core::num::nonzero::NonZero") [] [ Ty.path "u8" ];
                Ty.path "alloc::alloc::Global"
              ]
          ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_vec_Vec_core_num_nonzero_NonZero_u8_alloc_alloc_Global_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_clone_Clone_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::boxed::Box")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn clone(&self) -> Self {
              ( **self).into()
          }
      *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::convert::Into",
                Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ],
                [
                  Ty.apply
                    (Ty.path "alloc::boxed::Box")
                    []
                    [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ]
                ],
                "into",
                []
              |),
              [ M.read (| M.read (| self |) |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::boxed::Box")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn from(s: CString) -> Box<CStr> {
              s.into_boxed_c_str()
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "alloc::ffi::c_str::CString",
                "into_boxed_c_str",
                []
              |),
              [ M.read (| s |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *) [ (* T *) Ty.path "alloc::ffi::c_str::CString" ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_borrow_Cow_core_ffi_c_str_CStr.
      Definition Self : Ty.t :=
        Ty.apply (Ty.path "alloc::borrow::Cow") [] [ Ty.path "core::ffi::c_str::CStr" ].
      
      (*
          fn from(s: CString) -> Cow<'a, CStr> {
              Cow::Owned(s)
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            Value.StructTuple "alloc::borrow::Cow::Owned" [ M.read (| s |) ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *) [ (* T *) Ty.path "alloc::ffi::c_str::CString" ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_borrow_Cow_core_ffi_c_str_CStr.
    
    Module Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_borrow_Cow_core_ffi_c_str_CStr.
      Definition Self : Ty.t :=
        Ty.apply (Ty.path "alloc::borrow::Cow") [] [ Ty.path "core::ffi::c_str::CStr" ].
      
      (*
          fn from(s: &'a CStr) -> Cow<'a, CStr> {
              Cow::Borrowed(s)
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            Value.StructTuple "alloc::borrow::Cow::Borrowed" [ M.read (| s |) ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [ (* T *) Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ] ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_borrow_Cow_core_ffi_c_str_CStr.
    
    Module Impl_core_convert_From_ref__alloc_ffi_c_str_CString_for_alloc_borrow_Cow_core_ffi_c_str_CStr.
      Definition Self : Ty.t :=
        Ty.apply (Ty.path "alloc::borrow::Cow") [] [ Ty.path "core::ffi::c_str::CStr" ].
      
      (*
          fn from(s: &'a CString) -> Cow<'a, CStr> {
              Cow::Borrowed(s.as_c_str())
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            Value.StructTuple
              "alloc::borrow::Cow::Borrowed"
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "alloc::ffi::c_str::CString",
                    "as_c_str",
                    []
                  |),
                  [ M.read (| s |) ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [ (* T *) Ty.apply (Ty.path "&") [] [ Ty.path "alloc::ffi::c_str::CString" ] ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_ref__alloc_ffi_c_str_CString_for_alloc_borrow_Cow_core_ffi_c_str_CStr.
    
    Module Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_sync_Arc_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::sync::Arc")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn from(s: CString) -> Arc<CStr> {
              let arc: Arc<[u8]> = Arc::from(s.into_inner());
              unsafe { Arc::from_raw(Arc::into_raw(arc) as *const CStr) }
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.read (|
              let~ arc :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::From",
                      Ty.apply
                        (Ty.path "alloc::sync::Arc")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ],
                      [
                        Ty.apply
                          (Ty.path "alloc::boxed::Box")
                          []
                          [
                            Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                            Ty.path "alloc::alloc::Global"
                          ]
                      ],
                      "from",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "alloc::ffi::c_str::CString",
                          "into_inner",
                          []
                        |),
                        [ M.read (| s |) ]
                      |)
                    ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::sync::Arc")
                      []
                      [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                    "from_raw",
                    []
                  |),
                  [
                    M.rust_cast
                      (M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::sync::Arc")
                            []
                            [
                              Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "into_raw",
                          []
                        |),
                        [ M.read (| arc |) ]
                      |))
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *) [ (* T *) Ty.path "alloc::ffi::c_str::CString" ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_sync_Arc_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_sync_Arc_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::sync::Arc")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn from(s: &CStr) -> Arc<CStr> {
              let arc: Arc<[u8]> = Arc::from(s.to_bytes_with_nul());
              unsafe { Arc::from_raw(Arc::into_raw(arc) as *const CStr) }
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.read (|
              let~ arc :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::From",
                      Ty.apply
                        (Ty.path "alloc::sync::Arc")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ],
                      [ Ty.apply (Ty.path "&") [] [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ] ]
                      ],
                      "from",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::ffi::c_str::CStr",
                          "to_bytes_with_nul",
                          []
                        |),
                        [ M.read (| s |) ]
                      |)
                    ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::sync::Arc")
                      []
                      [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                    "from_raw",
                    []
                  |),
                  [
                    M.rust_cast
                      (M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::sync::Arc")
                            []
                            [
                              Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "into_raw",
                          []
                        |),
                        [ M.read (| arc |) ]
                      |))
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [ (* T *) Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ] ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_sync_Arc_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_rc_Rc_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::rc::Rc")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn from(s: CString) -> Rc<CStr> {
              let rc: Rc<[u8]> = Rc::from(s.into_inner());
              unsafe { Rc::from_raw(Rc::into_raw(rc) as *const CStr) }
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.read (|
              let~ rc :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::From",
                      Ty.apply
                        (Ty.path "alloc::rc::Rc")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ],
                      [
                        Ty.apply
                          (Ty.path "alloc::boxed::Box")
                          []
                          [
                            Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                            Ty.path "alloc::alloc::Global"
                          ]
                      ],
                      "from",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "alloc::ffi::c_str::CString",
                          "into_inner",
                          []
                        |),
                        [ M.read (| s |) ]
                      |)
                    ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::rc::Rc")
                      []
                      [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                    "from_raw",
                    []
                  |),
                  [
                    M.rust_cast
                      (M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::rc::Rc")
                            []
                            [
                              Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "into_raw",
                          []
                        |),
                        [ M.read (| rc |) ]
                      |))
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *) [ (* T *) Ty.path "alloc::ffi::c_str::CString" ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_alloc_ffi_c_str_CString_for_alloc_rc_Rc_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_rc_Rc_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::rc::Rc")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn from(s: &CStr) -> Rc<CStr> {
              let rc: Rc<[u8]> = Rc::from(s.to_bytes_with_nul());
              unsafe { Rc::from_raw(Rc::into_raw(rc) as *const CStr) }
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.read (|
              let~ rc :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::From",
                      Ty.apply
                        (Ty.path "alloc::rc::Rc")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ],
                      [ Ty.apply (Ty.path "&") [] [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ] ]
                      ],
                      "from",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::ffi::c_str::CStr",
                          "to_bytes_with_nul",
                          []
                        |),
                        [ M.read (| s |) ]
                      |)
                    ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::rc::Rc")
                      []
                      [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                    "from_raw",
                    []
                  |),
                  [
                    M.rust_cast
                      (M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::rc::Rc")
                            []
                            [
                              Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "into_raw",
                          []
                        |),
                        [ M.read (| rc |) ]
                      |))
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [ (* T *) Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ] ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_rc_Rc_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_default_Default_for_alloc_rc_Rc_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::rc::Rc")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn default() -> Self {
              let c_str: &CStr = Default::default();
              Rc::from(c_str)
          }
      *)
      Definition default (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [] =>
          ltac:(M.monadic
            (M.read (|
              let~ c_str :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::default::Default",
                      Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ],
                      [],
                      "default",
                      []
                    |),
                    []
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (|
                    "core::convert::From",
                    Ty.apply
                      (Ty.path "alloc::rc::Rc")
                      []
                      [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                    [ Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ] ],
                    "from",
                    []
                  |),
                  [ M.read (| c_str |) ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::default::Default"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("default", InstanceField.Method default) ].
    End Impl_core_default_Default_for_alloc_rc_Rc_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_core_default_Default_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
      Definition Self : Ty.t :=
        Ty.apply
          (Ty.path "alloc::boxed::Box")
          []
          [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ].
      
      (*
          fn default() -> Box<CStr> {
              let boxed: Box<[u8]> = Box::from([0]);
              unsafe { Box::from_raw(Box::into_raw(boxed) as *mut CStr) }
          }
      *)
      Definition default (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [] =>
          ltac:(M.monadic
            (M.read (|
              let~ boxed :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::From",
                      Ty.apply
                        (Ty.path "alloc::boxed::Box")
                        []
                        [
                          Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                          Ty.path "alloc::alloc::Global"
                        ],
                      [
                        Ty.apply
                          (Ty.path "array")
                          [ Value.Integer IntegerKind.Usize 1 ]
                          [ Ty.path "u8" ]
                      ],
                      "from",
                      []
                    |),
                    [ Value.Array [ Value.Integer IntegerKind.U8 0 ] ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "alloc::boxed::Box")
                      []
                      [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ],
                    "from_raw",
                    []
                  |),
                  [
                    M.rust_cast
                      (M.call_closure (|
                        M.get_associated_function (|
                          Ty.apply
                            (Ty.path "alloc::boxed::Box")
                            []
                            [
                              Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                              Ty.path "alloc::alloc::Global"
                            ],
                          "into_raw",
                          []
                        |),
                        [ M.read (| boxed |) ]
                      |))
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::default::Default"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("default", InstanceField.Method default) ].
    End Impl_core_default_Default_for_alloc_boxed_Box_core_ffi_c_str_CStr_alloc_alloc_Global.
    
    Module Impl_alloc_ffi_c_str_NulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::NulError".
      
      (*
          pub fn nul_position(&self) -> usize {
              self.0
          }
      *)
      Definition nul_position (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_tuple_field (|
                M.read (| self |),
                "alloc::ffi::c_str::NulError",
                0
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_nul_position :
        M.IsAssociatedFunction Self "nul_position" nul_position.
      
      (*
          pub fn into_vec(self) -> Vec<u8> {
              self.1
          }
      *)
      Definition into_vec (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_tuple_field (| self, "alloc::ffi::c_str::NulError", 1 |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_vec : M.IsAssociatedFunction Self "into_vec" into_vec.
    End Impl_alloc_ffi_c_str_NulError.
    
    Module Impl_core_fmt_Display_for_alloc_ffi_c_str_NulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::NulError".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              write!(f, "nul byte found in provided data at position: {}", self.0)
          }
      *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.call_closure (|
              M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_fmt", [] |),
              [
                M.read (| f |);
                M.call_closure (|
                  M.get_associated_function (| Ty.path "core::fmt::Arguments", "new_v1", [] |),
                  [
                    M.alloc (|
                      Value.Array
                        [ M.read (| Value.String "nul byte found in provided data at position: " |)
                        ]
                    |);
                    M.alloc (|
                      Value.Array
                        [
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::rt::Argument",
                              "new_display",
                              [ Ty.path "usize" ]
                            |),
                            [
                              M.SubPointer.get_struct_tuple_field (|
                                M.read (| self |),
                                "alloc::ffi::c_str::NulError",
                                0
                              |)
                            ]
                          |)
                        ]
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Display"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Display_for_alloc_ffi_c_str_NulError.
    
    Module Impl_core_fmt_Display_for_alloc_ffi_c_str_FromVecWithNulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromVecWithNulError".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              match self.error_kind {
                  FromBytesWithNulErrorKind::InteriorNul(pos) => {
                      write!(f, "data provided contains an interior nul byte at pos {pos}")
                  }
                  FromBytesWithNulErrorKind::NotNulTerminated => {
                      write!(f, "data provided is not nul terminated")
                  }
              }
          }
      *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.read (|
              M.match_operator (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::FromVecWithNulError",
                  "error_kind"
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "alloc::ffi::c_str::FromBytesWithNulErrorKind::InteriorNul",
                          0
                        |) in
                      let pos := M.copy (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::Formatter",
                            "write_fmt",
                            []
                          |),
                          [
                            M.read (| f |);
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "core::fmt::Arguments",
                                "new_v1",
                                []
                              |),
                              [
                                M.alloc (|
                                  Value.Array
                                    [
                                      M.read (|
                                        Value.String
                                          "data provided contains an interior nul byte at pos "
                                      |)
                                    ]
                                |);
                                M.alloc (|
                                  Value.Array
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "core::fmt::rt::Argument",
                                          "new_display",
                                          [ Ty.path "usize" ]
                                        |),
                                        [ pos ]
                                      |)
                                    ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_struct_tuple (|
                          γ,
                          "alloc::ffi::c_str::FromBytesWithNulErrorKind::NotNulTerminated"
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::Formatter",
                            "write_fmt",
                            []
                          |),
                          [
                            M.read (| f |);
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "core::fmt::Arguments",
                                "new_const",
                                []
                              |),
                              [
                                M.alloc (|
                                  Value.Array
                                    [
                                      M.read (|
                                        Value.String "data provided is not nul terminated"
                                      |)
                                    ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Display"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Display_for_alloc_ffi_c_str_FromVecWithNulError.
    
    Module Impl_alloc_ffi_c_str_IntoStringError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::IntoStringError".
      
      (*
          pub fn into_cstring(self) -> CString {
              self.inner
          }
      *)
      Definition into_cstring (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_record_field (|
                self,
                "alloc::ffi::c_str::IntoStringError",
                "inner"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_cstring :
        M.IsAssociatedFunction Self "into_cstring" into_cstring.
      
      (*
          pub fn utf8_error(&self) -> Utf8Error {
              self.error
          }
      *)
      Definition utf8_error (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "alloc::ffi::c_str::IntoStringError",
                "error"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_utf8_error : M.IsAssociatedFunction Self "utf8_error" utf8_error.
      (*
          fn description(&self) -> &str {
              "C string contained non-utf8 bytes"
          }
      *)
      Definition description (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (| Value.String "C string contained non-utf8 bytes" |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_description : M.IsAssociatedFunction Self "description" description.
    End Impl_alloc_ffi_c_str_IntoStringError.
    
    
    Module Impl_core_fmt_Display_for_alloc_ffi_c_str_IntoStringError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::IntoStringError".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              self.description().fmt(f)
          }
      *)
      Definition fmt (ε : list Value.t) (τ : 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_trait_method (| "core::fmt::Display", Ty.path "str", [], "fmt", [] |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "alloc::ffi::c_str::IntoStringError",
                    "description",
                    []
                  |),
                  [ M.read (| self |) ]
                |);
                M.read (| f |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Display"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Display_for_alloc_ffi_c_str_IntoStringError.
    
    Module Impl_alloc_borrow_ToOwned_for_core_ffi_c_str_CStr.
      Definition Self : Ty.t := Ty.path "core::ffi::c_str::CStr".
      
      (*     type Owned = CString; *)
      Definition _Owned : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn to_owned(&self) -> CString {
              CString { inner: self.to_bytes_with_nul().into() }
          }
      *)
      Definition to_owned (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructRecord
              "alloc::ffi::c_str::CString"
              [
                ("inner",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::convert::Into",
                      Ty.apply (Ty.path "&") [] [ Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ] ],
                      [
                        Ty.apply
                          (Ty.path "alloc::boxed::Box")
                          []
                          [
                            Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                            Ty.path "alloc::alloc::Global"
                          ]
                      ],
                      "into",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::ffi::c_str::CStr",
                          "to_bytes_with_nul",
                          []
                        |),
                        [ M.read (| self |) ]
                      |)
                    ]
                  |))
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn clone_into(&self, target: &mut CString) {
              let mut b = into_vec(mem::take(&mut target.inner));
              self.to_bytes_with_nul().clone_into(&mut b);
              target.inner = b.into_boxed_slice();
          }
      *)
      Definition clone_into (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; target ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let target := M.alloc (| target |) in
            M.read (|
              let~ b :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "alloc::slice::hack::into_vec",
                      [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ]
                    |),
                    [
                      M.call_closure (|
                        M.get_function (|
                          "core::mem::take",
                          [
                            Ty.apply
                              (Ty.path "alloc::boxed::Box")
                              []
                              [
                                Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ];
                                Ty.path "alloc::alloc::Global"
                              ]
                          ]
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| target |),
                            "alloc::ffi::c_str::CString",
                            "inner"
                          |)
                        ]
                      |)
                    ]
                  |)
                |) in
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "alloc::borrow::ToOwned",
                      Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ],
                      [],
                      "clone_into",
                      []
                    |),
                    [
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::ffi::c_str::CStr",
                          "to_bytes_with_nul",
                          []
                        |),
                        [ M.read (| self |) ]
                      |);
                      b
                    ]
                  |)
                |) in
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| target |),
                    "alloc::ffi::c_str::CString",
                    "inner"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "alloc::vec::Vec")
                        []
                        [ Ty.path "u8"; Ty.path "alloc::alloc::Global" ],
                      "into_boxed_slice",
                      []
                    |),
                    [ M.read (| b |) ]
                  |)
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "alloc::borrow::ToOwned"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Owned", InstanceField.Ty _Owned);
            ("to_owned", InstanceField.Method to_owned);
            ("clone_into", InstanceField.Method clone_into)
          ].
    End Impl_alloc_borrow_ToOwned_for_core_ffi_c_str_CStr.
    
    Module Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn from(s: &CStr) -> CString {
              s.to_owned()
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ s ] =>
          ltac:(M.monadic
            (let s := M.alloc (| s |) in
            M.call_closure (|
              M.get_trait_method (|
                "alloc::borrow::ToOwned",
                Ty.path "core::ffi::c_str::CStr",
                [],
                "to_owned",
                []
              |),
              [ M.read (| s |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *)
          [ (* T *) Ty.apply (Ty.path "&") [] [ Ty.path "core::ffi::c_str::CStr" ] ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_ref__core_ffi_c_str_CStr_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_ops_index_Index_core_ops_range_RangeFull_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*     type Output = CStr; *)
      Definition _Output : Ty.t := Ty.path "core::ffi::c_str::CStr".
      
      (*
          fn index(&self, _index: ops::RangeFull) -> &CStr {
              self
          }
      *)
      Definition index (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; _index ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let _index := M.alloc (| _index |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::ops::deref::Deref",
                Ty.path "alloc::ffi::c_str::CString",
                [],
                "deref",
                []
              |),
              [ M.read (| self |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::ops::index::Index"
          Self
          (* Trait polymorphic types *) [ (* Idx *) Ty.path "core::ops::range::RangeFull" ]
          (* Instance *)
          [ ("Output", InstanceField.Ty _Output); ("index", InstanceField.Method index) ].
    End Impl_core_ops_index_Index_core_ops_range_RangeFull_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_convert_AsRef_core_ffi_c_str_CStr_for_alloc_ffi_c_str_CString.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::CString".
      
      (*
          fn as_ref(&self) -> &CStr {
              self
          }
      *)
      Definition as_ref (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::ops::deref::Deref",
                Ty.path "alloc::ffi::c_str::CString",
                [],
                "deref",
                []
              |),
              [ M.read (| self |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::AsRef"
          Self
          (* Trait polymorphic types *) [ (* T *) Ty.path "core::ffi::c_str::CStr" ]
          (* Instance *) [ ("as_ref", InstanceField.Method as_ref) ].
    End Impl_core_convert_AsRef_core_ffi_c_str_CStr_for_alloc_ffi_c_str_CString.
    
    Module Impl_core_ffi_c_str_CStr.
      Definition Self : Ty.t := Ty.path "core::ffi::c_str::CStr".
      
      (*
          pub fn to_string_lossy(&self) -> Cow<'_, str> {
              String::from_utf8_lossy(self.to_bytes())
          }
      *)
      Definition to_string_lossy (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "alloc::string::String",
                "from_utf8_lossy",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (| Ty.path "core::ffi::c_str::CStr", "to_bytes", [] |),
                  [ M.read (| self |) ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_to_string_lossy :
        M.IsAssociatedFunction Self "to_string_lossy" to_string_lossy.
      
      (*
          pub fn into_c_string(self: Box<Self>) -> CString {
              CString::from(self)
          }
      *)
      Definition into_c_string (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::convert::From",
                Ty.path "alloc::ffi::c_str::CString",
                [
                  Ty.apply
                    (Ty.path "alloc::boxed::Box")
                    []
                    [ Ty.path "core::ffi::c_str::CStr"; Ty.path "alloc::alloc::Global" ]
                ],
                "from",
                []
              |),
              [ M.read (| self |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_into_c_string :
        M.IsAssociatedFunction Self "into_c_string" into_c_string.
    End Impl_core_ffi_c_str_CStr.
    
    Module Impl_core_error_Error_for_alloc_ffi_c_str_NulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::NulError".
      
      (*
          fn description(&self) -> &str {
              "nul byte found in data"
          }
      *)
      Definition description (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (| Value.String "nul byte found in data" |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::error::Error"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("description", InstanceField.Method description) ].
    End Impl_core_error_Error_for_alloc_ffi_c_str_NulError.
    
    Module Impl_core_error_Error_for_alloc_ffi_c_str_FromVecWithNulError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::FromVecWithNulError".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::error::Error"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_error_Error_for_alloc_ffi_c_str_FromVecWithNulError.
    
    Module Impl_core_error_Error_for_alloc_ffi_c_str_IntoStringError.
      Definition Self : Ty.t := Ty.path "alloc::ffi::c_str::IntoStringError".
      
      (*
          fn description(&self) -> &str {
              "C string contained non-utf8 bytes"
          }
      *)
      Definition description (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (| Value.String "C string contained non-utf8 bytes" |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
              Some(&self.error)
          }
      *)
      Definition source (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::option::Option::Some"
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "alloc::ffi::c_str::IntoStringError",
                  "error"
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::error::Error"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("description", InstanceField.Method description);
            ("source", InstanceField.Method source)
          ].
    End Impl_core_error_Error_for_alloc_ffi_c_str_IntoStringError.
  End c_str.
End ffi.
