; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/test/test_tbb_fork.ll (Z21TestSchedulerMemLeaksv)

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

%"struct.std::nothrow_t" = type { i8 }
%"class.tbb::task_scheduler_init" = type { ptr }
%"class.tbb::internal::allocate_root_proxy" = type { i8 }

@.str.19 = external hidden unnamed_addr constant [89 x i8], align 1
@_ZSt7nothrow = external global %"struct.std::nothrow_t", align 1
@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [52 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 void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i64 noundef) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z21TestSchedulerMemLeaksv() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.tbb::task_scheduler_init", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  %13 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 10, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %78, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 10
  br i1 %16, label %17, label %81

17:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %18 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  store i64 %18, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %61, %17
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = icmp slt i32 %20, 100
  br i1 %21, label %23, label %22

22:                                               ; preds = %19
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %69

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 1, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %35, %23
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = icmp slt i32 %25, 10
  br i1 %26, label %28, label %27

27:                                               ; preds = %24
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %52

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  invoke void @_ZN3tbb4task13allocate_rootEv()
          to label %29 unwind label %38

29:                                               ; preds = %28
  %30 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %31 unwind label %38

31:                                               ; preds = %29
  call void @llvm.memset.p0.i64(ptr align 8 %30, i8 0, i64 8, i1 false)
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %32 unwind label %42

32:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  store ptr %30, ptr %8, align 8, !tbaa !11
  %33 = load ptr, ptr %8, align 8, !tbaa !11
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %34 unwind label %47

34:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %35

35:                                               ; preds = %34
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %7, align 4, !tbaa !5
  br label %24, !llvm.loop !13

38:                                               ; preds = %29, %28
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %10, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %11, align 4
  br label %46

42:                                               ; preds = %31
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  call void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef %30, ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  br label %46

46:                                               ; preds = %42, %38
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  br label %51

47:                                               ; preds = %32
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %10, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %11, align 4
  br label %51

51:                                               ; preds = %47, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %68

52:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  %53 = call noundef zeroext i1 @_ZN3tbb19task_scheduler_init18blocking_terminateERKSt9nothrow_t(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #6
  %54 = zext i1 %53 to i8
  store i8 %54, ptr %13, align 1, !tbaa !15
  %55 = load i8, ptr %13, align 1, !tbaa !15, !range !17, !noundef !18
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %58

57:                                               ; preds = %52
  br label %60

58:                                               ; preds = %52
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.19, i32 noundef 180, ptr noundef @.str.21, ptr noundef null)
          to label %59 unwind label %64

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59, %57
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %4, align 4, !tbaa !5
  br label %19, !llvm.loop !19

64:                                               ; preds = %58
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %10, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %68

68:                                               ; preds = %64, %51
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %87

69:                                               ; preds = %22
  %70 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %71 = load i64, ptr %3, align 8, !tbaa !9
  %72 = icmp ule i64 %70, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %69
  store i32 2, ptr %5, align 4
  br label %75

74:                                               ; preds = %69
  store i32 0, ptr %5, align 4
  br label %75

75:                                               ; preds = %74, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %76 = load i32, ptr %5, align 4
  switch i32 %76, label %92 [
    i32 0, label %77
    i32 2, label %81
  ]

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !20

81:                                               ; preds = %75, %14
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = icmp slt i32 %82, 10
  br i1 %83, label %84, label %85

84:                                               ; preds = %81
  br label %86

85:                                               ; preds = %81
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.19, i32 noundef 190, ptr noundef @.str.34, ptr noundef @.str.35)
  br label %86

86:                                               ; preds = %85, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void

87:                                               ; preds = %68
  %88 = load ptr, ptr %10, align 8
  %89 = load i32, ptr %11, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91

92:                                               ; preds = %75
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb4task13allocate_rootEv() #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { 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 #6 = { 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 = !{!"int", !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 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


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

%"struct.std::nothrow_t" = type { i8 }
%"class.tbb::task_scheduler_init" = type { ptr }
%"class.tbb::internal::allocate_root_proxy" = type { i8 }

@.str.19 = external hidden unnamed_addr constant [89 x i8], align 1
@_ZSt7nothrow = external global %"struct.std::nothrow_t", align 1
@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [52 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 uwtable
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i64 noundef) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z21TestSchedulerMemLeaksv() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.tbb::task_scheduler_init", align 8
  %2 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  br label %5

3:                                                ; preds = %7
  %4 = add nuw nsw i32 %.026, 1
  %exitcond29.not = icmp eq i32 %4, 10
  br i1 %exitcond29.not, label %.critedge, label %5, !llvm.loop !5

5:                                                ; preds = %0, %3
  %.026 = phi i32 [ 0, %0 ], [ %4, %3 ]
  %6 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  br label %9

7:                                                ; preds = %59
  %8 = call noundef i64 @_Z14GetMemoryUsage14MemoryStatType(i32 noundef 0)
  %.not = icmp ugt i64 %8, %6
  br i1 %.not, label %3, label %.loopexit

9:                                                ; preds = %5, %59
  %.01625 = phi i32 [ 0, %5 ], [ %60, %59 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 1, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %10 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %11 unwind label %51

11:                                               ; preds = %9
  store i64 0, ptr %10, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %12 unwind label %53

12:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %13 unwind label %56

13:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %14 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %15 unwind label %51

15:                                               ; preds = %13
  store i64 0, ptr %14, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %16 unwind label %53

16:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %17 unwind label %56

17:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %18 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %19 unwind label %51

19:                                               ; preds = %17
  store i64 0, ptr %18, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %20 unwind label %53

20:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %21 unwind label %56

21:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %22 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %23 unwind label %51

23:                                               ; preds = %21
  store i64 0, ptr %22, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %24 unwind label %53

24:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %25 unwind label %56

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %26 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %27 unwind label %51

27:                                               ; preds = %25
  store i64 0, ptr %26, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %28 unwind label %53

28:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %29 unwind label %56

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %30 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %31 unwind label %51

31:                                               ; preds = %29
  store i64 0, ptr %30, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %32 unwind label %53

32:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %33 unwind label %56

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %34 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %35 unwind label %51

35:                                               ; preds = %33
  store i64 0, ptr %34, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %34)
          to label %36 unwind label %53

36:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %34)
          to label %37 unwind label %56

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %38 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %39 unwind label %51

39:                                               ; preds = %37
  store i64 0, ptr %38, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %40 unwind label %53

40:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %41 unwind label %56

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %42 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %43 unwind label %51

43:                                               ; preds = %41
  store i64 0, ptr %42, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %42)
          to label %44 unwind label %53

44:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %42)
          to label %45 unwind label %56

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN3tbb4task13allocate_rootEv()
  %46 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %47 unwind label %51

47:                                               ; preds = %45
  store i64 0, ptr %46, align 8
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %46)
          to label %48 unwind label %53

48:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  invoke void @_ZN3tbb4task7enqueueERS0_(ptr noundef nonnull align 8 dereferenceable(8) %46)
          to label %49 unwind label %56

49:                                               ; preds = %48
  %50 = call noundef zeroext i1 @_ZN3tbb19task_scheduler_init18blocking_terminateERKSt9nothrow_t(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #5
  br i1 %50, label %59, label %58

51:                                               ; preds = %45, %41, %37, %33, %29, %25, %21, %17, %13, %9
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %55

53:                                               ; preds = %47, %43, %39, %35, %31, %27, %23, %19, %15, %11
  %.lcssa = phi ptr [ %10, %11 ], [ %14, %15 ], [ %18, %19 ], [ %22, %23 ], [ %26, %27 ], [ %30, %31 ], [ %34, %35 ], [ %38, %39 ], [ %42, %43 ], [ %46, %47 ]
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef nonnull %.lcssa, ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  br label %55

55:                                               ; preds = %53, %51
  %.pn = phi { ptr, i32 } [ %54, %53 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  br label %63

56:                                               ; preds = %48, %44, %40, %36, %32, %28, %24, %20, %16, %12
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %63

58:                                               ; preds = %49
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.19, i32 noundef 180, ptr noundef nonnull @.str.21, ptr noundef null)
          to label %59 unwind label %61

59:                                               ; preds = %58, %49
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %60 = add nuw nsw i32 %.01625, 1
  %exitcond.not = icmp eq i32 %60, 100
  br i1 %exitcond.not, label %7, label %9, !llvm.loop !7

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

63:                                               ; preds = %55, %56, %61
  %.pn20.pn = phi { ptr, i32 } [ %62, %61 ], [ %57, %56 ], [ %.pn, %55 ]
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn20.pn

.critedge:                                        ; preds = %3
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.19, i32 noundef 190, ptr noundef nonnull @.str.34, ptr noundef nonnull @.str.35)
  br label %.loopexit

.loopexit:                                        ; preds = %7, %.critedge
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb4task13allocate_rootEv() local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

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

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


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