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

; 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.tbb::internal::allocate_root_proxy" = type { i8 }
%class.SharedRootBody = type { ptr }

@_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
@__FUNCTION__._Z14TestSharedRooti = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [51 x i8], align 1
@_ZL9MinThread = external hidden global i32, align 4
@_ZL9MaxThread = external hidden global i32, align 4
@.str.26 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [38 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 @_ZN3tbb4task13allocate_rootEv() #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr 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 #3 align 2

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

; 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 @_Z14TestSharedRooti(i32 noundef %0) #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.tbb::task_scheduler_init", align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  %9 = alloca i32, align 4
  %10 = alloca %class.SharedRootBody, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  %11 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %12 = trunc i8 %11 to i1
  br i1 %12, label %14, label %13

13:                                               ; preds = %1
  br label %16

14:                                               ; preds = %1
  %15 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.17, i64 noundef 273, ptr noundef @__FUNCTION__._Z14TestSharedRooti)
  call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %15, ptr noundef @.str.25)
  br label %16

16:                                               ; preds = %14, %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %17 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %17, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  invoke void @_ZN3tbb4task13allocate_rootEv()
          to label %18 unwind label %30

18:                                               ; preds = %16
  %19 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %20 unwind label %30

20:                                               ; preds = %18
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %21 unwind label %34

21:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  store ptr %19, ptr %4, align 8, !tbaa !13
  %22 = load ptr, ptr %4, align 8, !tbaa !13
  invoke void @_ZN3tbb4task13set_ref_countEi(ptr noundef nonnull align 8 dereferenceable(8) %22, i32 noundef 1)
          to label %23 unwind label %39

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %24 = load i32, ptr @_ZL9MinThread, align 4, !tbaa !5
  store i32 %24, ptr %9, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %59, %23
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = load i32, ptr @_ZL9MaxThread, align 4, !tbaa !5
  %28 = icmp sle i32 %26, %27
  br i1 %28, label %43, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %71

30:                                               ; preds = %18, %16
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %6, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %7, align 4
  br label %38

34:                                               ; preds = %20
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %6, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %7, align 4
  call void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  br label %38

38:                                               ; preds = %34, %30
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %84

39:                                               ; preds = %81, %79, %77, %75, %21
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %6, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %7, align 4
  br label %84

43:                                               ; preds = %25
  %44 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %45 = trunc i8 %44 to i1
  br i1 %45, label %47, label %46

46:                                               ; preds = %43
  br label %54

47:                                               ; preds = %43
  %48 = invoke noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.17, i64 noundef 278, ptr noundef @__FUNCTION__._Z14TestSharedRooti)
          to label %49 unwind label %62

49:                                               ; preds = %47
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sub nsw i32 %51, 1
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %48, ptr noundef @.str.26, i32 noundef %50, i32 noundef %52)
          to label %53 unwind label %62

53:                                               ; preds = %49
  br label %54

54:                                               ; preds = %53, %46
  %55 = load i32, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %56 = load ptr, ptr %4, align 8, !tbaa !13
  invoke void @_ZN14SharedRootBodyC2EPN3tbb4taskE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %56)
          to label %57 unwind label %66

57:                                               ; preds = %54
  invoke void @_Z17NativeParallelForIi14SharedRootBodyEvT_RKT0_(i32 noundef %55, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %58 unwind label %66

58:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %9, align 4, !tbaa !5
  br label %25, !llvm.loop !15

62:                                               ; preds = %49, %47
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %6, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %7, align 4
  br label %70

66:                                               ; preds = %57, %54
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %6, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %70

70:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %84

71:                                               ; preds = %29
  %72 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !9, !range !11, !noundef !12
  %73 = trunc i8 %72 to i1
  br i1 %73, label %75, label %74

74:                                               ; preds = %71
  br label %79

75:                                               ; preds = %71
  %76 = invoke noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.17, i64 noundef 281, ptr noundef @__FUNCTION__._Z14TestSharedRooti)
          to label %77 unwind label %39

77:                                               ; preds = %75
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %76, ptr noundef @.str.27)
          to label %78 unwind label %39

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78, %74
  %80 = load ptr, ptr %4, align 8, !tbaa !13
  invoke void @_ZN3tbb4task12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(8) %80)
          to label %81 unwind label %39

81:                                               ; preds = %79
  %82 = load ptr, ptr %4, align 8, !tbaa !13
  invoke void @_ZN3tbb10interface58internal9task_base7destroyERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(8) %82)
          to label %83 unwind label %39

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

84:                                               ; preds = %70, %39, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %6, align 8
  %87 = load i32, ptr %7, align 4
  %88 = insertvalue { ptr, i32 } poison, ptr %86, 0
  %89 = insertvalue { ptr, i32 } %88, i32 %87, 1
  resume { ptr, i32 } %89
}

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

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

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

declare void @_ZN3tbb10interface58internal9task_base7destroyERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(8)) #5

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 = { 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 = { "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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_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
@__FUNCTION__._Z14TestSharedRooti = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [51 x i8], align 1
@_ZL9MinThread = external hidden local_unnamed_addr global i32, align 4
@_ZL9MaxThread = external hidden local_unnamed_addr global i32, align 4
@.str.26 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [38 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 @_ZN3tbb4task13allocate_rootEv() local_unnamed_addr #1 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 nounwind uwtable
declare dso_local void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN3tbb4task13set_ref_countEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

; 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 @_Z14TestSharedRooti(i32 noundef %0) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.tbb::task_scheduler_init", align 8
  %3 = alloca %"class.tbb::internal::allocate_root_proxy", align 1
  %4 = alloca %class.SharedRootBody, align 8
  %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 = %1
  %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 273, ptr noundef nonnull @__FUNCTION__._Z14TestSharedRooti)
  tail call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %8, ptr noundef nonnull @.str.25)
  br label %9

9:                                                ; preds = %1, %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @_ZN3tbb19task_scheduler_initC2Eim(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef %0, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZN3tbb4task13allocate_rootEv()
  %10 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %11 unwind label %18

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

12:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  call void @_ZN3tbb4task13set_ref_countEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 1)
  %13 = load i32, ptr @_ZL9MinThread, align 4, !tbaa !11
  %14 = load i32, ptr @_ZL9MaxThread, align 4, !tbaa !11
  %.not19 = icmp sgt i32 %13, %14
  br i1 %.not19, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %12
  %15 = add nsw i32 %0, -1
  br label %25

._crit_edge:                                      ; preds = %31, %12
  %16 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %38, label %40

18:                                               ; preds = %9
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %22

20:                                               ; preds = %11
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef %10, ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  br label %22

22:                                               ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  br label %43

23:                                               ; preds = %41, %40, %38
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %43

25:                                               ; preds = %.lr.ph, %31
  %.020 = phi i32 [ %13, %.lr.ph ], [ %32, %31 ]
  %26 = load i8, ptr @_ZL7Verbose, align 1, !tbaa !5, !range !9, !noundef !10
  %27 = trunc nuw i8 %26 to i1
  br i1 %27, label %28, label %30

28:                                               ; preds = %25
  %29 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.17, i64 noundef 278, ptr noundef nonnull @__FUNCTION__._Z14TestSharedRooti)
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %29, ptr noundef nonnull @.str.26, i32 noundef %.020, i32 noundef %15)
          to label %30 unwind label %34

30:                                               ; preds = %28, %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN14SharedRootBodyC2EPN3tbb4taskE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %10)
  invoke void @_Z17NativeParallelForIi14SharedRootBodyEvT_RKT0_(i32 noundef %.020, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %31 unwind label %36

31:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %32 = add nsw i32 %.020, 1
  %33 = load i32, ptr @_ZL9MaxThread, align 4, !tbaa !11
  %.not.not = icmp slt i32 %.020, %33
  br i1 %.not.not, label %25, label %._crit_edge, !llvm.loop !13

34:                                               ; preds = %28
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %43

36:                                               ; preds = %30
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %43

38:                                               ; preds = %._crit_edge
  %39 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef nonnull @.str.17, i64 noundef 281, ptr noundef nonnull @__FUNCTION__._Z14TestSharedRooti)
  invoke void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %39, ptr noundef nonnull @.str.27)
          to label %40 unwind label %23

40:                                               ; preds = %38, %._crit_edge
  invoke void @_ZN3tbb4task12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %41 unwind label %23

41:                                               ; preds = %40
  invoke void @_ZN3tbb10interface58internal9task_base7destroyERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %42 unwind label %23

42:                                               ; preds = %41
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  ret void

43:                                               ; preds = %34, %36, %23, %22
  %.pn16.pn = phi { ptr, i32 } [ %24, %23 ], [ %.pn, %22 ], [ %37, %36 ], [ %35, %34 ]
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn16.pn
}

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

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

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

declare void @_ZN3tbb10interface58internal9task_base7destroyERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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


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