; LLVM IR from zsiciarz/aquila :: tests/functions.ll (ZNK14SuiteFunctions21TestRandomDoubleRange7RunImplEv)

; 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.UnitTest::TestDetails" = type <{ ptr, ptr, ptr, i32, i8, [3 x i8] }>
%"class.UnitTest::MemoryOutStream" = type { %"class.std::__cxx11::basic_ostringstream.base", %"class.std::__cxx11::basic_string", %"class.std::basic_ios" }
%"class.std::__cxx11::basic_ostringstream.base" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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] }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }

@_ZTISt9exception = external constant ptr
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [20 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

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) #0

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7ResultsEv() #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7DetailsEv() #1

declare void @_ZN8UnitTest11TestDetailsC1ERKS0_i(ptr noundef nonnull align 8 dereferenceable(29), ptr noundef nonnull align 8 dereferenceable(29), i32 noundef) unnamed_addr #1

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #2

declare ptr @__cxa_begin_catch(ptr)

declare void @_ZN8UnitTest11TestResults13OnTestFailureERKNS_11TestDetailsEPKc(ptr noundef nonnull align 8 dereferenceable(21), ptr noundef nonnull align 8 dereferenceable(29), ptr noundef) #1

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8UnitTest15MemoryOutStreamC1Ev(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

declare noundef ptr @_ZNK8UnitTest15MemoryOutStream7GetTextEv(ptr noundef nonnull align 8 dereferenceable(144)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8UnitTest15MemoryOutStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK14SuiteFunctions21TestRandomDoubleRange7RunImplEv(ptr noundef nonnull align 8 dereferenceable(49) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca double, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.UnitTest::TestDetails", align 8
  %8 = alloca %"class.UnitTest::TestDetails", align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.UnitTest::MemoryOutStream", align 8
  %11 = alloca %"class.UnitTest::TestDetails", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %13

13:                                               ; preds = %73, %1
  %14 = load i64, ptr %3, align 8, !tbaa !9
  %15 = icmp ult i64 %14, 1000
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %114

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %18 = call noundef double @_ZN6Aquila12randomDoubleEv()
  store double %18, ptr %4, align 8, !tbaa !11
  br label %19

19:                                               ; preds = %17
  %20 = load double, ptr %4, align 8, !tbaa !11
  %21 = fcmp olt double %20, 1.000000e+00
  %22 = invoke noundef zeroext i1 @_ZN8UnitTest5CheckIbEEbT_(i1 noundef zeroext %21)
          to label %23 unwind label %33

23:                                               ; preds = %19
  br i1 %22, label %87, label %24

24:                                               ; preds = %23
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7ResultsEv()
          to label %26 unwind label %33

26:                                               ; preds = %24
  %27 = load ptr, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #8
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7DetailsEv()
          to label %29 unwind label %37

29:                                               ; preds = %26
  %30 = load ptr, ptr %28, align 8, !tbaa !5
  invoke void @_ZN8UnitTest11TestDetailsC1ERKS0_i(ptr noundef nonnull align 8 dereferenceable(29) %7, ptr noundef nonnull align 8 dereferenceable(29) %30, i32 noundef 65)
          to label %31 unwind label %37

31:                                               ; preds = %29
  invoke void @_ZN8UnitTest11TestResults13OnTestFailureERKNS_11TestDetailsEPKc(ptr noundef nonnull align 8 dereferenceable(21) %27, ptr noundef nonnull align 8 dereferenceable(29) %7, ptr noundef @.str.30)
          to label %32 unwind label %37

32:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #8
  br label %87

33:                                               ; preds = %24, %19
  %34 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %5, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %6, align 4
  br label %41

37:                                               ; preds = %31, %29, %26
  %38 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #8
  br label %41

41:                                               ; preds = %37, %33
  %42 = load i32, ptr %6, align 4
  %43 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #8
  %44 = icmp eq i32 %42, %43
  br i1 %44, label %45, label %76

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %46 = load ptr, ptr %5, align 8
  %47 = call ptr @__cxa_begin_catch(ptr %46) #8
  store ptr %47, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 408, ptr %10) #8
  invoke void @_ZN8UnitTest15MemoryOutStreamC1Ev(ptr noundef nonnull align 8 dereferenceable(144) %10)
          to label %48 unwind label %98

48:                                               ; preds = %45
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef @.str.4)
          to label %50 unwind label %102

50:                                               ; preds = %48
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = getelementptr inbounds ptr, ptr %52, i64 2
  %54 = load ptr, ptr %53, align 8
  %55 = call noundef ptr %54(ptr noundef nonnull align 8 dereferenceable(8) %51) #8
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef %55)
          to label %57 unwind label %102

57:                                               ; preds = %50
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef @.str.32)
          to label %59 unwind label %102

59:                                               ; preds = %57
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7ResultsEv()
          to label %61 unwind label %102

61:                                               ; preds = %59
  %62 = load ptr, ptr %60, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #8
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7DetailsEv()
          to label %64 unwind label %106

64:                                               ; preds = %61
  %65 = load ptr, ptr %63, align 8, !tbaa !5
  invoke void @_ZN8UnitTest11TestDetailsC1ERKS0_i(ptr noundef nonnull align 8 dereferenceable(29) %11, ptr noundef nonnull align 8 dereferenceable(29) %65, i32 noundef 65)
          to label %66 unwind label %106

66:                                               ; preds = %64
  %67 = invoke noundef ptr @_ZNK8UnitTest15MemoryOutStream7GetTextEv(ptr noundef nonnull align 8 dereferenceable(144) %10)
          to label %68 unwind label %106

68:                                               ; preds = %66
  invoke void @_ZN8UnitTest11TestResults13OnTestFailureERKNS_11TestDetailsEPKc(ptr noundef nonnull align 8 dereferenceable(21) %62, ptr noundef nonnull align 8 dereferenceable(29) %11, ptr noundef %67)
          to label %69 unwind label %106

69:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #8
  call void @_ZN8UnitTest15MemoryOutStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(144) %10) #8
  call void @llvm.lifetime.end.p0(i64 408, ptr %10) #8
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %70

70:                                               ; preds = %87, %86, %69
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %73

73:                                               ; preds = %72
  %74 = load i64, ptr %3, align 8, !tbaa !9
  %75 = add i64 %74, 1
  store i64 %75, ptr %3, align 8, !tbaa !9
  br label %13, !llvm.loop !15

76:                                               ; preds = %41
  %77 = load ptr, ptr %5, align 8
  %78 = call ptr @__cxa_begin_catch(ptr %77) #8
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7ResultsEv()
          to label %80 unwind label %88

80:                                               ; preds = %76
  %81 = load ptr, ptr %79, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #8
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7DetailsEv()
          to label %83 unwind label %92

83:                                               ; preds = %80
  %84 = load ptr, ptr %82, align 8, !tbaa !5
  invoke void @_ZN8UnitTest11TestDetailsC1ERKS0_i(ptr noundef nonnull align 8 dereferenceable(29) %8, ptr noundef nonnull align 8 dereferenceable(29) %84, i32 noundef 65)
          to label %85 unwind label %92

85:                                               ; preds = %83
  invoke void @_ZN8UnitTest11TestResults13OnTestFailureERKNS_11TestDetailsEPKc(ptr noundef nonnull align 8 dereferenceable(21) %81, ptr noundef nonnull align 8 dereferenceable(29) %8, ptr noundef @.str.31)
          to label %86 unwind label %92

86:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #8
  call void @__cxa_end_catch()
  br label %70

87:                                               ; preds = %32, %23
  br label %70

88:                                               ; preds = %76
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %5, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %6, align 4
  br label %96

92:                                               ; preds = %85, %83, %80
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %5, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #8
  br label %96

96:                                               ; preds = %92, %88
  invoke void @__cxa_end_catch()
          to label %97 unwind label %120

97:                                               ; preds = %96
  br label %113

98:                                               ; preds = %45
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %5, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %6, align 4
  br label %111

102:                                              ; preds = %59, %57, %50, %48
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %5, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %6, align 4
  br label %110

106:                                              ; preds = %68, %66, %64, %61
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %5, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #8
  br label %110

110:                                              ; preds = %106, %102
  call void @_ZN8UnitTest15MemoryOutStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(144) %10) #8
  br label %111

111:                                              ; preds = %110, %98
  call void @llvm.lifetime.end.p0(i64 408, ptr %10) #8
  invoke void @__cxa_end_catch()
          to label %112 unwind label %120

112:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %113

113:                                              ; preds = %112, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %115

114:                                              ; preds = %16
  ret void

115:                                              ; preds = %113
  %116 = load ptr, ptr %5, align 8
  %117 = load i32, ptr %6, align 4
  %118 = insertvalue { ptr, i32 } poison, ptr %116, 0
  %119 = insertvalue { ptr, i32 } %118, i32 %117, 1
  resume { ptr, i32 } %119

120:                                              ; preds = %111, %96
  %121 = landingpad { ptr, i32 }
          catch ptr null
  %122 = extractvalue { ptr, i32 } %121, 0
  call void @__clang_call_terminate(ptr %122) #9
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN6Aquila12randomDoubleEv() #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8UnitTest5CheckIbEEbT_(i1 noundef zeroext) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 memory(none) }
attributes #3 = { noinline noreturn nounwind uwtable "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 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 #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 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 #7 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { noreturn 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, 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.UnitTest::TestDetails" = type <{ ptr, ptr, ptr, i32, i8, [3 x i8] }>
%"class.UnitTest::MemoryOutStream" = type { %"class.std::__cxx11::basic_ostringstream.base", %"class.std::__cxx11::basic_string", %"class.std::basic_ios" }
%"class.std::__cxx11::basic_ostringstream.base" = type { %"class.std::basic_ostream.base", %"class.std::__cxx11::basic_stringbuf" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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] }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }

@_ZTISt9exception = external constant ptr
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [20 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

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) #0

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7ResultsEv() local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7DetailsEv() local_unnamed_addr #1

declare void @_ZN8UnitTest11TestDetailsC1ERKS0_i(ptr noundef nonnull align 8 dereferenceable(29), ptr noundef nonnull align 8 dereferenceable(29), i32 noundef) unnamed_addr #1

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #2

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @_ZN8UnitTest11TestResults13OnTestFailureERKNS_11TestDetailsEPKc(ptr noundef nonnull align 8 dereferenceable(21), ptr noundef nonnull align 8 dereferenceable(29), ptr noundef) local_unnamed_addr #1

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8UnitTest15MemoryOutStreamC1Ev(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

declare noundef ptr @_ZNK8UnitTest15MemoryOutStream7GetTextEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8UnitTest15MemoryOutStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK14SuiteFunctions21TestRandomDoubleRange7RunImplEv(ptr nocapture noundef nonnull readnone align 8 dereferenceable(49) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.UnitTest::TestDetails", align 8
  %3 = alloca %"class.UnitTest::TestDetails", align 8
  %4 = alloca %"class.UnitTest::MemoryOutStream", align 8
  %5 = alloca %"class.UnitTest::TestDetails", align 8
  br label %7

6:                                                ; preds = %50
  ret void

7:                                                ; preds = %1, %50
  %.022 = phi i64 [ 0, %1 ], [ %51, %50 ]
  %8 = call noundef double @_ZN6Aquila12randomDoubleEv()
  %9 = fcmp olt double %8, 1.000000e+00
  %10 = call noundef zeroext i1 @_ZN8UnitTest5CheckIbEEbT_(i1 noundef zeroext %9)
  br i1 %10, label %50, label %11

11:                                               ; preds = %7
  %12 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7ResultsEv()
          to label %13 unwind label %20

13:                                               ; preds = %11
  %14 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #8
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7DetailsEv()
          to label %16 unwind label %22

16:                                               ; preds = %13
  %17 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZN8UnitTest11TestDetailsC1ERKS0_i(ptr noundef nonnull align 8 dereferenceable(29) %2, ptr noundef nonnull align 8 dereferenceable(29) %17, i32 noundef 65)
          to label %18 unwind label %22

18:                                               ; preds = %16
  invoke void @_ZN8UnitTest11TestResults13OnTestFailureERKNS_11TestDetailsEPKc(ptr noundef nonnull align 8 dereferenceable(21) %14, ptr noundef nonnull align 8 dereferenceable(29) %2, ptr noundef nonnull @.str.30)
          to label %19 unwind label %22

19:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  br label %50

20:                                               ; preds = %11
  %21 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  br label %24

22:                                               ; preds = %18, %16, %13
  %23 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9exception
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  br label %24

24:                                               ; preds = %22, %20
  %.pn = phi { ptr, i32 } [ %23, %22 ], [ %21, %20 ]
  %.09 = extractvalue { ptr, i32 } %.pn, 1
  %.010 = extractvalue { ptr, i32 } %.pn, 0
  %25 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #8
  %26 = icmp eq i32 %.09, %25
  %27 = call ptr @__cxa_begin_catch(ptr %.010) #8
  br i1 %26, label %28, label %52

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %4) #8
  invoke void @_ZN8UnitTest15MemoryOutStreamC1Ev(ptr noundef nonnull align 8 dereferenceable(144) %4)
          to label %29 unwind label %66

29:                                               ; preds = %28
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull @.str.4)
          to label %31 unwind label %68

31:                                               ; preds = %29
  %32 = load ptr, ptr %27, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %34 = load ptr, ptr %33, align 8
  %35 = call noundef ptr %34(ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef %35)
          to label %37 unwind label %68

37:                                               ; preds = %31
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @.str.32)
          to label %39 unwind label %68

39:                                               ; preds = %37
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7ResultsEv()
          to label %41 unwind label %68

41:                                               ; preds = %39
  %42 = load ptr, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7DetailsEv()
          to label %44 unwind label %70

44:                                               ; preds = %41
  %45 = load ptr, ptr %43, align 8, !tbaa !5
  invoke void @_ZN8UnitTest11TestDetailsC1ERKS0_i(ptr noundef nonnull align 8 dereferenceable(29) %5, ptr noundef nonnull align 8 dereferenceable(29) %45, i32 noundef 65)
          to label %46 unwind label %70

46:                                               ; preds = %44
  %47 = invoke noundef ptr @_ZNK8UnitTest15MemoryOutStream7GetTextEv(ptr noundef nonnull align 8 dereferenceable(144) %4)
          to label %48 unwind label %70

48:                                               ; preds = %46
  invoke void @_ZN8UnitTest11TestResults13OnTestFailureERKNS_11TestDetailsEPKc(ptr noundef nonnull align 8 dereferenceable(21) %42, ptr noundef nonnull align 8 dereferenceable(29) %5, ptr noundef %47)
          to label %49 unwind label %70

49:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  call void @_ZN8UnitTest15MemoryOutStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(144) %4) #8
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %4) #8
  call void @__cxa_end_catch()
  br label %50

50:                                               ; preds = %7, %19, %60, %49
  %51 = add nuw nsw i64 %.022, 1
  %exitcond.not = icmp eq i64 %51, 1000
  br i1 %exitcond.not, label %6, label %7, !llvm.loop !11

52:                                               ; preds = %24
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7ResultsEv()
          to label %54 unwind label %61

54:                                               ; preds = %52
  %55 = load ptr, ptr %53, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #8
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8UnitTest11CurrentTest7DetailsEv()
          to label %57 unwind label %63

57:                                               ; preds = %54
  %58 = load ptr, ptr %56, align 8, !tbaa !5
  invoke void @_ZN8UnitTest11TestDetailsC1ERKS0_i(ptr noundef nonnull align 8 dereferenceable(29) %3, ptr noundef nonnull align 8 dereferenceable(29) %58, i32 noundef 65)
          to label %59 unwind label %63

59:                                               ; preds = %57
  invoke void @_ZN8UnitTest11TestResults13OnTestFailureERKNS_11TestDetailsEPKc(ptr noundef nonnull align 8 dereferenceable(21) %55, ptr noundef nonnull align 8 dereferenceable(29) %3, ptr noundef nonnull @.str.31)
          to label %60 unwind label %63

60:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  call void @__cxa_end_catch()
  br label %50

61:                                               ; preds = %52
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %65

63:                                               ; preds = %59, %57, %54
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  br label %65

65:                                               ; preds = %63, %61
  %.pn16 = phi { ptr, i32 } [ %64, %63 ], [ %62, %61 ]
  invoke void @__cxa_end_catch()
          to label %74 unwind label %75

66:                                               ; preds = %28
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %73

68:                                               ; preds = %39, %37, %31, %29
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %72

70:                                               ; preds = %48, %46, %44, %41
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %72

72:                                               ; preds = %70, %68
  %.pn18 = phi { ptr, i32 } [ %71, %70 ], [ %69, %68 ]
  call void @_ZN8UnitTest15MemoryOutStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(144) %4) #8
  br label %73

73:                                               ; preds = %72, %66
  %.pn18.pn = phi { ptr, i32 } [ %.pn18, %72 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %4) #8
  invoke void @__cxa_end_catch()
          to label %74 unwind label %75

74:                                               ; preds = %73, %65
  %.pn18.pn.pn = phi { ptr, i32 } [ %.pn16, %65 ], [ %.pn18.pn, %73 ]
  resume { ptr, i32 } %.pn18.pn.pn

75:                                               ; preds = %73, %65
  %76 = landingpad { ptr, i32 }
          catch ptr null
  %77 = extractvalue { ptr, i32 } %76, 0
  call void @__clang_call_terminate(ptr %77) #9
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN6Aquila12randomDoubleEv() local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8UnitTest5CheckIbEEbT_(i1 noundef zeroext) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 nosync nounwind memory(none) }
attributes #3 = { noinline noreturn nounwind uwtable "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 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 #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 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 #7 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { noreturn 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 = !{!"vtable pointer", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass