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

; 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.Harness::internal::Tracer" = type <{ i32, [4 x i8], ptr, ptr, i64, [8 x i8] }>
%"class.tbb::task_scheduler_init" = type { ptr }
%class.EnqueuerBody = type { i8 }

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@_ZL7Verbose = external hidden global i8, align 1
@.str.17 = external hidden unnamed_addr constant [93 x i8], align 1
@NumRepeats = external dso_local global i32, align 4
@__FUNCTION__._Z19TestCascadedEnqueuev = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [26 x i8], align 1
@_ZL13MaxNumThreads = external hidden constant i32, align 4
@_ZL8CanStart = external hidden global i8, align 1
@_ZL8Finished = external hidden global [16 x i8], align 16
@.str.23 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [36 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, ptr noundef, i64 noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef, ...) #2 align 2

; 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 @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i64 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z19TestCascadedEnqueuev() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.tbb::task_scheduler_init", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %class.EnqueuerBody, align 1
  %12 = alloca i32, align 4
  %13 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %14 = trunc i8 %13 to i1
  br i1 %14, label %16, label %15

15:                                               ; preds = %0
  br label %18

16:                                               ; preds = %0
  %17 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.17, i64 noundef 226, ptr noundef @__FUNCTION__._Z19TestCascadedEnqueuev)
  call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %17, ptr noundef @.str.22)
  br label %18

18:                                               ; preds = %16, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  %19 = call noundef i32 @_ZN3tbb19task_scheduler_init19default_num_threadsEv()
  %20 = add nsw i32 %19, 1
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %20, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %21 = invoke noundef i32 @_ZN3tbb19task_scheduler_init19default_num_threadsEv()
          to label %22 unwind label %37

22:                                               ; preds = %18
  store i32 %21, ptr %3, align 4, !tbaa !11
  %23 = invoke noundef i32 @_Z3minIiiET_RKS0_RKT0_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) @_ZL13MaxNumThreads)
          to label %24 unwind label %37

24:                                               ; preds = %22
  %25 = sdiv i32 %23, 2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  store i32 %25, ptr %2, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %26 = invoke noundef i32 @_ZN3tbb19task_scheduler_init19default_num_threadsEv()
          to label %27 unwind label %41

27:                                               ; preds = %24
  %28 = mul nsw i32 %26, 2
  store i32 %28, ptr %7, align 4, !tbaa !11
  %29 = invoke noundef i32 @_Z3minIiiET_RKS0_RKT0_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) @_ZL13MaxNumThreads)
          to label %30 unwind label %41

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  store i32 %29, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %31 = load i32, ptr %2, align 4, !tbaa !11
  store i32 %31, ptr %8, align 4, !tbaa !11
  br label %32

32:                                               ; preds = %107, %30
  %33 = load i32, ptr %8, align 4, !tbaa !11
  %34 = load i32, ptr %6, align 4, !tbaa !11
  %35 = icmp sle i32 %33, %34
  br i1 %35, label %45, label %36

36:                                               ; preds = %32
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %110

37:                                               ; preds = %22, %18
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %124

41:                                               ; preds = %27, %24
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %4, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %123

45:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %46

46:                                               ; preds = %98, %45
  %47 = load i32, ptr %10, align 4, !tbaa !11
  %48 = load i32, ptr @NumRepeats, align 4, !tbaa !11
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %106

51:                                               ; preds = %46
  store volatile i8 0, ptr @_ZL8CanStart, align 1, !tbaa !5
  %52 = call i32 @sched_yield() #5
  %53 = load i32, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  invoke void @_Z17NativeParallelForIi12EnqueuerBodyEvT_RKT0_(i32 noundef %53, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %54 unwind label %68

54:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  store volatile i8 1, ptr @_ZL8CanStart, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %55

55:                                               ; preds = %74, %54
  %56 = load i32, ptr %12, align 4, !tbaa !11
  %57 = load i32, ptr %8, align 4, !tbaa !11
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %59, label %75

59:                                               ; preds = %55
  %60 = load i32, ptr %12, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %61
  %63 = load volatile i8, ptr %62, align 1, !tbaa !5, !range !9, !noundef !10
  %64 = trunc i8 %63 to i1
  br i1 %64, label %65, label %72

65:                                               ; preds = %59
  %66 = load i32, ptr %12, align 4, !tbaa !11
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %12, align 4, !tbaa !11
  br label %74

68:                                               ; preds = %51
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %4, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  br label %105

72:                                               ; preds = %59
  %73 = call i32 @sched_yield() #5
  br label %74

74:                                               ; preds = %72, %65
  br label %55, !llvm.loop !13

75:                                               ; preds = %55
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %76

76:                                               ; preds = %84, %75
  %77 = load i32, ptr %12, align 4, !tbaa !11
  %78 = load i32, ptr %8, align 4, !tbaa !11
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %87

80:                                               ; preds = %76
  %81 = load i32, ptr %12, align 4, !tbaa !11
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %82
  store volatile i8 0, ptr %83, align 1, !tbaa !5
  br label %84

84:                                               ; preds = %80
  %85 = load i32, ptr %12, align 4, !tbaa !11
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %12, align 4, !tbaa !11
  br label %76, !llvm.loop !15

87:                                               ; preds = %76
  %88 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %89 = trunc i8 %88 to i1
  br i1 %89, label %91, label %90

90:                                               ; preds = %87
  br label %97

91:                                               ; preds = %87
  %92 = invoke noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.17, i64 noundef 247, ptr noundef @__FUNCTION__._Z19TestCascadedEnqueuev)
          to label %93 unwind label %101

93:                                               ; preds = %91
  %94 = load i32, ptr %8, align 4, !tbaa !11
  %95 = load i32, ptr %10, align 4, !tbaa !11
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %92, ptr noundef @.str.23, i32 noundef %94, i32 noundef %95)
          to label %96 unwind label %101

96:                                               ; preds = %93
  br label %97

97:                                               ; preds = %96, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %10, align 4, !tbaa !11
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %10, align 4, !tbaa !11
  br label %46, !llvm.loop !16

101:                                              ; preds = %93, %91
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %4, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %105

105:                                              ; preds = %101, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %123

106:                                              ; preds = %50
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %8, align 4, !tbaa !11
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %8, align 4, !tbaa !11
  br label %32, !llvm.loop !17

110:                                              ; preds = %36
  %111 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %112 = trunc i8 %111 to i1
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  br label %118

114:                                              ; preds = %110
  %115 = invoke noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.17, i64 noundef 250, ptr noundef @__FUNCTION__._Z19TestCascadedEnqueuev)
          to label %116 unwind label %119

116:                                              ; preds = %114
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %115, ptr noundef @.str.24)
          to label %117 unwind label %119

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void

119:                                              ; preds = %116, %114
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %4, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %5, align 4
  br label %123

123:                                              ; preds = %119, %105, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %124

124:                                              ; preds = %123, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %4, align 8
  %127 = load i32, ptr %5, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129
}

declare noundef i32 @_ZN3tbb19task_scheduler_init19default_num_threadsEv() #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3minIiiET_RKS0_RKT0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: nounwind
declare i32 @sched_yield() #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17NativeParallelForIi12EnqueuerBodyEvT_RKT0_(i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #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 = { 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 #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 "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 = !{!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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !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"

%"class.Harness::internal::Tracer" = type <{ i32, [4 x i8], ptr, ptr, i64, [8 x i8] }>
%"class.tbb::task_scheduler_init" = type { ptr }
%class.EnqueuerBody = type { i8 }

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@_ZL7Verbose = external hidden local_unnamed_addr global i8, align 1
@.str.17 = external hidden unnamed_addr constant [93 x i8], align 1
@NumRepeats = external dso_local local_unnamed_addr global i32, align 4
@__FUNCTION__._Z19TestCascadedEnqueuev = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [26 x i8], align 1
@_ZL13MaxNumThreads = external hidden constant i32, align 4
@_ZL8CanStart = external hidden global i8, align 1
@_ZL8Finished = external hidden global [16 x i8], align 16
@.str.23 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [36 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 nounwind uwtable
declare dso_local noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef, ...) local_unnamed_addr #2 align 2

; 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 @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i64 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z19TestCascadedEnqueuev() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.tbb::task_scheduler_init", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %class.EnqueuerBody, align 1
  %5 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %6 = trunc nuw i8 %5 to i1
  br i1 %6, label %7, label %9

7:                                                ; preds = %0
  %8 = tail call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.17, i64 noundef 226, ptr noundef nonnull @__FUNCTION__._Z19TestCascadedEnqueuev)
  tail call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %8, ptr noundef nonnull @.str.22)
  br label %9

9:                                                ; preds = %0, %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %10 = tail call noundef i32 @_ZN3tbb19task_scheduler_init19default_num_threadsEv()
  %11 = add nsw i32 %10, 1
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %11, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %12 = invoke noundef i32 @_ZN3tbb19task_scheduler_init19default_num_threadsEv()
          to label %13 unwind label %60

13:                                               ; preds = %9
  store i32 %12, ptr %2, align 4, !tbaa !11
  %14 = call noundef i32 @_Z3minIiiET_RKS0_RKT0_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @_ZL13MaxNumThreads)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %15 = invoke noundef i32 @_ZN3tbb19task_scheduler_init19default_num_threadsEv()
          to label %16 unwind label %62

16:                                               ; preds = %13
  %17 = sdiv i32 %14, 2
  %18 = shl nsw i32 %15, 1
  store i32 %18, ptr %3, align 4, !tbaa !11
  %19 = call noundef i32 @_Z3minIiiET_RKS0_RKT0_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) @_ZL13MaxNumThreads)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %.not47 = icmp sle i32 %17, %19
  %20 = load i32, ptr @NumRepeats, align 4
  %21 = icmp sgt i32 %20, 0
  %or.cond = select i1 %.not47, i1 %21, i1 false
  br i1 %or.cond, label %.preheader29, label %._crit_edge

.preheader29:                                     ; preds = %16, %._crit_edge35
  %22 = phi i32 [ %64, %._crit_edge35 ], [ %20, %16 ]
  %.01948 = phi i32 [ %65, %._crit_edge35 ], [ %17, %16 ]
  %23 = zext i32 %.01948 to i64
  %24 = icmp sgt i32 %22, 0
  br i1 %24, label %.lr.ph34, label %._crit_edge35

.lr.ph34:                                         ; preds = %.preheader29
  %25 = icmp sgt i32 %.01948, 0
  br i1 %25, label %.lr.ph34.split.us.preheader, label %.lr.ph34.split.split

.lr.ph34.split.us.preheader:                      ; preds = %.lr.ph34
  %xtraiter = and i64 %23, 7
  %26 = icmp ult i32 %.01948, 8
  %unroll_iter = and i64 %23, 2147483640
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph34.split.us

.lr.ph34.split.us:                                ; preds = %.lr.ph34.split.us.preheader, %33
  %.01833.us = phi i32 [ %34, %33 ], [ 0, %.lr.ph34.split.us.preheader ]
  store volatile i8 0, ptr @_ZL8CanStart, align 1, !tbaa !5
  %27 = call i32 @sched_yield() #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  invoke void @_Z17NativeParallelForIi12EnqueuerBodyEvT_RKT0_(i32 noundef %.01948, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %.lr.ph.us unwind label %.split.us

.lr.ph.us:                                        ; preds = %.lr.ph34.split.us
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  store volatile i8 1, ptr @_ZL8CanStart, align 1, !tbaa !5
  br label %45

._crit_edge.us.unr-lcssa:                         ; preds = %.lr.ph32.us, %.lr.ph32.us.preheader
  %indvars.iv55.unr = phi i64 [ 0, %.lr.ph32.us.preheader ], [ %indvars.iv.next56.7, %.lr.ph32.us ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.lr.ph32.us.epil

.lr.ph32.us.epil:                                 ; preds = %._crit_edge.us.unr-lcssa, %.lr.ph32.us.epil
  %indvars.iv55.epil = phi i64 [ %indvars.iv.next56.epil, %.lr.ph32.us.epil ], [ %indvars.iv55.unr, %._crit_edge.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph32.us.epil ], [ 0, %._crit_edge.us.unr-lcssa ]
  %28 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv55.epil
  store volatile i8 0, ptr %28, align 1, !tbaa !5
  %indvars.iv.next56.epil = add nuw nsw i64 %indvars.iv55.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge.us, label %.lr.ph32.us.epil, !llvm.loop !13

._crit_edge.us:                                   ; preds = %.lr.ph32.us.epil, %._crit_edge.us.unr-lcssa
  %29 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %31, label %33

31:                                               ; preds = %._crit_edge.us
  %32 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.17, i64 noundef 247, ptr noundef nonnull @__FUNCTION__._Z19TestCascadedEnqueuev)
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %32, ptr noundef nonnull @.str.23, i32 noundef %.01948, i32 noundef %.01833.us)
          to label %33 unwind label %.split37.us

33:                                               ; preds = %31, %._crit_edge.us
  %34 = add nuw nsw i32 %.01833.us, 1
  %35 = load i32, ptr @NumRepeats, align 4, !tbaa !11
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph34.split.us, label %._crit_edge35, !llvm.loop !15

.lr.ph32.us:                                      ; preds = %.lr.ph32.us.preheader, %.lr.ph32.us
  %indvars.iv55 = phi i64 [ %indvars.iv.next56.7, %.lr.ph32.us ], [ 0, %.lr.ph32.us.preheader ]
  %niter = phi i64 [ %niter.next.7, %.lr.ph32.us ], [ 0, %.lr.ph32.us.preheader ]
  %37 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv55
  store volatile i8 0, ptr %37, align 8, !tbaa !5
  %indvars.iv.next56 = or disjoint i64 %indvars.iv55, 1
  %38 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv.next56
  store volatile i8 0, ptr %38, align 1, !tbaa !5
  %indvars.iv.next56.1 = or disjoint i64 %indvars.iv55, 2
  %39 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv.next56.1
  store volatile i8 0, ptr %39, align 2, !tbaa !5
  %indvars.iv.next56.2 = or disjoint i64 %indvars.iv55, 3
  %40 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv.next56.2
  store volatile i8 0, ptr %40, align 1, !tbaa !5
  %indvars.iv.next56.3 = or disjoint i64 %indvars.iv55, 4
  %41 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv.next56.3
  store volatile i8 0, ptr %41, align 4, !tbaa !5
  %indvars.iv.next56.4 = or disjoint i64 %indvars.iv55, 5
  %42 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv.next56.4
  store volatile i8 0, ptr %42, align 1, !tbaa !5
  %indvars.iv.next56.5 = or disjoint i64 %indvars.iv55, 6
  %43 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv.next56.5
  store volatile i8 0, ptr %43, align 2, !tbaa !5
  %indvars.iv.next56.6 = or disjoint i64 %indvars.iv55, 7
  %44 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %indvars.iv.next56.6
  store volatile i8 0, ptr %44, align 1, !tbaa !5
  %indvars.iv.next56.7 = add nuw nsw i64 %indvars.iv55, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge.us.unr-lcssa, label %.lr.ph32.us, !llvm.loop !17

45:                                               ; preds = %.lr.ph.us, %54
  %.030.us = phi i32 [ 0, %.lr.ph.us ], [ %.1.us, %54 ]
  %46 = sext i32 %.030.us to i64
  %47 = getelementptr inbounds [16 x i8], ptr @_ZL8Finished, i64 0, i64 %46
  %48 = load volatile i8, ptr %47, align 1, !tbaa !5, !range !9, !noundef !10
  %49 = trunc nuw i8 %48 to i1
  br i1 %49, label %52, label %50

50:                                               ; preds = %45
  %51 = call i32 @sched_yield() #5
  br label %54

52:                                               ; preds = %45
  %53 = add nsw i32 %.030.us, 1
  br label %54

54:                                               ; preds = %52, %50
  %.1.us = phi i32 [ %53, %52 ], [ %.030.us, %50 ]
  %55 = icmp slt i32 %.1.us, %.01948
  br i1 %55, label %45, label %.lr.ph32.us.preheader, !llvm.loop !18

.lr.ph32.us.preheader:                            ; preds = %54
  br i1 %26, label %._crit_edge.us.unr-lcssa, label %.lr.ph32.us

.split.us:                                        ; preds = %.lr.ph34.split.us
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %.split

.split37.us:                                      ; preds = %31
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %.split37

._crit_edge:                                      ; preds = %._crit_edge35, %16
  %58 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %77, label %79

60:                                               ; preds = %9
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  br label %.split37

62:                                               ; preds = %13
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %.split37

._crit_edge35:                                    ; preds = %72, %33, %.preheader29
  %64 = phi i32 [ %22, %.preheader29 ], [ %35, %33 ], [ %74, %72 ]
  %65 = add i32 %.01948, 1
  %.not = icmp sgt i32 %65, %19
  br i1 %.not, label %._crit_edge, label %.preheader29, !llvm.loop !19

.lr.ph34.split.split:                             ; preds = %.lr.ph34, %72
  %.01833 = phi i32 [ %73, %72 ], [ 0, %.lr.ph34 ]
  store volatile i8 0, ptr @_ZL8CanStart, align 1, !tbaa !5
  %66 = call i32 @sched_yield() #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  invoke void @_Z17NativeParallelForIi12EnqueuerBodyEvT_RKT0_(i32 noundef %.01948, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %.preheader unwind label %.split.split

.preheader:                                       ; preds = %.lr.ph34.split.split
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  store volatile i8 1, ptr @_ZL8CanStart, align 1, !tbaa !5
  %67 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %68 = trunc nuw i8 %67 to i1
  br i1 %68, label %70, label %72

.split.split:                                     ; preds = %.lr.ph34.split.split
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %.split

.split:                                           ; preds = %.split.split, %.split.us
  %.us-phi = phi { ptr, i32 } [ %56, %.split.us ], [ %69, %.split.split ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  br label %.split37

70:                                               ; preds = %.preheader
  %71 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.17, i64 noundef 247, ptr noundef nonnull @__FUNCTION__._Z19TestCascadedEnqueuev)
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %71, ptr noundef nonnull @.str.23, i32 noundef %.01948, i32 noundef %.01833)
          to label %72 unwind label %.split37.split

72:                                               ; preds = %70, %.preheader
  %73 = add nuw nsw i32 %.01833, 1
  %74 = load i32, ptr @NumRepeats, align 4, !tbaa !11
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %.lr.ph34.split.split, label %._crit_edge35, !llvm.loop !15

.split37.split:                                   ; preds = %70
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %.split37

77:                                               ; preds = %._crit_edge
  %78 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.17, i64 noundef 250, ptr noundef nonnull @__FUNCTION__._Z19TestCascadedEnqueuev)
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %78, ptr noundef nonnull @.str.24)
          to label %79 unwind label %80

79:                                               ; preds = %77, %._crit_edge
  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
  ret void

80:                                               ; preds = %77
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %.split37

.split37:                                         ; preds = %.split37.us, %.split37.split, %62, %80, %.split, %60
  %.pn.pn.pn = phi { ptr, i32 } [ %61, %60 ], [ %81, %80 ], [ %63, %62 ], [ %.us-phi, %.split ], [ %57, %.split37.us ], [ %76, %.split37.split ]
  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 } %.pn.pn.pn
}

declare noundef i32 @_ZN3tbb19task_scheduler_init19default_num_threadsEv() local_unnamed_addr #3

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

; Function Attrs: nounwind
declare i32 @sched_yield() local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17NativeParallelForIi12EnqueuerBodyEvT_RKT0_(i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #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 = { 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 #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 "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 = !{!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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16, !20}
!20 = !{!"llvm.loop.unswitch.partial.disable"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass