; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZN7testing19FLAGS_gtest_shuffleE = external dso_local global i8, align 1
@.str.199 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.200 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.201 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.202 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.203 = external hidden unnamed_addr constant [15 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 nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK7testing8UnitTest12elapsed_timeEv(ptr noundef nonnull align 8 dereferenceable(64)) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal24XmlUnitTestResultPrinter16PrintXmlUnitTestEP8_IO_FILERKNS_8UnitTestE(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(64) %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef @.str.199) #4
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = call noundef i32 @_ZNK7testing8UnitTest16total_test_countEv(ptr noundef nonnull align 8 dereferenceable(64) %10)
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call noundef i32 @_ZNK7testing8UnitTest17failed_test_countEv(ptr noundef nonnull align 8 dereferenceable(64) %12)
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call noundef i32 @_ZNK7testing8UnitTest19disabled_test_countEv(ptr noundef nonnull align 8 dereferenceable(64) %14)
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #4
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef i64 @_ZNK7testing8UnitTest12elapsed_timeEv(ptr noundef nonnull align 8 dereferenceable(64) %16)
  call void @_ZN7testing8internal27FormatTimeInMillisAsSecondsB5cxx11Ex(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %5, i64 noundef %17)
  %18 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef @.str.200, i32 noundef %11, i32 noundef %13, i32 noundef %15, ptr noundef %18) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  %20 = load i8, ptr @_ZN7testing19FLAGS_gtest_shuffleE, align 1, !tbaa !9, !range !11, !noundef !12
  %21 = trunc i8 %20 to i1
  br i1 %21, label %22, label %27

22:                                               ; preds = %2
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call noundef i32 @_ZNK7testing8UnitTest11random_seedEv(ptr noundef nonnull align 8 dereferenceable(64) %24)
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.201, i32 noundef %25) #4
  br label %27

27:                                               ; preds = %22, %2
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.202) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !13
  br label %30

30:                                               ; preds = %41, %27
  %31 = load i32, ptr %6, align 4, !tbaa !13
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = call noundef i32 @_ZNK7testing8UnitTest21total_test_case_countEv(ptr noundef nonnull align 8 dereferenceable(64) %32)
  %34 = icmp slt i32 %31, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %30
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %6, align 4, !tbaa !13
  %40 = call noundef ptr @_ZNK7testing8UnitTest11GetTestCaseEi(ptr noundef nonnull align 8 dereferenceable(64) %38, i32 noundef %39)
  call void @_ZN7testing8internal24XmlUnitTestResultPrinter16PrintXmlTestCaseEP8_IO_FILERKNS_8TestCaseE(ptr noundef %37, ptr noundef nonnull align 8 dereferenceable(112) %40)
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %6, align 4, !tbaa !13
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %6, align 4, !tbaa !13
  br label %30, !llvm.loop !15

44:                                               ; preds = %35
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.203) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal27FormatTimeInMillisAsSecondsB5cxx11Ex(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal24XmlUnitTestResultPrinter16PrintXmlTestCaseEP8_IO_FILERKNS_8TestCaseE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(112)) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 }

!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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"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"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZN7testing19FLAGS_gtest_shuffleE = external dso_local local_unnamed_addr global i8, align 1
@.str.199 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.200 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.201 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.202 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.203 = external hidden unnamed_addr constant [15 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK7testing8UnitTest12elapsed_timeEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal24XmlUnitTestResultPrinter16PrintXmlUnitTestEP8_IO_FILERKNS_8UnitTestE(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(64) %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.199) #4
  %5 = tail call noundef i32 @_ZNK7testing8UnitTest16total_test_countEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %6 = tail call noundef i32 @_ZNK7testing8UnitTest17failed_test_countEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %7 = tail call noundef i32 @_ZNK7testing8UnitTest19disabled_test_countEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  %8 = tail call noundef i64 @_ZNK7testing8UnitTest12elapsed_timeEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  call void @_ZN7testing8internal27FormatTimeInMillisAsSecondsB5cxx11Ex(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, i64 noundef %8)
  %9 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  %10 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.200, i32 noundef %5, i32 noundef %6, i32 noundef %7, ptr noundef %9) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  %11 = load i8, ptr @_ZN7testing19FLAGS_gtest_shuffleE, align 1, !tbaa !5, !range !9, !noundef !10
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %13, label %16

13:                                               ; preds = %2
  %14 = call noundef i32 @_ZNK7testing8UnitTest11random_seedEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %15 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.201, i32 noundef %14) #4
  br label %16

16:                                               ; preds = %13, %2
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.202) #4
  %18 = call noundef i32 @_ZNK7testing8UnitTest21total_test_case_countEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %16
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.203) #4
  ret void

.lr.ph:                                           ; preds = %16, %.lr.ph
  %.015 = phi i32 [ %22, %.lr.ph ], [ 0, %16 ]
  %21 = call noundef ptr @_ZNK7testing8UnitTest11GetTestCaseEi(ptr noundef nonnull align 8 dereferenceable(64) %1, i32 noundef %.015)
  call void @_ZN7testing8internal24XmlUnitTestResultPrinter16PrintXmlTestCaseEP8_IO_FILERKNS_8TestCaseE(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(112) %21)
  %22 = add nuw nsw i32 %.015, 1
  %23 = call noundef i32 @_ZNK7testing8UnitTest21total_test_case_countEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal27FormatTimeInMillisAsSecondsB5cxx11Ex(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing8internal24XmlUnitTestResultPrinter16PrintXmlTestCaseEP8_IO_FILERKNS_8TestCaseE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
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 }

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


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