; LLVM IR from yinqiwen/ardb :: src/common/util (network_helper)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.ardb::SocketInetAddress" = type <{ %"class.ardb::Address", %"union.ardb::SocketInetAddress::MyAddrUnion", [2 x i8] }>
%"class.ardb::Address" = type { ptr }
%"union.ardb::SocketInetAddress::MyAddrUnion" = type { %struct.sockaddr, [94 x i8] }
%struct.sockaddr = type { i16, [14 x i8] }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ardb16get_inet_addressERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEt(ptr dead_on_unwind noalias writable sret(%"class.ardb::SocketInetAddress") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i16 noundef zeroext %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i16, align 2
  %7 = alloca %struct.addrinfo, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [10 x i8], align 1
  %10 = alloca i32, align 4
  %11 = alloca i1, align 1
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.ardb::SocketInetAddress", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"class.ardb::SocketInetAddress", align 8
  %20 = alloca ptr, align 8
  %21 = alloca %"class.ardb::SocketInetAddress", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i16 %2, ptr %6, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 48, i1 false)
  %22 = getelementptr inbounds %struct.addrinfo, ptr %7, i32 0, i32 0
  store i32 0, ptr %22, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.addrinfo, ptr %7, i32 0, i32 1
  store i32 0, ptr %23, align 4, !tbaa !14
  %24 = getelementptr inbounds %struct.addrinfo, ptr %7, i32 0, i32 2
  store i32 0, ptr %24, align 8, !tbaa !15
  %25 = getelementptr inbounds %struct.addrinfo, ptr %7, i32 0, i32 3
  store i32 0, ptr %25, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 10, ptr %9) #7
  %26 = getelementptr inbounds [10 x i8], ptr %9, i64 0, i64 0
  %27 = load i16, ptr %6, align 2, !tbaa !9
  %28 = zext i16 %27 to i32
  %29 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %26, ptr noundef @.str, i32 noundef %28) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %30) #7
  %32 = getelementptr inbounds [10 x i8], ptr %9, i64 0, i64 0
  %33 = call i32 @getaddrinfo(ptr noundef %31, ptr noundef %32, ptr noundef %7, ptr noundef %8)
  store i32 %33, ptr %10, align 4, !tbaa !17
  store i1 false, ptr %11, align 1
  call void @_ZN4ardb17SocketInetAddressC2Ev(ptr noundef nonnull align 8 dereferenceable(118) %0)
  %34 = load i32, ptr %10, align 4, !tbaa !17
  %35 = icmp ne i32 0, %34
  br i1 %35, label %36, label %38

36:                                               ; preds = %3
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %37) #7
  store i1 true, ptr %11, align 1
  store i32 1, ptr %12, align 4
  br label %95

38:                                               ; preds = %3
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = icmp ne ptr null, %39
  br i1 %40, label %41, label %93

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.addrinfo, ptr %42, i32 0, i32 5
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  store ptr %44, ptr %13, align 8, !tbaa !5
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.sockaddr, ptr %45, i32 0, i32 0
  %47 = load i16, ptr %46, align 2, !tbaa !19
  %48 = zext i16 %47 to i32
  %49 = icmp eq i32 %48, 2
  br i1 %49, label %50, label %59

50:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %51, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 120, ptr %15) #7
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN4ardb17SocketInetAddressC2ERK11sockaddr_in(ptr noundef nonnull align 8 dereferenceable(118) %15, ptr noundef nonnull align 4 dereferenceable(16) %52)
          to label %53 unwind label %55

53:                                               ; preds = %50
  %54 = call noundef nonnull align 8 dereferenceable(118) ptr @_ZN4ardb17SocketInetAddressaSEOS0_(ptr noundef nonnull align 8 dereferenceable(118) %0, ptr noundef nonnull align 8 dereferenceable(118) %15) #7
  call void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(118) %15) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %91

55:                                               ; preds = %50
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %16, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %92

59:                                               ; preds = %41
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.sockaddr, ptr %60, i32 0, i32 0
  %62 = load i16, ptr %61, align 2, !tbaa !19
  %63 = zext i16 %62 to i32
  %64 = icmp eq i32 %63, 10
  br i1 %64, label %65, label %74

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %66, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 120, ptr %19) #7
  %67 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @_ZN4ardb17SocketInetAddressC2ERK12sockaddr_in6(ptr noundef nonnull align 8 dereferenceable(118) %19, ptr noundef nonnull align 4 dereferenceable(28) %67)
          to label %68 unwind label %70

68:                                               ; preds = %65
  %69 = call noundef nonnull align 8 dereferenceable(118) ptr @_ZN4ardb17SocketInetAddressaSEOS0_(ptr noundef nonnull align 8 dereferenceable(118) %0, ptr noundef nonnull align 8 dereferenceable(118) %19) #7
  call void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(118) %19) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %90

70:                                               ; preds = %65
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %16, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %92

74:                                               ; preds = %59
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.sockaddr, ptr %75, i32 0, i32 0
  %77 = load i16, ptr %76, align 2, !tbaa !19
  %78 = zext i16 %77 to i32
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %80, label %89

80:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %81, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 120, ptr %21) #7
  %82 = load ptr, ptr %20, align 8, !tbaa !5
  invoke void @_ZN4ardb17SocketInetAddressC2ERK11sockaddr_un(ptr noundef nonnull align 8 dereferenceable(118) %21, ptr noundef nonnull align 2 dereferenceable(110) %82)
          to label %83 unwind label %85

83:                                               ; preds = %80
  %84 = call noundef nonnull align 8 dereferenceable(118) ptr @_ZN4ardb17SocketInetAddressaSEOS0_(ptr noundef nonnull align 8 dereferenceable(118) %0, ptr noundef nonnull align 8 dereferenceable(118) %21) #7
  call void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(118) %21) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %89

85:                                               ; preds = %80
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %16, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %92

89:                                               ; preds = %83, %74
  br label %90

90:                                               ; preds = %89, %68
  br label %91

91:                                               ; preds = %90, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %93

92:                                               ; preds = %85, %70, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(118) %0) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 10, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #7
  br label %99

93:                                               ; preds = %91, %38
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %94) #7
  store i1 true, ptr %11, align 1
  store i32 1, ptr %12, align 4
  br label %95

95:                                               ; preds = %93, %36
  %96 = load i1, ptr %11, align 1
  br i1 %96, label %98, label %97

97:                                               ; preds = %95
  call void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(118) %0) #7
  br label %98

98:                                               ; preds = %97, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 10, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #7
  ret void

99:                                               ; preds = %92
  %100 = load ptr, ptr %16, align 8
  %101 = load i32, ptr %17, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb17SocketInetAddressC2ERK11sockaddr_un(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef nonnull align 2 dereferenceable(110)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #4

declare i32 @getaddrinfo(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb17SocketInetAddressC2Ev(ptr noundef nonnull align 8 dereferenceable(118)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @freeaddrinfo(ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb17SocketInetAddressC2ERK11sockaddr_in(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(118) ptr @_ZN4ardb17SocketInetAddressaSEOS0_(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef nonnull align 8 dereferenceable(118)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb17SocketInetAddressC2ERK12sockaddr_in6(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef nonnull align 4 dereferenceable(28)) unnamed_addr #2 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS8addrinfo", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = !{!12, !13, i64 8}
!16 = !{!12, !13, i64 12}
!17 = !{!13, !13, i64 0}
!18 = !{!12, !6, i64 24}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTS8sockaddr", !10, i64 0, !7, i64 2}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.ardb::SocketInetAddress" = type <{ %"class.ardb::Address", %"union.ardb::SocketInetAddress::MyAddrUnion", [2 x i8] }>
%"class.ardb::Address" = type { ptr }
%"union.ardb::SocketInetAddress::MyAddrUnion" = type { %struct.sockaddr, [94 x i8] }
%struct.sockaddr = type { i16, [14 x i8] }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ardb16get_inet_addressERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEt(ptr dead_on_unwind noalias writable sret(%"class.ardb::SocketInetAddress") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i16 noundef zeroext %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.addrinfo, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [10 x i8], align 1
  %7 = alloca %"class.ardb::SocketInetAddress", align 8
  %8 = alloca %"class.ardb::SocketInetAddress", align 8
  %9 = alloca %"class.ardb::SocketInetAddress", align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %4, i8 0, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %6) #8
  %10 = zext i16 %2 to i32
  %11 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10) #8
  %12 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %13 = call i32 @getaddrinfo(ptr noundef %12, ptr noundef nonnull %6, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @_ZN4ardb17SocketInetAddressC2Ev(ptr noundef nonnull align 8 dereferenceable(118) %0)
  %.not = icmp eq i32 %13, 0
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  br i1 %.not, label %15, label %28

15:                                               ; preds = %3
  %.not13 = icmp eq ptr %14, null
  br i1 %.not13, label %26, label %16

16:                                               ; preds = %15
  %17 = getelementptr inbounds i8, ptr %14, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = load i16, ptr %18, align 2, !tbaa !12
  switch i16 %19, label %26 [
    i16 2, label %20
    i16 10, label %22
    i16 1, label %24
  ]

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %7) #8
  call void @_ZN4ardb17SocketInetAddressC2ERK11sockaddr_in(ptr noundef nonnull align 8 dereferenceable(118) %7, ptr noundef nonnull align 4 dereferenceable(16) %18)
  %21 = call noundef nonnull align 8 dereferenceable(118) ptr @_ZN4ardb17SocketInetAddressaSEOS0_(ptr noundef nonnull align 8 dereferenceable(118) %0, ptr noundef nonnull align 8 dereferenceable(118) %7) #8
  call void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(118) %7) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %7) #8
  br label %26

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %8) #8
  call void @_ZN4ardb17SocketInetAddressC2ERK12sockaddr_in6(ptr noundef nonnull align 8 dereferenceable(118) %8, ptr noundef nonnull align 4 dereferenceable(28) %18)
  %23 = call noundef nonnull align 8 dereferenceable(118) ptr @_ZN4ardb17SocketInetAddressaSEOS0_(ptr noundef nonnull align 8 dereferenceable(118) %0, ptr noundef nonnull align 8 dereferenceable(118) %8) #8
  call void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(118) %8) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %8) #8
  br label %26

24:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %9) #8
  call void @_ZN4ardb17SocketInetAddressC2ERK11sockaddr_un(ptr noundef nonnull align 8 dereferenceable(118) %9, ptr noundef nonnull align 2 dereferenceable(110) %18)
  %25 = call noundef nonnull align 8 dereferenceable(118) ptr @_ZN4ardb17SocketInetAddressaSEOS0_(ptr noundef nonnull align 8 dereferenceable(118) %0, ptr noundef nonnull align 8 dereferenceable(118) %9) #8
  call void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(118) %9) #8
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %9) #8
  br label %26

26:                                               ; preds = %20, %24, %22, %16, %15
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %3, %26
  %.sink = phi ptr [ %27, %26 ], [ %14, %3 ]
  call void @freeaddrinfo(ptr noundef %.sink) #8
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb17SocketInetAddressC2ERK11sockaddr_un(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef nonnull align 2 dereferenceable(110)) unnamed_addr #2 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

declare i32 @getaddrinfo(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb17SocketInetAddressC2Ev(ptr noundef nonnull align 8 dereferenceable(118)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @freeaddrinfo(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb17SocketInetAddressC2ERK11sockaddr_in(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(118) ptr @_ZN4ardb17SocketInetAddressaSEOS0_(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef nonnull align 8 dereferenceable(118)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb7AddressD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb17SocketInetAddressC2ERK12sockaddr_in6(ptr noundef nonnull align 8 dereferenceable(118), ptr noundef nonnull align 4 dereferenceable(28)) unnamed_addr #2 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"_ZTS8addrinfo", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"_ZTS8sockaddr", !14, i64 0, !7, i64 2}
!14 = !{!"short", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass