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

Module fmt.
  Module builders.
    (* StructRecord
      {
        name := "PadAdapter";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("buf", Ty.apply (Ty.path "&mut") [] [ Ty.dyn [ ("core::fmt::Write::Trait", []) ] ]);
            ("state",
              Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::builders::PadAdapterState" ])
          ];
      } *)
    
    (* StructRecord
      {
        name := "PadAdapterState";
        const_params := [];
        ty_params := [];
        fields := [ ("on_newline", Ty.path "bool") ];
      } *)
    
    Module Impl_core_default_Default_for_core_fmt_builders_PadAdapterState.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::PadAdapterState".
      
      (*
          fn default() -> Self {
              PadAdapterState { on_newline: true }
          }
      *)
      Definition default (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [] =>
          ltac:(M.monadic
            (Value.StructRecord
              "core::fmt::builders::PadAdapterState"
              [ ("on_newline", Value.Bool true) ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::default::Default"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("default", InstanceField.Method default) ].
    End Impl_core_default_Default_for_core_fmt_builders_PadAdapterState.
    
    Module Impl_core_fmt_builders_PadAdapter.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::PadAdapter".
      
      (*
          fn wrap<'slot, 'fmt: 'buf + 'slot>(
              fmt: &'fmt mut fmt::Formatter<'_>,
              slot: &'slot mut Option<Self>,
              state: &'state mut PadAdapterState,
          ) -> fmt::Formatter<'slot> {
              fmt.wrap_buf(move |buf| slot.insert(PadAdapter { buf, state }))
          }
      *)
      Definition wrap (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ fmt; slot; state ] =>
          ltac:(M.monadic
            (let fmt := M.alloc (| fmt |) in
            let slot := M.alloc (| slot |) in
            let state := M.alloc (| state |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::fmt::Formatter",
                "wrap_buf",
                [
                  Ty.function
                    [
                      Ty.tuple
                        [
                          Ty.apply
                            (Ty.path "&mut")
                            []
                            [ Ty.dyn [ ("core::fmt::Write::Trait", []) ] ]
                        ]
                    ]
                    (Ty.apply (Ty.path "&mut") [] [ Ty.dyn [ ("core::fmt::Write::Trait", []) ] ])
                ]
              |),
              [
                M.read (| fmt |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let buf := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.apply
                                        (Ty.path "core::option::Option")
                                        []
                                        [ Ty.path "core::fmt::builders::PadAdapter" ],
                                      "insert",
                                      []
                                    |),
                                    [
                                      M.read (| slot |);
                                      Value.StructRecord
                                        "core::fmt::builders::PadAdapter"
                                        [ ("buf", M.read (| buf |)); ("state", M.read (| state |)) ]
                                    ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_wrap : M.IsAssociatedFunction Self "wrap" wrap.
    End Impl_core_fmt_builders_PadAdapter.
    
    Module Impl_core_fmt_Write_for_core_fmt_builders_PadAdapter.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::PadAdapter".
      
      (*
          fn write_str(&mut self, s: &str) -> fmt::Result {
              for s in s.split_inclusive('\n') {
                  if self.state.on_newline {
                      self.buf.write_str("    ")?;
                  }
      
                  self.state.on_newline = s.ends_with('\n');
                  self.buf.write_str(s)?;
              }
      
              Ok(())
          }
      *)
      Definition write_str (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; s ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let s := M.alloc (| s |) in
            M.catch_return (|
              ltac:(M.monadic
                (M.read (|
                  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::str::iter::SplitInclusive")
                                []
                                [ Ty.path "char" ],
                              [],
                              "into_iter",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "str",
                                  "split_inclusive",
                                  [ Ty.path "char" ]
                                |),
                                [ M.read (| s |); Value.UnicodeChar 10 ]
                              |)
                            ]
                          |)
                        |),
                        [
                          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::str::iter::SplitInclusive")
                                              []
                                              [ Ty.path "char" ],
                                            [],
                                            "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 s := M.copy (| γ0_0 |) in
                                            let~ _ :=
                                              M.match_operator (|
                                                M.alloc (| Value.Tuple [] |),
                                                [
                                                  fun γ =>
                                                    ltac:(M.monadic
                                                      (let γ :=
                                                        M.use
                                                          (M.SubPointer.get_struct_record_field (|
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::PadAdapter",
                                                                "state"
                                                              |)
                                                            |),
                                                            "core::fmt::builders::PadAdapterState",
                                                            "on_newline"
                                                          |)) in
                                                      let _ :=
                                                        M.is_constant_or_break_match (|
                                                          M.read (| γ |),
                                                          Value.Bool true
                                                        |) 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_trait_method (|
                                                                    "core::fmt::Write",
                                                                    Ty.dyn
                                                                      [
                                                                        ("core::fmt::Write::Trait",
                                                                          [])
                                                                      ],
                                                                    [],
                                                                    "write_str",
                                                                    []
                                                                  |),
                                                                  [
                                                                    M.read (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "core::fmt::builders::PadAdapter",
                                                                        "buf"
                                                                      |)
                                                                    |);
                                                                    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.Tuple [] |)));
                                                  fun γ =>
                                                    ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                                ]
                                              |) in
                                            let~ _ :=
                                              M.write (|
                                                M.SubPointer.get_struct_record_field (|
                                                  M.read (|
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.read (| self |),
                                                      "core::fmt::builders::PadAdapter",
                                                      "state"
                                                    |)
                                                  |),
                                                  "core::fmt::builders::PadAdapterState",
                                                  "on_newline"
                                                |),
                                                M.call_closure (|
                                                  M.get_associated_function (|
                                                    Ty.path "str",
                                                    "ends_with",
                                                    [ Ty.path "char" ]
                                                  |),
                                                  [ M.read (| s |); Value.UnicodeChar 10 ]
                                                |)
                                              |) 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_trait_method (|
                                                          "core::fmt::Write",
                                                          Ty.dyn
                                                            [ ("core::fmt::Write::Trait", []) ],
                                                          [],
                                                          "write_str",
                                                          []
                                                        |),
                                                        [
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::PadAdapter",
                                                              "buf"
                                                            |)
                                                          |);
                                                          M.read (| s |)
                                                        ]
                                                      |)
                                                    ]
                                                  |)
                                                |),
                                                [
                                                  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.Tuple [] |)))
                                      ]
                                    |) in
                                  M.alloc (| Value.Tuple [] |)))
                              |)))
                        ]
                      |)) in
                  M.alloc (| Value.StructTuple "core::result::Result::Ok" [ Value.Tuple [] ] |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      (*
          fn write_char(&mut self, c: char) -> fmt::Result {
              if self.state.on_newline {
                  self.buf.write_str("    ")?;
              }
              self.state.on_newline = c == '\n';
              self.buf.write_char(c)
          }
      *)
      Definition write_char (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; c ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let c := M.alloc (| c |) 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 (|
                                    M.SubPointer.get_struct_record_field (|
                                      M.read (| self |),
                                      "core::fmt::builders::PadAdapter",
                                      "state"
                                    |)
                                  |),
                                  "core::fmt::builders::PadAdapterState",
                                  "on_newline"
                                |)) in
                            let _ :=
                              M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) 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_trait_method (|
                                          "core::fmt::Write",
                                          Ty.dyn [ ("core::fmt::Write::Trait", []) ],
                                          [],
                                          "write_str",
                                          []
                                        |),
                                        [
                                          M.read (|
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::fmt::builders::PadAdapter",
                                              "buf"
                                            |)
                                          |);
                                          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.Tuple [] |)));
                        fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                      ]
                    |) in
                  let~ _ :=
                    M.write (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::fmt::builders::PadAdapter",
                            "state"
                          |)
                        |),
                        "core::fmt::builders::PadAdapterState",
                        "on_newline"
                      |),
                      BinOp.eq (| M.read (| c |), Value.UnicodeChar 10 |)
                    |) in
                  M.alloc (|
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::fmt::Write",
                        Ty.dyn [ ("core::fmt::Write::Trait", []) ],
                        [],
                        "write_char",
                        []
                      |),
                      [
                        M.read (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::fmt::builders::PadAdapter",
                            "buf"
                          |)
                        |);
                        M.read (| c |)
                      ]
                    |)
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Write"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [
            ("write_str", InstanceField.Method write_str);
            ("write_char", InstanceField.Method write_char)
          ].
    End Impl_core_fmt_Write_for_core_fmt_builders_PadAdapter.
    
    (* StructRecord
      {
        name := "DebugStruct";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("fmt", Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ]);
            ("result",
              Ty.apply
                (Ty.path "core::result::Result")
                []
                [ Ty.tuple []; Ty.path "core::fmt::Error" ]);
            ("has_fields", Ty.path "bool")
          ];
      } *)
    
    (*
    pub(super) fn debug_struct_new<'a, 'b>(
        fmt: &'a mut fmt::Formatter<'b>,
        name: &str,
    ) -> DebugStruct<'a, 'b> {
        let result = fmt.write_str(name);
        DebugStruct { fmt, result, has_fields: false }
    }
    *)
    Definition debug_struct_new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ fmt; name ] =>
        ltac:(M.monadic
          (let fmt := M.alloc (| fmt |) in
          let name := M.alloc (| name |) in
          M.read (|
            let~ result :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [] |),
                  [ M.read (| fmt |); M.read (| name |) ]
                |)
              |) in
            M.alloc (|
              Value.StructRecord
                "core::fmt::builders::DebugStruct"
                [
                  ("fmt", M.read (| fmt |));
                  ("result", M.read (| result |));
                  ("has_fields", Value.Bool false)
                ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Function_debug_struct_new :
      M.IsFunction "core::fmt::builders::debug_struct_new" debug_struct_new.
    
    Module Impl_core_fmt_builders_DebugStruct.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::DebugStruct".
      
      (*
          pub fn field(&mut self, name: &str, value: &dyn fmt::Debug) -> &mut Self {
              self.field_with(name, |f| value.fmt(f))
          }
      *)
      Definition field (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; name; value ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let name := M.alloc (| name |) in
            let value := M.alloc (| value |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::fmt::builders::DebugStruct",
                "field_with",
                [
                  Ty.function
                    [ Ty.tuple [ Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ] ] ]
                    (Ty.apply
                      (Ty.path "core::result::Result")
                      []
                      [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                ]
              |),
              [
                M.read (| self |);
                M.read (| name |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (let f := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::fmt::Debug",
                                      Ty.dyn [ ("core::fmt::Debug::Trait", []) ],
                                      [],
                                      "fmt",
                                      []
                                    |),
                                    [ M.read (| value |); M.read (| f |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_field : M.IsAssociatedFunction Self "field" field.
      
      (*
          pub fn field_with<F>(&mut self, name: &str, value_fmt: F) -> &mut Self
          where
              F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
          {
              self.result = self.result.and_then(|_| {
                  if self.is_pretty() {
                      if !self.has_fields {
                          self.fmt.write_str(" {\n")?;
                      }
                      let mut slot = None;
                      let mut state = Default::default();
                      let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
                      writer.write_str(name)?;
                      writer.write_str(": ")?;
                      value_fmt(&mut writer)?;
                      writer.write_str(",\n")
                  } else {
                      let prefix = if self.has_fields { ", " } else { " { " };
                      self.fmt.write_str(prefix)?;
                      self.fmt.write_str(name)?;
                      self.fmt.write_str(": ")?;
                      value_fmt(self.fmt)
                  }
              });
      
              self.has_fields = true;
              self
          }
      *)
      Definition field_with (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ self; name; value_fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let name := M.alloc (| name |) in
            let value_fmt := M.alloc (| value_fmt |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugStruct",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugStruct",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          M.match_operator (|
                                            M.alloc (| Value.Tuple [] |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ :=
                                                    M.use
                                                      (M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "core::fmt::builders::DebugStruct",
                                                            "is_pretty",
                                                            []
                                                          |),
                                                          [ M.read (| self |) ]
                                                        |)
                                                      |)) in
                                                  let _ :=
                                                    M.is_constant_or_break_match (|
                                                      M.read (| γ |),
                                                      Value.Bool true
                                                    |) in
                                                  let~ _ :=
                                                    M.match_operator (|
                                                      M.alloc (| Value.Tuple [] |),
                                                      [
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (let γ :=
                                                              M.use
                                                                (M.alloc (|
                                                                  UnOp.not (|
                                                                    M.read (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "core::fmt::builders::DebugStruct",
                                                                        "has_fields"
                                                                      |)
                                                                    |)
                                                                  |)
                                                                |)) in
                                                            let _ :=
                                                              M.is_constant_or_break_match (|
                                                                M.read (| γ |),
                                                                Value.Bool true
                                                              |) 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_str",
                                                                          []
                                                                        |),
                                                                        [
                                                                          M.read (|
                                                                            M.SubPointer.get_struct_record_field (|
                                                                              M.read (| self |),
                                                                              "core::fmt::builders::DebugStruct",
                                                                              "fmt"
                                                                            |)
                                                                          |);
                                                                          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.Tuple [] |)));
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (M.alloc (| Value.Tuple [] |)))
                                                      ]
                                                    |) in
                                                  let~ slot :=
                                                    M.alloc (|
                                                      Value.StructTuple
                                                        "core::option::Option::None"
                                                        []
                                                    |) in
                                                  let~ state :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::default::Default",
                                                          Ty.path
                                                            "core::fmt::builders::PadAdapterState",
                                                          [],
                                                          "default",
                                                          []
                                                        |),
                                                        []
                                                      |)
                                                    |) in
                                                  let~ writer :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "core::fmt::builders::PadAdapter",
                                                          "wrap",
                                                          []
                                                        |),
                                                        [
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::DebugStruct",
                                                              "fmt"
                                                            |)
                                                          |);
                                                          slot;
                                                          state
                                                        ]
                                                      |)
                                                    |) 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_str",
                                                                []
                                                              |),
                                                              [ writer; M.read (| name |) ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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_str",
                                                                []
                                                              |),
                                                              [
                                                                writer;
                                                                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
                                                  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_trait_method (|
                                                                "core::ops::function::FnOnce",
                                                                F,
                                                                [
                                                                  Ty.tuple
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "&mut")
                                                                        []
                                                                        [
                                                                          Ty.path
                                                                            "core::fmt::Formatter"
                                                                        ]
                                                                    ]
                                                                ],
                                                                "call_once",
                                                                []
                                                              |),
                                                              [
                                                                M.read (| value_fmt |);
                                                                Value.Tuple [ writer ]
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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 (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "core::fmt::Formatter",
                                                        "write_str",
                                                        []
                                                      |),
                                                      [ writer; M.read (| Value.String ",
" |) ]
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let~ prefix :=
                                                    M.copy (|
                                                      M.match_operator (|
                                                        M.alloc (| Value.Tuple [] |),
                                                        [
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ :=
                                                                M.use
                                                                  (M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugStruct",
                                                                    "has_fields"
                                                                  |)) in
                                                              let _ :=
                                                                M.is_constant_or_break_match (|
                                                                  M.read (| γ |),
                                                                  Value.Bool true
                                                                |) in
                                                              Value.String ", "));
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (M.alloc (|
                                                                M.read (| Value.String " { " |)
                                                              |)))
                                                        ]
                                                      |)
                                                    |) 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_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugStruct",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| prefix |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugStruct",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| name |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugStruct",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                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 (|
                                                    M.call_closure (|
                                                      M.get_trait_method (|
                                                        "core::ops::function::FnOnce",
                                                        F,
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&mut")
                                                                []
                                                                [ Ty.path "core::fmt::Formatter" ]
                                                            ]
                                                        ],
                                                        "call_once",
                                                        []
                                                      |),
                                                      [
                                                        M.read (| value_fmt |);
                                                        Value.Tuple
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::DebugStruct",
                                                                "fmt"
                                                              |)
                                                            |)
                                                          ]
                                                      ]
                                                    |)
                                                  |)))
                                            ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugStruct",
                    "has_fields"
                  |),
                  Value.Bool true
                |) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_field_with : M.IsAssociatedFunction Self "field_with" field_with.
      
      (*
          pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
              self.result = self.result.and_then(|_| {
                  if self.has_fields {
                      if self.is_pretty() {
                          let mut slot = None;
                          let mut state = Default::default();
                          let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
                          writer.write_str("..\n")?;
                          self.fmt.write_str("}")
                      } else {
                          self.fmt.write_str(", .. }")
                      }
                  } else {
                      self.fmt.write_str(" { .. }")
                  }
              });
              self.result
          }
      *)
      Definition finish_non_exhaustive (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugStruct",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugStruct",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          M.match_operator (|
                                            M.alloc (| Value.Tuple [] |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ :=
                                                    M.use
                                                      (M.SubPointer.get_struct_record_field (|
                                                        M.read (| self |),
                                                        "core::fmt::builders::DebugStruct",
                                                        "has_fields"
                                                      |)) in
                                                  let _ :=
                                                    M.is_constant_or_break_match (|
                                                      M.read (| γ |),
                                                      Value.Bool true
                                                    |) in
                                                  M.match_operator (|
                                                    M.alloc (| Value.Tuple [] |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ :=
                                                            M.use
                                                              (M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "core::fmt::builders::DebugStruct",
                                                                    "is_pretty",
                                                                    []
                                                                  |),
                                                                  [ M.read (| self |) ]
                                                                |)
                                                              |)) in
                                                          let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Bool true
                                                            |) in
                                                          let~ slot :=
                                                            M.alloc (|
                                                              Value.StructTuple
                                                                "core::option::Option::None"
                                                                []
                                                            |) in
                                                          let~ state :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::default::Default",
                                                                  Ty.path
                                                                    "core::fmt::builders::PadAdapterState",
                                                                  [],
                                                                  "default",
                                                                  []
                                                                |),
                                                                []
                                                              |)
                                                            |) in
                                                          let~ writer :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "core::fmt::builders::PadAdapter",
                                                                  "wrap",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugStruct",
                                                                      "fmt"
                                                                    |)
                                                                  |);
                                                                  slot;
                                                                  state
                                                                ]
                                                              |)
                                                            |) 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_str",
                                                                        []
                                                                      |),
                                                                      [
                                                                        writer;
                                                                        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 (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Formatter",
                                                                "write_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugStruct",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| Value.String "}" |)
                                                              ]
                                                            |)
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.alloc (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Formatter",
                                                                "write_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugStruct",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| Value.String ", .. }" |)
                                                              ]
                                                            |)
                                                          |)))
                                                    ]
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "core::fmt::Formatter",
                                                        "write_str",
                                                        []
                                                      |),
                                                      [
                                                        M.read (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| self |),
                                                            "core::fmt::builders::DebugStruct",
                                                            "fmt"
                                                          |)
                                                        |);
                                                        M.read (| Value.String " { .. }" |)
                                                      ]
                                                    |)
                                                  |)))
                                            ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::fmt::builders::DebugStruct",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish_non_exhaustive :
        M.IsAssociatedFunction Self "finish_non_exhaustive" finish_non_exhaustive.
      
      (*
          pub fn finish(&mut self) -> fmt::Result {
              if self.has_fields {
                  self.result = self.result.and_then(|_| {
                      if self.is_pretty() { self.fmt.write_str("}") } else { self.fmt.write_str(" }") }
                  });
              }
              self.result
          }
      *)
      Definition finish (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.match_operator (|
                  M.alloc (| Value.Tuple [] |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ :=
                          M.use
                            (M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::fmt::builders::DebugStruct",
                              "has_fields"
                            |)) 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::fmt::builders::DebugStruct",
                              "result"
                            |),
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "core::result::Result")
                                  []
                                  [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                "and_then",
                                [
                                  Ty.tuple [];
                                  Ty.function
                                    [ Ty.tuple [ Ty.tuple [] ] ]
                                    (Ty.apply
                                      (Ty.path "core::result::Result")
                                      []
                                      [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                                ]
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "core::fmt::builders::DebugStruct",
                                    "result"
                                  |)
                                |);
                                M.closure
                                  (fun γ =>
                                    ltac:(M.monadic
                                      match γ with
                                      | [ α0 ] =>
                                        ltac:(M.monadic
                                          (M.match_operator (|
                                            M.alloc (| α0 |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.read (|
                                                    M.match_operator (|
                                                      M.alloc (| Value.Tuple [] |),
                                                      [
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (let γ :=
                                                              M.use
                                                                (M.alloc (|
                                                                  M.call_closure (|
                                                                    M.get_associated_function (|
                                                                      Ty.path
                                                                        "core::fmt::builders::DebugStruct",
                                                                      "is_pretty",
                                                                      []
                                                                    |),
                                                                    [ M.read (| self |) ]
                                                                  |)
                                                                |)) in
                                                            let _ :=
                                                              M.is_constant_or_break_match (|
                                                                M.read (| γ |),
                                                                Value.Bool true
                                                              |) in
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path "core::fmt::Formatter",
                                                                  "write_str",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugStruct",
                                                                      "fmt"
                                                                    |)
                                                                  |);
                                                                  M.read (| Value.String "}" |)
                                                                ]
                                                              |)
                                                            |)));
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path "core::fmt::Formatter",
                                                                  "write_str",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugStruct",
                                                                      "fmt"
                                                                    |)
                                                                  |);
                                                                  M.read (| Value.String " }" |)
                                                                ]
                                                              |)
                                                            |)))
                                                      ]
                                                    |)
                                                  |)))
                                            ]
                                          |)))
                                      | _ => M.impossible "wrong number of arguments"
                                      end))
                              ]
                            |)
                          |) in
                        M.alloc (| Value.Tuple [] |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                  ]
                |) in
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::fmt::builders::DebugStruct",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish : M.IsAssociatedFunction Self "finish" finish.
      
      (*
          fn is_pretty(&self) -> bool {
              self.fmt.alternate()
          }
      *)
      Definition is_pretty (ε : 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::fmt::Formatter", "alternate", [] |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugStruct",
                    "fmt"
                  |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_is_pretty : M.IsAssociatedFunction Self "is_pretty" is_pretty.
    End Impl_core_fmt_builders_DebugStruct.
    
    (* StructRecord
      {
        name := "DebugTuple";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("fmt", Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ]);
            ("result",
              Ty.apply
                (Ty.path "core::result::Result")
                []
                [ Ty.tuple []; Ty.path "core::fmt::Error" ]);
            ("fields", Ty.path "usize");
            ("empty_name", Ty.path "bool")
          ];
      } *)
    
    (*
    pub(super) fn debug_tuple_new<'a, 'b>(
        fmt: &'a mut fmt::Formatter<'b>,
        name: &str,
    ) -> DebugTuple<'a, 'b> {
        let result = fmt.write_str(name);
        DebugTuple { fmt, result, fields: 0, empty_name: name.is_empty() }
    }
    *)
    Definition debug_tuple_new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ fmt; name ] =>
        ltac:(M.monadic
          (let fmt := M.alloc (| fmt |) in
          let name := M.alloc (| name |) in
          M.read (|
            let~ result :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [] |),
                  [ M.read (| fmt |); M.read (| name |) ]
                |)
              |) in
            M.alloc (|
              Value.StructRecord
                "core::fmt::builders::DebugTuple"
                [
                  ("fmt", M.read (| fmt |));
                  ("result", M.read (| result |));
                  ("fields", Value.Integer IntegerKind.Usize 0);
                  ("empty_name",
                    M.call_closure (|
                      M.get_associated_function (| Ty.path "str", "is_empty", [] |),
                      [ M.read (| name |) ]
                    |))
                ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Function_debug_tuple_new :
      M.IsFunction "core::fmt::builders::debug_tuple_new" debug_tuple_new.
    
    Module Impl_core_fmt_builders_DebugTuple.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::DebugTuple".
      
      (*
          pub fn field(&mut self, value: &dyn fmt::Debug) -> &mut Self {
              self.field_with(|f| value.fmt(f))
          }
      *)
      Definition field (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; value ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let value := M.alloc (| value |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::fmt::builders::DebugTuple",
                "field_with",
                [
                  Ty.function
                    [ Ty.tuple [ Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ] ] ]
                    (Ty.apply
                      (Ty.path "core::result::Result")
                      []
                      [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                ]
              |),
              [
                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 f := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::fmt::Debug",
                                      Ty.dyn [ ("core::fmt::Debug::Trait", []) ],
                                      [],
                                      "fmt",
                                      []
                                    |),
                                    [ M.read (| value |); M.read (| f |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_field : M.IsAssociatedFunction Self "field" field.
      
      (*
          pub fn field_with<F>(&mut self, value_fmt: F) -> &mut Self
          where
              F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
          {
              self.result = self.result.and_then(|_| {
                  if self.is_pretty() {
                      if self.fields == 0 {
                          self.fmt.write_str("(\n")?;
                      }
                      let mut slot = None;
                      let mut state = Default::default();
                      let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
                      value_fmt(&mut writer)?;
                      writer.write_str(",\n")
                  } else {
                      let prefix = if self.fields == 0 { "(" } else { ", " };
                      self.fmt.write_str(prefix)?;
                      value_fmt(self.fmt)
                  }
              });
      
              self.fields += 1;
              self
          }
      *)
      Definition field_with (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ self; value_fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let value_fmt := M.alloc (| value_fmt |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugTuple",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugTuple",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          M.match_operator (|
                                            M.alloc (| Value.Tuple [] |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ :=
                                                    M.use
                                                      (M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "core::fmt::builders::DebugTuple",
                                                            "is_pretty",
                                                            []
                                                          |),
                                                          [ M.read (| self |) ]
                                                        |)
                                                      |)) in
                                                  let _ :=
                                                    M.is_constant_or_break_match (|
                                                      M.read (| γ |),
                                                      Value.Bool true
                                                    |) in
                                                  let~ _ :=
                                                    M.match_operator (|
                                                      M.alloc (| Value.Tuple [] |),
                                                      [
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (let γ :=
                                                              M.use
                                                                (M.alloc (|
                                                                  BinOp.eq (|
                                                                    M.read (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "core::fmt::builders::DebugTuple",
                                                                        "fields"
                                                                      |)
                                                                    |),
                                                                    Value.Integer
                                                                      IntegerKind.Usize
                                                                      0
                                                                  |)
                                                                |)) in
                                                            let _ :=
                                                              M.is_constant_or_break_match (|
                                                                M.read (| γ |),
                                                                Value.Bool true
                                                              |) 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_str",
                                                                          []
                                                                        |),
                                                                        [
                                                                          M.read (|
                                                                            M.SubPointer.get_struct_record_field (|
                                                                              M.read (| self |),
                                                                              "core::fmt::builders::DebugTuple",
                                                                              "fmt"
                                                                            |)
                                                                          |);
                                                                          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.Tuple [] |)));
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (M.alloc (| Value.Tuple [] |)))
                                                      ]
                                                    |) in
                                                  let~ slot :=
                                                    M.alloc (|
                                                      Value.StructTuple
                                                        "core::option::Option::None"
                                                        []
                                                    |) in
                                                  let~ state :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::default::Default",
                                                          Ty.path
                                                            "core::fmt::builders::PadAdapterState",
                                                          [],
                                                          "default",
                                                          []
                                                        |),
                                                        []
                                                      |)
                                                    |) in
                                                  let~ writer :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "core::fmt::builders::PadAdapter",
                                                          "wrap",
                                                          []
                                                        |),
                                                        [
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::DebugTuple",
                                                              "fmt"
                                                            |)
                                                          |);
                                                          slot;
                                                          state
                                                        ]
                                                      |)
                                                    |) 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_trait_method (|
                                                                "core::ops::function::FnOnce",
                                                                F,
                                                                [
                                                                  Ty.tuple
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "&mut")
                                                                        []
                                                                        [
                                                                          Ty.path
                                                                            "core::fmt::Formatter"
                                                                        ]
                                                                    ]
                                                                ],
                                                                "call_once",
                                                                []
                                                              |),
                                                              [
                                                                M.read (| value_fmt |);
                                                                Value.Tuple [ writer ]
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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 (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "core::fmt::Formatter",
                                                        "write_str",
                                                        []
                                                      |),
                                                      [ writer; M.read (| Value.String ",
" |) ]
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let~ prefix :=
                                                    M.copy (|
                                                      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::fmt::builders::DebugTuple",
                                                                          "fields"
                                                                        |)
                                                                      |),
                                                                      Value.Integer
                                                                        IntegerKind.Usize
                                                                        0
                                                                    |)
                                                                  |)) in
                                                              let _ :=
                                                                M.is_constant_or_break_match (|
                                                                  M.read (| γ |),
                                                                  Value.Bool true
                                                                |) in
                                                              Value.String "("));
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (M.alloc (|
                                                                M.read (| Value.String ", " |)
                                                              |)))
                                                        ]
                                                      |)
                                                    |) 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_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugTuple",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| prefix |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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 (|
                                                    M.call_closure (|
                                                      M.get_trait_method (|
                                                        "core::ops::function::FnOnce",
                                                        F,
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&mut")
                                                                []
                                                                [ Ty.path "core::fmt::Formatter" ]
                                                            ]
                                                        ],
                                                        "call_once",
                                                        []
                                                      |),
                                                      [
                                                        M.read (| value_fmt |);
                                                        Value.Tuple
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::DebugTuple",
                                                                "fmt"
                                                              |)
                                                            |)
                                                          ]
                                                      ]
                                                    |)
                                                  |)))
                                            ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              let~ _ :=
                let β :=
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugTuple",
                    "fields"
                  |) in
                M.write (|
                  β,
                  BinOp.Wrap.add (| M.read (| β |), Value.Integer IntegerKind.Usize 1 |)
                |) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_field_with : M.IsAssociatedFunction Self "field_with" field_with.
      
      (*
          pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
              self.result = self.result.and_then(|_| {
                  if self.fields > 0 {
                      if self.is_pretty() {
                          let mut slot = None;
                          let mut state = Default::default();
                          let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
                          writer.write_str("..\n")?;
                          self.fmt.write_str(")")
                      } else {
                          self.fmt.write_str(", ..)")
                      }
                  } else {
                      self.fmt.write_str("(..)")
                  }
              });
              self.result
          }
      *)
      Definition finish_non_exhaustive (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugTuple",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugTuple",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          M.match_operator (|
                                            M.alloc (| Value.Tuple [] |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ :=
                                                    M.use
                                                      (M.alloc (|
                                                        BinOp.gt (|
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::DebugTuple",
                                                              "fields"
                                                            |)
                                                          |),
                                                          Value.Integer IntegerKind.Usize 0
                                                        |)
                                                      |)) in
                                                  let _ :=
                                                    M.is_constant_or_break_match (|
                                                      M.read (| γ |),
                                                      Value.Bool true
                                                    |) in
                                                  M.match_operator (|
                                                    M.alloc (| Value.Tuple [] |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ :=
                                                            M.use
                                                              (M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "core::fmt::builders::DebugTuple",
                                                                    "is_pretty",
                                                                    []
                                                                  |),
                                                                  [ M.read (| self |) ]
                                                                |)
                                                              |)) in
                                                          let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Bool true
                                                            |) in
                                                          let~ slot :=
                                                            M.alloc (|
                                                              Value.StructTuple
                                                                "core::option::Option::None"
                                                                []
                                                            |) in
                                                          let~ state :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::default::Default",
                                                                  Ty.path
                                                                    "core::fmt::builders::PadAdapterState",
                                                                  [],
                                                                  "default",
                                                                  []
                                                                |),
                                                                []
                                                              |)
                                                            |) in
                                                          let~ writer :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "core::fmt::builders::PadAdapter",
                                                                  "wrap",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugTuple",
                                                                      "fmt"
                                                                    |)
                                                                  |);
                                                                  slot;
                                                                  state
                                                                ]
                                                              |)
                                                            |) 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_str",
                                                                        []
                                                                      |),
                                                                      [
                                                                        writer;
                                                                        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 (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Formatter",
                                                                "write_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugTuple",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| Value.String ")" |)
                                                              ]
                                                            |)
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.alloc (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Formatter",
                                                                "write_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugTuple",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| Value.String ", ..)" |)
                                                              ]
                                                            |)
                                                          |)))
                                                    ]
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "core::fmt::Formatter",
                                                        "write_str",
                                                        []
                                                      |),
                                                      [
                                                        M.read (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| self |),
                                                            "core::fmt::builders::DebugTuple",
                                                            "fmt"
                                                          |)
                                                        |);
                                                        M.read (| Value.String "(..)" |)
                                                      ]
                                                    |)
                                                  |)))
                                            ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::fmt::builders::DebugTuple",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish_non_exhaustive :
        M.IsAssociatedFunction Self "finish_non_exhaustive" finish_non_exhaustive.
      
      (*
          pub fn finish(&mut self) -> fmt::Result {
              if self.fields > 0 {
                  self.result = self.result.and_then(|_| {
                      if self.fields == 1 && self.empty_name && !self.is_pretty() {
                          self.fmt.write_str(",")?;
                      }
                      self.fmt.write_str(")")
                  });
              }
              self.result
          }
      *)
      Definition finish (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.match_operator (|
                  M.alloc (| Value.Tuple [] |),
                  [
                    fun γ =>
                      ltac:(M.monadic
                        (let γ :=
                          M.use
                            (M.alloc (|
                              BinOp.gt (|
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "core::fmt::builders::DebugTuple",
                                    "fields"
                                  |)
                                |),
                                Value.Integer IntegerKind.Usize 0
                              |)
                            |)) 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::fmt::builders::DebugTuple",
                              "result"
                            |),
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "core::result::Result")
                                  []
                                  [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                                "and_then",
                                [
                                  Ty.tuple [];
                                  Ty.function
                                    [ Ty.tuple [ Ty.tuple [] ] ]
                                    (Ty.apply
                                      (Ty.path "core::result::Result")
                                      []
                                      [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                                ]
                              |),
                              [
                                M.read (|
                                  M.SubPointer.get_struct_record_field (|
                                    M.read (| self |),
                                    "core::fmt::builders::DebugTuple",
                                    "result"
                                  |)
                                |);
                                M.closure
                                  (fun γ =>
                                    ltac:(M.monadic
                                      match γ with
                                      | [ α0 ] =>
                                        ltac:(M.monadic
                                          (M.match_operator (|
                                            M.alloc (| α0 |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.read (|
                                                    let~ _ :=
                                                      M.match_operator (|
                                                        M.alloc (| Value.Tuple [] |),
                                                        [
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ :=
                                                                M.use
                                                                  (M.alloc (|
                                                                    LogicalOp.and (|
                                                                      LogicalOp.and (|
                                                                        BinOp.eq (|
                                                                          M.read (|
                                                                            M.SubPointer.get_struct_record_field (|
                                                                              M.read (| self |),
                                                                              "core::fmt::builders::DebugTuple",
                                                                              "fields"
                                                                            |)
                                                                          |),
                                                                          Value.Integer
                                                                            IntegerKind.Usize
                                                                            1
                                                                        |),
                                                                        ltac:(M.monadic
                                                                          (M.read (|
                                                                            M.SubPointer.get_struct_record_field (|
                                                                              M.read (| self |),
                                                                              "core::fmt::builders::DebugTuple",
                                                                              "empty_name"
                                                                            |)
                                                                          |)))
                                                                      |),
                                                                      ltac:(M.monadic
                                                                        (UnOp.not (|
                                                                          M.call_closure (|
                                                                            M.get_associated_function (|
                                                                              Ty.path
                                                                                "core::fmt::builders::DebugTuple",
                                                                              "is_pretty",
                                                                              []
                                                                            |),
                                                                            [ M.read (| self |) ]
                                                                          |)
                                                                        |)))
                                                                    |)
                                                                  |)) in
                                                              let _ :=
                                                                M.is_constant_or_break_match (|
                                                                  M.read (| γ |),
                                                                  Value.Bool true
                                                                |) 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_str",
                                                                            []
                                                                          |),
                                                                          [
                                                                            M.read (|
                                                                              M.SubPointer.get_struct_record_field (|
                                                                                M.read (| self |),
                                                                                "core::fmt::builders::DebugTuple",
                                                                                "fmt"
                                                                              |)
                                                                            |);
                                                                            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.Tuple [] |)));
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (M.alloc (| Value.Tuple [] |)))
                                                        ]
                                                      |) in
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "core::fmt::Formatter",
                                                          "write_str",
                                                          []
                                                        |),
                                                        [
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::DebugTuple",
                                                              "fmt"
                                                            |)
                                                          |);
                                                          M.read (| Value.String ")" |)
                                                        ]
                                                      |)
                                                    |)
                                                  |)))
                                            ]
                                          |)))
                                      | _ => M.impossible "wrong number of arguments"
                                      end))
                              ]
                            |)
                          |) in
                        M.alloc (| Value.Tuple [] |)));
                    fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                  ]
                |) in
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::fmt::builders::DebugTuple",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish : M.IsAssociatedFunction Self "finish" finish.
      
      (*
          fn is_pretty(&self) -> bool {
              self.fmt.alternate()
          }
      *)
      Definition is_pretty (ε : 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::fmt::Formatter", "alternate", [] |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugTuple",
                    "fmt"
                  |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_is_pretty : M.IsAssociatedFunction Self "is_pretty" is_pretty.
    End Impl_core_fmt_builders_DebugTuple.
    
    (* StructRecord
      {
        name := "DebugInner";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("fmt", Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ]);
            ("result",
              Ty.apply
                (Ty.path "core::result::Result")
                []
                [ Ty.tuple []; Ty.path "core::fmt::Error" ]);
            ("has_fields", Ty.path "bool")
          ];
      } *)
    
    Module Impl_core_fmt_builders_DebugInner.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::DebugInner".
      
      (*
          fn entry_with<F>(&mut self, entry_fmt: F)
          where
              F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
          {
              self.result = self.result.and_then(|_| {
                  if self.is_pretty() {
                      if !self.has_fields {
                          self.fmt.write_str("\n")?;
                      }
                      let mut slot = None;
                      let mut state = Default::default();
                      let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
                      entry_fmt(&mut writer)?;
                      writer.write_str(",\n")
                  } else {
                      if self.has_fields {
                          self.fmt.write_str(", ")?
                      }
                      entry_fmt(self.fmt)
                  }
              });
      
              self.has_fields = true;
          }
      *)
      Definition entry_with (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ self; entry_fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let entry_fmt := M.alloc (| entry_fmt |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugInner",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugInner",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          M.match_operator (|
                                            M.alloc (| Value.Tuple [] |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ :=
                                                    M.use
                                                      (M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "core::fmt::builders::DebugInner",
                                                            "is_pretty",
                                                            []
                                                          |),
                                                          [ M.read (| self |) ]
                                                        |)
                                                      |)) in
                                                  let _ :=
                                                    M.is_constant_or_break_match (|
                                                      M.read (| γ |),
                                                      Value.Bool true
                                                    |) in
                                                  let~ _ :=
                                                    M.match_operator (|
                                                      M.alloc (| Value.Tuple [] |),
                                                      [
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (let γ :=
                                                              M.use
                                                                (M.alloc (|
                                                                  UnOp.not (|
                                                                    M.read (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "core::fmt::builders::DebugInner",
                                                                        "has_fields"
                                                                      |)
                                                                    |)
                                                                  |)
                                                                |)) in
                                                            let _ :=
                                                              M.is_constant_or_break_match (|
                                                                M.read (| γ |),
                                                                Value.Bool true
                                                              |) 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_str",
                                                                          []
                                                                        |),
                                                                        [
                                                                          M.read (|
                                                                            M.SubPointer.get_struct_record_field (|
                                                                              M.read (| self |),
                                                                              "core::fmt::builders::DebugInner",
                                                                              "fmt"
                                                                            |)
                                                                          |);
                                                                          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.Tuple [] |)));
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (M.alloc (| Value.Tuple [] |)))
                                                      ]
                                                    |) in
                                                  let~ slot :=
                                                    M.alloc (|
                                                      Value.StructTuple
                                                        "core::option::Option::None"
                                                        []
                                                    |) in
                                                  let~ state :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_trait_method (|
                                                          "core::default::Default",
                                                          Ty.path
                                                            "core::fmt::builders::PadAdapterState",
                                                          [],
                                                          "default",
                                                          []
                                                        |),
                                                        []
                                                      |)
                                                    |) in
                                                  let~ writer :=
                                                    M.alloc (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "core::fmt::builders::PadAdapter",
                                                          "wrap",
                                                          []
                                                        |),
                                                        [
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::DebugInner",
                                                              "fmt"
                                                            |)
                                                          |);
                                                          slot;
                                                          state
                                                        ]
                                                      |)
                                                    |) 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_trait_method (|
                                                                "core::ops::function::FnOnce",
                                                                F,
                                                                [
                                                                  Ty.tuple
                                                                    [
                                                                      Ty.apply
                                                                        (Ty.path "&mut")
                                                                        []
                                                                        [
                                                                          Ty.path
                                                                            "core::fmt::Formatter"
                                                                        ]
                                                                    ]
                                                                ],
                                                                "call_once",
                                                                []
                                                              |),
                                                              [
                                                                M.read (| entry_fmt |);
                                                                Value.Tuple [ writer ]
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |),
                                                      [
                                                        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 (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "core::fmt::Formatter",
                                                        "write_str",
                                                        []
                                                      |),
                                                      [ writer; M.read (| Value.String ",
" |) ]
                                                    |)
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (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::fmt::builders::DebugInner",
                                                                  "has_fields"
                                                                |)) in
                                                            let _ :=
                                                              M.is_constant_or_break_match (|
                                                                M.read (| γ |),
                                                                Value.Bool true
                                                              |) in
                                                            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_str",
                                                                        []
                                                                      |),
                                                                      [
                                                                        M.read (|
                                                                          M.SubPointer.get_struct_record_field (|
                                                                            M.read (| self |),
                                                                            "core::fmt::builders::DebugInner",
                                                                            "fmt"
                                                                          |)
                                                                        |);
                                                                        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))
                                                              ]
                                                            |)));
                                                        fun γ =>
                                                          ltac:(M.monadic
                                                            (M.alloc (| Value.Tuple [] |)))
                                                      ]
                                                    |) in
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_trait_method (|
                                                        "core::ops::function::FnOnce",
                                                        F,
                                                        [
                                                          Ty.tuple
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&mut")
                                                                []
                                                                [ Ty.path "core::fmt::Formatter" ]
                                                            ]
                                                        ],
                                                        "call_once",
                                                        []
                                                      |),
                                                      [
                                                        M.read (| entry_fmt |);
                                                        Value.Tuple
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::DebugInner",
                                                                "fmt"
                                                              |)
                                                            |)
                                                          ]
                                                      ]
                                                    |)
                                                  |)))
                                            ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugInner",
                    "has_fields"
                  |),
                  Value.Bool true
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entry_with : M.IsAssociatedFunction Self "entry_with" entry_with.
      
      (*
          fn is_pretty(&self) -> bool {
              self.fmt.alternate()
          }
      *)
      Definition is_pretty (ε : 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::fmt::Formatter", "alternate", [] |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugInner",
                    "fmt"
                  |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_is_pretty : M.IsAssociatedFunction Self "is_pretty" is_pretty.
    End Impl_core_fmt_builders_DebugInner.
    
    (* StructRecord
      {
        name := "DebugSet";
        const_params := [];
        ty_params := [];
        fields := [ ("inner", Ty.path "core::fmt::builders::DebugInner") ];
      } *)
    
    (*
    pub(super) fn debug_set_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugSet<'a, 'b> {
        let result = fmt.write_str("{");
        DebugSet { inner: DebugInner { fmt, result, has_fields: false } }
    }
    *)
    Definition debug_set_new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ fmt ] =>
        ltac:(M.monadic
          (let fmt := M.alloc (| fmt |) in
          M.read (|
            let~ result :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [] |),
                  [ M.read (| fmt |); M.read (| Value.String "{" |) ]
                |)
              |) in
            M.alloc (|
              Value.StructRecord
                "core::fmt::builders::DebugSet"
                [
                  ("inner",
                    Value.StructRecord
                      "core::fmt::builders::DebugInner"
                      [
                        ("fmt", M.read (| fmt |));
                        ("result", M.read (| result |));
                        ("has_fields", Value.Bool false)
                      ])
                ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Function_debug_set_new : M.IsFunction "core::fmt::builders::debug_set_new" debug_set_new.
    
    Module Impl_core_fmt_builders_DebugSet.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::DebugSet".
      
      (*
          pub fn entry(&mut self, entry: &dyn fmt::Debug) -> &mut Self {
              self.inner.entry_with(|f| entry.fmt(f));
              self
          }
      *)
      Definition entry (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; entry ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let entry := M.alloc (| entry |) in
            M.read (|
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "core::fmt::builders::DebugInner",
                      "entry_with",
                      [
                        Ty.function
                          [
                            Ty.tuple
                              [ Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ] ]
                          ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::fmt::builders::DebugSet",
                        "inner"
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let f := M.copy (| γ |) in
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::fmt::Debug",
                                            Ty.dyn [ ("core::fmt::Debug::Trait", []) ],
                                            [],
                                            "fmt",
                                            []
                                          |),
                                          [ M.read (| entry |); M.read (| f |) ]
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entry : M.IsAssociatedFunction Self "entry" entry.
      
      (*
          pub fn entry_with<F>(&mut self, entry_fmt: F) -> &mut Self
          where
              F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
          {
              self.inner.entry_with(entry_fmt);
              self
          }
      *)
      Definition entry_with (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ self; entry_fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let entry_fmt := M.alloc (| entry_fmt |) in
            M.read (|
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "core::fmt::builders::DebugInner",
                      "entry_with",
                      [ F ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::fmt::builders::DebugSet",
                        "inner"
                      |);
                      M.read (| entry_fmt |)
                    ]
                  |)
                |) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entry_with : M.IsAssociatedFunction Self "entry_with" entry_with.
      
      (*
          pub fn entries<D, I>(&mut self, entries: I) -> &mut Self
          where
              D: fmt::Debug,
              I: IntoIterator<Item = D>,
          {
              for entry in entries {
                  self.entry(&entry);
              }
              self
          }
      *)
      Definition entries (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ D; _ as I ], [ self; entries ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let entries := M.alloc (| entries |) in
            M.read (|
              let~ _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          I,
                          [],
                          "into_iter",
                          []
                        |),
                        [ M.read (| entries |) ]
                      |)
                    |),
                    [
                      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.associated,
                                        [],
                                        "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 entry := M.copy (| γ0_0 |) in
                                        let~ _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "core::fmt::builders::DebugSet",
                                                "entry",
                                                []
                                              |),
                                              [ M.read (| self |); entry ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entries : M.IsAssociatedFunction Self "entries" entries.
      
      (*
          pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
              self.inner.result = self.inner.result.and_then(|_| {
                  if self.inner.has_fields {
                      if self.inner.is_pretty() {
                          let mut slot = None;
                          let mut state = Default::default();
                          let mut writer = PadAdapter::wrap(self.inner.fmt, &mut slot, &mut state);
                          writer.write_str("..\n")?;
                          self.inner.fmt.write_str("}")
                      } else {
                          self.inner.fmt.write_str(", ..}")
                      }
                  } else {
                      self.inner.fmt.write_str("..}")
                  }
              });
              self.inner.result
          }
      *)
      Definition finish_non_exhaustive (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::fmt::builders::DebugSet",
                      "inner"
                    |),
                    "core::fmt::builders::DebugInner",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::fmt::builders::DebugSet",
                            "inner"
                          |),
                          "core::fmt::builders::DebugInner",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          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.read (| self |),
                                                          "core::fmt::builders::DebugSet",
                                                          "inner"
                                                        |),
                                                        "core::fmt::builders::DebugInner",
                                                        "has_fields"
                                                      |)) in
                                                  let _ :=
                                                    M.is_constant_or_break_match (|
                                                      M.read (| γ |),
                                                      Value.Bool true
                                                    |) in
                                                  M.match_operator (|
                                                    M.alloc (| Value.Tuple [] |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ :=
                                                            M.use
                                                              (M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "core::fmt::builders::DebugInner",
                                                                    "is_pretty",
                                                                    []
                                                                  |),
                                                                  [
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugSet",
                                                                      "inner"
                                                                    |)
                                                                  ]
                                                                |)
                                                              |)) in
                                                          let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Bool true
                                                            |) in
                                                          let~ slot :=
                                                            M.alloc (|
                                                              Value.StructTuple
                                                                "core::option::Option::None"
                                                                []
                                                            |) in
                                                          let~ state :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::default::Default",
                                                                  Ty.path
                                                                    "core::fmt::builders::PadAdapterState",
                                                                  [],
                                                                  "default",
                                                                  []
                                                                |),
                                                                []
                                                              |)
                                                            |) in
                                                          let~ writer :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "core::fmt::builders::PadAdapter",
                                                                  "wrap",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.SubPointer.get_struct_record_field (|
                                                                        M.read (| self |),
                                                                        "core::fmt::builders::DebugSet",
                                                                        "inner"
                                                                      |),
                                                                      "core::fmt::builders::DebugInner",
                                                                      "fmt"
                                                                    |)
                                                                  |);
                                                                  slot;
                                                                  state
                                                                ]
                                                              |)
                                                            |) 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_str",
                                                                        []
                                                                      |),
                                                                      [
                                                                        writer;
                                                                        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 (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Formatter",
                                                                "write_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugSet",
                                                                      "inner"
                                                                    |),
                                                                    "core::fmt::builders::DebugInner",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| Value.String "}" |)
                                                              ]
                                                            |)
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.alloc (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Formatter",
                                                                "write_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugSet",
                                                                      "inner"
                                                                    |),
                                                                    "core::fmt::builders::DebugInner",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| Value.String ", ..}" |)
                                                              ]
                                                            |)
                                                          |)))
                                                    ]
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "core::fmt::Formatter",
                                                        "write_str",
                                                        []
                                                      |),
                                                      [
                                                        M.read (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::DebugSet",
                                                              "inner"
                                                            |),
                                                            "core::fmt::builders::DebugInner",
                                                            "fmt"
                                                          |)
                                                        |);
                                                        M.read (| Value.String "..}" |)
                                                      ]
                                                    |)
                                                  |)))
                                            ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.SubPointer.get_struct_record_field (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::fmt::builders::DebugSet",
                  "inner"
                |),
                "core::fmt::builders::DebugInner",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish_non_exhaustive :
        M.IsAssociatedFunction Self "finish_non_exhaustive" finish_non_exhaustive.
      
      (*
          pub fn finish(&mut self) -> fmt::Result {
              self.inner.result = self.inner.result.and_then(|_| self.inner.fmt.write_str("}"));
              self.inner.result
          }
      *)
      Definition finish (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::fmt::builders::DebugSet",
                      "inner"
                    |),
                    "core::fmt::builders::DebugInner",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::fmt::builders::DebugSet",
                            "inner"
                          |),
                          "core::fmt::builders::DebugInner",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "core::fmt::Formatter",
                                            "write_str",
                                            []
                                          |),
                                          [
                                            M.read (|
                                              M.SubPointer.get_struct_record_field (|
                                                M.SubPointer.get_struct_record_field (|
                                                  M.read (| self |),
                                                  "core::fmt::builders::DebugSet",
                                                  "inner"
                                                |),
                                                "core::fmt::builders::DebugInner",
                                                "fmt"
                                              |)
                                            |);
                                            M.read (| Value.String "}" |)
                                          ]
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.SubPointer.get_struct_record_field (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::fmt::builders::DebugSet",
                  "inner"
                |),
                "core::fmt::builders::DebugInner",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish : M.IsAssociatedFunction Self "finish" finish.
    End Impl_core_fmt_builders_DebugSet.
    
    (* StructRecord
      {
        name := "DebugList";
        const_params := [];
        ty_params := [];
        fields := [ ("inner", Ty.path "core::fmt::builders::DebugInner") ];
      } *)
    
    (*
    pub(super) fn debug_list_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugList<'a, 'b> {
        let result = fmt.write_str("[");
        DebugList { inner: DebugInner { fmt, result, has_fields: false } }
    }
    *)
    Definition debug_list_new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ fmt ] =>
        ltac:(M.monadic
          (let fmt := M.alloc (| fmt |) in
          M.read (|
            let~ result :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [] |),
                  [ M.read (| fmt |); M.read (| Value.String "[" |) ]
                |)
              |) in
            M.alloc (|
              Value.StructRecord
                "core::fmt::builders::DebugList"
                [
                  ("inner",
                    Value.StructRecord
                      "core::fmt::builders::DebugInner"
                      [
                        ("fmt", M.read (| fmt |));
                        ("result", M.read (| result |));
                        ("has_fields", Value.Bool false)
                      ])
                ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Function_debug_list_new :
      M.IsFunction "core::fmt::builders::debug_list_new" debug_list_new.
    
    Module Impl_core_fmt_builders_DebugList.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::DebugList".
      
      (*
          pub fn entry(&mut self, entry: &dyn fmt::Debug) -> &mut Self {
              self.inner.entry_with(|f| entry.fmt(f));
              self
          }
      *)
      Definition entry (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; entry ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let entry := M.alloc (| entry |) in
            M.read (|
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "core::fmt::builders::DebugInner",
                      "entry_with",
                      [
                        Ty.function
                          [
                            Ty.tuple
                              [ Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ] ]
                          ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::fmt::builders::DebugList",
                        "inner"
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let f := M.copy (| γ |) in
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::fmt::Debug",
                                            Ty.dyn [ ("core::fmt::Debug::Trait", []) ],
                                            [],
                                            "fmt",
                                            []
                                          |),
                                          [ M.read (| entry |); M.read (| f |) ]
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entry : M.IsAssociatedFunction Self "entry" entry.
      
      (*
          pub fn entry_with<F>(&mut self, entry_fmt: F) -> &mut Self
          where
              F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
          {
              self.inner.entry_with(entry_fmt);
              self
          }
      *)
      Definition entry_with (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ self; entry_fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let entry_fmt := M.alloc (| entry_fmt |) in
            M.read (|
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.path "core::fmt::builders::DebugInner",
                      "entry_with",
                      [ F ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::fmt::builders::DebugList",
                        "inner"
                      |);
                      M.read (| entry_fmt |)
                    ]
                  |)
                |) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entry_with : M.IsAssociatedFunction Self "entry_with" entry_with.
      
      (*
          pub fn entries<D, I>(&mut self, entries: I) -> &mut Self
          where
              D: fmt::Debug,
              I: IntoIterator<Item = D>,
          {
              for entry in entries {
                  self.entry(&entry);
              }
              self
          }
      *)
      Definition entries (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ D; _ as I ], [ self; entries ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let entries := M.alloc (| entries |) in
            M.read (|
              let~ _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          I,
                          [],
                          "into_iter",
                          []
                        |),
                        [ M.read (| entries |) ]
                      |)
                    |),
                    [
                      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.associated,
                                        [],
                                        "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 entry := M.copy (| γ0_0 |) in
                                        let~ _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "core::fmt::builders::DebugList",
                                                "entry",
                                                []
                                              |),
                                              [ M.read (| self |); entry ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entries : M.IsAssociatedFunction Self "entries" entries.
      
      (*
          pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
              self.inner.result.and_then(|_| {
                  if self.inner.has_fields {
                      if self.inner.is_pretty() {
                          let mut slot = None;
                          let mut state = Default::default();
                          let mut writer = PadAdapter::wrap(self.inner.fmt, &mut slot, &mut state);
                          writer.write_str("..\n")?;
                          self.inner.fmt.write_str("]")
                      } else {
                          self.inner.fmt.write_str(", ..]")
                      }
                  } else {
                      self.inner.fmt.write_str("..]")
                  }
              })
          }
      *)
      Definition finish_non_exhaustive (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.apply
                  (Ty.path "core::result::Result")
                  []
                  [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                "and_then",
                [
                  Ty.tuple [];
                  Ty.function
                    [ Ty.tuple [ Ty.tuple [] ] ]
                    (Ty.apply
                      (Ty.path "core::result::Result")
                      []
                      [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                ]
              |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::fmt::builders::DebugList",
                      "inner"
                    |),
                    "core::fmt::builders::DebugInner",
                    "result"
                  |)
                |);
                M.closure
                  (fun γ =>
                    ltac:(M.monadic
                      match γ with
                      | [ α0 ] =>
                        ltac:(M.monadic
                          (M.match_operator (|
                            M.alloc (| α0 |),
                            [
                              fun γ =>
                                ltac:(M.monadic
                                  (M.read (|
                                    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.read (| self |),
                                                    "core::fmt::builders::DebugList",
                                                    "inner"
                                                  |),
                                                  "core::fmt::builders::DebugInner",
                                                  "has_fields"
                                                |)) in
                                            let _ :=
                                              M.is_constant_or_break_match (|
                                                M.read (| γ |),
                                                Value.Bool true
                                              |) in
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "core::fmt::builders::DebugInner",
                                                              "is_pretty",
                                                              []
                                                            |),
                                                            [
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::DebugList",
                                                                "inner"
                                                              |)
                                                            ]
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    let~ slot :=
                                                      M.alloc (|
                                                        Value.StructTuple
                                                          "core::option::Option::None"
                                                          []
                                                      |) in
                                                    let~ state :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::default::Default",
                                                            Ty.path
                                                              "core::fmt::builders::PadAdapterState",
                                                            [],
                                                            "default",
                                                            []
                                                          |),
                                                          []
                                                        |)
                                                      |) in
                                                    let~ writer :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "core::fmt::builders::PadAdapter",
                                                            "wrap",
                                                            []
                                                          |),
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.SubPointer.get_struct_record_field (|
                                                                  M.read (| self |),
                                                                  "core::fmt::builders::DebugList",
                                                                  "inner"
                                                                |),
                                                                "core::fmt::builders::DebugInner",
                                                                "fmt"
                                                              |)
                                                            |);
                                                            slot;
                                                            state
                                                          ]
                                                        |)
                                                      |) 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_str",
                                                                  []
                                                                |),
                                                                [
                                                                  writer;
                                                                  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 (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "core::fmt::Formatter",
                                                          "write_str",
                                                          []
                                                        |),
                                                        [
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::DebugList",
                                                                "inner"
                                                              |),
                                                              "core::fmt::builders::DebugInner",
                                                              "fmt"
                                                            |)
                                                          |);
                                                          M.read (| Value.String "]" |)
                                                        ]
                                                      |)
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (M.alloc (|
                                                      M.call_closure (|
                                                        M.get_associated_function (|
                                                          Ty.path "core::fmt::Formatter",
                                                          "write_str",
                                                          []
                                                        |),
                                                        [
                                                          M.read (|
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::DebugList",
                                                                "inner"
                                                              |),
                                                              "core::fmt::builders::DebugInner",
                                                              "fmt"
                                                            |)
                                                          |);
                                                          M.read (| Value.String ", ..]" |)
                                                        ]
                                                      |)
                                                    |)))
                                              ]
                                            |)));
                                        fun γ =>
                                          ltac:(M.monadic
                                            (M.alloc (|
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "core::fmt::Formatter",
                                                  "write_str",
                                                  []
                                                |),
                                                [
                                                  M.read (|
                                                    M.SubPointer.get_struct_record_field (|
                                                      M.SubPointer.get_struct_record_field (|
                                                        M.read (| self |),
                                                        "core::fmt::builders::DebugList",
                                                        "inner"
                                                      |),
                                                      "core::fmt::builders::DebugInner",
                                                      "fmt"
                                                    |)
                                                  |);
                                                  M.read (| Value.String "..]" |)
                                                ]
                                              |)
                                            |)))
                                      ]
                                    |)
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish_non_exhaustive :
        M.IsAssociatedFunction Self "finish_non_exhaustive" finish_non_exhaustive.
      
      (*
          pub fn finish(&mut self) -> fmt::Result {
              self.inner.result = self.inner.result.and_then(|_| self.inner.fmt.write_str("]"));
              self.inner.result
          }
      *)
      Definition finish (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::fmt::builders::DebugList",
                      "inner"
                    |),
                    "core::fmt::builders::DebugInner",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.SubPointer.get_struct_record_field (|
                            M.read (| self |),
                            "core::fmt::builders::DebugList",
                            "inner"
                          |),
                          "core::fmt::builders::DebugInner",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.call_closure (|
                                          M.get_associated_function (|
                                            Ty.path "core::fmt::Formatter",
                                            "write_str",
                                            []
                                          |),
                                          [
                                            M.read (|
                                              M.SubPointer.get_struct_record_field (|
                                                M.SubPointer.get_struct_record_field (|
                                                  M.read (| self |),
                                                  "core::fmt::builders::DebugList",
                                                  "inner"
                                                |),
                                                "core::fmt::builders::DebugInner",
                                                "fmt"
                                              |)
                                            |);
                                            M.read (| Value.String "]" |)
                                          ]
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.SubPointer.get_struct_record_field (|
                M.SubPointer.get_struct_record_field (|
                  M.read (| self |),
                  "core::fmt::builders::DebugList",
                  "inner"
                |),
                "core::fmt::builders::DebugInner",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish : M.IsAssociatedFunction Self "finish" finish.
    End Impl_core_fmt_builders_DebugList.
    
    (* StructRecord
      {
        name := "DebugMap";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("fmt", Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ]);
            ("result",
              Ty.apply
                (Ty.path "core::result::Result")
                []
                [ Ty.tuple []; Ty.path "core::fmt::Error" ]);
            ("has_fields", Ty.path "bool");
            ("has_key", Ty.path "bool");
            ("state", Ty.path "core::fmt::builders::PadAdapterState")
          ];
      } *)
    
    (*
    pub(super) fn debug_map_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugMap<'a, 'b> {
        let result = fmt.write_str("{");
        DebugMap { fmt, result, has_fields: false, has_key: false, state: Default::default() }
    }
    *)
    Definition debug_map_new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [], [ fmt ] =>
        ltac:(M.monadic
          (let fmt := M.alloc (| fmt |) in
          M.read (|
            let~ result :=
              M.alloc (|
                M.call_closure (|
                  M.get_associated_function (| Ty.path "core::fmt::Formatter", "write_str", [] |),
                  [ M.read (| fmt |); M.read (| Value.String "{" |) ]
                |)
              |) in
            M.alloc (|
              Value.StructRecord
                "core::fmt::builders::DebugMap"
                [
                  ("fmt", M.read (| fmt |));
                  ("result", M.read (| result |));
                  ("has_fields", Value.Bool false);
                  ("has_key", Value.Bool false);
                  ("state",
                    M.call_closure (|
                      M.get_trait_method (|
                        "core::default::Default",
                        Ty.path "core::fmt::builders::PadAdapterState",
                        [],
                        "default",
                        []
                      |),
                      []
                    |))
                ]
            |)
          |)))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Function_debug_map_new : M.IsFunction "core::fmt::builders::debug_map_new" debug_map_new.
    
    Module Impl_core_fmt_builders_DebugMap.
      Definition Self : Ty.t := Ty.path "core::fmt::builders::DebugMap".
      
      (*
          pub fn entry(&mut self, key: &dyn fmt::Debug, value: &dyn fmt::Debug) -> &mut Self {
              self.key(key).value(value)
          }
      *)
      Definition entry (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; key; value ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let key := M.alloc (| key |) in
            let value := M.alloc (| value |) in
            M.call_closure (|
              M.get_associated_function (| Ty.path "core::fmt::builders::DebugMap", "value", [] |),
              [
                M.call_closure (|
                  M.get_associated_function (|
                    Ty.path "core::fmt::builders::DebugMap",
                    "key",
                    []
                  |),
                  [ M.read (| self |); M.read (| key |) ]
                |);
                M.read (| value |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entry : M.IsAssociatedFunction Self "entry" entry.
      
      (*
          pub fn key(&mut self, key: &dyn fmt::Debug) -> &mut Self {
              self.key_with(|f| key.fmt(f))
          }
      *)
      Definition key (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; key ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let key := M.alloc (| key |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::fmt::builders::DebugMap",
                "key_with",
                [
                  Ty.function
                    [ Ty.tuple [ Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ] ] ]
                    (Ty.apply
                      (Ty.path "core::result::Result")
                      []
                      [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                ]
              |),
              [
                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 f := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::fmt::Debug",
                                      Ty.dyn [ ("core::fmt::Debug::Trait", []) ],
                                      [],
                                      "fmt",
                                      []
                                    |),
                                    [ M.read (| key |); M.read (| f |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_key : M.IsAssociatedFunction Self "key" key.
      
      (*
          pub fn key_with<F>(&mut self, key_fmt: F) -> &mut Self
          where
              F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
          {
              self.result = self.result.and_then(|_| {
                  assert!(
                      !self.has_key,
                      "attempted to begin a new map entry \
                                          without completing the previous one"
                  );
      
                  if self.is_pretty() {
                      if !self.has_fields {
                          self.fmt.write_str("\n")?;
                      }
                      let mut slot = None;
                      self.state = Default::default();
                      let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut self.state);
                      key_fmt(&mut writer)?;
                      writer.write_str(": ")?;
                  } else {
                      if self.has_fields {
                          self.fmt.write_str(", ")?
                      }
                      key_fmt(self.fmt)?;
                      self.fmt.write_str(": ")?;
                  }
      
                  self.has_key = true;
                  Ok(())
              });
      
              self
          }
      *)
      Definition key_with (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ self; key_fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let key_fmt := M.alloc (| key_fmt |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugMap",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugMap",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          let~ _ :=
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          UnOp.not (|
                                                            UnOp.not (|
                                                              M.read (|
                                                                M.SubPointer.get_struct_record_field (|
                                                                  M.read (| self |),
                                                                  "core::fmt::builders::DebugMap",
                                                                  "has_key"
                                                                |)
                                                              |)
                                                            |)
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    M.alloc (|
                                                      M.never_to_any (|
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "core::panicking::panic_fmt",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Arguments",
                                                                "new_const",
                                                                []
                                                              |),
                                                              [
                                                                M.alloc (|
                                                                  Value.Array
                                                                    [
                                                                      M.read (|
                                                                        Value.String
                                                                          "attempted to begin a new map entry without completing the previous one"
                                                                      |)
                                                                    ]
                                                                |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |)
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |) in
                                          let~ _ :=
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "core::fmt::builders::DebugMap",
                                                              "is_pretty",
                                                              []
                                                            |),
                                                            [ M.read (| self |) ]
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    let~ _ :=
                                                      M.match_operator (|
                                                        M.alloc (| Value.Tuple [] |),
                                                        [
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (let γ :=
                                                                M.use
                                                                  (M.alloc (|
                                                                    UnOp.not (|
                                                                      M.read (|
                                                                        M.SubPointer.get_struct_record_field (|
                                                                          M.read (| self |),
                                                                          "core::fmt::builders::DebugMap",
                                                                          "has_fields"
                                                                        |)
                                                                      |)
                                                                    |)
                                                                  |)) in
                                                              let _ :=
                                                                M.is_constant_or_break_match (|
                                                                  M.read (| γ |),
                                                                  Value.Bool true
                                                                |) 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_str",
                                                                            []
                                                                          |),
                                                                          [
                                                                            M.read (|
                                                                              M.SubPointer.get_struct_record_field (|
                                                                                M.read (| self |),
                                                                                "core::fmt::builders::DebugMap",
                                                                                "fmt"
                                                                              |)
                                                                            |);
                                                                            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.Tuple [] |)));
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (M.alloc (| Value.Tuple [] |)))
                                                        ]
                                                      |) in
                                                    let~ slot :=
                                                      M.alloc (|
                                                        Value.StructTuple
                                                          "core::option::Option::None"
                                                          []
                                                      |) in
                                                    let~ _ :=
                                                      M.write (|
                                                        M.SubPointer.get_struct_record_field (|
                                                          M.read (| self |),
                                                          "core::fmt::builders::DebugMap",
                                                          "state"
                                                        |),
                                                        M.call_closure (|
                                                          M.get_trait_method (|
                                                            "core::default::Default",
                                                            Ty.path
                                                              "core::fmt::builders::PadAdapterState",
                                                            [],
                                                            "default",
                                                            []
                                                          |),
                                                          []
                                                        |)
                                                      |) in
                                                    let~ writer :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "core::fmt::builders::PadAdapter",
                                                            "wrap",
                                                            []
                                                          |),
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::DebugMap",
                                                                "fmt"
                                                              |)
                                                            |);
                                                            slot;
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::DebugMap",
                                                              "state"
                                                            |)
                                                          ]
                                                        |)
                                                      |) 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_trait_method (|
                                                                  "core::ops::function::FnOnce",
                                                                  F,
                                                                  [
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "&mut")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "core::fmt::Formatter"
                                                                          ]
                                                                      ]
                                                                  ],
                                                                  "call_once",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (| key_fmt |);
                                                                  Value.Tuple [ writer ]
                                                                ]
                                                              |)
                                                            ]
                                                          |)
                                                        |),
                                                        [
                                                          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_str",
                                                                  []
                                                                |),
                                                                [
                                                                  writer;
                                                                  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.Tuple [] |)));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (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::fmt::builders::DebugMap",
                                                                    "has_fields"
                                                                  |)) in
                                                              let _ :=
                                                                M.is_constant_or_break_match (|
                                                                  M.read (| γ |),
                                                                  Value.Bool true
                                                                |) in
                                                              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_str",
                                                                          []
                                                                        |),
                                                                        [
                                                                          M.read (|
                                                                            M.SubPointer.get_struct_record_field (|
                                                                              M.read (| self |),
                                                                              "core::fmt::builders::DebugMap",
                                                                              "fmt"
                                                                            |)
                                                                          |);
                                                                          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))
                                                                ]
                                                              |)));
                                                          fun γ =>
                                                            ltac:(M.monadic
                                                              (M.alloc (| Value.Tuple [] |)))
                                                        ]
                                                      |) in
                                                    let~ _ :=
                                                      M.match_operator (|
                                                        M.alloc (|
                                                          M.call_closure (|
                                                            M.get_trait_method (|
                                                              "core::ops::try_trait::Try",
                                                              Ty.apply
                                                                (Ty.path "core::result::Result")
                                                                []
                                                                [
                                                                  Ty.tuple [];
                                                                  Ty.path "core::fmt::Error"
                                                                ],
                                                              [],
                                                              "branch",
                                                              []
                                                            |),
                                                            [
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::ops::function::FnOnce",
                                                                  F,
                                                                  [
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "&mut")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "core::fmt::Formatter"
                                                                          ]
                                                                      ]
                                                                  ],
                                                                  "call_once",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (| key_fmt |);
                                                                  Value.Tuple
                                                                    [
                                                                      M.read (|
                                                                        M.SubPointer.get_struct_record_field (|
                                                                          M.read (| self |),
                                                                          "core::fmt::builders::DebugMap",
                                                                          "fmt"
                                                                        |)
                                                                      |)
                                                                    ]
                                                                ]
                                                              |)
                                                            ]
                                                          |)
                                                        |),
                                                        [
                                                          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_str",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugMap",
                                                                      "fmt"
                                                                    |)
                                                                  |);
                                                                  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.Tuple [] |)))
                                              ]
                                            |) in
                                          let~ _ :=
                                            M.write (|
                                              M.SubPointer.get_struct_record_field (|
                                                M.read (| self |),
                                                "core::fmt::builders::DebugMap",
                                                "has_key"
                                              |),
                                              Value.Bool true
                                            |) in
                                          M.alloc (|
                                            Value.StructTuple
                                              "core::result::Result::Ok"
                                              [ Value.Tuple [] ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_key_with : M.IsAssociatedFunction Self "key_with" key_with.
      
      (*
          pub fn value(&mut self, value: &dyn fmt::Debug) -> &mut Self {
              self.value_with(|f| value.fmt(f))
          }
      *)
      Definition value (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; value ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let value := M.alloc (| value |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::fmt::builders::DebugMap",
                "value_with",
                [
                  Ty.function
                    [ Ty.tuple [ Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ] ] ]
                    (Ty.apply
                      (Ty.path "core::result::Result")
                      []
                      [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                ]
              |),
              [
                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 f := M.copy (| γ |) in
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::fmt::Debug",
                                      Ty.dyn [ ("core::fmt::Debug::Trait", []) ],
                                      [],
                                      "fmt",
                                      []
                                    |),
                                    [ M.read (| value |); M.read (| f |) ]
                                  |)))
                            ]
                          |)))
                      | _ => M.impossible "wrong number of arguments"
                      end))
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_value : M.IsAssociatedFunction Self "value" value.
      
      (*
          pub fn value_with<F>(&mut self, value_fmt: F) -> &mut Self
          where
              F: FnOnce(&mut fmt::Formatter<'_>) -> fmt::Result,
          {
              self.result = self.result.and_then(|_| {
                  assert!(self.has_key, "attempted to format a map value before its key");
      
                  if self.is_pretty() {
                      let mut slot = None;
                      let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut self.state);
                      value_fmt(&mut writer)?;
                      writer.write_str(",\n")?;
                  } else {
                      value_fmt(self.fmt)?;
                  }
      
                  self.has_key = false;
                  Ok(())
              });
      
              self.has_fields = true;
              self
          }
      *)
      Definition value_with (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ F ], [ self; value_fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let value_fmt := M.alloc (| value_fmt |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugMap",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugMap",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      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::fmt::builders::DebugMap",
                                                                "has_key"
                                                              |)
                                                            |)
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    M.alloc (|
                                                      M.never_to_any (|
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "core::panicking::panic_fmt",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Arguments",
                                                                "new_const",
                                                                []
                                                              |),
                                                              [
                                                                M.alloc (|
                                                                  Value.Array
                                                                    [
                                                                      M.read (|
                                                                        Value.String
                                                                          "attempted to format a map value before its key"
                                                                      |)
                                                                    ]
                                                                |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |)
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |) in
                                          let~ _ :=
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          M.call_closure (|
                                                            M.get_associated_function (|
                                                              Ty.path
                                                                "core::fmt::builders::DebugMap",
                                                              "is_pretty",
                                                              []
                                                            |),
                                                            [ M.read (| self |) ]
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    let~ slot :=
                                                      M.alloc (|
                                                        Value.StructTuple
                                                          "core::option::Option::None"
                                                          []
                                                      |) in
                                                    let~ writer :=
                                                      M.alloc (|
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path
                                                              "core::fmt::builders::PadAdapter",
                                                            "wrap",
                                                            []
                                                          |),
                                                          [
                                                            M.read (|
                                                              M.SubPointer.get_struct_record_field (|
                                                                M.read (| self |),
                                                                "core::fmt::builders::DebugMap",
                                                                "fmt"
                                                              |)
                                                            |);
                                                            slot;
                                                            M.SubPointer.get_struct_record_field (|
                                                              M.read (| self |),
                                                              "core::fmt::builders::DebugMap",
                                                              "state"
                                                            |)
                                                          ]
                                                        |)
                                                      |) 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_trait_method (|
                                                                  "core::ops::function::FnOnce",
                                                                  F,
                                                                  [
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "&mut")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "core::fmt::Formatter"
                                                                          ]
                                                                      ]
                                                                  ],
                                                                  "call_once",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (| value_fmt |);
                                                                  Value.Tuple [ writer ]
                                                                ]
                                                              |)
                                                            ]
                                                          |)
                                                        |),
                                                        [
                                                          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_str",
                                                                  []
                                                                |),
                                                                [
                                                                  writer;
                                                                  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.Tuple [] |)));
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (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_trait_method (|
                                                                  "core::ops::function::FnOnce",
                                                                  F,
                                                                  [
                                                                    Ty.tuple
                                                                      [
                                                                        Ty.apply
                                                                          (Ty.path "&mut")
                                                                          []
                                                                          [
                                                                            Ty.path
                                                                              "core::fmt::Formatter"
                                                                          ]
                                                                      ]
                                                                  ],
                                                                  "call_once",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (| value_fmt |);
                                                                  Value.Tuple
                                                                    [
                                                                      M.read (|
                                                                        M.SubPointer.get_struct_record_field (|
                                                                          M.read (| self |),
                                                                          "core::fmt::builders::DebugMap",
                                                                          "fmt"
                                                                        |)
                                                                      |)
                                                                    ]
                                                                ]
                                                              |)
                                                            ]
                                                          |)
                                                        |),
                                                        [
                                                          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.Tuple [] |)))
                                              ]
                                            |) in
                                          let~ _ :=
                                            M.write (|
                                              M.SubPointer.get_struct_record_field (|
                                                M.read (| self |),
                                                "core::fmt::builders::DebugMap",
                                                "has_key"
                                              |),
                                              Value.Bool false
                                            |) in
                                          M.alloc (|
                                            Value.StructTuple
                                              "core::result::Result::Ok"
                                              [ Value.Tuple [] ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugMap",
                    "has_fields"
                  |),
                  Value.Bool true
                |) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_value_with : M.IsAssociatedFunction Self "value_with" value_with.
      
      (*
          pub fn entries<K, V, I>(&mut self, entries: I) -> &mut Self
          where
              K: fmt::Debug,
              V: fmt::Debug,
              I: IntoIterator<Item = (K, V)>,
          {
              for (k, v) in entries {
                  self.entry(&k, &v);
              }
              self
          }
      *)
      Definition entries (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ K; V; _ as I ], [ self; entries ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let entries := M.alloc (| entries |) in
            M.read (|
              let~ _ :=
                M.use
                  (M.match_operator (|
                    M.alloc (|
                      M.call_closure (|
                        M.get_trait_method (|
                          "core::iter::traits::collect::IntoIterator",
                          I,
                          [],
                          "into_iter",
                          []
                        |),
                        [ M.read (| entries |) ]
                      |)
                    |),
                    [
                      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.associated,
                                        [],
                                        "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 γ1_0 := M.SubPointer.get_tuple_field (| γ0_0, 0 |) in
                                        let γ1_1 := M.SubPointer.get_tuple_field (| γ0_0, 1 |) in
                                        let k := M.copy (| γ1_0 |) in
                                        let v := M.copy (| γ1_1 |) in
                                        let~ _ :=
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "core::fmt::builders::DebugMap",
                                                "entry",
                                                []
                                              |),
                                              [ M.read (| self |); k; v ]
                                            |)
                                          |) in
                                        M.alloc (| Value.Tuple [] |)))
                                  ]
                                |) in
                              M.alloc (| Value.Tuple [] |)))
                          |)))
                    ]
                  |)) in
              M.alloc (| M.read (| self |) |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_entries : M.IsAssociatedFunction Self "entries" entries.
      
      (*
          pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
              self.result = self.result.and_then(|_| {
                  assert!(!self.has_key, "attempted to finish a map with a partial entry");
      
                  if self.has_fields {
                      if self.is_pretty() {
                          let mut slot = None;
                          let mut state = Default::default();
                          let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
                          writer.write_str("..\n")?;
                          self.fmt.write_str("}")
                      } else {
                          self.fmt.write_str(", ..}")
                      }
                  } else {
                      self.fmt.write_str("..}")
                  }
              });
              self.result
          }
      *)
      Definition finish_non_exhaustive (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugMap",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugMap",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          let~ _ :=
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          UnOp.not (|
                                                            UnOp.not (|
                                                              M.read (|
                                                                M.SubPointer.get_struct_record_field (|
                                                                  M.read (| self |),
                                                                  "core::fmt::builders::DebugMap",
                                                                  "has_key"
                                                                |)
                                                              |)
                                                            |)
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    M.alloc (|
                                                      M.never_to_any (|
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "core::panicking::panic_fmt",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Arguments",
                                                                "new_const",
                                                                []
                                                              |),
                                                              [
                                                                M.alloc (|
                                                                  Value.Array
                                                                    [
                                                                      M.read (|
                                                                        Value.String
                                                                          "attempted to finish a map with a partial entry"
                                                                      |)
                                                                    ]
                                                                |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |)
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |) in
                                          M.match_operator (|
                                            M.alloc (| Value.Tuple [] |),
                                            [
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (let γ :=
                                                    M.use
                                                      (M.SubPointer.get_struct_record_field (|
                                                        M.read (| self |),
                                                        "core::fmt::builders::DebugMap",
                                                        "has_fields"
                                                      |)) in
                                                  let _ :=
                                                    M.is_constant_or_break_match (|
                                                      M.read (| γ |),
                                                      Value.Bool true
                                                    |) in
                                                  M.match_operator (|
                                                    M.alloc (| Value.Tuple [] |),
                                                    [
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (let γ :=
                                                            M.use
                                                              (M.alloc (|
                                                                M.call_closure (|
                                                                  M.get_associated_function (|
                                                                    Ty.path
                                                                      "core::fmt::builders::DebugMap",
                                                                    "is_pretty",
                                                                    []
                                                                  |),
                                                                  [ M.read (| self |) ]
                                                                |)
                                                              |)) in
                                                          let _ :=
                                                            M.is_constant_or_break_match (|
                                                              M.read (| γ |),
                                                              Value.Bool true
                                                            |) in
                                                          let~ slot :=
                                                            M.alloc (|
                                                              Value.StructTuple
                                                                "core::option::Option::None"
                                                                []
                                                            |) in
                                                          let~ state :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_trait_method (|
                                                                  "core::default::Default",
                                                                  Ty.path
                                                                    "core::fmt::builders::PadAdapterState",
                                                                  [],
                                                                  "default",
                                                                  []
                                                                |),
                                                                []
                                                              |)
                                                            |) in
                                                          let~ writer :=
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "core::fmt::builders::PadAdapter",
                                                                  "wrap",
                                                                  []
                                                                |),
                                                                [
                                                                  M.read (|
                                                                    M.SubPointer.get_struct_record_field (|
                                                                      M.read (| self |),
                                                                      "core::fmt::builders::DebugMap",
                                                                      "fmt"
                                                                    |)
                                                                  |);
                                                                  slot;
                                                                  state
                                                                ]
                                                              |)
                                                            |) 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_str",
                                                                        []
                                                                      |),
                                                                      [
                                                                        writer;
                                                                        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 (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Formatter",
                                                                "write_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugMap",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| Value.String "}" |)
                                                              ]
                                                            |)
                                                          |)));
                                                      fun γ =>
                                                        ltac:(M.monadic
                                                          (M.alloc (|
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Formatter",
                                                                "write_str",
                                                                []
                                                              |),
                                                              [
                                                                M.read (|
                                                                  M.SubPointer.get_struct_record_field (|
                                                                    M.read (| self |),
                                                                    "core::fmt::builders::DebugMap",
                                                                    "fmt"
                                                                  |)
                                                                |);
                                                                M.read (| Value.String ", ..}" |)
                                                              ]
                                                            |)
                                                          |)))
                                                    ]
                                                  |)));
                                              fun γ =>
                                                ltac:(M.monadic
                                                  (M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path "core::fmt::Formatter",
                                                        "write_str",
                                                        []
                                                      |),
                                                      [
                                                        M.read (|
                                                          M.SubPointer.get_struct_record_field (|
                                                            M.read (| self |),
                                                            "core::fmt::builders::DebugMap",
                                                            "fmt"
                                                          |)
                                                        |);
                                                        M.read (| Value.String "..}" |)
                                                      ]
                                                    |)
                                                  |)))
                                            ]
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::fmt::builders::DebugMap",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish_non_exhaustive :
        M.IsAssociatedFunction Self "finish_non_exhaustive" finish_non_exhaustive.
      
      (*
          pub fn finish(&mut self) -> fmt::Result {
              self.result = self.result.and_then(|_| {
                  assert!(!self.has_key, "attempted to finish a map with a partial entry");
      
                  self.fmt.write_str("}")
              });
              self.result
          }
      *)
      Definition finish (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugMap",
                    "result"
                  |),
                  M.call_closure (|
                    M.get_associated_function (|
                      Ty.apply
                        (Ty.path "core::result::Result")
                        []
                        [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                      "and_then",
                      [
                        Ty.tuple [];
                        Ty.function
                          [ Ty.tuple [ Ty.tuple [] ] ]
                          (Ty.apply
                            (Ty.path "core::result::Result")
                            []
                            [ Ty.tuple []; Ty.path "core::fmt::Error" ])
                      ]
                    |),
                    [
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::fmt::builders::DebugMap",
                          "result"
                        |)
                      |);
                      M.closure
                        (fun γ =>
                          ltac:(M.monadic
                            match γ with
                            | [ α0 ] =>
                              ltac:(M.monadic
                                (M.match_operator (|
                                  M.alloc (| α0 |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (M.read (|
                                          let~ _ :=
                                            M.match_operator (|
                                              M.alloc (| Value.Tuple [] |),
                                              [
                                                fun γ =>
                                                  ltac:(M.monadic
                                                    (let γ :=
                                                      M.use
                                                        (M.alloc (|
                                                          UnOp.not (|
                                                            UnOp.not (|
                                                              M.read (|
                                                                M.SubPointer.get_struct_record_field (|
                                                                  M.read (| self |),
                                                                  "core::fmt::builders::DebugMap",
                                                                  "has_key"
                                                                |)
                                                              |)
                                                            |)
                                                          |)
                                                        |)) in
                                                    let _ :=
                                                      M.is_constant_or_break_match (|
                                                        M.read (| γ |),
                                                        Value.Bool true
                                                      |) in
                                                    M.alloc (|
                                                      M.never_to_any (|
                                                        M.call_closure (|
                                                          M.get_function (|
                                                            "core::panicking::panic_fmt",
                                                            []
                                                          |),
                                                          [
                                                            M.call_closure (|
                                                              M.get_associated_function (|
                                                                Ty.path "core::fmt::Arguments",
                                                                "new_const",
                                                                []
                                                              |),
                                                              [
                                                                M.alloc (|
                                                                  Value.Array
                                                                    [
                                                                      M.read (|
                                                                        Value.String
                                                                          "attempted to finish a map with a partial entry"
                                                                      |)
                                                                    ]
                                                                |)
                                                              ]
                                                            |)
                                                          ]
                                                        |)
                                                      |)
                                                    |)));
                                                fun γ =>
                                                  ltac:(M.monadic (M.alloc (| Value.Tuple [] |)))
                                              ]
                                            |) in
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "core::fmt::Formatter",
                                                "write_str",
                                                []
                                              |),
                                              [
                                                M.read (|
                                                  M.SubPointer.get_struct_record_field (|
                                                    M.read (| self |),
                                                    "core::fmt::builders::DebugMap",
                                                    "fmt"
                                                  |)
                                                |);
                                                M.read (| Value.String "}" |)
                                              ]
                                            |)
                                          |)
                                        |)))
                                  ]
                                |)))
                            | _ => M.impossible "wrong number of arguments"
                            end))
                    ]
                  |)
                |) in
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::fmt::builders::DebugMap",
                "result"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_finish : M.IsAssociatedFunction Self "finish" finish.
      
      (*
          fn is_pretty(&self) -> bool {
              self.fmt.alternate()
          }
      *)
      Definition is_pretty (ε : 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::fmt::Formatter", "alternate", [] |),
              [
                M.read (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::fmt::builders::DebugMap",
                    "fmt"
                  |)
                |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_is_pretty : M.IsAssociatedFunction Self "is_pretty" is_pretty.
    End Impl_core_fmt_builders_DebugMap.
    
    (*
    pub fn from_fn<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result>(f: F) -> FromFn<F> {
        FromFn(f)
    }
    *)
    Definition from_fn (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
      match ε, τ, α with
      | [], [ F ], [ f ] =>
        ltac:(M.monadic
          (let f := M.alloc (| f |) in
          Value.StructTuple "core::fmt::builders::FromFn" [ M.read (| f |) ]))
      | _, _, _ => M.impossible "wrong number of arguments"
      end.
    
    Axiom Function_from_fn : M.IsFunction "core::fmt::builders::from_fn" from_fn.
    
    (* StructTuple
      {
        name := "FromFn";
        const_params := [];
        ty_params := [ "F" ];
        fields := [ F ];
      } *)
    
    Module Impl_core_fmt_Debug_where_core_ops_function_Fn_F_Tuple_ref_mut_core_fmt_Formatter__for_core_fmt_builders_FromFn_F.
      Definition Self (F : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::fmt::builders::FromFn") [] [ F ].
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              (self.0)(f)
          }
      *)
      Definition fmt (F : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self F 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_trait_method (|
                "core::ops::function::Fn",
                F,
                [ Ty.tuple [ Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ] ] ],
                "call",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::fmt::builders::FromFn",
                  0
                |);
                Value.Tuple [ M.read (| f |) ]
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (F : Ty.t),
        M.IsTraitInstance
          "core::fmt::Debug"
          (Self F)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt F)) ].
    End Impl_core_fmt_Debug_where_core_ops_function_Fn_F_Tuple_ref_mut_core_fmt_Formatter__for_core_fmt_builders_FromFn_F.
    
    Module Impl_core_fmt_Display_where_core_ops_function_Fn_F_Tuple_ref_mut_core_fmt_Formatter__for_core_fmt_builders_FromFn_F.
      Definition Self (F : Ty.t) : Ty.t :=
        Ty.apply (Ty.path "core::fmt::builders::FromFn") [] [ F ].
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              (self.0)(f)
          }
      *)
      Definition fmt (F : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self F 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_trait_method (|
                "core::ops::function::Fn",
                F,
                [ Ty.tuple [ Ty.apply (Ty.path "&mut") [] [ Ty.path "core::fmt::Formatter" ] ] ],
                "call",
                []
              |),
              [
                M.SubPointer.get_struct_tuple_field (|
                  M.read (| self |),
                  "core::fmt::builders::FromFn",
                  0
                |);
                Value.Tuple [ M.read (| f |) ]
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (F : Ty.t),
        M.IsTraitInstance
          "core::fmt::Display"
          (Self F)
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method (fmt F)) ].
    End Impl_core_fmt_Display_where_core_ops_function_Fn_F_Tuple_ref_mut_core_fmt_Formatter__for_core_fmt_builders_FromFn_F.
  End builders.
End fmt.
