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

@.str.37 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.156 = external hidden unnamed_addr constant [14 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7testing8TestCase17failed_test_countEv(ptr noundef nonnull align 8 dereferenceable(112)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7testing8TestCase11GetTestInfoEi(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal13ColoredPrintfENS0_10GTestColorEPKcz(i32 noundef, ptr noundef, ...) #1

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal29PrintFullTestCommentIfPresentERKNS_8TestInfoE(ptr noundef nonnull align 8 dereferenceable(216)) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7testing10TestResult6PassedEv(ptr noundef nonnull align 8 dereferenceable(112)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal27PrettyUnitTestResultPrinter16PrintFailedTestsERKNS_8UnitTestE(ptr noundef nonnull align 8 dereferenceable(64) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = call noundef i32 @_ZNK7testing8UnitTest17failed_test_countEv(ptr noundef nonnull align 8 dereferenceable(64) %9)
  store i32 %10, ptr %3, align 4, !tbaa !9
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %1
  store i32 1, ptr %4, align 4
  br label %72

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %68, %14
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = call noundef i32 @_ZNK7testing8UnitTest21total_test_case_countEv(ptr noundef nonnull align 8 dereferenceable(64) %17)
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %71

21:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = call noundef ptr @_ZNK7testing8UnitTest11GetTestCaseEi(ptr noundef nonnull align 8 dereferenceable(64) %22, i32 noundef %23)
  store ptr %24, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef zeroext i1 @_ZNK7testing8TestCase10should_runEv(ptr noundef nonnull align 8 dereferenceable(112) %25)
  br i1 %26, label %27, label %31

27:                                               ; preds = %21
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call noundef i32 @_ZNK7testing8TestCase17failed_test_countEv(ptr noundef nonnull align 8 dereferenceable(112) %28)
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %27, %21
  store i32 4, ptr %4, align 4
  br label %65

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %61, %32
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call noundef i32 @_ZNK7testing8TestCase16total_test_countEv(ptr noundef nonnull align 8 dereferenceable(112) %35)
  %37 = icmp slt i32 %34, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %64

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = call noundef ptr @_ZNK7testing8TestCase11GetTestInfoEi(ptr noundef nonnull align 8 dereferenceable(112) %40, i32 noundef %41)
  store ptr %42, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = call noundef zeroext i1 @_ZNK7testing8TestInfo10should_runEv(ptr noundef nonnull align 8 dereferenceable(216) %43)
  br i1 %44, label %45, label %49

45:                                               ; preds = %39
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = call noundef ptr @_ZNK7testing8TestInfo6resultEv(ptr noundef nonnull align 8 dereferenceable(216) %46)
  %48 = call noundef zeroext i1 @_ZNK7testing10TestResult6PassedEv(ptr noundef nonnull align 8 dereferenceable(112) %47)
  br i1 %48, label %49, label %50

49:                                               ; preds = %45, %39
  store i32 7, ptr %4, align 4
  br label %58

50:                                               ; preds = %45
  call void (i32, ptr, ...) @_ZN7testing8internal13ColoredPrintfENS0_10GTestColorEPKcz(i32 noundef 1, ptr noundef @.str.156)
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = call noundef ptr @_ZNK7testing8TestCase4nameEv(ptr noundef nonnull align 8 dereferenceable(112) %51)
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = call noundef ptr @_ZNK7testing8TestInfo4nameEv(ptr noundef nonnull align 8 dereferenceable(216) %53)
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.37, ptr noundef %52, ptr noundef %54)
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7testing8internal29PrintFullTestCommentIfPresentERKNS_8TestInfoE(ptr noundef nonnull align 8 dereferenceable(216) %56)
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.42)
  store i32 0, ptr %4, align 4
  br label %58

58:                                               ; preds = %50, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %59 = load i32, ptr %4, align 4
  switch i32 %59, label %75 [
    i32 0, label %60
    i32 7, label %61
  ]

60:                                               ; preds = %58
  br label %61

61:                                               ; preds = %60, %58
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %7, align 4, !tbaa !9
  br label %33, !llvm.loop !11

64:                                               ; preds = %38
  store i32 0, ptr %4, align 4
  br label %65

65:                                               ; preds = %64, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %66 = load i32, ptr %4, align 4
  switch i32 %66, label %75 [
    i32 0, label %67
    i32 4, label %68
  ]

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67, %65
  %69 = load i32, ptr %5, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %5, align 4, !tbaa !9
  br label %15, !llvm.loop !13

71:                                               ; preds = %20
  store i32 0, ptr %4, align 4
  br label %72

72:                                               ; preds = %71, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %73 = load i32, ptr %4, align 4
  switch i32 %73, label %75 [
    i32 0, label %74
    i32 1, label %74
  ]

74:                                               ; preds = %72, %72
  ret void

75:                                               ; preds = %72, %65, %58
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7testing8UnitTest17failed_test_countEv(ptr noundef nonnull align 8 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7testing8UnitTest21total_test_case_countEv(ptr noundef nonnull align 8 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7testing8UnitTest11GetTestCaseEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7testing8TestCase10should_runEv(ptr noundef nonnull align 8 dereferenceable(112)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7testing8TestInfo10should_runEv(ptr noundef nonnull align 8 dereferenceable(216)) #2 align 2

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

!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 = distinct !{!13, !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"

@.str.37 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.156 = external hidden unnamed_addr constant [14 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7testing8TestCase16total_test_countEv(ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7testing8TestCase11GetTestInfoEi(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal13ColoredPrintfENS0_10GTestColorEPKcz(i32 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal29PrintFullTestCommentIfPresentERKNS_8TestInfoE(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7testing10TestResult6PassedEv(ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal27PrettyUnitTestResultPrinter16PrintFailedTestsERKNS_8UnitTestE(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #0 align 2 {
  %2 = tail call noundef i32 @_ZNK7testing8UnitTest17failed_test_countEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %3 = icmp eq i32 %2, 0
  br i1 %3, label %.loopexit20, label %.preheader19

.preheader19:                                     ; preds = %1
  %4 = tail call noundef i32 @_ZNK7testing8UnitTest21total_test_case_countEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph23, label %.loopexit20

.lr.ph23:                                         ; preds = %.preheader19, %.loopexit
  %.01822 = phi i32 [ %27, %.loopexit ], [ 0, %.preheader19 ]
  %6 = tail call noundef ptr @_ZNK7testing8UnitTest11GetTestCaseEi(ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %.01822)
  %7 = tail call noundef zeroext i1 @_ZNK7testing8TestCase10should_runEv(ptr noundef nonnull align 8 dereferenceable(112) %6)
  br i1 %7, label %8, label %.loopexit

8:                                                ; preds = %.lr.ph23
  %9 = tail call noundef i32 @_ZNK7testing8TestCase17failed_test_countEv(ptr noundef nonnull align 8 dereferenceable(112) %6)
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %8
  %11 = tail call noundef i32 @_ZNK7testing8TestCase16total_test_countEv(ptr noundef nonnull align 8 dereferenceable(112) %6)
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %23
  %.021 = phi i32 [ %24, %23 ], [ 0, %.preheader ]
  %13 = tail call noundef ptr @_ZNK7testing8TestCase11GetTestInfoEi(ptr noundef nonnull align 8 dereferenceable(112) %6, i32 noundef %.021)
  %14 = tail call noundef zeroext i1 @_ZNK7testing8TestInfo10should_runEv(ptr noundef nonnull align 8 dereferenceable(216) %13)
  br i1 %14, label %15, label %23

15:                                               ; preds = %.lr.ph
  %16 = tail call noundef ptr @_ZNK7testing8TestInfo6resultEv(ptr noundef nonnull align 8 dereferenceable(216) %13)
  %17 = tail call noundef zeroext i1 @_ZNK7testing10TestResult6PassedEv(ptr noundef nonnull align 8 dereferenceable(112) %16)
  br i1 %17, label %23, label %18

18:                                               ; preds = %15
  tail call void (i32, ptr, ...) @_ZN7testing8internal13ColoredPrintfENS0_10GTestColorEPKcz(i32 noundef 1, ptr noundef nonnull @.str.156)
  %19 = tail call noundef ptr @_ZNK7testing8TestCase4nameEv(ptr noundef nonnull align 8 dereferenceable(112) %6)
  %20 = tail call noundef ptr @_ZNK7testing8TestInfo4nameEv(ptr noundef nonnull align 8 dereferenceable(216) %13)
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.37, ptr noundef %19, ptr noundef %20)
  tail call void @_ZN7testing8internal29PrintFullTestCommentIfPresentERKNS_8TestInfoE(ptr noundef nonnull align 8 dereferenceable(216) %13)
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.42)
  br label %23

23:                                               ; preds = %.lr.ph, %15, %18
  %24 = add nuw nsw i32 %.021, 1
  %25 = tail call noundef i32 @_ZNK7testing8TestCase16total_test_countEv(ptr noundef nonnull align 8 dereferenceable(112) %6)
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %.lr.ph, label %.loopexit, !llvm.loop !5

.loopexit:                                        ; preds = %23, %.preheader, %.lr.ph23, %8
  %27 = add nuw nsw i32 %.01822, 1
  %28 = tail call noundef i32 @_ZNK7testing8UnitTest21total_test_case_countEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %.lr.ph23, label %.loopexit20, !llvm.loop !7

.loopexit20:                                      ; preds = %.loopexit, %.preheader19, %1
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7testing8UnitTest11GetTestCaseEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) local_unnamed_addr #0 align 2

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


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