; LLVM IR from pictools/pica :: test/gtest/fused-src/gtest (gtest-all)

; 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.testing::internal::GTestLog" = type { i32 }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }
%"class.testing::internal::StreamingListener" = type { %"class.testing::EmptyTestEventListener", i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"class.testing::EmptyTestEventListener" = type { %"class.testing::TestEventListener" }
%"class.testing::TestEventListener" = type { ptr }
%"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] }

@.str.28 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.207 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.208 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.209 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.210 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.211 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal6IsTrueEb(i1 noundef zeroext) #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4)) #0 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) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal17StreamingListener14MakeConnectionEv(ptr noundef nonnull align 8 dereferenceable(80) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.testing::internal::GTestLog", align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.addrinfo, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.testing::internal::GTestLog", align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.testing::internal::GTestLog", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  %13 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 1
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = icmp eq i32 %14, -1
  %16 = call noundef zeroext i1 @_ZN7testing8internal6IsTrueEb(i1 noundef zeroext %15)
  br i1 %16, label %17, label %18

17:                                               ; preds = %1
  br label %29

18:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 3, ptr noundef @.str.28, i32 noundef 4764)
  %19 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %20 unwind label %25

20:                                               ; preds = %18
  %21 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef @.str.207)
          to label %22 unwind label %25

22:                                               ; preds = %20
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef @.str.208)
          to label %24 unwind label %25

24:                                               ; preds = %22
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %29

25:                                               ; preds = %22, %20, %18
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %4, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %5, align 4
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %125

29:                                               ; preds = %24, %17
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #7
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 48, i1 false)
  %30 = getelementptr inbounds %struct.addrinfo, ptr %6, i32 0, i32 1
  store i32 0, ptr %30, align 4, !tbaa !17
  %31 = getelementptr inbounds %struct.addrinfo, ptr %6, i32 0, i32 2
  store i32 1, ptr %31, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %32 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 2
  %33 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %32) #7
  %34 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 3
  %35 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %34) #7
  %36 = call i32 @getaddrinfo(ptr noundef %33, ptr noundef %35, ptr noundef %6, ptr noundef %7)
  store i32 %36, ptr %8, align 4, !tbaa !20
  %37 = load i32, ptr %8, align 4, !tbaa !20
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %52

39:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %9, i32 noundef 1, ptr noundef @.str.28, i32 noundef 4778)
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %41 unwind label %48

41:                                               ; preds = %39
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef @.str.209)
          to label %43 unwind label %48

43:                                               ; preds = %41
  %44 = load i32, ptr %8, align 4, !tbaa !20
  %45 = call ptr @gai_strerror(i32 noundef %44) #7
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef %45)
          to label %47 unwind label %48

47:                                               ; preds = %43
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %52

48:                                               ; preds = %43, %41, %39
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %4, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %5, align 4
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %124

52:                                               ; preds = %47, %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %53, ptr %10, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %97, %52
  %55 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 1
  %56 = load i32, ptr %55, align 8, !tbaa !9
  %57 = icmp eq i32 %56, -1
  br i1 %57, label %58, label %61

58:                                               ; preds = %54
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br label %61

61:                                               ; preds = %58, %54
  %62 = phi i1 [ false, %54 ], [ %60, %58 ]
  br i1 %62, label %64, label %63

63:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %101

64:                                               ; preds = %61
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.addrinfo, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !17
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.addrinfo, ptr %68, i32 0, i32 2
  %70 = load i32, ptr %69, align 8, !tbaa !19
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.addrinfo, ptr %71, i32 0, i32 3
  %73 = load i32, ptr %72, align 4, !tbaa !21
  %74 = call i32 @socket(i32 noundef %67, i32 noundef %70, i32 noundef %73) #7
  %75 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 1
  store i32 %74, ptr %75, align 8, !tbaa !9
  %76 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 1
  %77 = load i32, ptr %76, align 8, !tbaa !9
  %78 = icmp ne i32 %77, -1
  br i1 %78, label %79, label %96

79:                                               ; preds = %64
  %80 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 1
  %81 = load i32, ptr %80, align 8, !tbaa !9
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.addrinfo, ptr %82, i32 0, i32 5
  %84 = load ptr, ptr %83, align 8, !tbaa !22
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.addrinfo, ptr %85, i32 0, i32 4
  %87 = load i32, ptr %86, align 8, !tbaa !23
  %88 = call i32 @connect(i32 noundef %81, ptr noundef %84, i32 noundef %87)
  %89 = icmp eq i32 %88, -1
  br i1 %89, label %90, label %95

90:                                               ; preds = %79
  %91 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 1
  %92 = load i32, ptr %91, align 8, !tbaa !9
  %93 = call i32 @close(i32 noundef %92)
  %94 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 1
  store i32 -1, ptr %94, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %90, %79
  br label %96

96:                                               ; preds = %95, %64
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.addrinfo, ptr %98, i32 0, i32 7
  %100 = load ptr, ptr %99, align 8, !tbaa !24
  store ptr %100, ptr %10, align 8, !tbaa !5
  br label %54, !llvm.loop !25

101:                                              ; preds = %63
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %102) #7
  %103 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 1
  %104 = load i32, ptr %103, align 8, !tbaa !9
  %105 = icmp eq i32 %104, -1
  br i1 %105, label %106, label %123

106:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef 1, ptr noundef @.str.28, i32 noundef 4799)
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %108 unwind label %119

108:                                              ; preds = %106
  %109 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef @.str.210)
          to label %110 unwind label %119

110:                                              ; preds = %108
  %111 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 2
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef nonnull align 8 dereferenceable(32) %111)
          to label %113 unwind label %119

113:                                              ; preds = %110
  %114 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef @.str.211)
          to label %115 unwind label %119

115:                                              ; preds = %113
  %116 = getelementptr inbounds %"class.testing::internal::StreamingListener", ptr %12, i32 0, i32 3
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %114, ptr noundef nonnull align 8 dereferenceable(32) %116)
          to label %118 unwind label %119

118:                                              ; preds = %115
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %123

119:                                              ; preds = %115, %113, %110, %108, %106
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %4, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %5, align 4
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %124

123:                                              ; preds = %118, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #7
  ret void

124:                                              ; preds = %119, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #7
  br label %125

125:                                              ; preds = %124, %25
  %126 = load ptr, ptr %4, align 8
  %127 = load i32, ptr %5, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129
}

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

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

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

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

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

declare i32 @close(i32 noundef) #5

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

declare void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr, i32, ptr, i32)

declare void @_ZN7testing8internal8GTestLogD1Ev(ptr)

attributes #0 = { 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 #1 = { inlinehint 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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, !13, i64 8}
!10 = !{!"_ZTSN7testing8internal17StreamingListenerE", !11, i64 0, !13, i64 8, !14, i64 16, !14, i64 48}
!11 = !{!"_ZTSN7testing22EmptyTestEventListenerE", !12, i64 0}
!12 = !{!"_ZTSN7testing17TestEventListenerE"}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !16, i64 8, !7, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !13, i64 4}
!18 = !{!"_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}
!19 = !{!18, !13, i64 8}
!20 = !{!13, !13, i64 0}
!21 = !{!18, !13, i64 12}
!22 = !{!18, !6, i64 24}
!23 = !{!18, !13, i64 16}
!24 = !{!18, !6, i64 40}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; 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.testing::internal::GTestLog" = type { i32 }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }

@.str.28 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.207 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.208 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.209 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.210 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.211 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal6IsTrueEb(i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 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) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal17StreamingListener14MakeConnectionEv(ptr noundef nonnull align 8 dereferenceable(80) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.testing::internal::GTestLog", align 4
  %3 = alloca %struct.addrinfo, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.testing::internal::GTestLog", align 4
  %6 = alloca %"class.testing::internal::GTestLog", align 4
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = icmp eq i32 %8, -1
  %10 = tail call noundef zeroext i1 @_ZN7testing8internal6IsTrueEb(i1 noundef zeroext %9)
  br i1 %10, label %19, label %11

11:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef 3, ptr noundef nonnull @.str.28, i32 noundef 4764)
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @.str.207)
          to label %14 unwind label %17

14:                                               ; preds = %11
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @.str.208)
          to label %16 unwind label %17

16:                                               ; preds = %14
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %19

17:                                               ; preds = %14, %11
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %79

19:                                               ; preds = %1, %16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #7
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %3, i8 0, i64 48, i1 false)
  store i32 1, ptr %20, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store ptr null, ptr %4, align 8, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %21) #7
  %23 = getelementptr inbounds i8, ptr %0, i64 48
  %24 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %23) #7
  %25 = call i32 @getaddrinfo(ptr noundef %22, ptr noundef %24, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %35, label %26

26:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 1, ptr noundef nonnull @.str.28, i32 noundef 4778)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %5)
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @.str.209)
          to label %29 unwind label %33

29:                                               ; preds = %26
  %30 = call ptr @gai_strerror(i32 noundef %25) #7
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef %30)
          to label %32 unwind label %33

32:                                               ; preds = %29
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %35

33:                                               ; preds = %29, %26
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %78

35:                                               ; preds = %32, %19
  %.019 = load ptr, ptr %4, align 8, !tbaa !18
  %36 = load i32, ptr %7, align 8, !tbaa !5
  %37 = icmp eq i32 %36, -1
  %38 = icmp ne ptr %.019, null
  %39 = select i1 %37, i1 %38, i1 false
  br i1 %39, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %59
  %.pre21 = load ptr, ptr %4, align 8, !tbaa !18
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %35
  %40 = phi ptr [ %.pre21, %._crit_edge.loopexit ], [ %.019, %35 ]
  call void @freeaddrinfo(ptr noundef %40) #7
  %41 = load i32, ptr %7, align 8, !tbaa !5
  %42 = icmp eq i32 %41, -1
  br i1 %42, label %65, label %77

.lr.ph:                                           ; preds = %35, %59
  %.020 = phi ptr [ %.0, %59 ], [ %.019, %35 ]
  %43 = getelementptr inbounds i8, ptr %.020, i64 4
  %44 = load i32, ptr %43, align 4, !tbaa !19
  %45 = getelementptr inbounds i8, ptr %.020, i64 8
  %46 = load i32, ptr %45, align 8, !tbaa !16
  %47 = getelementptr inbounds i8, ptr %.020, i64 12
  %48 = load i32, ptr %47, align 4, !tbaa !20
  %49 = call i32 @socket(i32 noundef %44, i32 noundef %46, i32 noundef %48) #7
  store i32 %49, ptr %7, align 8, !tbaa !5
  %.not18 = icmp eq i32 %49, -1
  br i1 %.not18, label %59, label %50

50:                                               ; preds = %.lr.ph
  %51 = getelementptr inbounds i8, ptr %.020, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !21
  %53 = getelementptr inbounds i8, ptr %.020, i64 16
  %54 = load i32, ptr %53, align 8, !tbaa !22
  %55 = call i32 @connect(i32 noundef %49, ptr noundef %52, i32 noundef %54)
  %56 = icmp eq i32 %55, -1
  %.pre = load i32, ptr %7, align 8, !tbaa !5
  br i1 %56, label %57, label %59

57:                                               ; preds = %50
  %58 = call i32 @close(i32 noundef %.pre)
  store i32 -1, ptr %7, align 8, !tbaa !5
  br label %59

59:                                               ; preds = %.lr.ph, %57, %50
  %60 = phi i32 [ -1, %.lr.ph ], [ -1, %57 ], [ %.pre, %50 ]
  %61 = getelementptr inbounds i8, ptr %.020, i64 40
  %.0 = load ptr, ptr %61, align 8, !tbaa !18
  %62 = icmp eq i32 %60, -1
  %63 = icmp ne ptr %.0, null
  %64 = select i1 %62, i1 %63, i1 false
  br i1 %64, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !23

65:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef 1, ptr noundef nonnull @.str.28, i32 noundef 4799)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %6)
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @.str.210)
          to label %68 unwind label %75

68:                                               ; preds = %65
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %70 unwind label %75

70:                                               ; preds = %68
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull @.str.211)
          to label %72 unwind label %75

72:                                               ; preds = %70
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull align 8 dereferenceable(32) %23)
          to label %74 unwind label %75

74:                                               ; preds = %72
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %77

75:                                               ; preds = %72, %70, %68, %65
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %78

77:                                               ; preds = %74, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #7
  ret void

78:                                               ; preds = %75, %33
  %.pn = phi { ptr, i32 } [ %76, %75 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #7
  br label %79

79:                                               ; preds = %78, %17
  %.pn.pn = phi { ptr, i32 } [ %.pn, %78 ], [ %18, %17 ]
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #5

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

declare void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr, i32, ptr, i32) local_unnamed_addr

declare void @_ZN7testing8internal8GTestLogD1Ev(ptr) local_unnamed_addr

attributes #0 = { 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 #1 = { inlinehint 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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, !9, i64 8}
!6 = !{!"_ZTSN7testing8internal17StreamingListenerE", !7, i64 0, !9, i64 8, !12, i64 16, !12, i64 48}
!7 = !{!"_ZTSN7testing22EmptyTestEventListenerE", !8, i64 0}
!8 = !{!"_ZTSN7testing17TestEventListenerE"}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !13, i64 0, !15, i64 8, !10, i64 16}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !14, i64 0}
!14 = !{!"any pointer", !10, i64 0}
!15 = !{!"long", !10, i64 0}
!16 = !{!17, !9, i64 8}
!17 = !{!"_ZTS8addrinfo", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !14, i64 24, !14, i64 32, !14, i64 40}
!18 = !{!14, !14, i64 0}
!19 = !{!17, !9, i64 4}
!20 = !{!17, !9, i64 12}
!21 = !{!17, !14, i64 24}
!22 = !{!17, !9, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass