; LLVM IR from ICOMP-UNC/cppSocketLib :: src (cppSocket)

; 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"

%struct.in6_addr = type { %union.anon.3 }
%union.anon.3 = type { [4 x i32] }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }
%class.TCPv6Connection = type <{ %class.IConnection, %struct.sockaddr_in6, [4 x i8], ptr, i8, [7 x i8] }>
%class.IConnection = type { ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i8, i32 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.sockaddr_in6 = type { i16, i16, i32, %struct.in6_addr, i32 }

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@_ZTV15TCPv6Connection = external dso_local unnamed_addr constant { [12 x ptr] }, align 8
@in6addr_any = external global %struct.in6_addr, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11IConnectionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_b(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) #2

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext) #6

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

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

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

; Function Attrs: nounwind
declare ptr @gai_strerror(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN15TCPv6ConnectionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_b(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i1 noundef zeroext %3) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.addrinfo, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %14 = zext i1 %3 to i8
  store i8 %14, ptr %8, align 1, !tbaa !9
  %15 = load ptr, ptr %5, align 8
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %19 = trunc i8 %18 to i1
  call void @_ZN11IConnectionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_b(ptr noundef nonnull align 8 dereferenceable(80) %15, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(32) %17, i1 noundef zeroext %19)
  store ptr getelementptr inbounds inrange(-16, 80) ({ [12 x ptr] }, ptr @_ZTV15TCPv6Connection, i32 0, i32 0, i32 2), ptr %15, align 8, !tbaa !13
  %20 = getelementptr inbounds %class.TCPv6Connection, ptr %15, i32 0, i32 1
  %21 = getelementptr inbounds %class.TCPv6Connection, ptr %15, i32 0, i32 3
  store ptr null, ptr %21, align 8, !tbaa !15
  %22 = getelementptr inbounds %class.TCPv6Connection, ptr %15, i32 0, i32 4
  store i8 0, ptr %22, align 8, !tbaa !25
  %23 = call i32 @socket(i32 noundef 10, i32 noundef 1, i32 noundef 6) #8
  %24 = getelementptr inbounds %class.IConnection, ptr %15, i32 0, i32 4
  store i32 %23, ptr %24, align 4, !tbaa !26
  %25 = getelementptr inbounds %class.IConnection, ptr %15, i32 0, i32 4
  %26 = load i32, ptr %25, align 4, !tbaa !26
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %39

28:                                               ; preds = %4
  %29 = call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef @.str)
          to label %30 unwind label %31

30:                                               ; preds = %28
  invoke void @__cxa_throw(ptr %29, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %105 unwind label %35

31:                                               ; preds = %28
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  call void @__cxa_free_exception(ptr %29) #8
  br label %99

35:                                               ; preds = %30
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %9, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %10, align 4
  br label %99

39:                                               ; preds = %4
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %40) #8
  br i1 %41, label %42, label %58

42:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 28, ptr %11, align 4, !tbaa !27
  %43 = getelementptr inbounds %class.TCPv6Connection, ptr %15, i32 0, i32 1
  %44 = load i32, ptr %11, align 4, !tbaa !27
  %45 = zext i32 %44 to i64
  call void @llvm.memset.p0.i64(ptr align 8 %43, i8 0, i64 %45, i1 false)
  %46 = getelementptr inbounds %class.TCPv6Connection, ptr %15, i32 0, i32 1
  %47 = getelementptr inbounds %struct.sockaddr_in6, ptr %46, i32 0, i32 0
  store i16 10, ptr %47, align 8, !tbaa !28
  %48 = invoke noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 0)
          to label %49 unwind label %54

49:                                               ; preds = %42
  %50 = getelementptr inbounds %class.TCPv6Connection, ptr %15, i32 0, i32 1
  %51 = getelementptr inbounds %struct.sockaddr_in6, ptr %50, i32 0, i32 1
  store i16 %48, ptr %51, align 2, !tbaa !29
  %52 = getelementptr inbounds %class.TCPv6Connection, ptr %15, i32 0, i32 1
  %53 = getelementptr inbounds %struct.sockaddr_in6, ptr %52, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %53, ptr align 4 @in6addr_any, i64 16, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %97

54:                                               ; preds = %42
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %9, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %99

58:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #8
  %59 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 0
  store i32 0, ptr %59, align 8, !tbaa !32
  %60 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 1
  store i32 10, ptr %60, align 4, !tbaa !34
  %61 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 2
  store i32 1, ptr %61, align 8, !tbaa !35
  %62 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 3
  store i32 6, ptr %62, align 4, !tbaa !36
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %63) #8
  br i1 %64, label %65, label %67

65:                                               ; preds = %58
  %66 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 0
  store i32 1, ptr %66, align 8, !tbaa !32
  br label %67

67:                                               ; preds = %65, %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %68) #8
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  br label %74

71:                                               ; preds = %67
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %72) #8
  br label %74

74:                                               ; preds = %71, %70
  %75 = phi ptr [ null, %70 ], [ %73, %71 ]
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %76) #8
  %78 = getelementptr inbounds %class.TCPv6Connection, ptr %15, i32 0, i32 3
  %79 = invoke i32 @getaddrinfo(ptr noundef %75, ptr noundef %77, ptr noundef %12, ptr noundef %78)
          to label %80 unwind label %88

80:                                               ; preds = %74
  store i32 %79, ptr %13, align 4, !tbaa !27
  %81 = load i32, ptr %13, align 4, !tbaa !27
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %96

83:                                               ; preds = %80
  %84 = call ptr @__cxa_allocate_exception(i64 16) #8
  %85 = load i32, ptr %13, align 4, !tbaa !27
  %86 = call ptr @gai_strerror(i32 noundef %85) #8
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %84, ptr noundef %86)
          to label %87 unwind label %92

87:                                               ; preds = %83
  invoke void @__cxa_throw(ptr %84, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %105 unwind label %88

88:                                               ; preds = %87, %74
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %9, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %10, align 4
  br label %98

92:                                               ; preds = %83
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %9, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %10, align 4
  call void @__cxa_free_exception(ptr %84) #8
  br label %98

96:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #8
  br label %97

97:                                               ; preds = %96, %49
  ret void

98:                                               ; preds = %92, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #8
  br label %99

99:                                               ; preds = %98, %54, %35, %31
  call void @_ZN11IConnectionD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #8
  br label %100

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

105:                                              ; preds = %87, %30
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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 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 #2 = { 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 #3 = { "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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { noreturn }

!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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !6, i64 112}
!16 = !{!"_ZTS15TCPv6Connection", !17, i64 0, !22, i64 80, !6, i64 112, !10, i64 120}
!17 = !{!"_ZTS11IConnection", !18, i64 8, !18, i64 40, !10, i64 72, !21, i64 76}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !19, i64 0, !20, i64 8, !7, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = !{!"_ZTS12sockaddr_in6", !23, i64 0, !23, i64 2, !21, i64 4, !24, i64 8, !21, i64 24}
!23 = !{!"short", !7, i64 0}
!24 = !{!"_ZTS8in6_addr", !7, i64 0}
!25 = !{!16, !10, i64 120}
!26 = !{!17, !21, i64 76}
!27 = !{!21, !21, i64 0}
!28 = !{!16, !23, i64 80}
!29 = !{!16, !23, i64 82}
!30 = !{i64 0, i64 16, !31}
!31 = !{!7, !7, i64 0}
!32 = !{!33, !21, i64 0}
!33 = !{!"_ZTS8addrinfo", !21, i64 0, !21, i64 4, !21, i64 8, !21, i64 12, !21, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!34 = !{!33, !21, i64 4}
!35 = !{!33, !21, i64 8}
!36 = !{!33, !21, i64 12}


; 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"

%struct.in6_addr = type { %union.anon.3 }
%union.anon.3 = type { [4 x i32] }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [22 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@_ZTV15TCPv6Connection = external dso_local unnamed_addr constant { [12 x ptr] }, align 8
@in6addr_any = external local_unnamed_addr global %struct.in6_addr, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11IConnectionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_b(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext) local_unnamed_addr #6

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

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

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

; Function Attrs: nounwind
declare ptr @gai_strerror(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN15TCPv6ConnectionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_b(ptr noundef nonnull align 8 dereferenceable(121) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i1 noundef zeroext %3) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.addrinfo, align 16
  tail call void @_ZN11IConnectionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_b(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, i1 noundef zeroext %3)
  store ptr getelementptr inbounds inrange(-16, 80) (i8, ptr @_ZTV15TCPv6Connection, i64 16), ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 112
  store ptr null, ptr %6, align 8, !tbaa !8
  %7 = getelementptr inbounds i8, ptr %0, i64 120
  store i8 0, ptr %7, align 8, !tbaa !21
  %8 = tail call i32 @socket(i32 noundef 10, i32 noundef 1, i32 noundef 6) #8
  %9 = getelementptr inbounds i8, ptr %0, i64 76
  store i32 %8, ptr %9, align 4, !tbaa !22
  %10 = icmp slt i32 %8, 0
  br i1 %10, label %11, label %18

11:                                               ; preds = %4
  %12 = tail call ptr @__cxa_allocate_exception(i64 16) #8
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull @.str)
          to label %13 unwind label %14

13:                                               ; preds = %11
  invoke void @__cxa_throw(ptr nonnull %12, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #9
          to label %49 unwind label %16

14:                                               ; preds = %11
  %15 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %12) #8
  br label %48

16:                                               ; preds = %13
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %48

18:                                               ; preds = %4
  %19 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  br i1 %19, label %20, label %25

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %21, i8 0, i64 28, i1 false)
  store i16 10, ptr %21, align 8, !tbaa !23
  %22 = tail call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext 0)
  %23 = getelementptr inbounds i8, ptr %0, i64 82
  store i16 %22, ptr %23, align 2, !tbaa !24
  %24 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(16) @in6addr_any, i64 16, i1 false), !tbaa.struct !25
  br label %46

25:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #8
  store <4 x i32> <i32 0, i32 10, i32 1, i32 6>, ptr %5, align 16, !tbaa !27
  %26 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  br i1 %26, label %27, label %28

27:                                               ; preds = %25
  store i32 1, ptr %5, align 16, !tbaa !28
  br label %28

28:                                               ; preds = %27, %25
  %29 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  br i1 %29, label %32, label %30

30:                                               ; preds = %28
  %31 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  br label %32

32:                                               ; preds = %28, %30
  %33 = phi ptr [ %31, %30 ], [ null, %28 ]
  %34 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  %35 = invoke i32 @getaddrinfo(ptr noundef %33, ptr noundef %34, ptr noundef nonnull %5, ptr noundef nonnull %6)
          to label %36 unwind label %41

36:                                               ; preds = %32
  %.not = icmp eq i32 %35, 0
  br i1 %.not, label %45, label %37

37:                                               ; preds = %36
  %38 = call ptr @__cxa_allocate_exception(i64 16) #8
  %39 = call ptr @gai_strerror(i32 noundef %35) #8
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef %39)
          to label %40 unwind label %43

40:                                               ; preds = %37
  invoke void @__cxa_throw(ptr nonnull %38, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #9
          to label %49 unwind label %41

41:                                               ; preds = %40, %32
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %47

43:                                               ; preds = %37
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %38) #8
  br label %47

45:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #8
  br label %46

46:                                               ; preds = %45, %20
  ret void

47:                                               ; preds = %43, %41
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #8
  br label %48

48:                                               ; preds = %47, %16, %14
  %.pn17 = phi { ptr, i32 } [ %17, %16 ], [ %15, %14 ], [ %.pn, %47 ]
  call void @_ZN11IConnectionD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %0) #8
  resume { ptr, i32 } %.pn17

49:                                               ; preds = %40, %13
  unreachable
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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 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 #2 = { 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 #3 = { "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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { noreturn }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 112}
!9 = !{!"_ZTS15TCPv6Connection", !10, i64 0, !18, i64 80, !13, i64 112, !16, i64 120}
!10 = !{!"_ZTS11IConnection", !11, i64 8, !11, i64 40, !16, i64 72, !17, i64 76}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !15, i64 8, !14, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !14, i64 0}
!14 = !{!"omnipotent char", !7, i64 0}
!15 = !{!"long", !14, i64 0}
!16 = !{!"bool", !14, i64 0}
!17 = !{!"int", !14, i64 0}
!18 = !{!"_ZTS12sockaddr_in6", !19, i64 0, !19, i64 2, !17, i64 4, !20, i64 8, !17, i64 24}
!19 = !{!"short", !14, i64 0}
!20 = !{!"_ZTS8in6_addr", !14, i64 0}
!21 = !{!9, !16, i64 120}
!22 = !{!10, !17, i64 76}
!23 = !{!9, !19, i64 80}
!24 = !{!9, !19, i64 82}
!25 = !{i64 0, i64 16, !26}
!26 = !{!14, !14, i64 0}
!27 = !{!17, !17, i64 0}
!28 = !{!29, !17, i64 0}
!29 = !{!"_ZTS8addrinfo", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass