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

@.str.28 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.240 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.241 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.242 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.243 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.244 = external hidden unnamed_addr constant [24 x i8], align 1

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

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal6String6FormatEPKcz(ptr dead_on_unwind noalias writable sret(%"class.testing::internal::String") align 8, ptr noundef, ...) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal14DeathTestAbortERKNS0_6StringE(ptr noundef nonnull align 8 dereferenceable(16)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal23GetLastErrnoDescriptionEv(ptr dead_on_unwind noalias writable sret(%"class.testing::internal::String") align 8) #3

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal13DeathTestImpl26ReadAndInterpretStatusByteEv(ptr noundef nonnull align 8 dereferenceable(44) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca i32, align 4
  %5 = alloca %"class.testing::internal::GTestLog", align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.testing::internal::GTestLog", align 4
  %9 = alloca %"class.testing::internal::String", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.testing::internal::String", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  br label %13

13:                                               ; preds = %23, %1
  %14 = call noundef i32 @_ZNK7testing8internal13DeathTestImpl7read_fdEv(ptr noundef nonnull align 8 dereferenceable(44) %12)
  %15 = call noundef i32 @_ZN7testing8internal5posix4ReadEiPvj(i32 noundef %14, ptr noundef %3, i32 noundef 1)
  store i32 %15, ptr %4, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %13
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = icmp eq i32 %17, -1
  br i1 %18, label %19, label %23

19:                                               ; preds = %16
  %20 = call ptr @__errno_location() #6
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = icmp eq i32 %21, 4
  br label %23

23:                                               ; preds = %19, %16
  %24 = phi i1 [ false, %16 ], [ %22, %19 ]
  br i1 %24, label %13, label %25, !llvm.loop !11

25:                                               ; preds = %23
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  call void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44) %12, i32 noundef 1)
  br label %81

29:                                               ; preds = %25
  %30 = load i32, ptr %4, align 4, !tbaa !9
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %58

32:                                               ; preds = %29
  %33 = load i8, ptr %3, align 1, !tbaa !13
  %34 = sext i8 %33 to i32
  switch i32 %34, label %40 [
    i32 82, label %35
    i32 84, label %36
    i32 76, label %37
    i32 73, label %38
  ]

35:                                               ; preds = %32
  call void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44) %12, i32 noundef 3)
  br label %53

36:                                               ; preds = %32
  call void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44) %12, i32 noundef 4)
  br label %53

37:                                               ; preds = %32
  call void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44) %12, i32 noundef 2)
  br label %53

38:                                               ; preds = %32
  %39 = call noundef i32 @_ZNK7testing8internal13DeathTestImpl7read_fdEv(ptr noundef nonnull align 8 dereferenceable(44) %12)
  call void @_ZN7testing8internalL21FailFromInternalErrorEi(i32 noundef %39)
  br label %53

40:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 3, ptr noundef @.str.28, i32 noundef 6611)
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %42 unwind label %54

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

44:                                               ; preds = %42
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef @.str.241)
          to label %46 unwind label %54

46:                                               ; preds = %44
  %47 = load i8, ptr %3, align 1, !tbaa !13
  %48 = sext i8 %47 to i32
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %45, i32 noundef %48)
          to label %50 unwind label %54

50:                                               ; preds = %46
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef @.str.59)
          to label %52 unwind label %54

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

53:                                               ; preds = %52, %38, %37, %36, %35
  br label %80

54:                                               ; preds = %50, %46, %44, %42, %40
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %6, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %7, align 4
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %108

58:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 3, ptr noundef @.str.28, i32 noundef 6616)
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %60 unwind label %66

60:                                               ; preds = %58
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef @.str.242)
          to label %62 unwind label %66

62:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  invoke void @_ZN7testing8internal23GetLastErrnoDescriptionEv(ptr dead_on_unwind writable sret(%"class.testing::internal::String") align 8 %9)
          to label %63 unwind label %70

63:                                               ; preds = %62
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internallsERSoRKNS0_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %65 unwind label %74

65:                                               ; preds = %63
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %80

66:                                               ; preds = %60, %58
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %6, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %7, align 4
  br label %79

70:                                               ; preds = %62
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %6, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %7, align 4
  br label %78

74:                                               ; preds = %63
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %6, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %7, align 4
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  br label %78

78:                                               ; preds = %74, %70
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %79

79:                                               ; preds = %78, %66
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %108

80:                                               ; preds = %65, %53
  br label %81

81:                                               ; preds = %80, %28
  br label %82

82:                                               ; preds = %105, %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  br label %83

83:                                               ; preds = %93, %82
  %84 = call noundef i32 @_ZNK7testing8internal13DeathTestImpl7read_fdEv(ptr noundef nonnull align 8 dereferenceable(44) %12)
  %85 = call noundef i32 @_ZN7testing8internal5posix5CloseEi(i32 noundef %84)
  store i32 %85, ptr %10, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %83
  %87 = load i32, ptr %10, align 4, !tbaa !9
  %88 = icmp eq i32 %87, -1
  br i1 %88, label %89, label %93

89:                                               ; preds = %86
  %90 = call ptr @__errno_location() #6
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = icmp eq i32 %91, 4
  br label %93

93:                                               ; preds = %89, %86
  %94 = phi i1 [ false, %86 ], [ %92, %89 ]
  br i1 %94, label %83, label %95, !llvm.loop !14

95:                                               ; preds = %93
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = icmp eq i32 %96, -1
  br i1 %97, label %98, label %104

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  call void (ptr, ptr, ...) @_ZN7testing8internal6String6FormatEPKcz(ptr dead_on_unwind writable sret(%"class.testing::internal::String") align 8 %11, ptr noundef @.str.243, ptr noundef @.str.28, i32 noundef 6619, ptr noundef @.str.244)
  invoke void @_ZN7testing8internal14DeathTestAbortERKNS0_6StringE(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %99 unwind label %100

99:                                               ; preds = %98
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br label %104

100:                                              ; preds = %98
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %6, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %7, align 4
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %108

104:                                              ; preds = %99, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %105

105:                                              ; preds = %104
  %106 = call noundef zeroext i1 @_ZN7testing8internal11AlwaysFalseEv()
  br i1 %106, label %82, label %107, !llvm.loop !15

107:                                              ; preds = %105
  call void @_ZN7testing8internal13DeathTestImpl11set_read_fdEi(ptr noundef nonnull align 8 dereferenceable(44) %12, i32 noundef -1)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  ret void

108:                                              ; preds = %100, %79, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  br label %109

109:                                              ; preds = %108
  %110 = load ptr, ptr %6, align 8
  %111 = load i32, ptr %7, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN7testing8internal5posix4ReadEiPvj(i32 noundef, ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7testing8internal13DeathTestImpl7read_fdEv(ptr noundef nonnull align 8 dereferenceable(44)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7testing8internalL21FailFromInternalErrorEi(i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN7testing8internal5posix5CloseEi(i32 noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal11AlwaysFalseEv() #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7testing8internal13DeathTestImpl11set_read_fdEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) #0 align 2

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 = { nounwind willreturn memory(none) "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 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }

!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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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"

%"class.testing::internal::String" = type { ptr, i64 }
%"class.testing::internal::GTestLog" = type { i32 }

@.str.28 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.240 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.241 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.242 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.243 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.244 = external hidden unnamed_addr constant [24 x i8], align 1

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

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal6String6FormatEPKcz(ptr dead_on_unwind noalias writable sret(%"class.testing::internal::String") align 8, ptr noundef, ...) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal14DeathTestAbortERKNS0_6StringE(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal23GetLastErrnoDescriptionEv(ptr dead_on_unwind noalias writable sret(%"class.testing::internal::String") align 8) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal13DeathTestImpl26ReadAndInterpretStatusByteEv(ptr noundef nonnull align 8 dereferenceable(44) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i8, align 1
  %3 = alloca %"class.testing::internal::GTestLog", align 4
  %4 = alloca %"class.testing::internal::GTestLog", align 4
  %5 = alloca %"class.testing::internal::String", align 8
  %6 = alloca %"class.testing::internal::String", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  br label %7

7:                                                ; preds = %10, %1
  %8 = call noundef i32 @_ZNK7testing8internal13DeathTestImpl7read_fdEv(ptr noundef nonnull align 8 dereferenceable(44) %0)
  %9 = call noundef i32 @_ZN7testing8internal5posix4ReadEiPvj(i32 noundef %8, ptr noundef nonnull %2, i32 noundef 1)
  switch i32 %9, label %.critedge [
    i32 -1, label %10
    i32 0, label %14
    i32 1, label %15
  ]

10:                                               ; preds = %7
  %11 = tail call ptr @__errno_location() #6
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = icmp eq i32 %12, 4
  br i1 %13, label %7, label %.critedge, !llvm.loop !9

14:                                               ; preds = %7
  call void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef 1)
  br label %.preheader

15:                                               ; preds = %7
  %16 = load i8, ptr %2, align 1, !tbaa !11
  switch i8 %16, label %22 [
    i8 82, label %17
    i8 84, label %18
    i8 76, label %19
    i8 73, label %20
  ]

17:                                               ; preds = %15
  call void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef 3)
  br label %.preheader

18:                                               ; preds = %15
  call void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef 4)
  br label %.preheader

19:                                               ; preds = %15
  call void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef 2)
  br label %.preheader

20:                                               ; preds = %15
  %21 = call noundef i32 @_ZNK7testing8internal13DeathTestImpl7read_fdEv(ptr noundef nonnull align 8 dereferenceable(44) %0)
  call void @_ZN7testing8internalL21FailFromInternalErrorEi(i32 noundef %21)
  br label %.preheader

22:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 3, ptr noundef nonnull @.str.28, i32 noundef 6611)
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %3)
  %24 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @.str.240)
          to label %25 unwind label %34

25:                                               ; preds = %22
  %26 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull @.str.241)
          to label %27 unwind label %34

27:                                               ; preds = %25
  %28 = load i8, ptr %2, align 1, !tbaa !11
  %29 = sext i8 %28 to i32
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef %29)
          to label %31 unwind label %34

31:                                               ; preds = %27
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @.str.59)
          to label %33 unwind label %34

33:                                               ; preds = %31
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %.preheader

34:                                               ; preds = %31, %27, %25, %22
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %63

.critedge:                                        ; preds = %10, %7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @_ZN7testing8internal8GTestLogC1ENS0_16GTestLogSeverityEPKci(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef 3, ptr noundef nonnull @.str.28, i32 noundef 6616)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internal8GTestLog9GetStreamEv(ptr noundef nonnull align 4 dereferenceable(4) %4)
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @.str.242)
          to label %38 unwind label %42

38:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  invoke void @_ZN7testing8internal23GetLastErrnoDescriptionEv(ptr dead_on_unwind nonnull writable sret(%"class.testing::internal::String") align 8 %5)
          to label %39 unwind label %44

39:                                               ; preds = %38
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7testing8internallsERSoRKNS0_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %41 unwind label %46

41:                                               ; preds = %39
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %.preheader

.preheader:                                       ; preds = %14, %17, %18, %19, %20, %33, %41
  br label %50

42:                                               ; preds = %.critedge
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %49

44:                                               ; preds = %38
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %48

46:                                               ; preds = %39
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  br label %48

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

49:                                               ; preds = %48, %42
  %.pn.pn = phi { ptr, i32 } [ %.pn, %48 ], [ %43, %42 ]
  call void @_ZN7testing8internal8GTestLogD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %63

50:                                               ; preds = %.backedge, %.preheader
  %51 = call noundef i32 @_ZNK7testing8internal13DeathTestImpl7read_fdEv(ptr noundef nonnull align 8 dereferenceable(44) %0)
  %52 = call noundef i32 @_ZN7testing8internal5posix5CloseEi(i32 noundef %51)
  %53 = icmp eq i32 %52, -1
  br i1 %53, label %54, label %.critedge17

54:                                               ; preds = %50
  %55 = tail call ptr @__errno_location() #6
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 4
  br i1 %57, label %.backedge, label %.critedge2

.backedge:                                        ; preds = %54, %.critedge17
  br label %50, !llvm.loop !12

.critedge2:                                       ; preds = %54
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void (ptr, ptr, ...) @_ZN7testing8internal6String6FormatEPKcz(ptr dead_on_unwind nonnull writable sret(%"class.testing::internal::String") align 8 %6, ptr noundef nonnull @.str.243, ptr noundef nonnull @.str.28, i32 noundef 6619, ptr noundef nonnull @.str.244)
  invoke void @_ZN7testing8internal14DeathTestAbortERKNS0_6StringE(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %58 unwind label %59

58:                                               ; preds = %.critedge2
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %.critedge17

59:                                               ; preds = %.critedge2
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %63

.critedge17:                                      ; preds = %50, %58
  %61 = call noundef zeroext i1 @_ZN7testing8internal11AlwaysFalseEv()
  br i1 %61, label %.backedge, label %62

62:                                               ; preds = %.critedge17
  call void @_ZN7testing8internal13DeathTestImpl11set_read_fdEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef -1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  ret void

63:                                               ; preds = %59, %49, %34
  %.pn15 = phi { ptr, i32 } [ %60, %59 ], [ %35, %34 ], [ %.pn.pn, %49 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn15
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN7testing8internal5posix4ReadEiPvj(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7testing8internal13DeathTestImpl7read_fdEv(ptr noundef nonnull align 8 dereferenceable(44)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7testing8internal13DeathTestImpl11set_outcomeENS0_16DeathTestOutcomeE(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN7testing8internalL21FailFromInternalErrorEi(i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN7testing8internal5posix5CloseEi(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal11AlwaysFalseEv() local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7testing8internal13DeathTestImpl11set_read_fdEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) local_unnamed_addr #0 align 2

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 nofree nosync nounwind willreturn memory(none) "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 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass