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

; 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.RunInNativeThread = type { i8, 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.36 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [37 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: mustprogress uwtable
declare dso_local void @_Z15CallParallelForv() #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 uwtable
declare dso_local void @_Z17NativeParallelForIi17RunInNativeThreadEvT_RKT0_(i32 noundef, ptr noundef nonnull align 1 dereferenceable(2)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17RunInNativeThreadC2Ebb(ptr noundef nonnull align 1 dereferenceable(2), i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #2 align 2

; 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)) #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
define dso_local void @_Z14TestNestingTSIv() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.tbb::task_scheduler_init", align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.tbb::task_scheduler_init", align 8
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca %"class.tbb::task_scheduler_init", align 8
  %9 = alloca %class.RunInNativeThread, align 1
  %10 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %57, %0
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 2
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %67

15:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef 2, i64 noundef 0)
  invoke void @_Z15CallParallelForv()
          to label %16 unwind label %23

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  invoke void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 2, i64 noundef 0)
          to label %17 unwind label %27

17:                                               ; preds = %16
  invoke void @_Z15CallParallelForv()
          to label %18 unwind label %31

18:                                               ; preds = %17
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %35

21:                                               ; preds = %18
  invoke void @_ZN3tbb19task_scheduler_init9terminateEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %22 unwind label %31

22:                                               ; preds = %21
  br label %48

23:                                               ; preds = %15
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %3, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %4, align 4
  br label %66

27:                                               ; preds = %16
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %3, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %4, align 4
  br label %65

31:                                               ; preds = %21, %17
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %3, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %4, align 4
  br label %64

35:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #4
  %36 = call noundef zeroext i1 @_ZN3tbb19task_scheduler_init18blocking_terminateERKSt9nothrow_t(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  %37 = zext i1 %36 to i8
  store i8 %37, ptr %6, align 1, !tbaa !9
  %38 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %39 = trunc i8 %38 to i1
  br i1 %39, label %41, label %40

40:                                               ; preds = %35
  br label %43

41:                                               ; preds = %35
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.19, i32 noundef 205, ptr noundef @.str.36, ptr noundef @.str.37)
          to label %42 unwind label %44

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42, %40
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  br label %48

44:                                               ; preds = %41
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %3, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  br label %64

48:                                               ; preds = %43, %22
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #4
  %49 = call noundef zeroext i1 @_ZN3tbb19task_scheduler_init18blocking_terminateERKSt9nothrow_t(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  %50 = zext i1 %49 to i8
  store i8 %50, ptr %7, align 1, !tbaa !9
  %51 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %52 = trunc i8 %51 to i1
  br i1 %52, label %53, label %54

53:                                               ; preds = %48
  br label %56

54:                                               ; preds = %48
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.19, i32 noundef 208, ptr noundef @.str.21, ptr noundef null)
          to label %55 unwind label %60

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55, %53
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %1, align 4, !tbaa !5
  br label %11, !llvm.loop !13

60:                                               ; preds = %54
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %3, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  br label %64

64:                                               ; preds = %60, %44, %31
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  br label %65

65:                                               ; preds = %64, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %66

66:                                               ; preds = %65, %23
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %87

67:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 2, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #4
  invoke void @_ZN17RunInNativeThreadC2Ebb(ptr noundef nonnull align 1 dereferenceable(2) %9, i1 noundef zeroext true, i1 noundef zeroext true)
          to label %68 unwind label %78

68:                                               ; preds = %67
  invoke void @_Z17NativeParallelForIi17RunInNativeThreadEvT_RKT0_(i32 noundef 1, ptr noundef nonnull align 1 dereferenceable(2) %9)
          to label %69 unwind label %78

69:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #4
  %70 = call noundef zeroext i1 @_ZN3tbb19task_scheduler_init18blocking_terminateERKSt9nothrow_t(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  %71 = zext i1 %70 to i8
  store i8 %71, ptr %10, align 1, !tbaa !9
  %72 = load i8, ptr %10, align 1, !tbaa !9, !range !11, !noundef !12
  %73 = trunc i8 %72 to i1
  br i1 %73, label %74, label %75

74:                                               ; preds = %69
  br label %77

75:                                               ; preds = %69
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str.19, i32 noundef 214, ptr noundef @.str.21, ptr noundef null)
          to label %76 unwind label %82

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76, %74
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  ret void

78:                                               ; preds = %68, %67
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %3, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #4
  br label %86

82:                                               ; preds = %75
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %3, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  br label %86

86:                                               ; preds = %82, %78
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %87

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

declare void @_ZN3tbb19task_scheduler_init9terminateEv(ptr noundef nonnull align 8 dereferenceable(8)) #3

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 = !{!"int", !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 = distinct !{!13, !14}
!14 = !{!"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"

%"struct.std::nothrow_t" = type { i8 }
%"class.tbb::task_scheduler_init" = type { ptr }
%class.RunInNativeThread = type { i8, 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.36 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [37 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 @_Z15CallParallelForv() 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 uwtable
declare dso_local void @_Z17NativeParallelForIi17RunInNativeThreadEvT_RKT0_(i32 noundef, ptr noundef nonnull align 1 dereferenceable(2)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17RunInNativeThreadC2Ebb(ptr noundef nonnull align 1 dereferenceable(2), i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #2 align 2

; 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
define dso_local void @_Z14TestNestingTSIv() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.tbb::task_scheduler_init", align 8
  %2 = alloca %"class.tbb::task_scheduler_init", align 8
  %3 = alloca %"class.tbb::task_scheduler_init", align 8
  %4 = alloca %class.RunInNativeThread, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 2, i64 noundef 0)
  invoke void @_Z15CallParallelForv()
          to label %5 unwind label %7

5:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  invoke void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef 2, i64 noundef 0)
          to label %6 unwind label %9

6:                                                ; preds = %5
  invoke void @_Z15CallParallelForv()
          to label %13 unwind label %11

7:                                                ; preds = %21, %0
  %8 = landingpad { ptr, i32 }
          cleanup
  br label %33

9:                                                ; preds = %22, %5
  %10 = landingpad { ptr, i32 }
          cleanup
  br label %32

11:                                               ; preds = %24, %23, %6
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %31

13:                                               ; preds = %6
  %14 = call noundef zeroext i1 @_ZN3tbb19task_scheduler_init18blocking_terminateERKSt9nothrow_t(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  br i1 %14, label %15, label %18

15:                                               ; preds = %13
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.19, i32 noundef 205, ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.37)
          to label %18 unwind label %16

16:                                               ; preds = %15
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %31

18:                                               ; preds = %13, %15
  %19 = 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) #4
  br i1 %19, label %21, label %20

20:                                               ; preds = %18
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.19, i32 noundef 208, ptr noundef nonnull @.str.21, ptr noundef null)
          to label %21 unwind label %29

21:                                               ; preds = %20, %18
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 2, i64 noundef 0)
  invoke void @_Z15CallParallelForv()
          to label %22 unwind label %7

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  invoke void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef 2, i64 noundef 0)
          to label %23 unwind label %9

23:                                               ; preds = %22
  invoke void @_Z15CallParallelForv()
          to label %24 unwind label %11

24:                                               ; preds = %23
  invoke void @_ZN3tbb19task_scheduler_init9terminateEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %25 unwind label %11

25:                                               ; preds = %24
  %26 = 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) #4
  br i1 %26, label %28, label %27

27:                                               ; preds = %25
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.19, i32 noundef 208, ptr noundef nonnull @.str.21, ptr noundef null)
          to label %28 unwind label %29

28:                                               ; preds = %27, %25
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %4) #4
  call void @_ZN17RunInNativeThreadC2Ebb(ptr noundef nonnull align 1 dereferenceable(2) %4, i1 noundef zeroext true, i1 noundef zeroext true)
  invoke void @_Z17NativeParallelForIi17RunInNativeThreadEvT_RKT0_(i32 noundef 1, ptr noundef nonnull align 1 dereferenceable(2) %4)
          to label %34 unwind label %38

29:                                               ; preds = %27, %20
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %31

31:                                               ; preds = %29, %16, %11
  %.pn14 = phi { ptr, i32 } [ %30, %29 ], [ %12, %11 ], [ %17, %16 ]
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  br label %32

32:                                               ; preds = %31, %9
  %.pn14.pn = phi { ptr, i32 } [ %.pn14, %31 ], [ %10, %9 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  br label %33

33:                                               ; preds = %32, %7
  %.pn14.pn.pn = phi { ptr, i32 } [ %.pn14.pn, %32 ], [ %8, %7 ]
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  br label %43

34:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #4
  %35 = call noundef zeroext i1 @_ZN3tbb19task_scheduler_init18blocking_terminateERKSt9nothrow_t(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #4
  br i1 %35, label %37, label %36

36:                                               ; preds = %34
  invoke void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str.19, i32 noundef 214, ptr noundef nonnull @.str.21, ptr noundef null)
          to label %37 unwind label %40

37:                                               ; preds = %36, %34
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret void

38:                                               ; preds = %28
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #4
  br label %42

40:                                               ; preds = %36
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %42

42:                                               ; preds = %40, %38
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %43

43:                                               ; preds = %42, %33
  %.pn14.pn.pn.pn = phi { ptr, i32 } [ %.pn14.pn.pn, %33 ], [ %.pn, %42 ]
  resume { ptr, i32 } %.pn14.pn.pn.pn
}

declare void @_ZN3tbb19task_scheduler_init9terminateEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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 = { "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)"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,SCCPPass,SROAPass,SimplifyCFGPass