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

Module net.
  Module socket_addr.
    (*
    Enum SocketAddr
    {
      const_params := [];
      ty_params := [];
      variants :=
        [
          {
            name := "V4";
            item := StructTuple [ Ty.path "core::net::socket_addr::SocketAddrV4" ];
            discriminant := None;
          };
          {
            name := "V6";
            item := StructTuple [ Ty.path "core::net::socket_addr::SocketAddrV6" ];
            discriminant := None;
          }
        ];
    }
    *)
    
    Module Impl_core_marker_Copy_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::Copy"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_Copy_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_clone_Clone_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (* Clone *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        Value.DeclaredButUndefined,
                        [ fun γ => ltac:(M.monadic (M.read (| self |))) ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_marker_StructuralPartialEq_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_cmp_PartialEq_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (* PartialEq *)
      Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.read (|
              let~ __self_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "core::net::socket_addr::SocketAddr" ]
                    |),
                    [ M.read (| self |) ]
                  |)
                |) in
              let~ __arg1_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "core::net::socket_addr::SocketAddr" ]
                    |),
                    [ M.read (| other |) ]
                  |)
                |) in
              M.alloc (|
                LogicalOp.and (|
                  BinOp.eq (| M.read (| __self_discr |), M.read (| __arg1_discr |) |),
                  ltac:(M.monadic
                    (M.read (|
                      M.match_operator (|
                        M.alloc (| Value.Tuple [ M.read (| self |); M.read (| other |) ] |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                              let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                              let γ0_0 := M.read (| γ0_0 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_0,
                                  "core::net::socket_addr::SocketAddr::V4",
                                  0
                                |) in
                              let __self_0 := M.alloc (| γ2_0 |) in
                              let γ0_1 := M.read (| γ0_1 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_1,
                                  "core::net::socket_addr::SocketAddr::V4",
                                  0
                                |) in
                              let __arg1_0 := M.alloc (| γ2_0 |) in
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::PartialEq",
                                    Ty.apply
                                      (Ty.path "&")
                                      []
                                      [ Ty.path "core::net::socket_addr::SocketAddrV4" ],
                                    [
                                      Ty.apply
                                        (Ty.path "&")
                                        []
                                        [ Ty.path "core::net::socket_addr::SocketAddrV4" ]
                                    ],
                                    "eq",
                                    []
                                  |),
                                  [ __self_0; __arg1_0 ]
                                |)
                              |)));
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                              let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                              let γ0_0 := M.read (| γ0_0 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_0,
                                  "core::net::socket_addr::SocketAddr::V6",
                                  0
                                |) in
                              let __self_0 := M.alloc (| γ2_0 |) in
                              let γ0_1 := M.read (| γ0_1 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_1,
                                  "core::net::socket_addr::SocketAddr::V6",
                                  0
                                |) in
                              let __arg1_0 := M.alloc (| γ2_0 |) in
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::PartialEq",
                                    Ty.apply
                                      (Ty.path "&")
                                      []
                                      [ Ty.path "core::net::socket_addr::SocketAddrV6" ],
                                    [
                                      Ty.apply
                                        (Ty.path "&")
                                        []
                                        [ Ty.path "core::net::socket_addr::SocketAddrV6" ]
                                    ],
                                    "eq",
                                    []
                                  |),
                                  [ __self_0; __arg1_0 ]
                                |)
                              |)));
                          fun γ =>
                            ltac:(M.monadic
                              (M.alloc (|
                                M.never_to_any (|
                                  M.call_closure (|
                                    M.get_function (| "core::intrinsics::unreachable", [] |),
                                    []
                                  |)
                                |)
                              |)))
                        ]
                      |)
                    |)))
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_cmp_Eq_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (* Eq *)
      Definition assert_receiver_is_total_eq
          (ε : list Value.t)
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        Value.DeclaredButUndefined,
                        [ fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |))) ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Eq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
    End Impl_core_cmp_Eq_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_hash_Hash_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (* Hash *)
      Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __H ], [ self; state ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let state := M.alloc (| state |) in
            M.read (|
              let~ __self_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "core::net::socket_addr::SocketAddr" ]
                    |),
                    [ M.read (| self |) ]
                  |)
                |) in
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::hash::Hash",
                      Ty.path "isize",
                      [],
                      "hash",
                      [ __H ]
                    |),
                    [ __self_discr; M.read (| state |) ]
                  |)
                |) in
              M.match_operator (|
                self,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      let __self_0 := M.alloc (| γ1_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::hash::Hash",
                            Ty.path "core::net::socket_addr::SocketAddrV4",
                            [],
                            "hash",
                            [ __H ]
                          |),
                          [ M.read (| __self_0 |); M.read (| state |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ := M.read (| γ |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      let __self_0 := M.alloc (| γ1_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::hash::Hash",
                            Ty.path "core::net::socket_addr::SocketAddrV6",
                            [],
                            "hash",
                            [ __H ]
                          |),
                          [ M.read (| __self_0 |); M.read (| state |) ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::hash::Hash"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("hash", InstanceField.Method hash) ].
    End Impl_core_hash_Hash_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_cmp_PartialOrd_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (* PartialOrd *)
      Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.read (|
              let~ __self_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "core::net::socket_addr::SocketAddr" ]
                    |),
                    [ M.read (| self |) ]
                  |)
                |) in
              let~ __arg1_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "core::net::socket_addr::SocketAddr" ]
                    |),
                    [ M.read (| other |) ]
                  |)
                |) in
              M.match_operator (|
                M.alloc (| Value.Tuple [ M.read (| self |); M.read (| other |) ] |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                      let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                      let γ0_0 := M.read (| γ0_0 |) in
                      let γ2_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ0_0,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      let __self_0 := M.alloc (| γ2_0 |) in
                      let γ0_1 := M.read (| γ0_1 |) in
                      let γ2_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ0_1,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      let __arg1_0 := M.alloc (| γ2_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::PartialOrd",
                            Ty.path "core::net::socket_addr::SocketAddrV4",
                            [ Ty.path "core::net::socket_addr::SocketAddrV4" ],
                            "partial_cmp",
                            []
                          |),
                          [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                      let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                      let γ0_0 := M.read (| γ0_0 |) in
                      let γ2_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ0_0,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      let __self_0 := M.alloc (| γ2_0 |) in
                      let γ0_1 := M.read (| γ0_1 |) in
                      let γ2_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ0_1,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      let __arg1_0 := M.alloc (| γ2_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::PartialOrd",
                            Ty.path "core::net::socket_addr::SocketAddrV6",
                            [ Ty.path "core::net::socket_addr::SocketAddrV6" ],
                            "partial_cmp",
                            []
                          |),
                          [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::PartialOrd",
                            Ty.path "isize",
                            [ Ty.path "isize" ],
                            "partial_cmp",
                            []
                          |),
                          [ __self_discr; __arg1_discr ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialOrd"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
    End Impl_core_cmp_PartialOrd_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_cmp_Ord_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (* Ord *)
      Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.read (|
              let~ __self_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "core::net::socket_addr::SocketAddr" ]
                    |),
                    [ M.read (| self |) ]
                  |)
                |) in
              let~ __arg1_discr :=
                M.alloc (|
                  M.call_closure (|
                    M.get_function (|
                      "core::intrinsics::discriminant_value",
                      [ Ty.path "core::net::socket_addr::SocketAddr" ]
                    |),
                    [ M.read (| other |) ]
                  |)
                |) in
              M.match_operator (|
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (| "core::cmp::Ord", Ty.path "isize", [], "cmp", [] |),
                    [ __self_discr; __arg1_discr ]
                  |)
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                      M.match_operator (|
                        M.alloc (| Value.Tuple [ M.read (| self |); M.read (| other |) ] |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                              let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                              let γ0_0 := M.read (| γ0_0 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_0,
                                  "core::net::socket_addr::SocketAddr::V4",
                                  0
                                |) in
                              let __self_0 := M.alloc (| γ2_0 |) in
                              let γ0_1 := M.read (| γ0_1 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_1,
                                  "core::net::socket_addr::SocketAddr::V4",
                                  0
                                |) in
                              let __arg1_0 := M.alloc (| γ2_0 |) in
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::Ord",
                                    Ty.path "core::net::socket_addr::SocketAddrV4",
                                    [],
                                    "cmp",
                                    []
                                  |),
                                  [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                                |)
                              |)));
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                              let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                              let γ0_0 := M.read (| γ0_0 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_0,
                                  "core::net::socket_addr::SocketAddr::V6",
                                  0
                                |) in
                              let __self_0 := M.alloc (| γ2_0 |) in
                              let γ0_1 := M.read (| γ0_1 |) in
                              let γ2_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ0_1,
                                  "core::net::socket_addr::SocketAddr::V6",
                                  0
                                |) in
                              let __arg1_0 := M.alloc (| γ2_0 |) in
                              M.alloc (|
                                M.call_closure (|
                                  M.get_trait_method (|
                                    "core::cmp::Ord",
                                    Ty.path "core::net::socket_addr::SocketAddrV6",
                                    [],
                                    "cmp",
                                    []
                                  |),
                                  [ M.read (| __self_0 |); M.read (| __arg1_0 |) ]
                                |)
                              |)));
                          fun γ =>
                            ltac:(M.monadic
                              (M.alloc (|
                                M.never_to_any (|
                                  M.call_closure (|
                                    M.get_function (| "core::intrinsics::unreachable", [] |),
                                    []
                                  |)
                                |)
                              |)))
                        ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let cmp := M.copy (| γ |) in
                      cmp))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Ord"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
    End Impl_core_cmp_Ord_for_core_net_socket_addr_SocketAddr.
    
    (* StructRecord
      {
        name := "SocketAddrV4";
        const_params := [];
        ty_params := [];
        fields := [ ("ip", Ty.path "core::net::ip_addr::Ipv4Addr"); ("port", Ty.path "u16") ];
      } *)
    
    Module Impl_core_marker_Copy_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::Copy"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_Copy_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_clone_Clone_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (* Clone *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        Value.DeclaredButUndefined,
                        [ fun γ => ltac:(M.monadic (M.read (| self |))) ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_cmp_Eq_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (* Eq *)
      Definition assert_receiver_is_total_eq
          (ε : list Value.t)
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        Value.DeclaredButUndefined,
                        [ fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |))) ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Eq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
    End Impl_core_cmp_Eq_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_marker_StructuralPartialEq_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_cmp_PartialEq_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (* PartialEq *)
      Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            LogicalOp.and (|
              M.call_closure (|
                M.get_trait_method (|
                  "core::cmp::PartialEq",
                  Ty.path "core::net::ip_addr::Ipv4Addr",
                  [ Ty.path "core::net::ip_addr::Ipv4Addr" ],
                  "eq",
                  []
                |),
                [
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::net::socket_addr::SocketAddrV4",
                    "ip"
                  |);
                  M.SubPointer.get_struct_record_field (|
                    M.read (| other |),
                    "core::net::socket_addr::SocketAddrV4",
                    "ip"
                  |)
                ]
              |),
              ltac:(M.monadic
                (BinOp.eq (|
                  M.read (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::net::socket_addr::SocketAddrV4",
                      "port"
                    |)
                  |),
                  M.read (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "core::net::socket_addr::SocketAddrV4",
                      "port"
                    |)
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_cmp_Ord_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (* Ord *)
      Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.read (|
              M.match_operator (|
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::Ord",
                      Ty.path "core::net::ip_addr::Ipv4Addr",
                      [],
                      "cmp",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV4",
                        "ip"
                      |);
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "core::net::socket_addr::SocketAddrV4",
                        "ip"
                      |)
                    ]
                  |)
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (| "core::cmp::Ord", Ty.path "u16", [], "cmp", [] |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::net::socket_addr::SocketAddrV4",
                              "port"
                            |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| other |),
                              "core::net::socket_addr::SocketAddrV4",
                              "port"
                            |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let cmp := M.copy (| γ |) in
                      cmp))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Ord"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
    End Impl_core_cmp_Ord_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_cmp_PartialOrd_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (* PartialOrd *)
      Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.read (|
              M.match_operator (|
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::PartialOrd",
                      Ty.path "core::net::ip_addr::Ipv4Addr",
                      [ Ty.path "core::net::ip_addr::Ipv4Addr" ],
                      "partial_cmp",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV4",
                        "ip"
                      |);
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "core::net::socket_addr::SocketAddrV4",
                        "ip"
                      |)
                    ]
                  |)
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::option::Option::Some",
                          0
                        |) in
                      let _ := M.is_struct_tuple (| γ0_0, "core::cmp::Ordering::Equal" |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::cmp::PartialOrd",
                            Ty.path "u16",
                            [ Ty.path "u16" ],
                            "partial_cmp",
                            []
                          |),
                          [
                            M.SubPointer.get_struct_record_field (|
                              M.read (| self |),
                              "core::net::socket_addr::SocketAddrV4",
                              "port"
                            |);
                            M.SubPointer.get_struct_record_field (|
                              M.read (| other |),
                              "core::net::socket_addr::SocketAddrV4",
                              "port"
                            |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let cmp := M.copy (| γ |) in
                      cmp))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialOrd"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
    End Impl_core_cmp_PartialOrd_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_hash_Hash_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (* Hash *)
      Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __H ], [ self; state ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let state := M.alloc (| state |) in
            M.read (|
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::hash::Hash",
                      Ty.path "core::net::ip_addr::Ipv4Addr",
                      [],
                      "hash",
                      [ __H ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV4",
                        "ip"
                      |);
                      M.read (| state |)
                    ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (| "core::hash::Hash", Ty.path "u16", [], "hash", [ __H ] |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::net::socket_addr::SocketAddrV4",
                      "port"
                    |);
                    M.read (| state |)
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::hash::Hash"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("hash", InstanceField.Method hash) ].
    End Impl_core_hash_Hash_for_core_net_socket_addr_SocketAddrV4.
    
    (* StructRecord
      {
        name := "SocketAddrV6";
        const_params := [];
        ty_params := [];
        fields :=
          [
            ("ip", Ty.path "core::net::ip_addr::Ipv6Addr");
            ("port", Ty.path "u16");
            ("flowinfo", Ty.path "u32");
            ("scope_id", Ty.path "u32")
          ];
      } *)
    
    Module Impl_core_marker_Copy_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::Copy"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_Copy_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_clone_Clone_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (* Clone *)
      Definition clone (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        Value.DeclaredButUndefined,
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (M.match_operator (|
                                Value.DeclaredButUndefined,
                                [ fun γ => ltac:(M.monadic (M.read (| self |))) ]
                              |)))
                        ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::clone::Clone"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("clone", InstanceField.Method clone) ].
    End Impl_core_clone_Clone_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_cmp_Eq_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (* Eq *)
      Definition assert_receiver_is_total_eq
          (ε : list Value.t)
          (τ : list Ty.t)
          (α : list Value.t)
          : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                Value.DeclaredButUndefined,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (M.match_operator (|
                        Value.DeclaredButUndefined,
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (M.match_operator (|
                                Value.DeclaredButUndefined,
                                [ fun γ => ltac:(M.monadic (M.alloc (| Value.Tuple [] |))) ]
                              |)))
                        ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Eq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *)
          [ ("assert_receiver_is_total_eq", InstanceField.Method assert_receiver_is_total_eq) ].
    End Impl_core_cmp_Eq_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_marker_StructuralPartialEq_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      Axiom Implements :
        M.IsTraitInstance
          "core::marker::StructuralPartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [].
    End Impl_core_marker_StructuralPartialEq_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_cmp_PartialEq_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (* PartialEq *)
      Definition eq (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            LogicalOp.and (|
              LogicalOp.and (|
                LogicalOp.and (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::PartialEq",
                      Ty.path "core::net::ip_addr::Ipv6Addr",
                      [ Ty.path "core::net::ip_addr::Ipv6Addr" ],
                      "eq",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV6",
                        "ip"
                      |);
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "core::net::socket_addr::SocketAddrV6",
                        "ip"
                      |)
                    ]
                  |),
                  ltac:(M.monadic
                    (BinOp.eq (|
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| self |),
                          "core::net::socket_addr::SocketAddrV6",
                          "port"
                        |)
                      |),
                      M.read (|
                        M.SubPointer.get_struct_record_field (|
                          M.read (| other |),
                          "core::net::socket_addr::SocketAddrV6",
                          "port"
                        |)
                      |)
                    |)))
                |),
                ltac:(M.monadic
                  (BinOp.eq (|
                    M.read (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV6",
                        "flowinfo"
                      |)
                    |),
                    M.read (|
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "core::net::socket_addr::SocketAddrV6",
                        "flowinfo"
                      |)
                    |)
                  |)))
              |),
              ltac:(M.monadic
                (BinOp.eq (|
                  M.read (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::net::socket_addr::SocketAddrV6",
                      "scope_id"
                    |)
                  |),
                  M.read (|
                    M.SubPointer.get_struct_record_field (|
                      M.read (| other |),
                      "core::net::socket_addr::SocketAddrV6",
                      "scope_id"
                    |)
                  |)
                |)))
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialEq"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("eq", InstanceField.Method eq) ].
    End Impl_core_cmp_PartialEq_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_cmp_Ord_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (* Ord *)
      Definition cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.read (|
              M.match_operator (|
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::Ord",
                      Ty.path "core::net::ip_addr::Ipv6Addr",
                      [],
                      "cmp",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV6",
                        "ip"
                      |);
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "core::net::socket_addr::SocketAddrV6",
                        "ip"
                      |)
                    ]
                  |)
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                      M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (| "core::cmp::Ord", Ty.path "u16", [], "cmp", [] |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "core::net::socket_addr::SocketAddrV6",
                                "port"
                              |);
                              M.SubPointer.get_struct_record_field (|
                                M.read (| other |),
                                "core::net::socket_addr::SocketAddrV6",
                                "port"
                              |)
                            ]
                          |)
                        |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let _ := M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                              M.match_operator (|
                                M.alloc (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::Ord",
                                      Ty.path "u32",
                                      [],
                                      "cmp",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::net::socket_addr::SocketAddrV6",
                                        "flowinfo"
                                      |);
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| other |),
                                        "core::net::socket_addr::SocketAddrV6",
                                        "flowinfo"
                                      |)
                                    ]
                                  |)
                                |),
                                [
                                  fun γ =>
                                    ltac:(M.monadic
                                      (let _ :=
                                        M.is_struct_tuple (| γ, "core::cmp::Ordering::Equal" |) in
                                      M.alloc (|
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::cmp::Ord",
                                            Ty.path "u32",
                                            [],
                                            "cmp",
                                            []
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::net::socket_addr::SocketAddrV6",
                                              "scope_id"
                                            |);
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| other |),
                                              "core::net::socket_addr::SocketAddrV6",
                                              "scope_id"
                                            |)
                                          ]
                                        |)
                                      |)));
                                  fun γ =>
                                    ltac:(M.monadic
                                      (let cmp := M.copy (| γ |) in
                                      cmp))
                                ]
                              |)));
                          fun γ =>
                            ltac:(M.monadic
                              (let cmp := M.copy (| γ |) in
                              cmp))
                        ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let cmp := M.copy (| γ |) in
                      cmp))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::Ord"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("cmp", InstanceField.Method cmp) ].
    End Impl_core_cmp_Ord_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_cmp_PartialOrd_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (* PartialOrd *)
      Definition partial_cmp (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; other ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let other := M.alloc (| other |) in
            M.read (|
              M.match_operator (|
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::cmp::PartialOrd",
                      Ty.path "core::net::ip_addr::Ipv6Addr",
                      [ Ty.path "core::net::ip_addr::Ipv6Addr" ],
                      "partial_cmp",
                      []
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV6",
                        "ip"
                      |);
                      M.SubPointer.get_struct_record_field (|
                        M.read (| other |),
                        "core::net::socket_addr::SocketAddrV6",
                        "ip"
                      |)
                    ]
                  |)
                |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::option::Option::Some",
                          0
                        |) in
                      let _ := M.is_struct_tuple (| γ0_0, "core::cmp::Ordering::Equal" |) in
                      M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_trait_method (|
                              "core::cmp::PartialOrd",
                              Ty.path "u16",
                              [ Ty.path "u16" ],
                              "partial_cmp",
                              []
                            |),
                            [
                              M.SubPointer.get_struct_record_field (|
                                M.read (| self |),
                                "core::net::socket_addr::SocketAddrV6",
                                "port"
                              |);
                              M.SubPointer.get_struct_record_field (|
                                M.read (| other |),
                                "core::net::socket_addr::SocketAddrV6",
                                "port"
                              |)
                            ]
                          |)
                        |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let γ0_0 :=
                                M.SubPointer.get_struct_tuple_field (|
                                  γ,
                                  "core::option::Option::Some",
                                  0
                                |) in
                              let _ := M.is_struct_tuple (| γ0_0, "core::cmp::Ordering::Equal" |) in
                              M.match_operator (|
                                M.alloc (|
                                  M.call_closure (|
                                    M.get_trait_method (|
                                      "core::cmp::PartialOrd",
                                      Ty.path "u32",
                                      [ Ty.path "u32" ],
                                      "partial_cmp",
                                      []
                                    |),
                                    [
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| self |),
                                        "core::net::socket_addr::SocketAddrV6",
                                        "flowinfo"
                                      |);
                                      M.SubPointer.get_struct_record_field (|
                                        M.read (| other |),
                                        "core::net::socket_addr::SocketAddrV6",
                                        "flowinfo"
                                      |)
                                    ]
                                  |)
                                |),
                                [
                                  fun γ =>
                                    ltac:(M.monadic
                                      (let γ0_0 :=
                                        M.SubPointer.get_struct_tuple_field (|
                                          γ,
                                          "core::option::Option::Some",
                                          0
                                        |) in
                                      let _ :=
                                        M.is_struct_tuple (|
                                          γ0_0,
                                          "core::cmp::Ordering::Equal"
                                        |) in
                                      M.alloc (|
                                        M.call_closure (|
                                          M.get_trait_method (|
                                            "core::cmp::PartialOrd",
                                            Ty.path "u32",
                                            [ Ty.path "u32" ],
                                            "partial_cmp",
                                            []
                                          |),
                                          [
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| self |),
                                              "core::net::socket_addr::SocketAddrV6",
                                              "scope_id"
                                            |);
                                            M.SubPointer.get_struct_record_field (|
                                              M.read (| other |),
                                              "core::net::socket_addr::SocketAddrV6",
                                              "scope_id"
                                            |)
                                          ]
                                        |)
                                      |)));
                                  fun γ =>
                                    ltac:(M.monadic
                                      (let cmp := M.copy (| γ |) in
                                      cmp))
                                ]
                              |)));
                          fun γ =>
                            ltac:(M.monadic
                              (let cmp := M.copy (| γ |) in
                              cmp))
                        ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let cmp := M.copy (| γ |) in
                      cmp))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::cmp::PartialOrd"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("partial_cmp", InstanceField.Method partial_cmp) ].
    End Impl_core_cmp_PartialOrd_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_hash_Hash_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (* Hash *)
      Definition hash (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [ __H ], [ self; state ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let state := M.alloc (| state |) in
            M.read (|
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (|
                      "core::hash::Hash",
                      Ty.path "core::net::ip_addr::Ipv6Addr",
                      [],
                      "hash",
                      [ __H ]
                    |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV6",
                        "ip"
                      |);
                      M.read (| state |)
                    ]
                  |)
                |) in
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (| "core::hash::Hash", Ty.path "u16", [], "hash", [ __H ] |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV6",
                        "port"
                      |);
                      M.read (| state |)
                    ]
                  |)
                |) in
              let~ _ :=
                M.alloc (|
                  M.call_closure (|
                    M.get_trait_method (| "core::hash::Hash", Ty.path "u32", [], "hash", [ __H ] |),
                    [
                      M.SubPointer.get_struct_record_field (|
                        M.read (| self |),
                        "core::net::socket_addr::SocketAddrV6",
                        "flowinfo"
                      |);
                      M.read (| state |)
                    ]
                  |)
                |) in
              M.alloc (|
                M.call_closure (|
                  M.get_trait_method (| "core::hash::Hash", Ty.path "u32", [], "hash", [ __H ] |),
                  [
                    M.SubPointer.get_struct_record_field (|
                      M.read (| self |),
                      "core::net::socket_addr::SocketAddrV6",
                      "scope_id"
                    |);
                    M.read (| state |)
                  ]
                |)
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::hash::Hash"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("hash", InstanceField.Method hash) ].
    End Impl_core_hash_Hash_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (*
          pub const fn new(ip: IpAddr, port: u16) -> SocketAddr {
              match ip {
                  IpAddr::V4(a) => SocketAddr::V4(SocketAddrV4::new(a, port)),
                  IpAddr::V6(a) => SocketAddr::V6(SocketAddrV6::new(a, port, 0, 0)),
              }
          }
      *)
      Definition new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ ip; port ] =>
          ltac:(M.monadic
            (let ip := M.alloc (| ip |) in
            let port := M.alloc (| port |) in
            M.read (|
              M.match_operator (|
                ip,
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::ip_addr::IpAddr::V4",
                          0
                        |) in
                      let a := M.copy (| γ0_0 |) in
                      M.alloc (|
                        Value.StructTuple
                          "core::net::socket_addr::SocketAddr::V4"
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "core::net::socket_addr::SocketAddrV4",
                                "new",
                                []
                              |),
                              [ M.read (| a |); M.read (| port |) ]
                            |)
                          ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::ip_addr::IpAddr::V6",
                          0
                        |) in
                      let a := M.copy (| γ0_0 |) in
                      M.alloc (|
                        Value.StructTuple
                          "core::net::socket_addr::SocketAddr::V6"
                          [
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "core::net::socket_addr::SocketAddrV6",
                                "new",
                                []
                              |),
                              [
                                M.read (| a |);
                                M.read (| port |);
                                Value.Integer IntegerKind.U32 0;
                                Value.Integer IntegerKind.U32 0
                              ]
                            |)
                          ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
      
      (*
          pub const fn ip(&self) -> IpAddr {
              match *self {
                  SocketAddr::V4(ref a) => IpAddr::V4( *a.ip()),
                  SocketAddr::V6(ref a) => IpAddr::V6( *a.ip()),
              }
          }
      *)
      Definition ip (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.read (| self |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      let a := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        Value.StructTuple
                          "core::net::ip_addr::IpAddr::V4"
                          [
                            M.read (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "core::net::socket_addr::SocketAddrV4",
                                  "ip",
                                  []
                                |),
                                [ M.read (| a |) ]
                              |)
                            |)
                          ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      let a := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        Value.StructTuple
                          "core::net::ip_addr::IpAddr::V6"
                          [
                            M.read (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.path "core::net::socket_addr::SocketAddrV6",
                                  "ip",
                                  []
                                |),
                                [ M.read (| a |) ]
                              |)
                            |)
                          ]
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_ip : M.IsAssociatedFunction Self "ip" ip.
      
      (*
          pub fn set_ip(&mut self, new_ip: IpAddr) {
              // `match ( *self, new_ip)` would have us mutate a copy of self only to throw it away.
              match (self, new_ip) {
                  (&mut SocketAddr::V4(ref mut a), IpAddr::V4(new_ip)) => a.set_ip(new_ip),
                  (&mut SocketAddr::V6(ref mut a), IpAddr::V6(new_ip)) => a.set_ip(new_ip),
                  (self_, new_ip) => *self_ = Self::new(new_ip, self_.port()),
              }
          }
      *)
      Definition set_ip (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; new_ip ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let new_ip := M.alloc (| new_ip |) in
            M.read (|
              M.match_operator (|
                M.alloc (| Value.Tuple [ M.read (| self |); M.read (| new_ip |) ] |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                      let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                      let γ0_0 := M.read (| γ0_0 |) in
                      let γ2_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ0_0,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      let a := M.alloc (| γ2_0 |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ0_1,
                          "core::net::ip_addr::IpAddr::V4",
                          0
                        |) in
                      let new_ip := M.copy (| γ1_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::net::socket_addr::SocketAddrV4",
                            "set_ip",
                            []
                          |),
                          [ M.read (| a |); M.read (| new_ip |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                      let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                      let γ0_0 := M.read (| γ0_0 |) in
                      let γ2_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ0_0,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      let a := M.alloc (| γ2_0 |) in
                      let γ1_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ0_1,
                          "core::net::ip_addr::IpAddr::V6",
                          0
                        |) in
                      let new_ip := M.copy (| γ1_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::net::socket_addr::SocketAddrV6",
                            "set_ip",
                            []
                          |),
                          [ M.read (| a |); M.read (| new_ip |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 := M.SubPointer.get_tuple_field (| γ, 0 |) in
                      let γ0_1 := M.SubPointer.get_tuple_field (| γ, 1 |) in
                      let self_ := M.copy (| γ0_0 |) in
                      let new_ip := M.copy (| γ0_1 |) in
                      M.write (|
                        M.read (| self_ |),
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::net::socket_addr::SocketAddr",
                            "new",
                            []
                          |),
                          [
                            M.read (| new_ip |);
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "core::net::socket_addr::SocketAddr",
                                "port",
                                []
                              |),
                              [ M.read (| self_ |) ]
                            |)
                          ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_set_ip : M.IsAssociatedFunction Self "set_ip" set_ip.
      
      (*
          pub const fn port(&self) -> u16 {
              match *self {
                  SocketAddr::V4(ref a) => a.port(),
                  SocketAddr::V6(ref a) => a.port(),
              }
          }
      *)
      Definition port (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.read (| self |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      let a := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::net::socket_addr::SocketAddrV4",
                            "port",
                            []
                          |),
                          [ M.read (| a |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      let a := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::net::socket_addr::SocketAddrV6",
                            "port",
                            []
                          |),
                          [ M.read (| a |) ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_port : M.IsAssociatedFunction Self "port" port.
      
      (*
          pub fn set_port(&mut self, new_port: u16) {
              match *self {
                  SocketAddr::V4(ref mut a) => a.set_port(new_port),
                  SocketAddr::V6(ref mut a) => a.set_port(new_port),
              }
          }
      *)
      Definition set_port (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; new_port ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let new_port := M.alloc (| new_port |) in
            M.read (|
              M.match_operator (|
                M.read (| self |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      let a := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::net::socket_addr::SocketAddrV4",
                            "set_port",
                            []
                          |),
                          [ M.read (| a |); M.read (| new_port |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      let a := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (|
                            Ty.path "core::net::socket_addr::SocketAddrV6",
                            "set_port",
                            []
                          |),
                          [ M.read (| a |); M.read (| new_port |) ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_set_port : M.IsAssociatedFunction Self "set_port" set_port.
      
      (*
          pub const fn is_ipv4(&self) -> bool {
              matches!( *self, SocketAddr::V4(_))
          }
      *)
      Definition is_ipv4 (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.read (| self |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      M.alloc (| Value.Bool true |)));
                  fun γ => ltac:(M.monadic (M.alloc (| Value.Bool false |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_is_ipv4 : M.IsAssociatedFunction Self "is_ipv4" is_ipv4.
      
      (*
          pub const fn is_ipv6(&self) -> bool {
              matches!( *self, SocketAddr::V6(_))
          }
      *)
      Definition is_ipv6 (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.match_operator (|
                M.read (| self |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      M.alloc (| Value.Bool true |)));
                  fun γ => ltac:(M.monadic (M.alloc (| Value.Bool false |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_is_ipv6 : M.IsAssociatedFunction Self "is_ipv6" is_ipv6.
    End Impl_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (*
          pub const fn new(ip: Ipv4Addr, port: u16) -> SocketAddrV4 {
              SocketAddrV4 { ip, port }
          }
      *)
      Definition new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ ip; port ] =>
          ltac:(M.monadic
            (let ip := M.alloc (| ip |) in
            let port := M.alloc (| port |) in
            Value.StructRecord
              "core::net::socket_addr::SocketAddrV4"
              [ ("ip", M.read (| ip |)); ("port", M.read (| port |)) ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
      
      (*
          pub const fn ip(&self) -> &Ipv4Addr {
              &self.ip
          }
      *)
      Definition ip (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.SubPointer.get_struct_record_field (|
              M.read (| self |),
              "core::net::socket_addr::SocketAddrV4",
              "ip"
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_ip : M.IsAssociatedFunction Self "ip" ip.
      
      (*
          pub fn set_ip(&mut self, new_ip: Ipv4Addr) {
              self.ip = new_ip;
          }
      *)
      Definition set_ip (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; new_ip ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let new_ip := M.alloc (| new_ip |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::net::socket_addr::SocketAddrV4",
                    "ip"
                  |),
                  M.read (| new_ip |)
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_set_ip : M.IsAssociatedFunction Self "set_ip" set_ip.
      
      (*
          pub const fn port(&self) -> u16 {
              self.port
          }
      *)
      Definition port (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::net::socket_addr::SocketAddrV4",
                "port"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_port : M.IsAssociatedFunction Self "port" port.
      
      (*
          pub fn set_port(&mut self, new_port: u16) {
              self.port = new_port;
          }
      *)
      Definition set_port (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; new_port ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let new_port := M.alloc (| new_port |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::net::socket_addr::SocketAddrV4",
                    "port"
                  |),
                  M.read (| new_port |)
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_set_port : M.IsAssociatedFunction Self "set_port" set_port.
    End Impl_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (*
          pub const fn new(ip: Ipv6Addr, port: u16, flowinfo: u32, scope_id: u32) -> SocketAddrV6 {
              SocketAddrV6 { ip, port, flowinfo, scope_id }
          }
      *)
      Definition new (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ ip; port; flowinfo; scope_id ] =>
          ltac:(M.monadic
            (let ip := M.alloc (| ip |) in
            let port := M.alloc (| port |) in
            let flowinfo := M.alloc (| flowinfo |) in
            let scope_id := M.alloc (| scope_id |) in
            Value.StructRecord
              "core::net::socket_addr::SocketAddrV6"
              [
                ("ip", M.read (| ip |));
                ("port", M.read (| port |));
                ("flowinfo", M.read (| flowinfo |));
                ("scope_id", M.read (| scope_id |))
              ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_new : M.IsAssociatedFunction Self "new" new.
      
      (*
          pub const fn ip(&self) -> &Ipv6Addr {
              &self.ip
          }
      *)
      Definition ip (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.SubPointer.get_struct_record_field (|
              M.read (| self |),
              "core::net::socket_addr::SocketAddrV6",
              "ip"
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_ip : M.IsAssociatedFunction Self "ip" ip.
      
      (*
          pub fn set_ip(&mut self, new_ip: Ipv6Addr) {
              self.ip = new_ip;
          }
      *)
      Definition set_ip (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; new_ip ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let new_ip := M.alloc (| new_ip |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::net::socket_addr::SocketAddrV6",
                    "ip"
                  |),
                  M.read (| new_ip |)
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_set_ip : M.IsAssociatedFunction Self "set_ip" set_ip.
      
      (*
          pub const fn port(&self) -> u16 {
              self.port
          }
      *)
      Definition port (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::net::socket_addr::SocketAddrV6",
                "port"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_port : M.IsAssociatedFunction Self "port" port.
      
      (*
          pub fn set_port(&mut self, new_port: u16) {
              self.port = new_port;
          }
      *)
      Definition set_port (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; new_port ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let new_port := M.alloc (| new_port |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::net::socket_addr::SocketAddrV6",
                    "port"
                  |),
                  M.read (| new_port |)
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_set_port : M.IsAssociatedFunction Self "set_port" set_port.
      
      (*
          pub const fn flowinfo(&self) -> u32 {
              self.flowinfo
          }
      *)
      Definition flowinfo (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::net::socket_addr::SocketAddrV6",
                "flowinfo"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_flowinfo : M.IsAssociatedFunction Self "flowinfo" flowinfo.
      
      (*
          pub fn set_flowinfo(&mut self, new_flowinfo: u32) {
              self.flowinfo = new_flowinfo;
          }
      *)
      Definition set_flowinfo (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; new_flowinfo ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let new_flowinfo := M.alloc (| new_flowinfo |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::net::socket_addr::SocketAddrV6",
                    "flowinfo"
                  |),
                  M.read (| new_flowinfo |)
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_set_flowinfo :
        M.IsAssociatedFunction Self "set_flowinfo" set_flowinfo.
      
      (*
          pub const fn scope_id(&self) -> u32 {
              self.scope_id
          }
      *)
      Definition scope_id (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            M.read (|
              M.SubPointer.get_struct_record_field (|
                M.read (| self |),
                "core::net::socket_addr::SocketAddrV6",
                "scope_id"
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_scope_id : M.IsAssociatedFunction Self "scope_id" scope_id.
      
      (*
          pub fn set_scope_id(&mut self, new_scope_id: u32) {
              self.scope_id = new_scope_id;
          }
      *)
      Definition set_scope_id (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; new_scope_id ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let new_scope_id := M.alloc (| new_scope_id |) in
            M.read (|
              let~ _ :=
                M.write (|
                  M.SubPointer.get_struct_record_field (|
                    M.read (| self |),
                    "core::net::socket_addr::SocketAddrV6",
                    "scope_id"
                  |),
                  M.read (| new_scope_id |)
                |) in
              M.alloc (| Value.Tuple [] |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom AssociatedFunction_set_scope_id :
        M.IsAssociatedFunction Self "set_scope_id" set_scope_id.
    End Impl_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_convert_From_core_net_socket_addr_SocketAddrV4_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (*
          fn from(sock4: SocketAddrV4) -> SocketAddr {
              SocketAddr::V4(sock4)
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ sock4 ] =>
          ltac:(M.monadic
            (let sock4 := M.alloc (| sock4 |) in
            Value.StructTuple "core::net::socket_addr::SocketAddr::V4" [ M.read (| sock4 |) ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *) [ (* T *) Ty.path "core::net::socket_addr::SocketAddrV4" ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_core_net_socket_addr_SocketAddrV4_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_convert_From_core_net_socket_addr_SocketAddrV6_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (*
          fn from(sock6: SocketAddrV6) -> SocketAddr {
              SocketAddr::V6(sock6)
          }
      *)
      Definition from (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ sock6 ] =>
          ltac:(M.monadic
            (let sock6 := M.alloc (| sock6 |) in
            Value.StructTuple "core::net::socket_addr::SocketAddr::V6" [ M.read (| sock6 |) ]))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::convert::From"
          Self
          (* Trait polymorphic types *) [ (* T *) Ty.path "core::net::socket_addr::SocketAddrV6" ]
          (* Instance *) [ ("from", InstanceField.Method from) ].
    End Impl_core_convert_From_core_net_socket_addr_SocketAddrV6_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_convert_From_where_core_convert_Into_I_core_net_ip_addr_IpAddr_Tuple_I_u16__for_core_net_socket_addr_SocketAddr.
      Definition Self (I : Ty.t) : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (*
          fn from(pieces: (I, u16)) -> SocketAddr {
              SocketAddr::new(pieces.0.into(), pieces.1)
          }
      *)
      Definition from (I : Ty.t) (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        let Self : Ty.t := Self I in
        match ε, τ, α with
        | [], [], [ pieces ] =>
          ltac:(M.monadic
            (let pieces := M.alloc (| pieces |) in
            M.call_closure (|
              M.get_associated_function (|
                Ty.path "core::net::socket_addr::SocketAddr",
                "new",
                []
              |),
              [
                M.call_closure (|
                  M.get_trait_method (|
                    "core::convert::Into",
                    I,
                    [ Ty.path "core::net::ip_addr::IpAddr" ],
                    "into",
                    []
                  |),
                  [ M.read (| M.SubPointer.get_tuple_field (| pieces, 0 |) |) ]
                |);
                M.read (| M.SubPointer.get_tuple_field (| pieces, 1 |) |)
              ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        forall (I : Ty.t),
        M.IsTraitInstance
          "core::convert::From"
          (Self I)
          (* Trait polymorphic types *) [ (* T *) Ty.tuple [ I; Ty.path "u16" ] ]
          (* Instance *) [ ("from", InstanceField.Method (from I)) ].
    End Impl_core_convert_From_where_core_convert_Into_I_core_net_ip_addr_IpAddr_Tuple_I_u16__for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_fmt_Display_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              match *self {
                  SocketAddr::V4(ref a) => a.fmt(f),
                  SocketAddr::V6(ref a) => a.fmt(f),
              }
          }
      *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.read (|
              M.match_operator (|
                M.read (| self |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V4",
                          0
                        |) in
                      let a := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::fmt::Display",
                            Ty.path "core::net::socket_addr::SocketAddrV4",
                            [],
                            "fmt",
                            []
                          |),
                          [ M.read (| a |); M.read (| f |) ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let γ0_0 :=
                        M.SubPointer.get_struct_tuple_field (|
                          γ,
                          "core::net::socket_addr::SocketAddr::V6",
                          0
                        |) in
                      let a := M.alloc (| γ0_0 |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_trait_method (|
                            "core::fmt::Display",
                            Ty.path "core::net::socket_addr::SocketAddrV6",
                            [],
                            "fmt",
                            []
                          |),
                          [ M.read (| a |); M.read (| f |) ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Display"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Display_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_fmt_Debug_for_core_net_socket_addr_SocketAddr.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddr".
      
      (*
          fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
              fmt::Display::fmt(self, fmt)
          }
      *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let fmt := M.alloc (| fmt |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::fmt::Display",
                Ty.path "core::net::socket_addr::SocketAddr",
                [],
                "fmt",
                []
              |),
              [ M.read (| self |); M.read (| fmt |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_core_net_socket_addr_SocketAddr.
    
    Module Impl_core_fmt_Display_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              // If there are no alignment requirements, write the socket address directly to `f`.
              // Otherwise, write it to a local buffer and then use `f.pad`.
              if f.precision().is_none() && f.width().is_none() {
                  write!(f, "{}:{}", self.ip(), self.port())
              } else {
                  const LONGEST_IPV4_SOCKET_ADDR: &str = "255.255.255.255:65535";
      
                  let mut buf = DisplayBuffer::<{ LONGEST_IPV4_SOCKET_ADDR.len() }>::new();
                  // Buffer is long enough for the longest possible IPv4 socket address, so this should never fail.
                  write!(buf, "{}:{}", self.ip(), self.port()).unwrap();
      
                  f.pad(buf.as_str())
              }
          }
      *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.read (|
              M.match_operator (|
                M.alloc (| Value.Tuple [] |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ :=
                        M.use
                          (M.alloc (|
                            LogicalOp.and (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply (Ty.path "core::option::Option") [] [ Ty.path "usize" ],
                                  "is_none",
                                  []
                                |),
                                [
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::Formatter",
                                        "precision",
                                        []
                                      |),
                                      [ M.read (| f |) ]
                                    |)
                                  |)
                                ]
                              |),
                              ltac:(M.monadic
                                (M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::option::Option")
                                      []
                                      [ Ty.path "usize" ],
                                    "is_none",
                                    []
                                  |),
                                  [
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "core::fmt::Formatter",
                                          "width",
                                          []
                                        |),
                                        [ M.read (| f |) ]
                                      |)
                                    |)
                                  ]
                                |)))
                            |)
                          |)) 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_fmt",
                            []
                          |),
                          [
                            M.read (| f |);
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.path "core::fmt::Arguments",
                                "new_v1",
                                []
                              |),
                              [
                                M.alloc (|
                                  Value.Array
                                    [ M.read (| Value.String "" |); M.read (| Value.String ":" |) ]
                                |);
                                M.alloc (|
                                  Value.Array
                                    [
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "core::fmt::rt::Argument",
                                          "new_display",
                                          [
                                            Ty.apply
                                              (Ty.path "&")
                                              []
                                              [ Ty.path "core::net::ip_addr::Ipv4Addr" ]
                                          ]
                                        |),
                                        [
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "core::net::socket_addr::SocketAddrV4",
                                                "ip",
                                                []
                                              |),
                                              [ M.read (| self |) ]
                                            |)
                                          |)
                                        ]
                                      |);
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "core::fmt::rt::Argument",
                                          "new_display",
                                          [ Ty.path "u16" ]
                                        |),
                                        [
                                          M.alloc (|
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "core::net::socket_addr::SocketAddrV4",
                                                "port",
                                                []
                                              |),
                                              [ M.read (| self |) ]
                                            |)
                                          |)
                                        ]
                                      |)
                                    ]
                                |)
                              ]
                            |)
                          ]
                        |)
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let~ buf :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "core::net::display_buffer::DisplayBuffer")
                                [ Value.Integer IntegerKind.Usize 21 ]
                                [],
                              "new",
                              []
                            |),
                            []
                          |)
                        |) in
                      let~ _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "core::result::Result")
                                []
                                [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                              "unwrap",
                              []
                            |),
                            [
                              M.call_closure (|
                                M.get_trait_method (|
                                  "core::fmt::Write",
                                  Ty.apply
                                    (Ty.path "core::net::display_buffer::DisplayBuffer")
                                    [ Value.Integer IntegerKind.Usize 21 ]
                                    [],
                                  [],
                                  "write_fmt",
                                  []
                                |),
                                [
                                  buf;
                                  M.call_closure (|
                                    M.get_associated_function (|
                                      Ty.path "core::fmt::Arguments",
                                      "new_v1",
                                      []
                                    |),
                                    [
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.read (| Value.String "" |);
                                            M.read (| Value.String ":" |)
                                          ]
                                      |);
                                      M.alloc (|
                                        Value.Array
                                          [
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "core::fmt::rt::Argument",
                                                "new_display",
                                                [
                                                  Ty.apply
                                                    (Ty.path "&")
                                                    []
                                                    [ Ty.path "core::net::ip_addr::Ipv4Addr" ]
                                                ]
                                              |),
                                              [
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "core::net::socket_addr::SocketAddrV4",
                                                      "ip",
                                                      []
                                                    |),
                                                    [ M.read (| self |) ]
                                                  |)
                                                |)
                                              ]
                                            |);
                                            M.call_closure (|
                                              M.get_associated_function (|
                                                Ty.path "core::fmt::rt::Argument",
                                                "new_display",
                                                [ Ty.path "u16" ]
                                              |),
                                              [
                                                M.alloc (|
                                                  M.call_closure (|
                                                    M.get_associated_function (|
                                                      Ty.path
                                                        "core::net::socket_addr::SocketAddrV4",
                                                      "port",
                                                      []
                                                    |),
                                                    [ M.read (| self |) ]
                                                  |)
                                                |)
                                              ]
                                            |)
                                          ]
                                      |)
                                    ]
                                  |)
                                ]
                              |)
                            ]
                          |)
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (| Ty.path "core::fmt::Formatter", "pad", [] |),
                          [
                            M.read (| f |);
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "core::net::display_buffer::DisplayBuffer")
                                  [ Value.Integer IntegerKind.Usize 21 ]
                                  [],
                                "as_str",
                                []
                              |),
                              [ buf ]
                            |)
                          ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Display"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Display_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_fmt_Debug_for_core_net_socket_addr_SocketAddrV4.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV4".
      
      (*
          fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
              fmt::Display::fmt(self, fmt)
          }
      *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let fmt := M.alloc (| fmt |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::fmt::Display",
                Ty.path "core::net::socket_addr::SocketAddrV4",
                [],
                "fmt",
                []
              |),
              [ M.read (| self |); M.read (| fmt |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_core_net_socket_addr_SocketAddrV4.
    
    Module Impl_core_fmt_Display_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (*
          fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
              // If there are no alignment requirements, write the socket address directly to `f`.
              // Otherwise, write it to a local buffer and then use `f.pad`.
              if f.precision().is_none() && f.width().is_none() {
                  match self.scope_id() {
                      0 => write!(f, "[{}]:{}", self.ip(), self.port()),
                      scope_id => write!(f, "[{}%{}]:{}", self.ip(), scope_id, self.port()),
                  }
              } else {
                  const LONGEST_IPV6_SOCKET_ADDR: &str =
                      "[ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff%4294967295]:65535";
      
                  let mut buf = DisplayBuffer::<{ LONGEST_IPV6_SOCKET_ADDR.len() }>::new();
                  match self.scope_id() {
                      0 => write!(buf, "[{}]:{}", self.ip(), self.port()),
                      scope_id => write!(buf, "[{}%{}]:{}", self.ip(), scope_id, self.port()),
                  }
                  // Buffer is long enough for the longest possible IPv6 socket address, so this should never fail.
                  .unwrap();
      
                  f.pad(buf.as_str())
              }
          }
      *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; f ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let f := M.alloc (| f |) in
            M.read (|
              M.match_operator (|
                M.alloc (| Value.Tuple [] |),
                [
                  fun γ =>
                    ltac:(M.monadic
                      (let γ :=
                        M.use
                          (M.alloc (|
                            LogicalOp.and (|
                              M.call_closure (|
                                M.get_associated_function (|
                                  Ty.apply (Ty.path "core::option::Option") [] [ Ty.path "usize" ],
                                  "is_none",
                                  []
                                |),
                                [
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::Formatter",
                                        "precision",
                                        []
                                      |),
                                      [ M.read (| f |) ]
                                    |)
                                  |)
                                ]
                              |),
                              ltac:(M.monadic
                                (M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.apply
                                      (Ty.path "core::option::Option")
                                      []
                                      [ Ty.path "usize" ],
                                    "is_none",
                                    []
                                  |),
                                  [
                                    M.alloc (|
                                      M.call_closure (|
                                        M.get_associated_function (|
                                          Ty.path "core::fmt::Formatter",
                                          "width",
                                          []
                                        |),
                                        [ M.read (| f |) ]
                                      |)
                                    |)
                                  ]
                                |)))
                            |)
                          |)) in
                      let _ := M.is_constant_or_break_match (| M.read (| γ |), Value.Bool true |) in
                      M.match_operator (|
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.path "core::net::socket_addr::SocketAddrV6",
                              "scope_id",
                              []
                            |),
                            [ M.read (| self |) ]
                          |)
                        |),
                        [
                          fun γ =>
                            ltac:(M.monadic
                              (let _ :=
                                M.is_constant_or_break_match (|
                                  M.read (| γ |),
                                  Value.Integer IntegerKind.U32 0
                                |) in
                              M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "core::fmt::Formatter",
                                    "write_fmt",
                                    []
                                  |),
                                  [
                                    M.read (| f |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::Arguments",
                                        "new_v1",
                                        []
                                      |),
                                      [
                                        M.alloc (|
                                          Value.Array
                                            [
                                              M.read (| Value.String "[" |);
                                              M.read (| Value.String "]:" |)
                                            ]
                                        |);
                                        M.alloc (|
                                          Value.Array
                                            [
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "core::fmt::rt::Argument",
                                                  "new_display",
                                                  [
                                                    Ty.apply
                                                      (Ty.path "&")
                                                      []
                                                      [ Ty.path "core::net::ip_addr::Ipv6Addr" ]
                                                  ]
                                                |),
                                                [
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path
                                                          "core::net::socket_addr::SocketAddrV6",
                                                        "ip",
                                                        []
                                                      |),
                                                      [ M.read (| self |) ]
                                                    |)
                                                  |)
                                                ]
                                              |);
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "core::fmt::rt::Argument",
                                                  "new_display",
                                                  [ Ty.path "u16" ]
                                                |),
                                                [
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path
                                                          "core::net::socket_addr::SocketAddrV6",
                                                        "port",
                                                        []
                                                      |),
                                                      [ M.read (| self |) ]
                                                    |)
                                                  |)
                                                ]
                                              |)
                                            ]
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              |)));
                          fun γ =>
                            ltac:(M.monadic
                              (let scope_id := M.copy (| γ |) in
                              M.alloc (|
                                M.call_closure (|
                                  M.get_associated_function (|
                                    Ty.path "core::fmt::Formatter",
                                    "write_fmt",
                                    []
                                  |),
                                  [
                                    M.read (| f |);
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::fmt::Arguments",
                                        "new_v1",
                                        []
                                      |),
                                      [
                                        M.alloc (|
                                          Value.Array
                                            [
                                              M.read (| Value.String "[" |);
                                              M.read (| Value.String "%" |);
                                              M.read (| Value.String "]:" |)
                                            ]
                                        |);
                                        M.alloc (|
                                          Value.Array
                                            [
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "core::fmt::rt::Argument",
                                                  "new_display",
                                                  [
                                                    Ty.apply
                                                      (Ty.path "&")
                                                      []
                                                      [ Ty.path "core::net::ip_addr::Ipv6Addr" ]
                                                  ]
                                                |),
                                                [
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path
                                                          "core::net::socket_addr::SocketAddrV6",
                                                        "ip",
                                                        []
                                                      |),
                                                      [ M.read (| self |) ]
                                                    |)
                                                  |)
                                                ]
                                              |);
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "core::fmt::rt::Argument",
                                                  "new_display",
                                                  [ Ty.path "u32" ]
                                                |),
                                                [ scope_id ]
                                              |);
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "core::fmt::rt::Argument",
                                                  "new_display",
                                                  [ Ty.path "u16" ]
                                                |),
                                                [
                                                  M.alloc (|
                                                    M.call_closure (|
                                                      M.get_associated_function (|
                                                        Ty.path
                                                          "core::net::socket_addr::SocketAddrV6",
                                                        "port",
                                                        []
                                                      |),
                                                      [ M.read (| self |) ]
                                                    |)
                                                  |)
                                                ]
                                              |)
                                            ]
                                        |)
                                      ]
                                    |)
                                  ]
                                |)
                              |)))
                        ]
                      |)));
                  fun γ =>
                    ltac:(M.monadic
                      (let~ buf :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "core::net::display_buffer::DisplayBuffer")
                                [ Value.Integer IntegerKind.Usize 58 ]
                                [],
                              "new",
                              []
                            |),
                            []
                          |)
                        |) in
                      let~ _ :=
                        M.alloc (|
                          M.call_closure (|
                            M.get_associated_function (|
                              Ty.apply
                                (Ty.path "core::result::Result")
                                []
                                [ Ty.tuple []; Ty.path "core::fmt::Error" ],
                              "unwrap",
                              []
                            |),
                            [
                              M.read (|
                                M.match_operator (|
                                  M.alloc (|
                                    M.call_closure (|
                                      M.get_associated_function (|
                                        Ty.path "core::net::socket_addr::SocketAddrV6",
                                        "scope_id",
                                        []
                                      |),
                                      [ M.read (| self |) ]
                                    |)
                                  |),
                                  [
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let _ :=
                                          M.is_constant_or_break_match (|
                                            M.read (| γ |),
                                            Value.Integer IntegerKind.U32 0
                                          |) in
                                        M.alloc (|
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::fmt::Write",
                                              Ty.apply
                                                (Ty.path "core::net::display_buffer::DisplayBuffer")
                                                [ Value.Integer IntegerKind.Usize 58 ]
                                                [],
                                              [],
                                              "write_fmt",
                                              []
                                            |),
                                            [
                                              buf;
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "core::fmt::Arguments",
                                                  "new_v1",
                                                  []
                                                |),
                                                [
                                                  M.alloc (|
                                                    Value.Array
                                                      [
                                                        M.read (| Value.String "[" |);
                                                        M.read (| Value.String "]:" |)
                                                      ]
                                                  |);
                                                  M.alloc (|
                                                    Value.Array
                                                      [
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path "core::fmt::rt::Argument",
                                                            "new_display",
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                []
                                                                [
                                                                  Ty.path
                                                                    "core::net::ip_addr::Ipv6Addr"
                                                                ]
                                                            ]
                                                          |),
                                                          [
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "core::net::socket_addr::SocketAddrV6",
                                                                  "ip",
                                                                  []
                                                                |),
                                                                [ M.read (| self |) ]
                                                              |)
                                                            |)
                                                          ]
                                                        |);
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path "core::fmt::rt::Argument",
                                                            "new_display",
                                                            [ Ty.path "u16" ]
                                                          |),
                                                          [
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "core::net::socket_addr::SocketAddrV6",
                                                                  "port",
                                                                  []
                                                                |),
                                                                [ M.read (| self |) ]
                                                              |)
                                                            |)
                                                          ]
                                                        |)
                                                      ]
                                                  |)
                                                ]
                                              |)
                                            ]
                                          |)
                                        |)));
                                    fun γ =>
                                      ltac:(M.monadic
                                        (let scope_id := M.copy (| γ |) in
                                        M.alloc (|
                                          M.call_closure (|
                                            M.get_trait_method (|
                                              "core::fmt::Write",
                                              Ty.apply
                                                (Ty.path "core::net::display_buffer::DisplayBuffer")
                                                [ Value.Integer IntegerKind.Usize 58 ]
                                                [],
                                              [],
                                              "write_fmt",
                                              []
                                            |),
                                            [
                                              buf;
                                              M.call_closure (|
                                                M.get_associated_function (|
                                                  Ty.path "core::fmt::Arguments",
                                                  "new_v1",
                                                  []
                                                |),
                                                [
                                                  M.alloc (|
                                                    Value.Array
                                                      [
                                                        M.read (| Value.String "[" |);
                                                        M.read (| Value.String "%" |);
                                                        M.read (| Value.String "]:" |)
                                                      ]
                                                  |);
                                                  M.alloc (|
                                                    Value.Array
                                                      [
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path "core::fmt::rt::Argument",
                                                            "new_display",
                                                            [
                                                              Ty.apply
                                                                (Ty.path "&")
                                                                []
                                                                [
                                                                  Ty.path
                                                                    "core::net::ip_addr::Ipv6Addr"
                                                                ]
                                                            ]
                                                          |),
                                                          [
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "core::net::socket_addr::SocketAddrV6",
                                                                  "ip",
                                                                  []
                                                                |),
                                                                [ M.read (| self |) ]
                                                              |)
                                                            |)
                                                          ]
                                                        |);
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path "core::fmt::rt::Argument",
                                                            "new_display",
                                                            [ Ty.path "u32" ]
                                                          |),
                                                          [ scope_id ]
                                                        |);
                                                        M.call_closure (|
                                                          M.get_associated_function (|
                                                            Ty.path "core::fmt::rt::Argument",
                                                            "new_display",
                                                            [ Ty.path "u16" ]
                                                          |),
                                                          [
                                                            M.alloc (|
                                                              M.call_closure (|
                                                                M.get_associated_function (|
                                                                  Ty.path
                                                                    "core::net::socket_addr::SocketAddrV6",
                                                                  "port",
                                                                  []
                                                                |),
                                                                [ M.read (| self |) ]
                                                              |)
                                                            |)
                                                          ]
                                                        |)
                                                      ]
                                                  |)
                                                ]
                                              |)
                                            ]
                                          |)
                                        |)))
                                  ]
                                |)
                              |)
                            ]
                          |)
                        |) in
                      M.alloc (|
                        M.call_closure (|
                          M.get_associated_function (| Ty.path "core::fmt::Formatter", "pad", [] |),
                          [
                            M.read (| f |);
                            M.call_closure (|
                              M.get_associated_function (|
                                Ty.apply
                                  (Ty.path "core::net::display_buffer::DisplayBuffer")
                                  [ Value.Integer IntegerKind.Usize 58 ]
                                  [],
                                "as_str",
                                []
                              |),
                              [ buf ]
                            |)
                          ]
                        |)
                      |)))
                ]
              |)
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Display"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Display_for_core_net_socket_addr_SocketAddrV6.
    
    Module Impl_core_fmt_Debug_for_core_net_socket_addr_SocketAddrV6.
      Definition Self : Ty.t := Ty.path "core::net::socket_addr::SocketAddrV6".
      
      (*
          fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
              fmt::Display::fmt(self, fmt)
          }
      *)
      Definition fmt (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
        match ε, τ, α with
        | [], [], [ self; fmt ] =>
          ltac:(M.monadic
            (let self := M.alloc (| self |) in
            let fmt := M.alloc (| fmt |) in
            M.call_closure (|
              M.get_trait_method (|
                "core::fmt::Display",
                Ty.path "core::net::socket_addr::SocketAddrV6",
                [],
                "fmt",
                []
              |),
              [ M.read (| self |); M.read (| fmt |) ]
            |)))
        | _, _, _ => M.impossible "wrong number of arguments"
        end.
      
      Axiom Implements :
        M.IsTraitInstance
          "core::fmt::Debug"
          Self
          (* Trait polymorphic types *) []
          (* Instance *) [ ("fmt", InstanceField.Method fmt) ].
    End Impl_core_fmt_Debug_for_core_net_socket_addr_SocketAddrV6.
  End socket_addr.
End net.
