; 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.95 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.159 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [6 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 @_ZNK7testing9TestSuite18skipped_test_countEv(ptr noundef nonnull align 8 dereferenceable(264)) #1 align 2

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

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

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

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

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

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

; 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)) #2 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)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal27PrettyUnitTestResultPrinter17PrintSkippedTestsERKNS_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
  %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 @_ZNK7testing8UnitTest18skipped_test_countEv(ptr noundef nonnull align 8 dereferenceable(72) %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 %71

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 = %67, %14
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = call noundef i32 @_ZNK7testing8UnitTest22total_test_suite_countEv(ptr noundef nonnull align 8 dereferenceable(72) %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 %70

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 @_ZNK7testing8UnitTest12GetTestSuiteEi(ptr noundef nonnull align 8 dereferenceable(72) %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 @_ZNK7testing9TestSuite10should_runEv(ptr noundef nonnull align 8 dereferenceable(264) %25)
  br i1 %26, label %27, label %31

27:                                               ; preds = %21
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call noundef i32 @_ZNK7testing9TestSuite18skipped_test_countEv(ptr noundef nonnull align 8 dereferenceable(264) %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 %64

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 = %60, %32
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call noundef i32 @_ZNK7testing9TestSuite16total_test_countEv(ptr noundef nonnull align 8 dereferenceable(264) %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 %63

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 @_ZNK7testing9TestSuite11GetTestInfoEi(ptr noundef nonnull align 8 dereferenceable(264) %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(272) %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(272) %46)
  %48 = call noundef zeroext i1 @_ZNK7testing10TestResult7SkippedEv(ptr noundef nonnull align 8 dereferenceable(128) %47)
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  call void (i32, ptr, ...) @_ZN7testing8internalL13ColoredPrintfENS0_12_GLOBAL__N_110GTestColorEPKcz(i32 noundef 2, ptr noundef @.str.159)
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = call noundef ptr @_ZNK7testing9TestSuite4nameEv(ptr noundef nonnull align 8 dereferenceable(264) %51)
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = call noundef ptr @_ZNK7testing8TestInfo4nameEv(ptr noundef nonnull align 8 dereferenceable(272) %53)
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.165, ptr noundef %52, ptr noundef %54)
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.95)
  store i32 0, ptr %4, align 4
  br label %57

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

59:                                               ; preds = %57
  br label %60

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

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

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

66:                                               ; preds = %64
  br label %67

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

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

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

73:                                               ; preds = %71, %71
  ret void

74:                                               ; preds = %71, %64, %57
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7testing8UnitTest18skipped_test_countEv(ptr noundef nonnull align 8 dereferenceable(72)) #1 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.95 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.159 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

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

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

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

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

; 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 #1 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 #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal27PrettyUnitTestResultPrinter17PrintSkippedTestsERKNS_8UnitTestE(ptr noundef nonnull align 8 dereferenceable(72) %0) local_unnamed_addr #0 align 2 {
  %2 = tail call noundef i32 @_ZNK7testing8UnitTest18skipped_test_countEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %3 = icmp eq i32 %2, 0
  br i1 %3, label %.loopexit19, label %.preheader18

.preheader18:                                     ; preds = %1
  %4 = tail call noundef i32 @_ZNK7testing8UnitTest22total_test_suite_countEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph22, label %.loopexit19

.lr.ph22:                                         ; preds = %.preheader18, %.loopexit
  %.01721 = phi i32 [ %27, %.loopexit ], [ 0, %.preheader18 ]
  %6 = tail call noundef ptr @_ZNK7testing8UnitTest12GetTestSuiteEi(ptr noundef nonnull align 8 dereferenceable(72) %0, i32 noundef %.01721)
  %7 = tail call noundef zeroext i1 @_ZNK7testing9TestSuite10should_runEv(ptr noundef nonnull align 8 dereferenceable(264) %6)
  br i1 %7, label %8, label %.loopexit

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

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

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

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

18:                                               ; preds = %15
  tail call void (i32, ptr, ...) @_ZN7testing8internalL13ColoredPrintfENS0_12_GLOBAL__N_110GTestColorEPKcz(i32 noundef 2, ptr noundef nonnull @.str.159)
  %19 = tail call noundef ptr @_ZNK7testing9TestSuite4nameEv(ptr noundef nonnull align 8 dereferenceable(264) %6)
  %20 = tail call noundef ptr @_ZNK7testing8TestInfo4nameEv(ptr noundef nonnull align 8 dereferenceable(272) %13)
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.165, ptr noundef %19, ptr noundef %20)
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.95)
  br label %23

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

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

.loopexit19:                                      ; preds = %.loopexit, %.preheader18, %1
  ret void
}

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