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

Module str.
  Module iter.
    (* StructRecord
      {
        name := "Chars";
        const_params := [];
        ty_params := [];
        fields := [ ("iter", Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ]) ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_Chars.
      Definition Self : Ty.t := Ty.path "core::str::iter::Chars".
      
      (* 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
              "core::str::iter::Chars"
              [
                ("iter",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ],
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::Chars",
                        "iter"
                      |)
                    ]
                  |))
              ]))
        | _, _, _ => 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_core_str_iter_Chars.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_Chars.
      Definition Self : Ty.t := Ty.path "core::str::iter::Chars".
      
      (*     type Item = char; *)
      Definition _Item : Ty.t := Ty.path "char".
      
      (*
          fn next(&mut self) -> Option<char> {
              // SAFETY: `str` invariant says `self.iter` is a valid UTF-8 string and
              // the resulting `ch` is a valid Unicode Scalar Value.
              unsafe { next_code_point(&mut self.iter).map(|ch| char::from_u32_unchecked(ch)) }
          }
      *)
      Definition next (ε : 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::option::Option") [] [ Ty.path "u32" ],
                "map",
                [ Ty.path "char"; Ty.function [ Ty.tuple [ Ty.path "u32" ] ] (Ty.path "char") ]
              |),
              [
                M.call_closure (|
                  M.get_function (|
                    "core::str::validations::next_code_point",
                    [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ]
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::str::iter::Chars",
                      "iter"
                    |)
                  ]
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let ch := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "char",
                                      "from_u32_unchecked",
                                      []
                                    |),
                                    [ M.read (| ch |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn count(self) -> usize {
              super::count::count_chars(self.as_str())
          }
      *)
      Definition count (ε : 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 (| "core::str::count::count_chars", [] |),
              [
                M.call_closure (|
                  M.get_associated_function (| Ty.path "core::str::iter::Chars", "as_str", [] |),
                  [ self ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn advance_by(&mut self, mut remainder: usize) -> Result<(), NonZero<usize>> {
              const CHUNK_SIZE: usize = 32;
      
              if remainder >= CHUNK_SIZE {
                  let mut chunks = self.iter.as_slice().array_chunks::<CHUNK_SIZE>();
                  let mut bytes_skipped: usize = 0;
      
                  while remainder > CHUNK_SIZE
                      && let Some(chunk) = chunks.next()
                  {
                      bytes_skipped += CHUNK_SIZE;
      
                      let mut start_bytes = [false; CHUNK_SIZE];
      
                      for i in 0..CHUNK_SIZE {
                          start_bytes[i] = !super::validations::utf8_is_cont_byte(chunk[i]);
                      }
      
                      remainder -= start_bytes.into_iter().map(|i| i as u8).sum::<u8>() as usize;
                  }
      
                  // SAFETY: The amount of bytes exists since we just iterated over them,
                  // so advance_by will succeed.
                  unsafe { self.iter.advance_by(bytes_skipped).unwrap_unchecked() };
      
                  // skip trailing continuation bytes
                  while self.iter.len() > 0 {
                      let b = self.iter.as_slice()[0];
                      if !super::validations::utf8_is_cont_byte(b) {
                          break;
                      }
                      // SAFETY: We just peeked at the byte, therefore it exists
                      unsafe { self.iter.advance_by(1).unwrap_unchecked() };
                  }
              }
      
              while (remainder > 0) && (self.iter.len() > 0) {
                  remainder -= 1;
                  let b = self.iter.as_slice()[0];
                  let slurp = super::validations::utf8_char_width(b);
                  // SAFETY: utf8 validity requires that the string must contain
                  // the continuation bytes (if any)
                  unsafe { self.iter.advance_by(slurp).unwrap_unchecked() };
              }
      
              NonZero::new(remainder).map_or(Ok(()), Err)
          }
      *)
      Definition advance_by (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; remainder ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let remainder := M.alloc (| remainder |) in
            M.read (|
              let~ _ :=
                M.match_operator (|
                  M.alloc (| Value.Tuple [] |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ :=
                          M.use
                            (M.alloc (|
                              BinOp.ge (|
                                M.read (| remainder |),
                                M.read (|
                                  M.get_constant (| "core::str::iter::advance_by::CHUNK_SIZE" |)
                                |)
                              |)
                            |)) in
                        let _ :=
                          M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                        let~ chunks :=
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply (Ty.path "slice") [] [ Ty.path "u8" ],
                                "array_chunks",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      []
                                      [ Ty.path "u8" ],
                                    "as_slice",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "core::str::iter::Chars",
                                      "iter"
                                    |)
                                  ]
                                |)
                              ]
                            |)
                          |) in
                        let~ bytes_skipped := M.alloc (| Value.Integer IntegerKind.Usize 0 |) in
                        let~ _ :=
                          M.loop (|
                            ltac:(M.monadic
                              (M.match_operator (|
                                M.alloc (| Value.Tuple [] |),
                                [
                                  fun γ =>
                                    ltac:(M.monadic
                                      (let γ :=
                                        M.use
                                          (M.alloc (|
                                            BinOp.gt (|
                                              M.read (| remainder |),
                                              M.read (|
                                                M.get_constant (|
                                                  "core::str::iter::advance_by::CHUNK_SIZE"
                                                |)
                                              |)
                                            |)
                                          |)) in
                                      let _ :=
                                        M.is_constant_or_break_match (|
                                          M.read (| γ |),
                                          Value.Bool true
                                        |) in
                                      let γ :=
                                        M.alloc (|
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::iter::traits::iterator::Iterator",
                                              Ty.apply
                                                (Ty.path "core::slice::iter::ArrayChunks")
                                                [ Value.Integer IntegerKind.Usize 32 ]
                                                [ Ty.path "u8" ],
                                              [],
                                              "next",
                                              []
                                            |),
                                            [ chunks ]
                                          |)
                                        |) in
                                      let γ0_0 :=
                                        M.SubPointer.get_struct_tuple_field (|
                                          γ,
                                          "core::option::Option::Some",
                                          0
                                        |) in
                                      let chunk := M.copy (| γ0_0 |) in
                                      let~ _ :=
                                        let β := bytes_skipped in
                                        M.write (|
                                          β,
                                          BinOp.Wrap.add (|
                                            M.read (| β |),
                                            M.read (|
                                              M.get_constant (|
                                                "core::str::iter::advance_by::CHUNK_SIZE"
                                              |)
                                            |)
                                          |)
                                        |) in
                                      let~ start_bytes :=
                                        M.alloc (|
                                          repeat (|
                                            Value.Bool false,
                                            Value.Integer IntegerKind.Usize 32
                                          |)
                                        |) in
                                      let~ _ :=
                                        M.use
                                          (M.match_operator (|
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::iter::traits::collect::IntoIterator",
                                                  Ty.apply
                                                    (Ty.path "core::ops::range::Range")
                                                    []
                                                    [ Ty.path "usize" ],
                                                  [],
                                                  "into_iter",
                                                  []
                                                |),
                                                [
                                                  Value.StructRecord
                                                    "core::ops::range::Range"
                                                    [
                                                      ("start", Value.Integer IntegerKind.Usize 0);
                                                      ("end_",
                                                        M.read (|
                                                          M.get_constant (|
                                                            "core::str::iter::advance_by::CHUNK_SIZE"
                                                          |)
                                                        |))
                                                    ]
                                                ]
                                              |)
                                            |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let iter := M.copy (| γ |) in
                                                  M.loop (|
                                                    ltac:(M.monadic
                                                      (let~ _ :=
                                                        M.match_operator (|
                                                          M.alloc (|
                                                            M.call_closure (|
                                                              M.get_trait_method (|
                                                                "core::iter::traits::iterator::Iterator",
                                                                Ty.apply
                                                                  (Ty.path
                                                                    "core::ops::range::Range")
                                                                  []
                                                                  [ Ty.path "usize" ],
                                                                [],
                                                                "next",
                                                                []
                                                              |),
                                                              [ iter ]
                                                            |)
                                                          |),
                                                          [
                                                            fun γ =>
                                                              ltac:(M.monadic
                                                                (let _ :=
                                                                  M.is_struct_tuple (|
                                                                    γ,
                                                                    "core::option::Option::None"
                                                                  |) in
                                                                M.alloc (|
                                                                  M.never_to_any (|
                                                                    M.read (| M.break (||) |)
                                                                  |)
                                                                |)));
                                                            fun γ =>
                                                              ltac:(M.monadic
                                                                (let γ0_0 :=
                                                                  M.SubPointer.get_struct_tuple_field (|
                                                                    γ,
                                                                    "core::option::Option::Some",
                                                                    0
                                                                  |) in
                                                                let i := M.copy (| γ0_0 |) in
                                                                let~ _ :=
                                                                  M.write (|
                                                                    M.SubPointer.get_array_field (|
                                                                      start_bytes,
                                                                      i
                                                                    |),
                                                                    UnOp.not (|
                                                                      M.call_closure (|
                                                                        M.get_function (|
                                                                          "core::str::validations::utf8_is_cont_byte",
                                                                          []
                                                                        |),
                                                                        [
                                                                          M.read (|
                                                                            M.SubPointer.get_array_field (|
                                                                              M.read (| chunk |),
                                                                              i
                                                                            |)
                                                                          |)
                                                                        ]
                                                                      |)
                                                                    |)
                                                                  |) in
                                                                M.alloc (| Value.Tuple [] |)))
                                                          ]
                                                        |) in
                                                      M.alloc (| Value.Tuple [] |)))
                                                  |)))
                                            ]
                                          |)) in
                                      let~ _ :=
                                        let β := remainder in
                                        M.write (|
                                          β,
                                          BinOp.Wrap.sub (|
                                            M.read (| β |),
                                            M.rust_cast
                                              (M.call_closure (|
                                                M.get_trait_method (|
                                                  "core::iter::traits::iterator::Iterator",
                                                  Ty.apply
                                                    (Ty.path "core::iter::adapters::map::Map")
                                                    []
                                                    [
                                                      Ty.apply
                                                        (Ty.path "core::array::iter::IntoIter")
                                                        [ Value.Integer IntegerKind.Usize 32 ]
                                                        [ Ty.path "bool" ];
                                                      Ty.function
                                                        [ Ty.tuple [ Ty.path "bool" ] ]
                                                        (Ty.path "u8")
                                                    ],
                                                  [],
                                                  "sum",
                                                  [ Ty.path "u8" ]
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_trait_method (|
                                                      "core::iter::traits::iterator::Iterator",
                                                      Ty.apply
                                                        (Ty.path "core::array::iter::IntoIter")
                                                        [ Value.Integer IntegerKind.Usize 32 ]
                                                        [ Ty.path "bool" ],
                                                      [],
                                                      "map",
                                                      [
                                                        Ty.path "u8";
                                                        Ty.function
                                                          [ Ty.tuple [ Ty.path "bool" ] ]
                                                          (Ty.path "u8")
                                                      ]
                                                    |),
                                                    [
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::iter::traits::collect::IntoIterator",
                                                          Ty.apply
                                                            (Ty.path "array")
                                                            [ Value.Integer IntegerKind.Usize 32 ]
                                                            [ Ty.path "bool" ],
                                                          [],
                                                          "into_iter",
                                                          []
                                                        |),
                                                        [ M.read (| start_bytes |) ]
                                                      |);
                                                      M.closure
                                                        (fun γ =>
                                                          ltac:(M.monadic
                                                            match γ with
                                                            | [ α0 ] =>
                                                              ltac:(M.monadic
                                                                (M.match_operator (|
                                                                  M.alloc (| α0 |),
                                                                  [
                                                                    fun γ =>
                                                                      ltac:(M.monadic
                                                                        (let i := M.copy (| γ |) in
                                                                        M.rust_cast
                                                                          (M.read (| i |))))
                                                                  ]
                                                                |)))
                                                            | _ =>
                                                              M.impossible
                                                                "wrong number of arguments"
                                                            end))
                                                    ]
                                                  |)
                                                ]
                                              |))
                                          |)
                                        |) in
                                      M.alloc (| Value.Tuple [] |)));
                                  fun γ =>
                                    ltac:(M.monadic
                                      (M.alloc (|
                                        M.never_to_any (|
                                          M.read (|
                                            let~ _ :=
                                              M.alloc (|
                                                M.never_to_any (| M.read (| M.break (||) |) |)
                                              |) in
                                            M.alloc (| Value.Tuple [] |)
                                          |)
                                        |)
                                      |)))
                                ]
                              |)))
                          |) in
                        let~ _ :=
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "core::result::Result")
                                  []
                                  [
                                    Ty.tuple [];
                                    Ty.apply
                                      (Ty.path "core::num::nonzero::NonZero")
                                      []
                                      [ Ty.path "usize" ]
                                  ],
                                "unwrap_unchecked",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::iter::traits::iterator::Iterator",
                                    Ty.apply
                                      (Ty.path "core::slice::iter::Iter")
                                      []
                                      [ Ty.path "u8" ],
                                    [],
                                    "advance_by",
                                    []
                                  |),
                                  [
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "core::str::iter::Chars",
                                      "iter"
                                    |);
                                    M.read (| bytes_skipped |)
                                  ]
                                |)
                              ]
                            |)
                          |) in
                        M.loop (|
                          ltac:(M.monadic
                            (M.match_operator (|
                              M.alloc (| Value.Tuple [] |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ :=
                                      M.use
                                        (M.alloc (|
                                          BinOp.gt (|
                                            M.call_closure (|
                                              M.get_trait_method (|
                                                "core::iter::traits::exact_size::ExactSizeIterator",
                                                Ty.apply
                                                  (Ty.path "core::slice::iter::Iter")
                                                  []
                                                  [ Ty.path "u8" ],
                                                [],
                                                "len",
                                                []
                                              |),
                                              [
                                                M.SubPointer.get_struct_record_field (|
                                                  M.read (| self |),
                                                  "core::str::iter::Chars",
                                                  "iter"
                                                |)
                                              ]
                                            |),
                                            Value.Integer IntegerKind.Usize 0
                                          |)
                                        |)) in
                                    let _ :=
                                      M.is_constant_or_break_match (|
                                        M.read (| γ |),
                                        Value.Bool true
                                      |) in
                                    let~ b :=
                                      M.copy (|
                                        M.SubPointer.get_array_field (|
                                          M.call_closure (|
                                            M.get_associated_function (|
                                              Ty.apply
                                                (Ty.path "core::slice::iter::Iter")
                                                []
                                                [ Ty.path "u8" ],
                                              "as_slice",
                                              []
                                            |),
                                            [
                                              M.SubPointer.get_struct_record_field (|
                                                M.read (| self |),
                                                "core::str::iter::Chars",
                                                "iter"
                                              |)
                                            ]
                                          |),
                                          M.alloc (| Value.Integer IntegerKind.Usize 0 |)
                                        |)
                                      |) 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_function (|
                                                          "core::str::validations::utf8_is_cont_byte",
                                                          []
                                                        |),
                                                        [ M.read (| b |) ]
                                                      |)
                                                    |)
                                                  |)) in
                                              let _ :=
                                                M.is_constant_or_break_match (|
                                                  M.read (| γ |),
                                                  Value.Bool true
                                                |) in
                                              M.alloc (|
                                                M.never_to_any (| M.read (| M.break (||) |) |)
                                              |)));
                                          fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                        ]
                                      |) in
                                    let~ _ :=
                                      M.alloc (|
                                        M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.apply
                                              (Ty.path "core::result::Result")
                                              []
                                              [
                                                Ty.tuple [];
                                                Ty.apply
                                                  (Ty.path "core::num::nonzero::NonZero")
                                                  []
                                                  [ Ty.path "usize" ]
                                              ],
                                            "unwrap_unchecked",
                                            []
                                          |),
                                          [
                                            M.call_closure (|
                                              M.get_trait_method (|
                                                "core::iter::traits::iterator::Iterator",
                                                Ty.apply
                                                  (Ty.path "core::slice::iter::Iter")
                                                  []
                                                  [ Ty.path "u8" ],
                                                [],
                                                "advance_by",
                                                []
                                              |),
                                              [
                                                M.SubPointer.get_struct_record_field (|
                                                  M.read (| self |),
                                                  "core::str::iter::Chars",
                                                  "iter"
                                                |);
                                                Value.Integer IntegerKind.Usize 1
                                              ]
                                            |)
                                          ]
                                        |)
                                      |) in
                                    M.alloc (| Value.Tuple [] |)));
                                fun γ =>
                                  ltac:(M.monadic
                                    (M.alloc (|
                                      M.never_to_any (|
                                        M.read (|
                                          let~ _ :=
                                            M.alloc (|
                                              M.never_to_any (| M.read (| M.break (||) |) |)
                                            |) in
                                          M.alloc (| Value.Tuple [] |)
                                        |)
                                      |)
                                    |)))
                              ]
                            |)))
                        |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                  ]
                |) in
              let~ _ :=
                M.loop (|
                  ltac:(M.monadic
                    (M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  LogicalOp.and (|
                                    BinOp.gt (|
                                      M.read (| remainder |),
                                      Value.Integer IntegerKind.Usize 0
                                    |),
                                    ltac:(M.monadic
                                      (BinOp.gt (|
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::iter::traits::exact_size::ExactSizeIterator",
                                            Ty.apply
                                              (Ty.path "core::slice::iter::Iter")
                                              []
                                              [ Ty.path "u8" ],
                                            [],
                                            "len",
                                            []
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::str::iter::Chars",
                                              "iter"
                                            |)
                                          ]
                                        |),
                                        Value.Integer IntegerKind.Usize 0
                                      |)))
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            let~ _ :=
                              let β := remainder in
                              M.write (|
                                β,
                                BinOp.Wrap.sub (|
                                  M.read (| β |),
                                  Value.Integer IntegerKind.Usize 1
                                |)
                              |) in
                            let~ b :=
                              M.copy (|
                                M.SubPointer.get_array_field (|
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "core::slice::iter::Iter")
                                        []
                                        [ Ty.path "u8" ],
                                      "as_slice",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::str::iter::Chars",
                                        "iter"
                                      |)
                                    ]
                                  |),
                                  M.alloc (| Value.Integer IntegerKind.Usize 0 |)
                                |)
                              |) in
                            let~ slurp :=
                              M.alloc (|
                                M.call_closure (|
                                  M.get_function (|
                                    "core::str::validations::utf8_char_width",
                                    []
                                  |),
                                  [ M.read (| b |) ]
                                |)
                              |) in
                            let~ _ :=
                              M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::result::Result")
                                      []
                                      [
                                        Ty.tuple [];
                                        Ty.apply
                                          (Ty.path "core::num::nonzero::NonZero")
                                          []
                                          [ Ty.path "usize" ]
                                      ],
                                    "unwrap_unchecked",
                                    []
                                  |),
                                  [
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::iter::traits::iterator::Iterator",
                                        Ty.apply
                                          (Ty.path "core::slice::iter::Iter")
                                          []
                                          [ Ty.path "u8" ],
                                        [],
                                        "advance_by",
                                        []
                                      |),
                                      [
                                        M.SubPointer.get_struct_record_field (|
                                          M.read (| self |),
                                          "core::str::iter::Chars",
                                          "iter"
                                        |);
                                        M.read (| slurp |)
                                      ]
                                    |)
                                  ]
                                |)
                              |) in
                            M.alloc (| Value.Tuple [] |)));
                        fun γ =>
                          ltac:(M.monadic
                            (M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  let~ _ :=
                                    M.alloc (| M.never_to_any (| M.read (| M.break (||) |) |) |) in
                                  M.alloc (| Value.Tuple [] |)
                                |)
                              |)
                            |)))
                      ]
                    |)))
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply
                      (Ty.path "core::option::Option")
                      []
                      [ Ty.apply (Ty.path "core::num::nonzero::NonZero") [] [ Ty.path "usize" ] ],
                    "map_or",
                    [
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [
                          Ty.tuple [];
                          Ty.apply (Ty.path "core::num::nonzero::NonZero") [] [ Ty.path "usize" ]
                        ];
                      Ty.function
                        [ Ty.apply (Ty.path "core::num::nonzero::NonZero") [] [ Ty.path "usize" ] ]
                        (Ty.apply
                          (Ty.path "core::result::Result")
                          []
                          [
                            Ty.tuple [];
                            Ty.apply (Ty.path "core::num::nonzero::NonZero") [] [ Ty.path "usize" ]
                          ])
                    ]
                  |),
                  [
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply (Ty.path "core::num::nonzero::NonZero") [] [ Ty.path "usize" ],
                        "new",
                        []
                      |),
                      [ M.read (| remainder |) ]
                    |);
                    Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ];
                    M.constructor_as_closure "core::result::Result::Err"
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn size_hint(&self) -> (usize, Option<usize>) {
              let len = self.iter.len();
              // `(len + 3)` can't overflow, because we know that the `slice::Iter`
              // belongs to a slice in memory which has a maximum length of
              // `isize::MAX` (that's well below `usize::MAX`).
              ((len + 3) / 4, Some(len))
          }
      *)
      Definition size_hint (ε : 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~ len :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::iter::traits::exact_size::ExactSizeIterator",
                      Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ],
                      [],
                      "len",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::Chars",
                        "iter"
                      |)
                    ]
                  |)
                |) in
              M.alloc (|
                Value.Tuple
                  [
                    BinOp.Wrap.div (|
                      BinOp.Wrap.add (| M.read (| len |), Value.Integer IntegerKind.Usize 3 |),
                      Value.Integer IntegerKind.Usize 4
                    |);
                    Value.StructTuple "core::option::Option::Some" [ M.read (| len |) ]
                  ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn last(mut self) -> Option<char> {
              // No need to go through the entire string.
              self.next_back()
          }
      *)
      Definition last (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.path "core::str::iter::Chars",
                [],
                "next_back",
                []
              |),
              [ self ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("count", InstanceField.Method count);
            ("advance_by", InstanceField.Method advance_by);
            ("size_hint", InstanceField.Method size_hint);
            ("last", InstanceField.Method last)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_Chars.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_Chars.
      Definition Self : Ty.t := Ty.path "core::str::iter::Chars".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              write!(f, "Chars(")?;
              f.debug_list().entries(self.clone()).finish()?;
              write!(f, ")")?;
              Ok(())
          }
      *)
      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.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::try_trait::Try",
                            Ty.apply
                              (Ty.path "core::result::Result")
                              []
                              [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            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 "Chars(" |) ] |)
                                  ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Break",
                                0
                              |) in
                            let residual := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::try_trait::FromResidual",
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                        [
                                          Ty.apply
                                            (Ty.path "core::result::Result")
                                            []
                                            [
                                              Ty.path "core::convert::Infallible";
                                              Ty.path "core::fmt::Error"
                                            ]
                                        ],
                                        "from_residual",
                                        []
                                      |),
                                      [ M.read (| residual |) ]
                                    |)
                                  |)
                                |)
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Continue",
                                0
                              |) in
                            let val := M.copy (| γ0_0 |) in
                            val))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::try_trait::Try",
                            Ty.apply
                              (Ty.path "core::result::Result")
                              []
                              [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "core::fmt::builders::DebugList",
                                "finish",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "core::fmt::builders::DebugList",
                                    "entries",
                                    [ Ty.path "char"; Ty.path "core::str::iter::Chars" ]
                                  |),
                                  [
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "core::fmt::Formatter",
                                          "debug_list",
                                          []
                                        |),
                                        [ M.read (| f |) ]
                                      |)
                                    |);
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::clone::Clone",
                                        Ty.path "core::str::iter::Chars",
                                        [],
                                        "clone",
                                        []
                                      |),
                                      [ M.read (| self |) ]
                                    |)
                                  ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Break",
                                0
                              |) in
                            let residual := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::try_trait::FromResidual",
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                        [
                                          Ty.apply
                                            (Ty.path "core::result::Result")
                                            []
                                            [
                                              Ty.path "core::convert::Infallible";
                                              Ty.path "core::fmt::Error"
                                            ]
                                        ],
                                        "from_residual",
                                        []
                                      |),
                                      [ M.read (| residual |) ]
                                    |)
                                  |)
                                |)
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Continue",
                                0
                              |) in
                            let val := M.copy (| γ0_0 |) in
                            val))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::ops::try_trait::Try",
                            Ty.apply
                              (Ty.path "core::result::Result")
                              []
                              [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                            [],
                            "branch",
                            []
                          |),
                          [
                            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 ")" |) ] |) ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Break",
                                0
                              |) in
                            let residual := M.copy (| γ0_0 |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (|
                                    M.call_closure (|
                                      M.get_trait_method (|
                                        "core::ops::try_trait::FromResidual",
                                        Ty.apply
                                          (Ty.path "core::result::Result")
                                          []
                                          [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                        [
                                          Ty.apply
                                            (Ty.path "core::result::Result")
                                            []
                                            [
                                              Ty.path "core::convert::Infallible";
                                              Ty.path "core::fmt::Error"
                                            ]
                                        ],
                                        "from_residual",
                                        []
                                      |),
                                      [ M.read (| residual |) ]
                                    |)
                                  |)
                                |)
                              |)
                            |)));
                        fun γ =>
                          ltac:(M.monadic
                            (let γ0_0 :=
                              M.SubPointer.get_struct_tuple_field (|
                                γ,
                                "core::ops::control_flow::ControlFlow::Continue",
                                0
                              |) in
                            let val := M.copy (| γ0_0 |) in
                            val))
                      ]
                    |) in
                  M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
                |)))
            |)))
        | _, _, _ => M.impossible "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_core_str_iter_Chars.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_Chars.
      Definition Self : Ty.t := Ty.path "core::str::iter::Chars".
      
      (*
          fn next_back(&mut self) -> Option<char> {
              // SAFETY: `str` invariant says `self.iter` is a valid UTF-8 string and
              // the resulting `ch` is a valid Unicode Scalar Value.
              unsafe { next_code_point_reverse(&mut self.iter).map(|ch| char::from_u32_unchecked(ch)) }
          }
      *)
      Definition next_back (ε : 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::option::Option") [] [ Ty.path "u32" ],
                "map",
                [ Ty.path "char"; Ty.function [ Ty.tuple [ Ty.path "u32" ] ] (Ty.path "char") ]
              |),
              [
                M.call_closure (|
                  M.get_function (|
                    "core::str::validations::next_code_point_reverse",
                    [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ]
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::str::iter::Chars",
                      "iter"
                    |)
                  ]
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let ch := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "char",
                                      "from_u32_unchecked",
                                      []
                                    |),
                                    [ M.read (| ch |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method next_back) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_Chars.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_Chars.
      Definition Self : Ty.t := Ty.path "core::str::iter::Chars".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_Chars.
    
    Module Impl_core_str_iter_Chars.
      Definition Self : Ty.t := Ty.path "core::str::iter::Chars".
      
      (*
          pub fn as_str(&self) -> &'a str {
              // SAFETY: `Chars` is only made from a str, which guarantees the iter is valid UTF-8.
              unsafe { from_utf8_unchecked(self.iter.as_slice()) }
          }
      *)
      Definition as_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_function (| "core::str::converts::from_utf8_unchecked", [] |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ],
                    "as_slice",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::str::iter::Chars",
                      "iter"
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_as_str : M.IsAssociatedFunction Self "as_str" as_str.
    End Impl_core_str_iter_Chars.
    
    (* StructRecord
      {
        name := "CharIndices";
        const_params := [];
        ty_params := [];
        fields := [ ("front_offset", Ty.path "usize"); ("iter", Ty.path "core::str::iter::Chars") ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_CharIndices.
      Definition Self : Ty.t := Ty.path "core::str::iter::CharIndices".
      
      (* 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
              "core::str::iter::CharIndices"
              [
                ("front_offset",
                  M.call_closure (|
                    M.get_trait_method (| "core::clone::Clone", Ty.path "usize", [], "clone", [] |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::CharIndices",
                        "front_offset"
                      |)
                    ]
                  |));
                ("iter",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.path "core::str::iter::Chars",
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::CharIndices",
                        "iter"
                      |)
                    ]
                  |))
              ]))
        | _, _, _ => 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_core_str_iter_CharIndices.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_CharIndices.
      Definition Self : Ty.t := Ty.path "core::str::iter::CharIndices".
      
      (* 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 "CharIndices" |);
                M.read (| Value.String "front_offset" |);
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::CharIndices",
                  "front_offset"
                |);
                M.read (| Value.String "iter" |);
                M.alloc (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::str::iter::CharIndices",
                    "iter"
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_CharIndices.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_CharIndices.
      Definition Self : Ty.t := Ty.path "core::str::iter::CharIndices".
      
      (*     type Item = (usize, char); *)
      Definition _Item : Ty.t := Ty.tuple [ Ty.path "usize"; Ty.path "char" ].
      
      (*
          fn next(&mut self) -> Option<(usize, char)> {
              let pre_len = self.iter.iter.len();
              match self.iter.next() {
                  None => None,
                  Some(ch) => {
                      let index = self.front_offset;
                      let len = self.iter.iter.len();
                      self.front_offset += pre_len - len;
                      Some((index, ch))
                  }
              }
          }
      *)
      Definition next (ε : 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~ pre_len :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::iter::traits::exact_size::ExactSizeIterator",
                      Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ],
                      [],
                      "len",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::str::iter::CharIndices",
                          "iter"
                        |),
                        "core::str::iter::Chars",
                        "iter"
                      |)
                    ]
                  |)
                |) in
              M.match_operator (|
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::iter::traits::iterator::Iterator",
                      Ty.path "core::str::iter::Chars",
                      [],
                      "next",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::CharIndices",
                        "iter"
                      |)
                    ]
                  |)
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let _ := M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                      M.alloc (| Value.StructTuple "core::option::Option::None" [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::option::Option::Some",
                          0
                        |) in
                      let ch := M.copy (| γ0_0 |) in
                      let~ index :=
                        M.copy (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::CharIndices",
                            "front_offset"
                          |)
                        |) in
                      let~ len :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::iter::traits::exact_size::ExactSizeIterator",
                              Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ],
                              [],
                              "len",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::CharIndices",
                                  "iter"
                                |),
                                "core::str::iter::Chars",
                                "iter"
                              |)
                            ]
                          |)
                        |) in
                      let~ _ :=
                        let β :=
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::CharIndices",
                            "front_offset"
                          |) in
                        M.write (|
                          β,
                          BinOp.Wrap.add (|
                            M.read (| β |),
                            BinOp.Wrap.sub (| M.read (| pre_len |), M.read (| len |) |)
                          |)
                        |) in
                      M.alloc (|
                        Value.StructTuple
                          "core::option::Option::Some"
                          [ Value.Tuple [ M.read (| index |); M.read (| ch |) ] ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn count(self) -> usize {
              self.iter.count()
          }
      *)
      Definition count (ε : 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::iter::traits::iterator::Iterator",
                Ty.path "core::str::iter::Chars",
                [],
                "count",
                []
              |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    self,
                    "core::str::iter::CharIndices",
                    "iter"
                  |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn size_hint(&self) -> (usize, Option<usize>) {
              self.iter.size_hint()
          }
      *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.path "core::str::iter::Chars",
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::CharIndices",
                  "iter"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn last(mut self) -> Option<(usize, char)> {
              // No need to go through the entire string.
              self.next_back()
          }
      *)
      Definition last (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.path "core::str::iter::CharIndices",
                [],
                "next_back",
                []
              |),
              [ self ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("count", InstanceField.Method count);
            ("size_hint", InstanceField.Method size_hint);
            ("last", InstanceField.Method last)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_CharIndices.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_CharIndices.
      Definition Self : Ty.t := Ty.path "core::str::iter::CharIndices".
      
      (*
          fn next_back(&mut self) -> Option<(usize, char)> {
              self.iter.next_back().map(|ch| {
                  let index = self.front_offset + self.iter.iter.len();
                  (index, ch)
              })
          }
      *)
      Definition next_back (ε : 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::option::Option") [] [ Ty.path "char" ],
                "map",
                [
                  Ty.tuple [ Ty.path "usize"; Ty.path "char" ];
                  Ty.function
                    [ Ty.tuple [ Ty.path "char" ] ]
                    (Ty.tuple [ Ty.path "usize"; Ty.path "char" ])
                ]
              |),
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::iter::traits::double_ended::DoubleEndedIterator",
                    Ty.path "core::str::iter::Chars",
                    [],
                    "next_back",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::str::iter::CharIndices",
                      "iter"
                    |)
                  ]
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let ch := M.copy (| γ |) in
                                  M.read (|
                                    let~ index :=
                                      M.alloc (|
                                        BinOp.Wrap.add (|
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::str::iter::CharIndices",
                                              "front_offset"
                                            |)
                                          |),
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::iter::traits::exact_size::ExactSizeIterator",
                                              Ty.apply
                                                (Ty.path "core::slice::iter::Iter")
                                                []
                                                [ Ty.path "u8" ],
                                              [],
                                              "len",
                                              []
                                            |),
                                            [
                                              M.SubPointer.get_struct_record_field (|
                                                M.SubPointer.get_struct_record_field (|
                                                  M.read (| self |),
                                                  "core::str::iter::CharIndices",
                                                  "iter"
                                                |),
                                                "core::str::iter::Chars",
                                                "iter"
                                              |)
                                            ]
                                          |)
                                        |)
                                      |) in
                                    M.alloc (|
                                      Value.Tuple [ M.read (| index |); M.read (| ch |) ]
                                    |)
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method next_back) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_CharIndices.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_CharIndices.
      Definition Self : Ty.t := Ty.path "core::str::iter::CharIndices".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_CharIndices.
    
    Module Impl_core_str_iter_CharIndices.
      Definition Self : Ty.t := Ty.path "core::str::iter::CharIndices".
      
      (*
          pub fn as_str(&self) -> &'a str {
              self.iter.as_str()
          }
      *)
      Definition as_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.path "core::str::iter::Chars", "as_str", [] |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::CharIndices",
                  "iter"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_as_str : M.IsAssociatedFunction Self "as_str" as_str.
      
      (*
          pub fn offset(&self) -> usize {
              self.front_offset
          }
      *)
      Definition offset (ε : 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 |),
                "core::str::iter::CharIndices",
                "front_offset"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_offset : M.IsAssociatedFunction Self "offset" offset.
    End Impl_core_str_iter_CharIndices.
    
    (* StructTuple
      {
        name := "Bytes";
        const_params := [];
        ty_params := [];
        fields :=
          [
            Ty.apply
              (Ty.path "core::iter::adapters::copied::Copied")
              []
              [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ]
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      (* 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
              "core::str::iter::Bytes"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply
                      (Ty.path "core::iter::adapters::copied::Copied")
                      []
                      [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::Bytes",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => 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_core_str_iter_Bytes.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      (* 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_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "Bytes" |);
                M.alloc (|
                  M.SubPointer.get_struct_tuple_field (|
                    M.read (| self |),
                    "core::str::iter::Bytes",
                    0
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_Bytes.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      (*     type Item = u8; *)
      Definition _Item : Ty.t := Ty.path "u8".
      
      (*
          fn next(&mut self) -> Option<u8> {
              self.0.next()
          }
      *)
      Definition next (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn size_hint(&self) -> (usize, Option<usize>) {
              self.0.size_hint()
          }
      *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn count(self) -> usize {
              self.0.count()
          }
      *)
      Definition count (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "count",
                []
              |),
              [
                M.read (|
                  M.SubPointer.get_struct_tuple_field (| self, "core::str::iter::Bytes", 0 |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn last(self) -> Option<Self::Item> {
              self.0.last()
          }
      *)
      Definition last (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "last",
                []
              |),
              [
                M.read (|
                  M.SubPointer.get_struct_tuple_field (| self, "core::str::iter::Bytes", 0 |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn nth(&mut self, n: usize) -> Option<Self::Item> {
              self.0.nth(n)
          }
      *)
      Definition nth (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; n ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let n := M.alloc (| n |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "nth",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| n |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn all<F>(&mut self, f: F) -> bool
          where
              F: FnMut(Self::Item) -> bool,
          {
              self.0.all(f)
          }
      *)
      Definition all (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "all",
                [ F ]
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| f |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn any<F>(&mut self, f: F) -> bool
          where
              F: FnMut(Self::Item) -> bool,
          {
              self.0.any(f)
          }
      *)
      Definition any (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "any",
                [ F ]
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| f |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
          where
              P: FnMut(&Self::Item) -> bool,
          {
              self.0.find(predicate)
          }
      *)
      Definition find (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ P ], [ self; predicate ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let predicate := M.alloc (| predicate |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "find",
                [ P ]
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| predicate |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn position<P>(&mut self, predicate: P) -> Option<usize>
          where
              P: FnMut(Self::Item) -> bool,
          {
              self.0.position(predicate)
          }
      *)
      Definition position (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ P ], [ self; predicate ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let predicate := M.alloc (| predicate |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "position",
                [ P ]
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| predicate |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn rposition<P>(&mut self, predicate: P) -> Option<usize>
          where
              P: FnMut(Self::Item) -> bool,
          {
              self.0.rposition(predicate)
          }
      *)
      Definition rposition (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ P ], [ self; predicate ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let predicate := M.alloc (| predicate |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "rposition",
                [ P ]
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| predicate |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> u8 {
              // SAFETY: the caller must uphold the safety contract
              // for `Iterator::__iterator_get_unchecked`.
              unsafe { self.0.__iterator_get_unchecked(idx) }
          }
      *)
      Definition __iterator_get_unchecked
          (ε : list Value.t)
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        match ε, τ, α with
        | [], [], [ self; idx ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let idx := M.alloc (| idx |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "__iterator_get_unchecked",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| idx |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint);
            ("count", InstanceField.Method count);
            ("last", InstanceField.Method last);
            ("nth", InstanceField.Method nth);
            ("all", InstanceField.Method all);
            ("any", InstanceField.Method any);
            ("find", InstanceField.Method find);
            ("position", InstanceField.Method position);
            ("rposition", InstanceField.Method rposition);
            ("__iterator_get_unchecked", InstanceField.Method __iterator_get_unchecked)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_Bytes.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      (*
          fn next_back(&mut self) -> Option<u8> {
              self.0.next_back()
          }
      *)
      Definition next_back (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn nth_back(&mut self, n: usize) -> Option<Self::Item> {
              self.0.nth_back(n)
          }
      *)
      Definition nth_back (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; n ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let n := M.alloc (| n |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::double_ended::DoubleEndedIterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "nth_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| n |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
          where
              P: FnMut(&Self::Item) -> bool,
          {
              self.0.rfind(predicate)
          }
      *)
      Definition rfind (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ P ], [ self; predicate ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let predicate := M.alloc (| predicate |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::double_ended::DoubleEndedIterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "rfind",
                [ P ]
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |);
                M.read (| predicate |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("next_back", InstanceField.Method next_back);
            ("nth_back", InstanceField.Method nth_back);
            ("rfind", InstanceField.Method rfind)
          ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_Bytes.
    
    Module Impl_core_iter_traits_exact_size_ExactSizeIterator_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      (*
          fn len(&self) -> usize {
              self.0.len()
          }
      *)
      Definition len (ε : 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::iter::traits::exact_size::ExactSizeIterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "len",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn is_empty(&self) -> bool {
              self.0.is_empty()
          }
      *)
      Definition is_empty (ε : 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::iter::traits::exact_size::ExactSizeIterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::copied::Copied")
                  []
                  [ Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ] ],
                [],
                "is_empty",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Bytes",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::exact_size::ExactSizeIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("len", InstanceField.Method len); ("is_empty", InstanceField.Method is_empty) ].
    End Impl_core_iter_traits_exact_size_ExactSizeIterator_for_core_str_iter_Bytes.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_Bytes.
    
    Module Impl_core_iter_traits_marker_TrustedLen_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::TrustedLen"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_TrustedLen_for_core_str_iter_Bytes.
    
    Module Impl_core_iter_adapters_zip_TrustedRandomAccess_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::adapters::zip::TrustedRandomAccess"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_adapters_zip_TrustedRandomAccess_for_core_str_iter_Bytes.
    
    Module Impl_core_iter_adapters_zip_TrustedRandomAccessNoCoerce_for_core_str_iter_Bytes.
      Definition Self : Ty.t := Ty.path "core::str::iter::Bytes".
      
      (*     const MAY_HAVE_SIDE_EFFECT: bool = false; *)
      (* Ty.path "bool" *)
      Definition value_MAY_HAVE_SIDE_EFFECT : Value.t :=
        M.run ltac:(M.monadic (M.alloc (| Value.Bool false |))).
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::adapters::zip::TrustedRandomAccessNoCoerce"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("value_MAY_HAVE_SIDE_EFFECT", InstanceField.Constant value_MAY_HAVE_SIDE_EFFECT) ].
    End Impl_core_iter_adapters_zip_TrustedRandomAccessNoCoerce_for_core_str_iter_Bytes.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      let $s = self;
                      $e
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ s := M.copy (| self |) in
              M.alloc (|
                M.struct_record_update
                  (M.read (| M.read (| s |) |))
                  [
                    ("matcher",
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::clone::Clone",
                          Ty.associated,
                          [],
                          "clone",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| s |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |))
                  ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInternal_P.
    
    (* StructRecord
      {
        name := "SplitInternal";
        const_params := [];
        ty_params := [ "P" ];
        fields :=
          [
            ("start", Ty.path "usize");
            ("end_", Ty.path "usize");
            ("matcher", Ty.associated);
            ("allow_trailing_empty", Ty.path "bool");
            ("finished", Ty.path "bool")
          ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ].
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              f.debug_struct("SplitInternal")
                  .field("start", &self.start)
                  .field("end", &self.end)
                  .field("matcher", &self.matcher)
                  .field("allow_trailing_empty", &self.allow_trailing_empty)
                  .field("finished", &self.finished)
                  .finish()
          }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugStruct",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugStruct",
                    "field",
                    []
                  |),
                  [
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "core::fmt::builders::DebugStruct",
                        "field",
                        []
                      |),
                      [
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::fmt::builders::DebugStruct",
                            "field",
                            []
                          |),
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "core::fmt::builders::DebugStruct",
                                "field",
                                []
                              |),
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "core::fmt::builders::DebugStruct",
                                    "field",
                                    []
                                  |),
                                  [
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "core::fmt::Formatter",
                                          "debug_struct",
                                          []
                                        |),
                                        [ M.read (| f |); M.read (| Value.String "SplitInternal" |)
                                        ]
                                      |)
                                    |);
                                    M.read (| Value.String "start" |);
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "core::str::iter::SplitInternal",
                                      "start"
                                    |)
                                  ]
                                |);
                                M.read (| Value.String "end" |);
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "end"
                                |)
                              ]
                            |);
                            M.read (| Value.String "matcher" |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::str::iter::SplitInternal",
                              "matcher"
                            |)
                          ]
                        |);
                        M.read (| Value.String "allow_trailing_empty" |);
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::str::iter::SplitInternal",
                          "allow_trailing_empty"
                        |)
                      ]
                    |);
                    M.read (| Value.String "finished" |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::str::iter::SplitInternal",
                      "finished"
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInternal_P.
    
    Module Impl_core_str_iter_SplitInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ].
      
      (*
          fn get_end(&mut self) -> Option<&'a str> {
              if !self.finished {
                  self.finished = true;
      
                  if self.allow_trailing_empty || self.end - self.start > 0 {
                      // SAFETY: `self.start` and `self.end` always lie on unicode boundaries.
                      let string = unsafe { self.matcher.haystack().get_unchecked(self.start..self.end) };
                      return Some(string);
                  }
              }
      
              None
          }
      *)
      Definition get_end (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  UnOp.not (|
                                    M.read (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::str::iter::SplitInternal",
                                        "finished"
                                      |)
                                    |)
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            let~ _ :=
                              M.write (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "finished"
                                |),
                                Value.Bool true
                              |) in
                            M.match_operator (|
                              M.alloc (| Value.Tuple [] |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ :=
                                      M.use
                                        (M.alloc (|
                                          LogicalOp.or (|
                                            M.read (|
                                              M.SubPointer.get_struct_record_field (|
                                                M.read (| self |),
                                                "core::str::iter::SplitInternal",
                                                "allow_trailing_empty"
                                              |)
                                            |),
                                            ltac:(M.monadic
                                              (BinOp.gt (|
                                                BinOp.Wrap.sub (|
                                                  M.read (|
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.read (| self |),
                                                      "core::str::iter::SplitInternal",
                                                      "end"
                                                    |)
                                                  |),
                                                  M.read (|
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.read (| self |),
                                                      "core::str::iter::SplitInternal",
                                                      "start"
                                                    |)
                                                  |)
                                                |),
                                                Value.Integer IntegerKind.Usize 0
                                              |)))
                                          |)
                                        |)) in
                                    let _ :=
                                      M.is_constant_or_break_match (|
                                        M.read (| γ |),
                                        Value.Bool true
                                      |) in
                                    M.alloc (|
                                      M.never_to_any (|
                                        M.read (|
                                          let~ string :=
                                            M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "str",
                                                  "get_unchecked",
                                                  [
                                                    Ty.apply
                                                      (Ty.path "core::ops::range::Range")
                                                      []
                                                      [ Ty.path "usize" ]
                                                  ]
                                                |),
                                                [
                                                  M.call_closure (|
                                                    M.get_trait_method (|
                                                      "core::str::pattern::Searcher",
                                                      Ty.associated,
                                                      [],
                                                      "haystack",
                                                      []
                                                    |),
                                                    [
                                                      M.SubPointer.get_struct_record_field (|
                                                        M.read (| self |),
                                                        "core::str::iter::SplitInternal",
                                                        "matcher"
                                                      |)
                                                    ]
                                                  |);
                                                  Value.StructRecord
                                                    "core::ops::range::Range"
                                                    [
                                                      ("start",
                                                        M.read (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| self |),
                                                            "core::str::iter::SplitInternal",
                                                            "start"
                                                          |)
                                                        |));
                                                      ("end_",
                                                        M.read (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| self |),
                                                            "core::str::iter::SplitInternal",
                                                            "end"
                                                          |)
                                                        |))
                                                    ]
                                                ]
                                              |)
                                            |) in
                                          M.return_ (|
                                            Value.StructTuple
                                              "core::option::Option::Some"
                                              [ M.read (| string |) ]
                                          |)
                                        |)
                                      |)
                                    |)));
                                fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                              ]
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  M.alloc (| Value.StructTuple "core::option::Option::None" [] |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_get_end :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "get_end" (get_end P).
      
      (*
          fn next(&mut self) -> Option<&'a str> {
              if self.finished {
                  return None;
              }
      
              let haystack = self.matcher.haystack();
              match self.matcher.next_match() {
                  // SAFETY: `Searcher` guarantees that `a` and `b` lie on unicode boundaries.
                  Some((a, b)) => unsafe {
                      let elt = haystack.get_unchecked(self.start..a);
                      self.start = b;
                      Some(elt)
                  },
                  None => self.get_end(),
              }
          }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "finished"
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (| Value.StructTuple "core::option::Option::None" [] |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let~ haystack :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::str::pattern::Searcher",
                          Ty.associated,
                          [],
                          "haystack",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |)
                    |) in
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::str::pattern::Searcher",
                          Ty.associated,
                          [],
                          "next_match",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::option::Option::Some",
                              0
                            |) in
                          let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                          let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                          let a := M.copy (| γ1_0 |) in
                          let b := M.copy (| γ1_1 |) in
                          let~ elt :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "str",
                                  "get_unchecked",
                                  [
                                    Ty.apply
                                      (Ty.path "core::ops::range::Range")
                                      []
                                      [ Ty.path "usize" ]
                                  ]
                                |),
                                [
                                  M.read (| haystack |);
                                  Value.StructRecord
                                    "core::ops::range::Range"
                                    [
                                      ("start",
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "core::str::iter::SplitInternal",
                                            "start"
                                          |)
                                        |));
                                      ("end_", M.read (| a |))
                                    ]
                                ]
                              |)
                            |) in
                          let~ _ :=
                            M.write (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "core::str::iter::SplitInternal",
                                "start"
                              |),
                              M.read (| b |)
                            |) in
                          M.alloc (|
                            Value.StructTuple "core::option::Option::Some" [ M.read (| elt |) ]
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let _ := M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                                "get_end",
                                []
                              |),
                              [ M.read (| self |) ]
                            |)
                          |)))
                    ]
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next" (next P).
      
      (*
          fn next_inclusive(&mut self) -> Option<&'a str> {
              if self.finished {
                  return None;
              }
      
              let haystack = self.matcher.haystack();
              match self.matcher.next_match() {
                  // SAFETY: `Searcher` guarantees that `b` lies on unicode boundary,
                  // and self.start is either the start of the original string,
                  // or `b` was assigned to it, so it also lies on unicode boundary.
                  Some((_, b)) => unsafe {
                      let elt = haystack.get_unchecked(self.start..b);
                      self.start = b;
                      Some(elt)
                  },
                  None => self.get_end(),
              }
          }
      *)
      Definition next_inclusive
          (P : Ty.t)
          (ε : list Value.t)
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "finished"
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (| Value.StructTuple "core::option::Option::None" [] |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let~ haystack :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::str::pattern::Searcher",
                          Ty.associated,
                          [],
                          "haystack",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |)
                    |) in
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::str::pattern::Searcher",
                          Ty.associated,
                          [],
                          "next_match",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::option::Option::Some",
                              0
                            |) in
                          let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                          let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                          let b := M.copy (| γ1_1 |) in
                          let~ elt :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "str",
                                  "get_unchecked",
                                  [
                                    Ty.apply
                                      (Ty.path "core::ops::range::Range")
                                      []
                                      [ Ty.path "usize" ]
                                  ]
                                |),
                                [
                                  M.read (| haystack |);
                                  Value.StructRecord
                                    "core::ops::range::Range"
                                    [
                                      ("start",
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "core::str::iter::SplitInternal",
                                            "start"
                                          |)
                                        |));
                                      ("end_", M.read (| b |))
                                    ]
                                ]
                              |)
                            |) in
                          let~ _ :=
                            M.write (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "core::str::iter::SplitInternal",
                                "start"
                              |),
                              M.read (| b |)
                            |) in
                          M.alloc (|
                            Value.StructTuple "core::option::Option::Some" [ M.read (| elt |) ]
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let _ := M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                          M.alloc (|
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                                "get_end",
                                []
                              |),
                              [ M.read (| self |) ]
                            |)
                          |)))
                    ]
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next_inclusive :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next_inclusive" (next_inclusive P).
      
      (*
          fn next_back(&mut self) -> Option<&'a str>
          where
              P::Searcher<'a>: ReverseSearcher<'a>,
          {
              if self.finished {
                  return None;
              }
      
              if !self.allow_trailing_empty {
                  self.allow_trailing_empty = true;
                  match self.next_back() {
                      Some(elt) if !elt.is_empty() => return Some(elt),
                      _ => {
                          if self.finished {
                              return None;
                          }
                      }
                  }
              }
      
              let haystack = self.matcher.haystack();
              match self.matcher.next_match_back() {
                  // SAFETY: `Searcher` guarantees that `a` and `b` lie on unicode boundaries.
                  Some((a, b)) => unsafe {
                      let elt = haystack.get_unchecked(b..self.end);
                      self.end = a;
                      Some(elt)
                  },
                  // SAFETY: `self.start` and `self.end` always lie on unicode boundaries.
                  None => unsafe {
                      self.finished = true;
                      Some(haystack.get_unchecked(self.start..self.end))
                  },
              }
          }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "finished"
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (| Value.StructTuple "core::option::Option::None" [] |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  UnOp.not (|
                                    M.read (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::str::iter::SplitInternal",
                                        "allow_trailing_empty"
                                      |)
                                    |)
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            let~ _ :=
                              M.write (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "allow_trailing_empty"
                                |),
                                Value.Bool true
                              |) in
                            M.match_operator (|
                              M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                                    "next_back",
                                    []
                                  |),
                                  [ M.read (| self |) ]
                                |)
                              |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "core::option::Option::Some",
                                        0
                                      |) in
                                    let elt := M.copy (| γ0_0 |) in
                                    let γ :=
                                      M.alloc (|
                                        UnOp.not (|
                                          M.call_closure (|
                                            M.get_associated_function (|
                                              Ty.path "str",
                                              "is_empty",
                                              []
                                            |),
                                            [ M.read (| elt |) ]
                                          |)
                                        |)
                                      |) in
                                    let _ :=
                                      M.is_constant_or_break_match (|
                                        M.read (| γ |),
                                        Value.Bool true
                                      |) in
                                    M.alloc (|
                                      M.never_to_any (|
                                        M.read (|
                                          M.return_ (|
                                            Value.StructTuple
                                              "core::option::Option::Some"
                                              [ M.read (| elt |) ]
                                          |)
                                        |)
                                      |)
                                    |)));
                                fun γ =>
                                  ltac:(M.monadic
                                    (M.match_operator (|
                                      M.alloc (| Value.Tuple [] |),
                                      [
                                        fun γ =>
                                          ltac:(M.monadic
                                            (let γ :=
                                              M.use
                                                (M.SubPointer.get_struct_record_field (|
                                                  M.read (| self |),
                                                  "core::str::iter::SplitInternal",
                                                  "finished"
                                                |)) in
                                            let _ :=
                                              M.is_constant_or_break_match (|
                                                M.read (| γ |),
                                                Value.Bool true
                                              |) in
                                            M.alloc (|
                                              M.never_to_any (|
                                                M.read (|
                                                  M.return_ (|
                                                    Value.StructTuple
                                                      "core::option::Option::None"
                                                      []
                                                  |)
                                                |)
                                              |)
                                            |)));
                                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                      ]
                                    |)))
                              ]
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let~ haystack :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::str::pattern::Searcher",
                          Ty.associated,
                          [],
                          "haystack",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |)
                    |) in
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::str::pattern::ReverseSearcher",
                          Ty.associated,
                          [],
                          "next_match_back",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::option::Option::Some",
                              0
                            |) in
                          let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                          let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                          let a := M.copy (| γ1_0 |) in
                          let b := M.copy (| γ1_1 |) in
                          let~ elt :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "str",
                                  "get_unchecked",
                                  [
                                    Ty.apply
                                      (Ty.path "core::ops::range::Range")
                                      []
                                      [ Ty.path "usize" ]
                                  ]
                                |),
                                [
                                  M.read (| haystack |);
                                  Value.StructRecord
                                    "core::ops::range::Range"
                                    [
                                      ("start", M.read (| b |));
                                      ("end_",
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "core::str::iter::SplitInternal",
                                            "end"
                                          |)
                                        |))
                                    ]
                                ]
                              |)
                            |) in
                          let~ _ :=
                            M.write (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "core::str::iter::SplitInternal",
                                "end"
                              |),
                              M.read (| a |)
                            |) in
                          M.alloc (|
                            Value.StructTuple "core::option::Option::Some" [ M.read (| elt |) ]
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let _ := M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                          let~ _ :=
                            M.write (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "core::str::iter::SplitInternal",
                                "finished"
                              |),
                              Value.Bool true
                            |) in
                          M.alloc (|
                            Value.StructTuple
                              "core::option::Option::Some"
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "str",
                                    "get_unchecked",
                                    [
                                      Ty.apply
                                        (Ty.path "core::ops::range::Range")
                                        []
                                        [ Ty.path "usize" ]
                                    ]
                                  |),
                                  [
                                    M.read (| haystack |);
                                    Value.StructRecord
                                      "core::ops::range::Range"
                                      [
                                        ("start",
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::str::iter::SplitInternal",
                                              "start"
                                            |)
                                          |));
                                        ("end_",
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::str::iter::SplitInternal",
                                              "end"
                                            |)
                                          |))
                                      ]
                                  ]
                                |)
                              ]
                          |)))
                    ]
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next_back :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next_back" (next_back P).
      
      (*
          fn next_back_inclusive(&mut self) -> Option<&'a str>
          where
              P::Searcher<'a>: ReverseSearcher<'a>,
          {
              if self.finished {
                  return None;
              }
      
              if !self.allow_trailing_empty {
                  self.allow_trailing_empty = true;
                  match self.next_back_inclusive() {
                      Some(elt) if !elt.is_empty() => return Some(elt),
                      _ => {
                          if self.finished {
                              return None;
                          }
                      }
                  }
              }
      
              let haystack = self.matcher.haystack();
              match self.matcher.next_match_back() {
                  // SAFETY: `Searcher` guarantees that `b` lies on unicode boundary,
                  // and self.end is either the end of the original string,
                  // or `b` was assigned to it, so it also lies on unicode boundary.
                  Some((_, b)) => unsafe {
                      let elt = haystack.get_unchecked(b..self.end);
                      self.end = b;
                      Some(elt)
                  },
                  // SAFETY: self.start is either the start of the original string,
                  // or start of a substring that represents the part of the string that hasn't
                  // iterated yet. Either way, it is guaranteed to lie on unicode boundary.
                  // self.end is either the end of the original string,
                  // or `b` was assigned to it, so it also lies on unicode boundary.
                  None => unsafe {
                      self.finished = true;
                      Some(haystack.get_unchecked(self.start..self.end))
                  },
              }
          }
      *)
      Definition next_back_inclusive
          (P : Ty.t)
          (ε : list Value.t)
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "finished"
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (| Value.StructTuple "core::option::Option::None" [] |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  UnOp.not (|
                                    M.read (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::str::iter::SplitInternal",
                                        "allow_trailing_empty"
                                      |)
                                    |)
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            let~ _ :=
                              M.write (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "allow_trailing_empty"
                                |),
                                Value.Bool true
                              |) in
                            M.match_operator (|
                              M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                                    "next_back_inclusive",
                                    []
                                  |),
                                  [ M.read (| self |) ]
                                |)
                              |),
                              [
                                fun γ =>
                                  ltac:(M.monadic
                                    (let γ0_0 :=
                                      M.SubPointer.get_struct_tuple_field (|
                                        γ,
                                        "core::option::Option::Some",
                                        0
                                      |) in
                                    let elt := M.copy (| γ0_0 |) in
                                    let γ :=
                                      M.alloc (|
                                        UnOp.not (|
                                          M.call_closure (|
                                            M.get_associated_function (|
                                              Ty.path "str",
                                              "is_empty",
                                              []
                                            |),
                                            [ M.read (| elt |) ]
                                          |)
                                        |)
                                      |) in
                                    let _ :=
                                      M.is_constant_or_break_match (|
                                        M.read (| γ |),
                                        Value.Bool true
                                      |) in
                                    M.alloc (|
                                      M.never_to_any (|
                                        M.read (|
                                          M.return_ (|
                                            Value.StructTuple
                                              "core::option::Option::Some"
                                              [ M.read (| elt |) ]
                                          |)
                                        |)
                                      |)
                                    |)));
                                fun γ =>
                                  ltac:(M.monadic
                                    (M.match_operator (|
                                      M.alloc (| Value.Tuple [] |),
                                      [
                                        fun γ =>
                                          ltac:(M.monadic
                                            (let γ :=
                                              M.use
                                                (M.SubPointer.get_struct_record_field (|
                                                  M.read (| self |),
                                                  "core::str::iter::SplitInternal",
                                                  "finished"
                                                |)) in
                                            let _ :=
                                              M.is_constant_or_break_match (|
                                                M.read (| γ |),
                                                Value.Bool true
                                              |) in
                                            M.alloc (|
                                              M.never_to_any (|
                                                M.read (|
                                                  M.return_ (|
                                                    Value.StructTuple
                                                      "core::option::Option::None"
                                                      []
                                                  |)
                                                |)
                                              |)
                                            |)));
                                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                      ]
                                    |)))
                              ]
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let~ haystack :=
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::str::pattern::Searcher",
                          Ty.associated,
                          [],
                          "haystack",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |)
                    |) in
                  M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::str::pattern::ReverseSearcher",
                          Ty.associated,
                          [],
                          "next_match_back",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitInternal",
                            "matcher"
                          |)
                        ]
                      |)
                    |),
                    [
                      fun γ =>
                        ltac:(M.monadic
                          (let γ0_0 :=
                            M.SubPointer.get_struct_tuple_field (|
                              γ,
                              "core::option::Option::Some",
                              0
                            |) in
                          let γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                          let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                          let b := M.copy (| γ1_1 |) in
                          let~ elt :=
                            M.alloc (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "str",
                                  "get_unchecked",
                                  [
                                    Ty.apply
                                      (Ty.path "core::ops::range::Range")
                                      []
                                      [ Ty.path "usize" ]
                                  ]
                                |),
                                [
                                  M.read (| haystack |);
                                  Value.StructRecord
                                    "core::ops::range::Range"
                                    [
                                      ("start", M.read (| b |));
                                      ("end_",
                                        M.read (|
                                          M.SubPointer.get_struct_record_field (|
                                            M.read (| self |),
                                            "core::str::iter::SplitInternal",
                                            "end"
                                          |)
                                        |))
                                    ]
                                ]
                              |)
                            |) in
                          let~ _ :=
                            M.write (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "core::str::iter::SplitInternal",
                                "end"
                              |),
                              M.read (| b |)
                            |) in
                          M.alloc (|
                            Value.StructTuple "core::option::Option::Some" [ M.read (| elt |) ]
                          |)));
                      fun γ =>
                        ltac:(M.monadic
                          (let _ := M.is_struct_tuple (| γ, "core::option::Option::None" |) in
                          let~ _ :=
                            M.write (|
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "core::str::iter::SplitInternal",
                                "finished"
                              |),
                              Value.Bool true
                            |) in
                          M.alloc (|
                            Value.StructTuple
                              "core::option::Option::Some"
                              [
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "str",
                                    "get_unchecked",
                                    [
                                      Ty.apply
                                        (Ty.path "core::ops::range::Range")
                                        []
                                        [ Ty.path "usize" ]
                                    ]
                                  |),
                                  [
                                    M.read (| haystack |);
                                    Value.StructRecord
                                      "core::ops::range::Range"
                                      [
                                        ("start",
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::str::iter::SplitInternal",
                                              "start"
                                            |)
                                          |));
                                        ("end_",
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::str::iter::SplitInternal",
                                              "end"
                                            |)
                                          |))
                                      ]
                                  ]
                                |)
                              ]
                          |)))
                    ]
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next_back_inclusive :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next_back_inclusive" (next_back_inclusive P).
      
      (*
          fn remainder(&self) -> Option<&'a str> {
              // `Self::get_end` doesn't change `self.start`
              if self.finished {
                  return None;
              }
      
              // SAFETY: `self.start` and `self.end` always lie on unicode boundaries.
              Some(unsafe { self.matcher.haystack().get_unchecked(self.start..self.end) })
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "finished"
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (| Value.StructTuple "core::option::Option::None" [] |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  M.alloc (|
                    Value.StructTuple
                      "core::option::Option::Some"
                      [
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "str",
                            "get_unchecked",
                            [ Ty.apply (Ty.path "core::ops::range::Range") [] [ Ty.path "usize" ] ]
                          |),
                          [
                            M.call_closure (|
                              M.get_trait_method (|
                                "core::str::pattern::Searcher",
                                Ty.associated,
                                [],
                                "haystack",
                                []
                              |),
                              [
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::SplitInternal",
                                  "matcher"
                                |)
                              ]
                            |);
                            Value.StructRecord
                              "core::ops::range::Range"
                              [
                                ("start",
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "core::str::iter::SplitInternal",
                                      "start"
                                    |)
                                  |));
                                ("end_",
                                  M.read (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "core::str::iter::SplitInternal",
                                      "end"
                                    |)
                                  |))
                              ]
                          ]
                        |)
                      ]
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_SplitInternal_P.
    
    (* StructTuple
      {
        name := "Split";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Split") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($forward_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "Split" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::Split",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Split") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Split",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Split") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $forward_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::Split"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::Split",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
    
    (* StructTuple
      {
        name := "RSplit";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplit") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($reverse_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "RSplit" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RSplit",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplit") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RSplit",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplit") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $reverse_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::RSplit"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RSplit",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Split") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplit") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Split") [] [ P ].
      
      (*
                  fn next_back(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Split",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Split_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplit") [] [ P ].
      
      (*
                  fn next_back(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RSplit",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplit_P.
    
    Module Impl_core_str_iter_Split_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Split") [] [ P ].
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.0.remainder()
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Split",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_Split_P.
    
    Module Impl_core_str_iter_RSplit_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplit") [] [ P ].
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.0.remainder()
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RSplit",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_RSplit_P.
    
    (* StructTuple
      {
        name := "SplitTerminator";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitTerminator") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($forward_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "SplitTerminator" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::SplitTerminator",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitTerminator") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::SplitTerminator",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitTerminator") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $forward_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::SplitTerminator"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::SplitTerminator",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
    
    (* StructTuple
      {
        name := "RSplitTerminator";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RSplitTerminator") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($reverse_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "RSplitTerminator" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RSplitTerminator",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RSplitTerminator") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RSplitTerminator",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RSplitTerminator") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $reverse_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::RSplitTerminator"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RSplitTerminator",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitTerminator") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RSplitTerminator") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitTerminator") [] [ P ].
      
      (*
                  fn next_back(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::SplitTerminator",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitTerminator_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RSplitTerminator") [] [ P ].
      
      (*
                  fn next_back(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RSplitTerminator",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitTerminator_P.
    
    Module Impl_core_str_iter_SplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitTerminator") [] [ P ].
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.0.remainder()
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::SplitTerminator",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_SplitTerminator_P.
    
    Module Impl_core_str_iter_RSplitTerminator_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RSplitTerminator") [] [ P ].
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.0.remainder()
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RSplitTerminator",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_RSplitTerminator_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitNInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      let $s = self;
                      $e
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ s := M.copy (| self |) in
              M.alloc (|
                M.struct_record_update
                  (M.read (| M.read (| s |) |))
                  [
                    ("iter",
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::clone::Clone",
                          Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                          [],
                          "clone",
                          []
                        |),
                        [
                          M.SubPointer.get_struct_record_field (|
                            M.read (| s |),
                            "core::str::iter::SplitNInternal",
                            "iter"
                          |)
                        ]
                      |))
                  ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitNInternal_P.
    
    (* StructRecord
      {
        name := "SplitNInternal";
        const_params := [];
        ty_params := [ "P" ];
        fields :=
          [
            ("iter", Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ]);
            ("count", Ty.path "usize")
          ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitNInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ].
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              f.debug_struct("SplitNInternal")
                  .field("iter", &self.iter)
                  .field("count", &self.count)
                  .finish()
          }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugStruct",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugStruct",
                    "field",
                    []
                  |),
                  [
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.path "core::fmt::builders::DebugStruct",
                        "field",
                        []
                      |),
                      [
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::fmt::Formatter",
                              "debug_struct",
                              []
                            |),
                            [ M.read (| f |); M.read (| Value.String "SplitNInternal" |) ]
                          |)
                        |);
                        M.read (| Value.String "iter" |);
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::str::iter::SplitNInternal",
                          "iter"
                        |)
                      ]
                    |);
                    M.read (| Value.String "count" |);
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::str::iter::SplitNInternal",
                      "count"
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitNInternal_P.
    
    Module Impl_core_str_iter_SplitNInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ].
      
      (*
          fn next(&mut self) -> Option<&'a str> {
              match self.count {
                  0 => None,
                  1 => {
                      self.count = 0;
                      self.iter.get_end()
                  }
                  _ => {
                      self.count -= 1;
                      self.iter.next()
                  }
              }
          }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitNInternal",
                  "count"
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_constant_or_break_match (|
                          M.read (| γ |),
                          Value.Integer IntegerKind.Usize 0
                        |) in
                      M.alloc (| Value.StructTuple "core::option::Option::None" [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_constant_or_break_match (|
                          M.read (| γ |),
                          Value.Integer IntegerKind.Usize 1
                        |) in
                      let~ _ :=
                        M.write (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitNInternal",
                            "count"
                          |),
                          Value.Integer IntegerKind.Usize 0
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                            "get_end",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::str::iter::SplitNInternal",
                              "iter"
                            |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let~ _ :=
                        let β :=
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitNInternal",
                            "count"
                          |) in
                        M.write (|
                          β,
                          BinOp.Wrap.sub (| M.read (| β |), Value.Integer IntegerKind.Usize 1 |)
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                            "next",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::str::iter::SplitNInternal",
                              "iter"
                            |)
                          ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next" (next P).
      
      (*
          fn next_back(&mut self) -> Option<&'a str>
          where
              P::Searcher<'a>: ReverseSearcher<'a>,
          {
              match self.count {
                  0 => None,
                  1 => {
                      self.count = 0;
                      self.iter.get_end()
                  }
                  _ => {
                      self.count -= 1;
                      self.iter.next_back()
                  }
              }
          }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitNInternal",
                  "count"
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_constant_or_break_match (|
                          M.read (| γ |),
                          Value.Integer IntegerKind.Usize 0
                        |) in
                      M.alloc (| Value.StructTuple "core::option::Option::None" [] |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let _ :=
                        M.is_constant_or_break_match (|
                          M.read (| γ |),
                          Value.Integer IntegerKind.Usize 1
                        |) in
                      let~ _ :=
                        M.write (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitNInternal",
                            "count"
                          |),
                          Value.Integer IntegerKind.Usize 0
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                            "get_end",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::str::iter::SplitNInternal",
                              "iter"
                            |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let~ _ :=
                        let β :=
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::str::iter::SplitNInternal",
                            "count"
                          |) in
                        M.write (|
                          β,
                          BinOp.Wrap.sub (| M.read (| β |), Value.Integer IntegerKind.Usize 1 |)
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                            "next_back",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::str::iter::SplitNInternal",
                              "iter"
                            |)
                          ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next_back :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next_back" (next_back P).
      
      (*
          fn remainder(&self) -> Option<&'a str> {
              self.iter.remainder()
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitNInternal",
                  "iter"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_SplitNInternal_P.
    
    (* StructTuple
      {
        name := "SplitN";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::SplitN") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($forward_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "SplitN" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::SplitN",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitN_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::SplitN") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::SplitN",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitN_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::SplitN") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $forward_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::SplitN"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::SplitN",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitN_P.
    
    (* StructTuple
      {
        name := "RSplitN";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplitN") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($reverse_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "RSplitN" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RSplitN",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitN_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplitN") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RSplitN",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitN_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplitN") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $reverse_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::RSplitN"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RSplitN",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitN_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::SplitN") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitN_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplitN") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RSplitN_P.
    
    Module Impl_core_str_iter_SplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::SplitN") [] [ P ].
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.0.remainder()
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::SplitN",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_SplitN_P.
    
    Module Impl_core_str_iter_RSplitN_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RSplitN") [] [ P ].
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.0.remainder()
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitNInternal") [] [ P ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RSplitN",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_RSplitN_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndicesInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      let $s = self;
                      $e
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ s := M.copy (| self |) in
              M.alloc (|
                Value.StructTuple
                  "core::str::iter::MatchIndicesInternal"
                  [
                    M.call_closure (|
                      M.get_trait_method (| "core::clone::Clone", Ty.associated, [], "clone", [] |),
                      [
                        M.SubPointer.get_struct_tuple_field (|
                          M.read (| s |),
                          "core::str::iter::MatchIndicesInternal",
                          0
                        |)
                      ]
                    |)
                  ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndicesInternal_P.
    
    (* StructTuple
      {
        name := "MatchIndicesInternal";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.associated ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndicesInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ].
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              f.debug_tuple("MatchIndicesInternal").field(&self.0).finish()
          }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "MatchIndicesInternal" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::MatchIndicesInternal",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndicesInternal_P.
    
    Module Impl_core_str_iter_MatchIndicesInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ].
      
      (*
          fn next(&mut self) -> Option<(usize, &'a str)> {
              self.0
                  .next_match()
                  // SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries.
                  .map(|(start, end)| unsafe { (start, self.0.haystack().get_unchecked(start..end)) })
          }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply
                  (Ty.path "core::option::Option")
                  []
                  [ Ty.tuple [ Ty.path "usize"; Ty.path "usize" ] ],
                "map",
                [
                  Ty.tuple [ Ty.path "usize"; Ty.apply (Ty.path "&") [] [ Ty.path "str" ] ];
                  Ty.function
                    [ Ty.tuple [ Ty.tuple [ Ty.path "usize"; Ty.path "usize" ] ] ]
                    (Ty.tuple [ Ty.path "usize"; Ty.apply (Ty.path "&") [] [ Ty.path "str" ] ])
                ]
              |),
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::str::pattern::Searcher",
                    Ty.associated,
                    [],
                    "next_match",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::MatchIndicesInternal",
                      0
                    |)
                  ]
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                  let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                  let start := M.copy (| γ0_0 |) in
                                  let end_ := M.copy (| γ0_1 |) in
                                  Value.Tuple
                                    [
                                      M.read (| start |);
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "str",
                                          "get_unchecked",
                                          [
                                            Ty.apply
                                              (Ty.path "core::ops::range::Range")
                                              []
                                              [ Ty.path "usize" ]
                                          ]
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::str::pattern::Searcher",
                                              Ty.associated,
                                              [],
                                              "haystack",
                                              []
                                            |),
                                            [
                                              M.SubPointer.get_struct_tuple_field (|
                                                M.read (| self |),
                                                "core::str::iter::MatchIndicesInternal",
                                                0
                                              |)
                                            ]
                                          |);
                                          Value.StructRecord
                                            "core::ops::range::Range"
                                            [
                                              ("start", M.read (| start |));
                                              ("end_", M.read (| end_ |))
                                            ]
                                        ]
                                      |)
                                    ]))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next" (next P).
      
      (*
          fn next_back(&mut self) -> Option<(usize, &'a str)>
          where
              P::Searcher<'a>: ReverseSearcher<'a>,
          {
              self.0
                  .next_match_back()
                  // SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries.
                  .map(|(start, end)| unsafe { (start, self.0.haystack().get_unchecked(start..end)) })
          }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply
                  (Ty.path "core::option::Option")
                  []
                  [ Ty.tuple [ Ty.path "usize"; Ty.path "usize" ] ],
                "map",
                [
                  Ty.tuple [ Ty.path "usize"; Ty.apply (Ty.path "&") [] [ Ty.path "str" ] ];
                  Ty.function
                    [ Ty.tuple [ Ty.tuple [ Ty.path "usize"; Ty.path "usize" ] ] ]
                    (Ty.tuple [ Ty.path "usize"; Ty.apply (Ty.path "&") [] [ Ty.path "str" ] ])
                ]
              |),
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::str::pattern::ReverseSearcher",
                    Ty.associated,
                    [],
                    "next_match_back",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::MatchIndicesInternal",
                      0
                    |)
                  ]
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                  let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                  let start := M.copy (| γ0_0 |) in
                                  let end_ := M.copy (| γ0_1 |) in
                                  Value.Tuple
                                    [
                                      M.read (| start |);
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "str",
                                          "get_unchecked",
                                          [
                                            Ty.apply
                                              (Ty.path "core::ops::range::Range")
                                              []
                                              [ Ty.path "usize" ]
                                          ]
                                        |),
                                        [
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::str::pattern::Searcher",
                                              Ty.associated,
                                              [],
                                              "haystack",
                                              []
                                            |),
                                            [
                                              M.SubPointer.get_struct_tuple_field (|
                                                M.read (| self |),
                                                "core::str::iter::MatchIndicesInternal",
                                                0
                                              |)
                                            ]
                                          |);
                                          Value.StructRecord
                                            "core::ops::range::Range"
                                            [
                                              ("start", M.read (| start |));
                                              ("end_", M.read (| end_ |))
                                            ]
                                        ]
                                      |)
                                    ]))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next_back :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next_back" (next_back P).
    End Impl_core_str_iter_MatchIndicesInternal_P.
    
    (* StructTuple
      {
        name := "MatchIndices";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchIndices") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($forward_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "MatchIndices" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::MatchIndices",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchIndices") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t :=
        Ty.tuple [ Ty.path "usize"; Ty.apply (Ty.path "&") [] [ Ty.path "str" ] ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::MatchIndices",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchIndices") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $forward_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::MatchIndices"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::MatchIndices",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
    
    (* StructTuple
      {
        name := "RMatchIndices";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RMatchIndices") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($reverse_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "RMatchIndices" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RMatchIndices",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RMatchIndices") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t :=
        Ty.tuple [ Ty.path "usize"; Ty.apply (Ty.path "&") [] [ Ty.path "str" ] ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RMatchIndices",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RMatchIndices") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $reverse_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::RMatchIndices"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RMatchIndices",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchIndices") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RMatchIndices") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchIndices") [] [ P ].
      
      (*
                  fn next_back(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::MatchIndices",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchIndices_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::RMatchIndices") [] [ P ].
      
      (*
                  fn next_back(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::MatchIndicesInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RMatchIndices",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatchIndices_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchesInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      let $s = self;
                      $e
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ s := M.copy (| self |) in
              M.alloc (|
                Value.StructTuple
                  "core::str::iter::MatchesInternal"
                  [
                    M.call_closure (|
                      M.get_trait_method (| "core::clone::Clone", Ty.associated, [], "clone", [] |),
                      [
                        M.SubPointer.get_struct_tuple_field (|
                          M.read (| s |),
                          "core::str::iter::MatchesInternal",
                          0
                        |)
                      ]
                    |)
                  ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchesInternal_P.
    
    (* StructTuple
      {
        name := "MatchesInternal";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.associated ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchesInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ].
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              f.debug_tuple("MatchesInternal").field(&self.0).finish()
          }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "MatchesInternal" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::MatchesInternal",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_MatchesInternal_P.
    
    Module Impl_core_str_iter_MatchesInternal_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ].
      
      (*
          fn next(&mut self) -> Option<&'a str> {
              // SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries.
              self.0.next_match().map(|(a, b)| unsafe {
                  // Indices are known to be on utf8 boundaries
                  self.0.haystack().get_unchecked(a..b)
              })
          }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply
                  (Ty.path "core::option::Option")
                  []
                  [ Ty.tuple [ Ty.path "usize"; Ty.path "usize" ] ],
                "map",
                [
                  Ty.apply (Ty.path "&") [] [ Ty.path "str" ];
                  Ty.function
                    [ Ty.tuple [ Ty.tuple [ Ty.path "usize"; Ty.path "usize" ] ] ]
                    (Ty.apply (Ty.path "&") [] [ Ty.path "str" ])
                ]
              |),
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::str::pattern::Searcher",
                    Ty.associated,
                    [],
                    "next_match",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::MatchesInternal",
                      0
                    |)
                  ]
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                  let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                  let a := M.copy (| γ0_0 |) in
                                  let b := M.copy (| γ0_1 |) in
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "str",
                                      "get_unchecked",
                                      [
                                        Ty.apply
                                          (Ty.path "core::ops::range::Range")
                                          []
                                          [ Ty.path "usize" ]
                                      ]
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::str::pattern::Searcher",
                                          Ty.associated,
                                          [],
                                          "haystack",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_tuple_field (|
                                            M.read (| self |),
                                            "core::str::iter::MatchesInternal",
                                            0
                                          |)
                                        ]
                                      |);
                                      Value.StructRecord
                                        "core::ops::range::Range"
                                        [ ("start", M.read (| a |)); ("end_", M.read (| b |)) ]
                                    ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next" (next P).
      
      (*
          fn next_back(&mut self) -> Option<&'a str>
          where
              P::Searcher<'a>: ReverseSearcher<'a>,
          {
              // SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries.
              self.0.next_match_back().map(|(a, b)| unsafe {
                  // Indices are known to be on utf8 boundaries
                  self.0.haystack().get_unchecked(a..b)
              })
          }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply
                  (Ty.path "core::option::Option")
                  []
                  [ Ty.tuple [ Ty.path "usize"; Ty.path "usize" ] ],
                "map",
                [
                  Ty.apply (Ty.path "&") [] [ Ty.path "str" ];
                  Ty.function
                    [ Ty.tuple [ Ty.tuple [ Ty.path "usize"; Ty.path "usize" ] ] ]
                    (Ty.apply (Ty.path "&") [] [ Ty.path "str" ])
                ]
              |),
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::str::pattern::ReverseSearcher",
                    Ty.associated,
                    [],
                    "next_match_back",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::MatchesInternal",
                      0
                    |)
                  ]
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                                  let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                                  let a := M.copy (| γ0_0 |) in
                                  let b := M.copy (| γ0_1 |) in
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "str",
                                      "get_unchecked",
                                      [
                                        Ty.apply
                                          (Ty.path "core::ops::range::Range")
                                          []
                                          [ Ty.path "usize" ]
                                      ]
                                    |),
                                    [
                                      M.call_closure (|
                                        M.get_trait_method (|
                                          "core::str::pattern::Searcher",
                                          Ty.associated,
                                          [],
                                          "haystack",
                                          []
                                        |),
                                        [
                                          M.SubPointer.get_struct_tuple_field (|
                                            M.read (| self |),
                                            "core::str::iter::MatchesInternal",
                                            0
                                          |)
                                        ]
                                      |);
                                      Value.StructRecord
                                        "core::ops::range::Range"
                                        [ ("start", M.read (| a |)); ("end_", M.read (| b |)) ]
                                    ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_next_back :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "next_back" (next_back P).
    End Impl_core_str_iter_MatchesInternal_P.
    
    (* StructTuple
      {
        name := "Matches";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Matches") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($forward_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "Matches" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::Matches",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Matches") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Matches",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Matches") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $forward_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::Matches"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::Matches",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
    
    (* StructTuple
      {
        name := "RMatches";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RMatches") [] [ P ].
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      f.debug_tuple(stringify!($reverse_iterator))
                          .field(&self.0)
                          .finish()
                  }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugTuple",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugTuple",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_tuple",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "RMatches" |) ]
                      |)
                    |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RMatches",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RMatches") [] [ P ].
      
      (*             type Item = $iterty; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
                  fn next(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RMatches",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RMatches") [] [ P ].
      
      (*
                  fn clone(&self) -> Self {
                      $reverse_iterator(self.0.clone())
                  }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::RMatches"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::RMatches",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Matches") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RMatches") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::Matches") [] [ P ].
      
      (*
                  fn next_back(&mut self) -> Option<$iterty> {
                      self.0.next_back()
                  }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Matches",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_Matches_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
      Definition Self (P : Ty.t) : Ty.t := Ty.apply (Ty.path "core::str::iter::RMatches") [] [ P ].
      
      (*
                  fn next_back(&mut self) -> Option<$iterty> {
                      self.0.next()
                  }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::MatchesInternal") [] [ P ],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::RMatches",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_RMatches_P.
    
    (* StructTuple
      {
        name := "Lines";
        const_params := [];
        ty_params := [];
        fields :=
          [
            Ty.apply
              (Ty.path "core::iter::adapters::map::Map")
              []
              [
                Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ Ty.path "char" ];
                Ty.path "core::str::LinesMap"
              ]
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_Lines.
      Definition Self : Ty.t := Ty.path "core::str::iter::Lines".
      
      (* 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
              "core::str::iter::Lines"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply
                      (Ty.path "core::iter::adapters::map::Map")
                      []
                      [
                        Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ Ty.path "char" ];
                        Ty.path "core::str::LinesMap"
                      ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::Lines",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => 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_core_str_iter_Lines.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_Lines.
      Definition Self : Ty.t := Ty.path "core::str::iter::Lines".
      
      (* 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_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "Lines" |);
                M.alloc (|
                  M.SubPointer.get_struct_tuple_field (|
                    M.read (| self |),
                    "core::str::iter::Lines",
                    0
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_Lines.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_Lines.
      Definition Self : Ty.t := Ty.path "core::str::iter::Lines".
      
      (*     type Item = &'a str; *)
      Definition _Item : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
          fn next(&mut self) -> Option<&'a str> {
              self.0.next()
          }
      *)
      Definition next (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::map::Map")
                  []
                  [
                    Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ Ty.path "char" ];
                    Ty.path "core::str::LinesMap"
                  ],
                [],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Lines",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn size_hint(&self) -> (usize, Option<usize>) {
              self.0.size_hint()
          }
      *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::map::Map")
                  []
                  [
                    Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ Ty.path "char" ];
                    Ty.path "core::str::LinesMap"
                  ],
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Lines",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn last(mut self) -> Option<&'a str> {
              self.next_back()
          }
      *)
      Definition last (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.path "core::str::iter::Lines",
                [],
                "next_back",
                []
              |),
              [ self ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint);
            ("last", InstanceField.Method last)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_Lines.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_Lines.
      Definition Self : Ty.t := Ty.path "core::str::iter::Lines".
      
      (*
          fn next_back(&mut self) -> Option<&'a str> {
              self.0.next_back()
          }
      *)
      Definition next_back (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::map::Map")
                  []
                  [
                    Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ Ty.path "char" ];
                    Ty.path "core::str::LinesMap"
                  ],
                [],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::Lines",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method next_back) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_Lines.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_Lines.
      Definition Self : Ty.t := Ty.path "core::str::iter::Lines".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_Lines.
    
    Module Impl_core_str_iter_Lines.
      Definition Self : Ty.t := Ty.path "core::str::iter::Lines".
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.0.iter.remainder()
          }
      *)
      Definition remainder (ε : 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::str::iter::SplitInclusive") [] [ Ty.path "char" ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.SubPointer.get_struct_tuple_field (|
                    M.read (| self |),
                    "core::str::iter::Lines",
                    0
                  |),
                  "core::iter::adapters::map::Map",
                  "iter"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder : M.IsAssociatedFunction Self "remainder" remainder.
    End Impl_core_str_iter_Lines.
    
    (* StructTuple
      {
        name := "LinesAny";
        const_params := [];
        ty_params := [];
        fields := [ Ty.path "core::str::iter::Lines" ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_LinesAny.
      Definition Self : Ty.t := Ty.path "core::str::iter::LinesAny".
      
      (* 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
              "core::str::iter::LinesAny"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.path "core::str::iter::Lines",
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::LinesAny",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => 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_core_str_iter_LinesAny.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_LinesAny.
      Definition Self : Ty.t := Ty.path "core::str::iter::LinesAny".
      
      (* 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_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "LinesAny" |);
                M.alloc (|
                  M.SubPointer.get_struct_tuple_field (|
                    M.read (| self |),
                    "core::str::iter::LinesAny",
                    0
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_LinesAny.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_LinesAny.
      Definition Self : Ty.t := Ty.path "core::str::iter::LinesAny".
      
      (*     type Item = &'a str; *)
      Definition _Item : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
          fn next(&mut self) -> Option<&'a str> {
              self.0.next()
          }
      *)
      Definition next (ε : 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::iter::traits::iterator::Iterator",
                Ty.path "core::str::iter::Lines",
                [],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::LinesAny",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn size_hint(&self) -> (usize, Option<usize>) {
              self.0.size_hint()
          }
      *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.path "core::str::iter::Lines",
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::LinesAny",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_LinesAny.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_LinesAny.
      Definition Self : Ty.t := Ty.path "core::str::iter::LinesAny".
      
      (*
          fn next_back(&mut self) -> Option<&'a str> {
              self.0.next_back()
          }
      *)
      Definition next_back (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.path "core::str::iter::Lines",
                [],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::LinesAny",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method next_back) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_LinesAny.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_LinesAny.
      Definition Self : Ty.t := Ty.path "core::str::iter::LinesAny".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_LinesAny.
    
    (* StructRecord
      {
        name := "SplitWhitespace";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("inner",
              Ty.apply
                (Ty.path "core::iter::adapters::filter::Filter")
                []
                [
                  Ty.apply
                    (Ty.path "core::str::iter::Split")
                    []
                    [ Ty.path "core::str::IsWhitespace" ];
                  Ty.path "core::str::IsNotEmpty"
                ])
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_SplitWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitWhitespace".
      
      (* 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
              "core::str::iter::SplitWhitespace"
              [
                ("inner",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.apply
                        (Ty.path "core::iter::adapters::filter::Filter")
                        []
                        [
                          Ty.apply
                            (Ty.path "core::str::iter::Split")
                            []
                            [ Ty.path "core::str::IsWhitespace" ];
                          Ty.path "core::str::IsNotEmpty"
                        ],
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::SplitWhitespace",
                        "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_core_str_iter_SplitWhitespace.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_SplitWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitWhitespace".
      
      (* 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_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "SplitWhitespace" |);
                M.read (| Value.String "inner" |);
                M.alloc (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::str::iter::SplitWhitespace",
                    "inner"
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_SplitWhitespace.
    
    (* StructRecord
      {
        name := "SplitAsciiWhitespace";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("inner",
              Ty.apply
                (Ty.path "core::iter::adapters::map::Map")
                []
                [
                  Ty.apply
                    (Ty.path "core::iter::adapters::filter::Filter")
                    []
                    [
                      Ty.apply
                        (Ty.path "core::slice::iter::Split")
                        []
                        [ Ty.path "u8"; Ty.path "core::str::IsAsciiWhitespace" ];
                      Ty.path "core::str::BytesIsNotEmpty"
                    ];
                  Ty.path "core::str::UnsafeBytesToStr"
                ])
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_SplitAsciiWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitAsciiWhitespace".
      
      (* 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
              "core::str::iter::SplitAsciiWhitespace"
              [
                ("inner",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.apply
                        (Ty.path "core::iter::adapters::map::Map")
                        []
                        [
                          Ty.apply
                            (Ty.path "core::iter::adapters::filter::Filter")
                            []
                            [
                              Ty.apply
                                (Ty.path "core::slice::iter::Split")
                                []
                                [ Ty.path "u8"; Ty.path "core::str::IsAsciiWhitespace" ];
                              Ty.path "core::str::BytesIsNotEmpty"
                            ];
                          Ty.path "core::str::UnsafeBytesToStr"
                        ],
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::SplitAsciiWhitespace",
                        "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_core_str_iter_SplitAsciiWhitespace.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_SplitAsciiWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitAsciiWhitespace".
      
      (* 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_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "SplitAsciiWhitespace" |);
                M.read (| Value.String "inner" |);
                M.alloc (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::str::iter::SplitAsciiWhitespace",
                    "inner"
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_SplitAsciiWhitespace.
    
    (* StructTuple
      {
        name := "SplitInclusive";
        const_params := [];
        ty_params := [ "P" ];
        fields := [ Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ] ];
      } *)
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_SplitWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitWhitespace".
      
      (*     type Item = &'a str; *)
      Definition _Item : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
          fn next(&mut self) -> Option<&'a str> {
              self.inner.next()
          }
      *)
      Definition next (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::filter::Filter")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::str::iter::Split")
                      []
                      [ Ty.path "core::str::IsWhitespace" ];
                    Ty.path "core::str::IsNotEmpty"
                  ],
                [],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitWhitespace",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn size_hint(&self) -> (usize, Option<usize>) {
              self.inner.size_hint()
          }
      *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::filter::Filter")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::str::iter::Split")
                      []
                      [ Ty.path "core::str::IsWhitespace" ];
                    Ty.path "core::str::IsNotEmpty"
                  ],
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitWhitespace",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn last(mut self) -> Option<&'a str> {
              self.next_back()
          }
      *)
      Definition last (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.path "core::str::iter::SplitWhitespace",
                [],
                "next_back",
                []
              |),
              [ self ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint);
            ("last", InstanceField.Method last)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_SplitWhitespace.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_SplitWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitWhitespace".
      
      (*
          fn next_back(&mut self) -> Option<&'a str> {
              self.inner.next_back()
          }
      *)
      Definition next_back (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::filter::Filter")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::str::iter::Split")
                      []
                      [ Ty.path "core::str::IsWhitespace" ];
                    Ty.path "core::str::IsNotEmpty"
                  ],
                [],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitWhitespace",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method next_back) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_SplitWhitespace.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_SplitWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitWhitespace".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_SplitWhitespace.
    
    Module Impl_core_str_iter_SplitWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitWhitespace".
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.inner.iter.remainder()
          }
      *)
      Definition remainder (ε : 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::str::iter::Split")
                  []
                  [ Ty.path "core::str::IsWhitespace" ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::str::iter::SplitWhitespace",
                    "inner"
                  |),
                  "core::iter::adapters::filter::Filter",
                  "iter"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder : M.IsAssociatedFunction Self "remainder" remainder.
    End Impl_core_str_iter_SplitWhitespace.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_SplitAsciiWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitAsciiWhitespace".
      
      (*     type Item = &'a str; *)
      Definition _Item : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
          fn next(&mut self) -> Option<&'a str> {
              self.inner.next()
          }
      *)
      Definition next (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::map::Map")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::iter::adapters::filter::Filter")
                      []
                      [
                        Ty.apply
                          (Ty.path "core::slice::iter::Split")
                          []
                          [ Ty.path "u8"; Ty.path "core::str::IsAsciiWhitespace" ];
                        Ty.path "core::str::BytesIsNotEmpty"
                      ];
                    Ty.path "core::str::UnsafeBytesToStr"
                  ],
                [],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitAsciiWhitespace",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn size_hint(&self) -> (usize, Option<usize>) {
              self.inner.size_hint()
          }
      *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::map::Map")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::iter::adapters::filter::Filter")
                      []
                      [
                        Ty.apply
                          (Ty.path "core::slice::iter::Split")
                          []
                          [ Ty.path "u8"; Ty.path "core::str::IsAsciiWhitespace" ];
                        Ty.path "core::str::BytesIsNotEmpty"
                      ];
                    Ty.path "core::str::UnsafeBytesToStr"
                  ],
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitAsciiWhitespace",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn last(mut self) -> Option<&'a str> {
              self.next_back()
          }
      *)
      Definition last (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.path "core::str::iter::SplitAsciiWhitespace",
                [],
                "next_back",
                []
              |),
              [ self ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint);
            ("last", InstanceField.Method last)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_SplitAsciiWhitespace.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_SplitAsciiWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitAsciiWhitespace".
      
      (*
          fn next_back(&mut self) -> Option<&'a str> {
              self.inner.next_back()
          }
      *)
      Definition next_back (ε : 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::iter::traits::double_ended::DoubleEndedIterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::map::Map")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::iter::adapters::filter::Filter")
                      []
                      [
                        Ty.apply
                          (Ty.path "core::slice::iter::Split")
                          []
                          [ Ty.path "u8"; Ty.path "core::str::IsAsciiWhitespace" ];
                        Ty.path "core::str::BytesIsNotEmpty"
                      ];
                    Ty.path "core::str::UnsafeBytesToStr"
                  ],
                [],
                "next_back",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::SplitAsciiWhitespace",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method next_back) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_for_core_str_iter_SplitAsciiWhitespace.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_SplitAsciiWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitAsciiWhitespace".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_SplitAsciiWhitespace.
    
    Module Impl_core_str_iter_SplitAsciiWhitespace.
      Definition Self : Ty.t := Ty.path "core::str::iter::SplitAsciiWhitespace".
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              if self.inner.iter.iter.finished {
                  return None;
              }
      
              // SAFETY: Slice is created from str.
              Some(unsafe { crate::str::from_utf8_unchecked(&self.inner.iter.iter.v) })
          }
      *)
      Definition remainder (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.SubPointer.get_struct_record_field (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::str::iter::SplitAsciiWhitespace",
                                        "inner"
                                      |),
                                      "core::iter::adapters::map::Map",
                                      "iter"
                                    |),
                                    "core::iter::adapters::filter::Filter",
                                    "iter"
                                  |),
                                  "core::slice::iter::Split",
                                  "finished"
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  M.return_ (| Value.StructTuple "core::option::Option::None" [] |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  M.alloc (|
                    Value.StructTuple
                      "core::option::Option::Some"
                      [
                        M.call_closure (|
                          M.get_function (| "core::str::converts::from_utf8_unchecked", [] |),
                          [
                            M.read (|
                              M.SubPointer.get_struct_record_field (|
                                M.SubPointer.get_struct_record_field (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "core::str::iter::SplitAsciiWhitespace",
                                      "inner"
                                    |),
                                    "core::iter::adapters::map::Map",
                                    "iter"
                                  |),
                                  "core::iter::adapters::filter::Filter",
                                  "iter"
                                |),
                                "core::slice::iter::Split",
                                "v"
                              |)
                            |)
                          ]
                        |)
                      ]
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder : M.IsAssociatedFunction Self "remainder" remainder.
    End Impl_core_str_iter_SplitAsciiWhitespace.
    
    Module Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ P ].
      
      (*     type Item = &'a str; *)
      Definition _Item (P : Ty.t) : Ty.t := Ty.apply (Ty.path "&") [] [ Ty.path "str" ].
      
      (*
          fn next(&mut self) -> Option<&'a str> {
              self.0.next_inclusive()
          }
      *)
      Definition next (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next_inclusive",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::SplitInclusive",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("Item", InstanceField.Ty (_Item P)); ("next", InstanceField.Method (next P)) ].
    End Impl_core_iter_traits_iterator_Iterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
    
    Module Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ P ].
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              f.debug_struct("SplitInclusive").field("0", &self.0).finish()
          }
      *)
      Definition fmt (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        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::builders::DebugStruct",
                "finish",
                []
              |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugStruct",
                    "field",
                    []
                  |),
                  [
                    M.alloc (|
                      M.call_closure (|
                        M.get_associated_function (|
                          Ty.path "core::fmt::Formatter",
                          "debug_struct",
                          []
                        |),
                        [ M.read (| f |); M.read (| Value.String "SplitInclusive" |) ]
                      |)
                    |);
                    M.read (| Value.String "0" |);
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::SplitInclusive",
                      0
                    |)
                  ]
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt P)) ].
    End Impl_core_fmt_Debug_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
    
    Module Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ P ].
      
      (*
          fn clone(&self) -> Self {
              SplitInclusive(self.0.clone())
          }
      *)
      Definition clone (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            Value.StructTuple
              "core::str::iter::SplitInclusive"
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::clone::Clone",
                    Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                    [],
                    "clone",
                    []
                  |),
                  [
                    M.SubPointer.get_struct_tuple_field (|
                      M.read (| self |),
                      "core::str::iter::SplitInclusive",
                      0
                    |)
                  ]
                |)
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::clone::Clone"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method (clone P)) ].
    End Impl_core_clone_Clone_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
    
    Module Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ P ].
      
      (*
          fn next_back(&mut self) -> Option<&'a str> {
              self.0.next_back_inclusive()
          }
      *)
      Definition next_back (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "next_back_inclusive",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::SplitInclusive",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::double_ended::DoubleEndedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("next_back", InstanceField.Method (next_back P)) ].
    End Impl_core_iter_traits_double_ended_DoubleEndedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
    
    Module Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ P ].
      
      Axiom Implements :
        forall (P : Ty.t),
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          (Self P)
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_where_core_str_pattern_Pattern_P_for_core_str_iter_SplitInclusive_P.
    
    Module Impl_core_str_iter_SplitInclusive_P.
      Definition Self (P : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::str::iter::SplitInclusive") [] [ P ].
      
      (*
          pub fn remainder(&self) -> Option<&'a str> {
              self.0.remainder()
          }
      *)
      Definition remainder (P : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self P in
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply (Ty.path "core::str::iter::SplitInternal") [] [ P ],
                "remainder",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::str::iter::SplitInclusive",
                  0
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_remainder :
        forall (P : Ty.t),
        M.IsAssociatedFunction (Self P) "remainder" (remainder P).
    End Impl_core_str_iter_SplitInclusive_P.
    
    (* StructRecord
      {
        name := "EncodeUtf16";
        const_params := [];
        ty_params := [];
        fields := [ ("chars", Ty.path "core::str::iter::Chars"); ("extra", Ty.path "u16") ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_EncodeUtf16.
      Definition Self : Ty.t := Ty.path "core::str::iter::EncodeUtf16".
      
      (* 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
              "core::str::iter::EncodeUtf16"
              [
                ("chars",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.path "core::str::iter::Chars",
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::EncodeUtf16",
                        "chars"
                      |)
                    ]
                  |));
                ("extra",
                  M.call_closure (|
                    M.get_trait_method (| "core::clone::Clone", Ty.path "u16", [], "clone", [] |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::EncodeUtf16",
                        "extra"
                      |)
                    ]
                  |))
              ]))
        | _, _, _ => 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_core_str_iter_EncodeUtf16.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_EncodeUtf16.
      Definition Self : Ty.t := Ty.path "core::str::iter::EncodeUtf16".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              f.debug_struct("EncodeUtf16").finish_non_exhaustive()
          }
      *)
      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::builders::DebugStruct",
                "finish_non_exhaustive",
                []
              |),
              [
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "core::fmt::Formatter",
                      "debug_struct",
                      []
                    |),
                    [ M.read (| f |); M.read (| Value.String "EncodeUtf16" |) ]
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_EncodeUtf16.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_EncodeUtf16.
      Definition Self : Ty.t := Ty.path "core::str::iter::EncodeUtf16".
      
      (*     type Item = u16; *)
      Definition _Item : Ty.t := Ty.path "u16".
      
      (*
          fn next(&mut self) -> Option<u16> {
              if self.extra != 0 {
                  let tmp = self.extra;
                  self.extra = 0;
                  return Some(tmp);
              }
      
              let mut buf = [0; 2];
              self.chars.next().map(|ch| {
                  let n = ch.encode_utf16(&mut buf).len();
                  if n == 2 {
                      self.extra = buf[1];
                  }
                  buf[0]
              })
          }
      *)
      Definition next (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  let~ _ :=
                    M.match_operator (|
                      M.alloc (| Value.Tuple [] |),
                      [
                        fun γ =>
                          ltac:(M.monadic
                            (let γ :=
                              M.use
                                (M.alloc (|
                                  BinOp.ne (|
                                    M.read (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::str::iter::EncodeUtf16",
                                        "extra"
                                      |)
                                    |),
                                    Value.Integer IntegerKind.U16 0
                                  |)
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                            M.alloc (|
                              M.never_to_any (|
                                M.read (|
                                  let~ tmp :=
                                    M.copy (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::str::iter::EncodeUtf16",
                                        "extra"
                                      |)
                                    |) in
                                  let~ _ :=
                                    M.write (|
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::str::iter::EncodeUtf16",
                                        "extra"
                                      |),
                                      Value.Integer IntegerKind.U16 0
                                    |) in
                                  M.return_ (|
                                    Value.StructTuple
                                      "core::option::Option::Some"
                                      [ M.read (| tmp |) ]
                                  |)
                                |)
                              |)
                            |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let~ buf :=
                    M.alloc (|
                      repeat (|
                        Value.Integer IntegerKind.U16 0,
                        Value.Integer IntegerKind.Usize 2
                      |)
                    |) in
                  M.alloc (|
                    M.call_closure (|
                      M.get_associated_function (|
                        Ty.apply (Ty.path "core::option::Option") [] [ Ty.path "char" ],
                        "map",
                        [ Ty.path "u16"; Ty.function [ Ty.tuple [ Ty.path "char" ] ] (Ty.path "u16")
                        ]
                      |),
                      [
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::iter::traits::iterator::Iterator",
                            Ty.path "core::str::iter::Chars",
                            [],
                            "next",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::str::iter::EncodeUtf16",
                              "chars"
                            |)
                          ]
                        |);
                        M.closure
                          (fun γ =>
                            ltac:(M.monadic
                              match γ with
                              | [ α0 ] =>
                                ltac:(M.monadic
                                  (M.match_operator (|
                                    M.alloc (| α0 |),
                                    [
                                      fun γ =>
                                        ltac:(M.monadic
                                          (let ch := M.copy (| γ |) in
                                          M.read (|
                                            let~ n :=
                                              M.alloc (|
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.apply (Ty.path "slice") [] [ Ty.path "u16" ],
                                                    "len",
                                                    []
                                                  |),
                                                  [
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "char",
                                                        "encode_utf16",
                                                        []
                                                      |),
                                                      [ M.read (| ch |); buf ]
                                                    |)
                                                  ]
                                                |)
                                              |) in
                                            let~ _ :=
                                              M.match_operator (|
                                                M.alloc (| Value.Tuple [] |),
                                                [
                                                  fun γ =>
                                                    ltac:(M.monadic
                                                      (let γ :=
                                                        M.use
                                                          (M.alloc (|
                                                            BinOp.eq (|
                                                              M.read (| n |),
                                                              Value.Integer IntegerKind.Usize 2
                                                            |)
                                                          |)) in
                                                      let _ :=
                                                        M.is_constant_or_break_match (|
                                                          M.read (| γ |),
                                                          Value.Bool true
                                                        |) in
                                                      let~ _ :=
                                                        M.write (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| self |),
                                                            "core::str::iter::EncodeUtf16",
                                                            "extra"
                                                          |),
                                                          M.read (|
                                                            M.SubPointer.get_array_field (|
                                                              buf,
                                                              M.alloc (|
                                                                Value.Integer IntegerKind.Usize 1
                                                              |)
                                                            |)
                                                          |)
                                                        |) in
                                                      M.alloc (| Value.Tuple [] |)));
                                                  fun γ =>
                                                    ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                                ]
                                              |) in
                                            M.SubPointer.get_array_field (|
                                              buf,
                                              M.alloc (| Value.Integer IntegerKind.Usize 0 |)
                                            |)
                                          |)))
                                    ]
                                  |)))
                              | _ => M.impossible "wrong number of arguments"
                              end))
                      ]
                    |)
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn size_hint(&self) -> (usize, Option<usize>) {
              let len = self.chars.iter.len();
              // The highest bytes:code units ratio occurs for 3-byte sequences,
              // since a 4-byte sequence results in 2 code units. The lower bound
              // is therefore determined by assuming the remaining bytes contain as
              // many 3-byte sequences as possible. The highest bytes:code units
              // ratio is for 1-byte sequences, so use this for the upper bound.
              // `(len + 2)` can't overflow, because we know that the `slice::Iter`
              // belongs to a slice in memory which has a maximum length of
              // `isize::MAX` (that's well below `usize::MAX`)
              if self.extra == 0 {
                  ((len + 2) / 3, Some(len))
              } else {
                  // We're in the middle of a surrogate pair, so add the remaining
                  // surrogate to the bounds.
                  ((len + 2) / 3 + 1, Some(len + 1))
              }
          }
      *)
      Definition size_hint (ε : 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~ len :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::iter::traits::exact_size::ExactSizeIterator",
                      Ty.apply (Ty.path "core::slice::iter::Iter") [] [ Ty.path "u8" ],
                      [],
                      "len",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::str::iter::EncodeUtf16",
                          "chars"
                        |),
                        "core::str::iter::Chars",
                        "iter"
                      |)
                    ]
                  |)
                |) in
              M.match_operator (|
                M.alloc (| Value.Tuple [] |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ :=
                        M.use
                          (M.alloc (|
                            BinOp.eq (|
                              M.read (|
                                M.SubPointer.get_struct_record_field (|
                                  M.read (| self |),
                                  "core::str::iter::EncodeUtf16",
                                  "extra"
                                |)
                              |),
                              Value.Integer IntegerKind.U16 0
                            |)
                          |)) in
                      let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                      M.alloc (|
                        Value.Tuple
                          [
                            BinOp.Wrap.div (|
                              BinOp.Wrap.add (|
                                M.read (| len |),
                                Value.Integer IntegerKind.Usize 2
                              |),
                              Value.Integer IntegerKind.Usize 3
                            |);
                            Value.StructTuple "core::option::Option::Some" [ M.read (| len |) ]
                          ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (M.alloc (|
                        Value.Tuple
                          [
                            BinOp.Wrap.add (|
                              BinOp.Wrap.div (|
                                BinOp.Wrap.add (|
                                  M.read (| len |),
                                  Value.Integer IntegerKind.Usize 2
                                |),
                                Value.Integer IntegerKind.Usize 3
                              |),
                              Value.Integer IntegerKind.Usize 1
                            |);
                            Value.StructTuple
                              "core::option::Option::Some"
                              [
                                BinOp.Wrap.add (|
                                  M.read (| len |),
                                  Value.Integer IntegerKind.Usize 1
                                |)
                              ]
                          ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_EncodeUtf16.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_EncodeUtf16.
      Definition Self : Ty.t := Ty.path "core::str::iter::EncodeUtf16".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_EncodeUtf16.
    
    (* StructRecord
      {
        name := "EscapeDebug";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("inner",
              Ty.apply
                (Ty.path "core::iter::adapters::chain::Chain")
                []
                [
                  Ty.apply
                    (Ty.path "core::iter::adapters::flatten::Flatten")
                    []
                    [
                      Ty.apply
                        (Ty.path "core::option::IntoIter")
                        []
                        [ Ty.path "core::char::EscapeDebug" ]
                    ];
                  Ty.apply
                    (Ty.path "core::iter::adapters::flatten::FlatMap")
                    []
                    [
                      Ty.path "core::str::iter::Chars";
                      Ty.path "core::char::EscapeDebug";
                      Ty.path "core::str::CharEscapeDebugContinue"
                    ]
                ])
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_EscapeDebug.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDebug".
      
      (* 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
              "core::str::iter::EscapeDebug"
              [
                ("inner",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.apply
                        (Ty.path "core::iter::adapters::chain::Chain")
                        []
                        [
                          Ty.apply
                            (Ty.path "core::iter::adapters::flatten::Flatten")
                            []
                            [
                              Ty.apply
                                (Ty.path "core::option::IntoIter")
                                []
                                [ Ty.path "core::char::EscapeDebug" ]
                            ];
                          Ty.apply
                            (Ty.path "core::iter::adapters::flatten::FlatMap")
                            []
                            [
                              Ty.path "core::str::iter::Chars";
                              Ty.path "core::char::EscapeDebug";
                              Ty.path "core::str::CharEscapeDebugContinue"
                            ]
                        ],
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::EscapeDebug",
                        "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_core_str_iter_EscapeDebug.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_EscapeDebug.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDebug".
      
      (* 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_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "EscapeDebug" |);
                M.read (| Value.String "inner" |);
                M.alloc (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::str::iter::EscapeDebug",
                    "inner"
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_EscapeDebug.
    
    (* StructRecord
      {
        name := "EscapeDefault";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("inner",
              Ty.apply
                (Ty.path "core::iter::adapters::flatten::FlatMap")
                []
                [
                  Ty.path "core::str::iter::Chars";
                  Ty.path "core::char::EscapeDefault";
                  Ty.path "core::str::CharEscapeDefault"
                ])
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_EscapeDefault.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDefault".
      
      (* 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
              "core::str::iter::EscapeDefault"
              [
                ("inner",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.apply
                        (Ty.path "core::iter::adapters::flatten::FlatMap")
                        []
                        [
                          Ty.path "core::str::iter::Chars";
                          Ty.path "core::char::EscapeDefault";
                          Ty.path "core::str::CharEscapeDefault"
                        ],
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::EscapeDefault",
                        "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_core_str_iter_EscapeDefault.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_EscapeDefault.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDefault".
      
      (* 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_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "EscapeDefault" |);
                M.read (| Value.String "inner" |);
                M.alloc (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::str::iter::EscapeDefault",
                    "inner"
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_EscapeDefault.
    
    (* StructRecord
      {
        name := "EscapeUnicode";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("inner",
              Ty.apply
                (Ty.path "core::iter::adapters::flatten::FlatMap")
                []
                [
                  Ty.path "core::str::iter::Chars";
                  Ty.path "core::char::EscapeUnicode";
                  Ty.path "core::str::CharEscapeUnicode"
                ])
          ];
      } *)
    
    Module Impl_core_clone_Clone_for_core_str_iter_EscapeUnicode.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeUnicode".
      
      (* 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
              "core::str::iter::EscapeUnicode"
              [
                ("inner",
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.apply
                        (Ty.path "core::iter::adapters::flatten::FlatMap")
                        []
                        [
                          Ty.path "core::str::iter::Chars";
                          Ty.path "core::char::EscapeUnicode";
                          Ty.path "core::str::CharEscapeUnicode"
                        ],
                      [],
                      "clone",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::str::iter::EscapeUnicode",
                        "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_core_str_iter_EscapeUnicode.
    
    Module Impl_core_fmt_Debug_for_core_str_iter_EscapeUnicode.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeUnicode".
      
      (* 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_field1_finish",
                []
              |),
              [
                M.read (| f |);
                M.read (| Value.String "EscapeUnicode" |);
                M.read (| Value.String "inner" |);
                M.alloc (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::str::iter::EscapeUnicode",
                    "inner"
                  |)
                |)
              ]
            |)))
        | _, _, _ => 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_core_str_iter_EscapeUnicode.
    
    Module Impl_core_fmt_Display_for_core_str_iter_EscapeDebug.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDebug".
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      self.clone().try_for_each(|c| f.write_char(c))
                  }
      *)
      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::iter::traits::iterator::Iterator",
                Ty.path "core::str::iter::EscapeDebug",
                [],
                "try_for_each",
                [
                  Ty.function
                    [ Ty.tuple [ Ty.path "char" ] ]
                    (Ty.apply
                      (Ty.path "core::result::Result")
                      []
                      [ Ty.tuple []; Ty.path "core::fmt::Error" ]);
                  Ty.apply
                    (Ty.path "core::result::Result")
                    []
                    [ Ty.tuple []; Ty.path "core::fmt::Error" ]
                ]
              |),
              [
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.path "core::str::iter::EscapeDebug",
                      [],
                      "clone",
                      []
                    |),
                    [ 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 c := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::fmt::Write",
                                      Ty.path "core::fmt::Formatter",
                                      [],
                                      "write_char",
                                      []
                                    |),
                                    [ M.read (| f |); M.read (| c |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => 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_core_str_iter_EscapeDebug.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_EscapeDebug.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDebug".
      
      (*             type Item = char; *)
      Definition _Item : Ty.t := Ty.path "char".
      
      (*             fn next(&mut self) -> Option<char> { self.inner.next() } *)
      Definition next (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::chain::Chain")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::iter::adapters::flatten::Flatten")
                      []
                      [
                        Ty.apply
                          (Ty.path "core::option::IntoIter")
                          []
                          [ Ty.path "core::char::EscapeDebug" ]
                      ];
                    Ty.apply
                      (Ty.path "core::iter::adapters::flatten::FlatMap")
                      []
                      [
                        Ty.path "core::str::iter::Chars";
                        Ty.path "core::char::EscapeDebug";
                        Ty.path "core::str::CharEscapeDebugContinue"
                      ]
                  ],
                [],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeDebug",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*             fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() } *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::chain::Chain")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::iter::adapters::flatten::Flatten")
                      []
                      [
                        Ty.apply
                          (Ty.path "core::option::IntoIter")
                          []
                          [ Ty.path "core::char::EscapeDebug" ]
                      ];
                    Ty.apply
                      (Ty.path "core::iter::adapters::flatten::FlatMap")
                      []
                      [
                        Ty.path "core::str::iter::Chars";
                        Ty.path "core::char::EscapeDebug";
                        Ty.path "core::str::CharEscapeDebugContinue"
                      ]
                  ],
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeDebug",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
                  fn try_fold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
                      Self: Sized, Fold: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>
                  {
                      self.inner.try_fold(init, fold)
                  }
      *)
      Definition try_fold (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ Acc; Fold; R ], [ self; init; fold ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let init := M.alloc (| init |) in
            let fold := M.alloc (| fold |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::chain::Chain")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::iter::adapters::flatten::Flatten")
                      []
                      [
                        Ty.apply
                          (Ty.path "core::option::IntoIter")
                          []
                          [ Ty.path "core::char::EscapeDebug" ]
                      ];
                    Ty.apply
                      (Ty.path "core::iter::adapters::flatten::FlatMap")
                      []
                      [
                        Ty.path "core::str::iter::Chars";
                        Ty.path "core::char::EscapeDebug";
                        Ty.path "core::str::CharEscapeDebugContinue"
                      ]
                  ],
                [],
                "try_fold",
                [ Acc; Fold; R ]
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeDebug",
                  "inner"
                |);
                M.read (| init |);
                M.read (| fold |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
                  fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc
                      where Fold: FnMut(Acc, Self::Item) -> Acc,
                  {
                      self.inner.fold(init, fold)
                  }
      *)
      Definition fold (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ Acc; Fold ], [ self; init; fold ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let init := M.alloc (| init |) in
            let fold := M.alloc (| fold |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::chain::Chain")
                  []
                  [
                    Ty.apply
                      (Ty.path "core::iter::adapters::flatten::Flatten")
                      []
                      [
                        Ty.apply
                          (Ty.path "core::option::IntoIter")
                          []
                          [ Ty.path "core::char::EscapeDebug" ]
                      ];
                    Ty.apply
                      (Ty.path "core::iter::adapters::flatten::FlatMap")
                      []
                      [
                        Ty.path "core::str::iter::Chars";
                        Ty.path "core::char::EscapeDebug";
                        Ty.path "core::str::CharEscapeDebugContinue"
                      ]
                  ],
                [],
                "fold",
                [ Acc; Fold ]
              |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    self,
                    "core::str::iter::EscapeDebug",
                    "inner"
                  |)
                |);
                M.read (| init |);
                M.read (| fold |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint);
            ("try_fold", InstanceField.Method try_fold);
            ("fold", InstanceField.Method fold)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_EscapeDebug.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_EscapeDebug.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDebug".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_EscapeDebug.
    
    Module Impl_core_fmt_Display_for_core_str_iter_EscapeDefault.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDefault".
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      self.clone().try_for_each(|c| f.write_char(c))
                  }
      *)
      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::iter::traits::iterator::Iterator",
                Ty.path "core::str::iter::EscapeDefault",
                [],
                "try_for_each",
                [
                  Ty.function
                    [ Ty.tuple [ Ty.path "char" ] ]
                    (Ty.apply
                      (Ty.path "core::result::Result")
                      []
                      [ Ty.tuple []; Ty.path "core::fmt::Error" ]);
                  Ty.apply
                    (Ty.path "core::result::Result")
                    []
                    [ Ty.tuple []; Ty.path "core::fmt::Error" ]
                ]
              |),
              [
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.path "core::str::iter::EscapeDefault",
                      [],
                      "clone",
                      []
                    |),
                    [ 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 c := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::fmt::Write",
                                      Ty.path "core::fmt::Formatter",
                                      [],
                                      "write_char",
                                      []
                                    |),
                                    [ M.read (| f |); M.read (| c |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => 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_core_str_iter_EscapeDefault.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_EscapeDefault.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDefault".
      
      (*             type Item = char; *)
      Definition _Item : Ty.t := Ty.path "char".
      
      (*             fn next(&mut self) -> Option<char> { self.inner.next() } *)
      Definition next (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::flatten::FlatMap")
                  []
                  [
                    Ty.path "core::str::iter::Chars";
                    Ty.path "core::char::EscapeDefault";
                    Ty.path "core::str::CharEscapeDefault"
                  ],
                [],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeDefault",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*             fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() } *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::flatten::FlatMap")
                  []
                  [
                    Ty.path "core::str::iter::Chars";
                    Ty.path "core::char::EscapeDefault";
                    Ty.path "core::str::CharEscapeDefault"
                  ],
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeDefault",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
                  fn try_fold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
                      Self: Sized, Fold: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>
                  {
                      self.inner.try_fold(init, fold)
                  }
      *)
      Definition try_fold (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ Acc; Fold; R ], [ self; init; fold ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let init := M.alloc (| init |) in
            let fold := M.alloc (| fold |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::flatten::FlatMap")
                  []
                  [
                    Ty.path "core::str::iter::Chars";
                    Ty.path "core::char::EscapeDefault";
                    Ty.path "core::str::CharEscapeDefault"
                  ],
                [],
                "try_fold",
                [ Acc; Fold; R ]
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeDefault",
                  "inner"
                |);
                M.read (| init |);
                M.read (| fold |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
                  fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc
                      where Fold: FnMut(Acc, Self::Item) -> Acc,
                  {
                      self.inner.fold(init, fold)
                  }
      *)
      Definition fold (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ Acc; Fold ], [ self; init; fold ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let init := M.alloc (| init |) in
            let fold := M.alloc (| fold |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::flatten::FlatMap")
                  []
                  [
                    Ty.path "core::str::iter::Chars";
                    Ty.path "core::char::EscapeDefault";
                    Ty.path "core::str::CharEscapeDefault"
                  ],
                [],
                "fold",
                [ Acc; Fold ]
              |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    self,
                    "core::str::iter::EscapeDefault",
                    "inner"
                  |)
                |);
                M.read (| init |);
                M.read (| fold |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint);
            ("try_fold", InstanceField.Method try_fold);
            ("fold", InstanceField.Method fold)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_EscapeDefault.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_EscapeDefault.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeDefault".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_EscapeDefault.
    
    Module Impl_core_fmt_Display_for_core_str_iter_EscapeUnicode.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeUnicode".
      
      (*
                  fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                      self.clone().try_for_each(|c| f.write_char(c))
                  }
      *)
      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::iter::traits::iterator::Iterator",
                Ty.path "core::str::iter::EscapeUnicode",
                [],
                "try_for_each",
                [
                  Ty.function
                    [ Ty.tuple [ Ty.path "char" ] ]
                    (Ty.apply
                      (Ty.path "core::result::Result")
                      []
                      [ Ty.tuple []; Ty.path "core::fmt::Error" ]);
                  Ty.apply
                    (Ty.path "core::result::Result")
                    []
                    [ Ty.tuple []; Ty.path "core::fmt::Error" ]
                ]
              |),
              [
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::clone::Clone",
                      Ty.path "core::str::iter::EscapeUnicode",
                      [],
                      "clone",
                      []
                    |),
                    [ 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 c := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::fmt::Write",
                                      Ty.path "core::fmt::Formatter",
                                      [],
                                      "write_char",
                                      []
                                    |),
                                    [ M.read (| f |); M.read (| c |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => 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_core_str_iter_EscapeUnicode.
    
    Module Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_EscapeUnicode.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeUnicode".
      
      (*             type Item = char; *)
      Definition _Item : Ty.t := Ty.path "char".
      
      (*             fn next(&mut self) -> Option<char> { self.inner.next() } *)
      Definition next (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::flatten::FlatMap")
                  []
                  [
                    Ty.path "core::str::iter::Chars";
                    Ty.path "core::char::EscapeUnicode";
                    Ty.path "core::str::CharEscapeUnicode"
                  ],
                [],
                "next",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeUnicode",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*             fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() } *)
      Definition size_hint (ε : 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::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::flatten::FlatMap")
                  []
                  [
                    Ty.path "core::str::iter::Chars";
                    Ty.path "core::char::EscapeUnicode";
                    Ty.path "core::str::CharEscapeUnicode"
                  ],
                [],
                "size_hint",
                []
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeUnicode",
                  "inner"
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
                  fn try_fold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R where
                      Self: Sized, Fold: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>
                  {
                      self.inner.try_fold(init, fold)
                  }
      *)
      Definition try_fold (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ Acc; Fold; R ], [ self; init; fold ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let init := M.alloc (| init |) in
            let fold := M.alloc (| fold |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::flatten::FlatMap")
                  []
                  [
                    Ty.path "core::str::iter::Chars";
                    Ty.path "core::char::EscapeUnicode";
                    Ty.path "core::str::CharEscapeUnicode"
                  ],
                [],
                "try_fold",
                [ Acc; Fold; R ]
              |),
              [
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::str::iter::EscapeUnicode",
                  "inner"
                |);
                M.read (| init |);
                M.read (| fold |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
                  fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc
                      where Fold: FnMut(Acc, Self::Item) -> Acc,
                  {
                      self.inner.fold(init, fold)
                  }
      *)
      Definition fold (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ Acc; Fold ], [ self; init; fold ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let init := M.alloc (| init |) in
            let fold := M.alloc (| fold |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::iter::traits::iterator::Iterator",
                Ty.apply
                  (Ty.path "core::iter::adapters::flatten::FlatMap")
                  []
                  [
                    Ty.path "core::str::iter::Chars";
                    Ty.path "core::char::EscapeUnicode";
                    Ty.path "core::str::CharEscapeUnicode"
                  ],
                [],
                "fold",
                [ Acc; Fold ]
              |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    self,
                    "core::str::iter::EscapeUnicode",
                    "inner"
                  |)
                |);
                M.read (| init |);
                M.read (| fold |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::iterator::Iterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("Item", InstanceField.Ty _Item);
            ("next", InstanceField.Method next);
            ("size_hint", InstanceField.Method size_hint);
            ("try_fold", InstanceField.Method try_fold);
            ("fold", InstanceField.Method fold)
          ].
    End Impl_core_iter_traits_iterator_Iterator_for_core_str_iter_EscapeUnicode.
    
    Module Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_EscapeUnicode.
      Definition Self : Ty.t := Ty.path "core::str::iter::EscapeUnicode".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::iter::traits::marker::FusedIterator"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_iter_traits_marker_FusedIterator_for_core_str_iter_EscapeUnicode.
  End iter.
End str.
