; LLVM IR from QAQdev/mini-sql-engine :: thirdparty/googletest/src (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.160 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [7 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 zeroext i1 @_ZNK7testing10TestResult6FailedEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal27PrettyUnitTestResultPrinter21PrintFailedTestSuitesERKNS_8UnitTestE(ptr noundef nonnull align 8 dereferenceable(72) %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
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %7

7:                                                ; preds = %34, %1
  %8 = load i32, ptr %4, align 4, !tbaa !9
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = call noundef i32 @_ZNK7testing8UnitTest22total_test_suite_countEv(ptr noundef nonnull align 8 dereferenceable(72) %9)
  %11 = icmp slt i32 %8, %10
  br i1 %11, label %13, label %12

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

13:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = load i32, ptr %4, align 4, !tbaa !9
  %16 = call noundef ptr @_ZNK7testing8UnitTest12GetTestSuiteEi(ptr noundef nonnull align 8 dereferenceable(72) %14, i32 noundef %15)
  store ptr %16, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call noundef zeroext i1 @_ZNK7testing9TestSuite10should_runEv(ptr noundef nonnull align 8 dereferenceable(264) %17)
  br i1 %18, label %20, label %19

19:                                               ; preds = %13
  store i32 4, ptr %5, align 4
  br label %31

20:                                               ; preds = %13
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZNK7testing9TestSuite18ad_hoc_test_resultEv(ptr noundef nonnull align 8 dereferenceable(264) %21)
  %23 = call noundef zeroext i1 @_ZNK7testing10TestResult6FailedEv(ptr noundef nonnull align 8 dereferenceable(128) %22)
  br i1 %23, label %24, label %30

24:                                               ; preds = %20
  call void (i32, ptr, ...) @_ZN7testing8internalL13ColoredPrintfENS0_12_GLOBAL__N_110GTestColorEPKcz(i32 noundef 1, ptr noundef @.str.160)
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef ptr @_ZNK7testing9TestSuite4nameEv(ptr noundef nonnull align 8 dereferenceable(264) %25)
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.169, ptr noundef %26)
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %24, %20
  store i32 0, ptr %5, align 4
  br label %31

31:                                               ; preds = %30, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %32 = load i32, ptr %5, align 4
  switch i32 %32, label %48 [
    i32 0, label %33
    i32 4, label %34
  ]

33:                                               ; preds = %31
  br label %34

34:                                               ; preds = %33, %31
  %35 = load i32, ptr %4, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %4, align 4, !tbaa !9
  br label %7, !llvm.loop !11

37:                                               ; preds = %12
  %38 = load i32, ptr %3, align 4, !tbaa !9
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %40, label %47

40:                                               ; preds = %37
  %41 = load i32, ptr %3, align 4, !tbaa !9
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 1
  %44 = zext i1 %43 to i64
  %45 = select i1 %43, ptr @.str.171, ptr @.str.172
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.170, i32 noundef %41, ptr noundef %45)
  br label %47

47:                                               ; preds = %40, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void

48:                                               ; preds = %31
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(128) ptr @_ZNK7testing9TestSuite18ad_hoc_test_resultEv(ptr noundef nonnull align 8 dereferenceable(264)) #3 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 = { "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 = { 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 #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"}


; 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.160 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal27PrettyUnitTestResultPrinter21PrintFailedTestSuitesERKNS_8UnitTestE(ptr noundef nonnull align 8 dereferenceable(72) %0) local_unnamed_addr #0 align 2 {
  %2 = tail call noundef i32 @_ZNK7testing8UnitTest22total_test_suite_countEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %14
  %4 = icmp sgt i32 %.2, 0
  br i1 %4, label %18, label %._crit_edge.thread

.lr.ph:                                           ; preds = %1, %14
  %.013 = phi i32 [ %.2, %14 ], [ 0, %1 ]
  %.01112 = phi i32 [ %15, %14 ], [ 0, %1 ]
  %5 = tail call noundef ptr @_ZNK7testing8UnitTest12GetTestSuiteEi(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %.01112)
  %6 = tail call noundef zeroext i1 @_ZNK7testing9TestSuite10should_runEv(ptr noundef nonnull align 8 dereferenceable(264) %5)
  br i1 %6, label %7, label %14

7:                                                ; preds = %.lr.ph
  %8 = tail call noundef nonnull align 8 dereferenceable(128) ptr @_ZNK7testing9TestSuite18ad_hoc_test_resultEv(ptr noundef nonnull align 8 dereferenceable(264) %5)
  %9 = tail call noundef zeroext i1 @_ZNK7testing10TestResult6FailedEv(ptr noundef nonnull align 8 dereferenceable(128) %8)
  br i1 %9, label %10, label %14

10:                                               ; preds = %7
  tail call void (i32, ptr, ...) @_ZN7testing8internalL13ColoredPrintfENS0_12_GLOBAL__N_110GTestColorEPKcz(i32 noundef 1, ptr noundef nonnull @.str.160)
  %11 = tail call noundef ptr @_ZNK7testing9TestSuite4nameEv(ptr noundef nonnull align 8 dereferenceable(264) %5)
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.169, ptr noundef %11)
  %13 = add nsw i32 %.013, 1
  br label %14

14:                                               ; preds = %7, %10, %.lr.ph
  %.2 = phi i32 [ %.013, %.lr.ph ], [ %13, %10 ], [ %.013, %7 ]
  %15 = add nuw nsw i32 %.01112, 1
  %16 = tail call noundef i32 @_ZNK7testing8UnitTest22total_test_suite_countEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %.lr.ph, label %._crit_edge, !llvm.loop !5

18:                                               ; preds = %._crit_edge
  %19 = icmp eq i32 %.2, 1
  %20 = select i1 %19, ptr @.str.171, ptr @.str.172
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.170, i32 noundef %.2, ptr noundef nonnull %20)
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %1, %18, %._crit_edge
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(128) ptr @_ZNK7testing9TestSuite18ad_hoc_test_resultEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #2 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 = { 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" }
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" }

!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"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass