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

@.str.28 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.243 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.245 = external hidden unnamed_addr constant [40 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: noreturn
declare void @_exit(i32 noundef) #3

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

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

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

13:                                               ; preds = %2
  br label %19

14:                                               ; preds = %2
  %15 = load i32, ptr %4, align 4, !tbaa !9
  %16 = icmp eq i32 %15, 1
  %17 = zext i1 %16 to i64
  %18 = select i1 %16, i8 84, i8 82
  br label %19

19:                                               ; preds = %14, %13
  %20 = phi i8 [ 76, %13 ], [ %18, %14 ]
  store i8 %20, ptr %5, align 1, !tbaa !11
  br label %21

21:                                               ; preds = %44, %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  br label %22

22:                                               ; preds = %32, %21
  %23 = call noundef i32 @_ZNK7testing8internal13DeathTestImpl8write_fdEv(ptr noundef nonnull align 8 dereferenceable(44) %10)
  %24 = call noundef i32 @_ZN7testing8internal5posix5WriteEiPKvj(i32 noundef %23, ptr noundef %5, i32 noundef 1)
  store i32 %24, ptr %6, align 4, !tbaa !12
  br label %25

25:                                               ; preds = %22
  %26 = load i32, ptr %6, align 4, !tbaa !12
  %27 = icmp eq i32 %26, -1
  br i1 %27, label %28, label %32

28:                                               ; preds = %25
  %29 = call ptr @__errno_location() #7
  %30 = load i32, ptr %29, align 4, !tbaa !12
  %31 = icmp eq i32 %30, 4
  br label %32

32:                                               ; preds = %28, %25
  %33 = phi i1 [ false, %25 ], [ %31, %28 ]
  br i1 %33, label %22, label %34, !llvm.loop !14

34:                                               ; preds = %32
  %35 = load i32, ptr %6, align 4, !tbaa !12
  %36 = icmp eq i32 %35, -1
  br i1 %36, label %37, label %43

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void (ptr, ptr, ...) @_ZN7testing8internal6String6FormatEPKcz(ptr dead_on_unwind writable sret(%"class.testing::internal::String") align 8 %7, ptr noundef @.str.243, ptr noundef @.str.28, i32 noundef 6635, ptr noundef @.str.245)
  invoke void @_ZN7testing8internal14DeathTestAbortERKNS0_6StringE(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %38 unwind label %39

38:                                               ; preds = %37
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br label %43

39:                                               ; preds = %37
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %8, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %9, align 4
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %47

43:                                               ; preds = %38, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %44

44:                                               ; preds = %43
  %45 = call noundef zeroext i1 @_ZN7testing8internal11AlwaysFalseEv()
  br i1 %45, label %21, label %46, !llvm.loop !16

46:                                               ; preds = %44
  call void @_exit(i32 noundef 1) #8
  unreachable

47:                                               ; preds = %39
  %48 = load ptr, ptr %8, align 8
  %49 = load i32, ptr %9, align 4
  %50 = insertvalue { ptr, i32 } poison, ptr %48, 0
  %51 = insertvalue { ptr, i32 } %50, i32 %49, 1
  resume { ptr, i32 } %51
}

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { noreturn "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 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }
attributes #8 = { 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 = !{!"_ZTSN7testing8internal9DeathTest11AbortReasonE", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

@.str.28 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.243 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.245 = external hidden unnamed_addr constant [40 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: noreturn
declare void @_exit(i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress noreturn uwtable
define dso_local void @_ZN7testing8internal13DeathTestImpl5AbortENS0_9DeathTest11AbortReasonE(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1) unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i8, align 1
  %4 = alloca %"class.testing::internal::String", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #7
  %5 = icmp eq i32 %1, 2
  %6 = icmp eq i32 %1, 1
  %7 = select i1 %6, i8 84, i8 82
  %8 = select i1 %5, i8 76, i8 %7
  store i8 %8, ptr %3, align 1, !tbaa !5
  br label %9

9:                                                ; preds = %.backedge, %2
  %10 = call noundef i32 @_ZNK7testing8internal13DeathTestImpl8write_fdEv(ptr noundef nonnull align 8 dereferenceable(44) %0)
  %11 = call noundef i32 @_ZN7testing8internal5posix5WriteEiPKvj(i32 noundef %10, ptr noundef nonnull %3, i32 noundef 1)
  %12 = icmp eq i32 %11, -1
  br i1 %12, label %13, label %.critedge6

13:                                               ; preds = %9
  %14 = tail call ptr @__errno_location() #8
  %15 = load i32, ptr %14, align 4, !tbaa !8
  %16 = icmp eq i32 %15, 4
  br i1 %16, label %.backedge, label %.critedge

.backedge:                                        ; preds = %13, %.critedge6
  br label %9, !llvm.loop !10

.critedge:                                        ; preds = %13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void (ptr, ptr, ...) @_ZN7testing8internal6String6FormatEPKcz(ptr dead_on_unwind nonnull writable sret(%"class.testing::internal::String") align 8 %4, ptr noundef nonnull @.str.243, ptr noundef nonnull @.str.28, i32 noundef 6635, ptr noundef nonnull @.str.245)
  invoke void @_ZN7testing8internal14DeathTestAbortERKNS0_6StringE(ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %17 unwind label %18

17:                                               ; preds = %.critedge
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  br label %.critedge6

18:                                               ; preds = %.critedge
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  resume { ptr, i32 } %19

.critedge6:                                       ; preds = %9, %17
  %20 = call noundef zeroext i1 @_ZN7testing8internal11AlwaysFalseEv()
  br i1 %20, label %.backedge, label %21

21:                                               ; preds = %.critedge6
  call void @_exit(i32 noundef 1) #9
  unreachable
}

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { noreturn "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 = { 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 #6 = { mustprogress noreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


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