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

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

@_ZN7Harness8internalL6tracerE = external hidden global %"class.Harness::internal::Tracer", align 8
@_ZL7Verbose = external hidden global i8, align 1
@.str.17 = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__._Z30TestDispatchLoopResponsivenessv = external hidden unnamed_addr constant [31 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [97 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

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

declare i32 @__gxx_personality_v0(...)

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

; 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 noundef nonnull align 1 dereferenceable(1) ptr @_ZN3tbb4task14allocate_childEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

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

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

11:                                               ; preds = %0
  br label %14

12:                                               ; preds = %0
  %13 = call noundef ptr @_ZN7Harness8internal6Tracer14set_trace_infoEiPKcmS3_(ptr noundef nonnull align 8 dereferenceable(33) @_ZN7Harness8internalL6tracerE, i32 noundef 0, ptr noundef @.str.17, i64 noundef 616, ptr noundef @__FUNCTION__._Z30TestDispatchLoopResponsivenessv)
  call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %13, ptr noundef @.str.33)
  br label %14

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

15:                                               ; preds = %14
  %16 = invoke noundef ptr @_ZnwmRKN3tbb8internal19allocate_root_proxyE(i64 noundef 8, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %17 unwind label %23

17:                                               ; preds = %15
  invoke void @_ZN3tbb10empty_taskC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %18 unwind label %27

18:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  store ptr %16, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !13
  br label %19

19:                                               ; preds = %42, %18
  %20 = load i32, ptr %7, align 4, !tbaa !13
  %21 = icmp slt i32 %20, 3
  br i1 %21, label %32, label %22

22:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %54

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

27:                                               ; preds = %17
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %4, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %5, align 4
  call void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef %16, ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  br label %31

31:                                               ; preds = %27, %23
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  br label %62

32:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %33 = load ptr, ptr %2, align 8, !tbaa !11
  %34 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN3tbb4task14allocate_childEv(ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %35 unwind label %45

35:                                               ; preds = %32
  %36 = invoke noundef ptr @_ZnwmRKN3tbb8internal20allocate_child_proxyE(i64 noundef 16, ptr noundef nonnull align 1 dereferenceable(1) %34)
          to label %37 unwind label %45

37:                                               ; preds = %35
  %38 = load i32, ptr %7, align 4, !tbaa !13
  invoke void @_ZN20TaskWithChildToStealC2Ei(ptr noundef nonnull align 8 dereferenceable(13) %36, i32 noundef %38)
          to label %39 unwind label %49

39:                                               ; preds = %37
  store ptr %36, ptr %8, align 8, !tbaa !11
  %40 = load ptr, ptr %8, align 8, !tbaa !11
  invoke void @_ZN20TaskWithChildToSteal20SpawnAndWaitOnParentEv(ptr noundef nonnull align 8 dereferenceable(13) %40)
          to label %41 unwind label %45

41:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %7, align 4, !tbaa !13
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %7, align 4, !tbaa !13
  br label %19, !llvm.loop !15

45:                                               ; preds = %39, %35, %32
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %4, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %5, align 4
  br label %53

49:                                               ; preds = %37
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %4, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %5, align 4
  call void @_ZdlPvRKN3tbb8internal20allocate_child_proxyE(ptr noundef %36, ptr noundef nonnull align 1 dereferenceable(1) %34) #6
  br label %53

53:                                               ; preds = %49, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %62

54:                                               ; preds = %22
  %55 = load ptr, ptr %2, align 8, !tbaa !11
  %56 = load ptr, ptr %2, align 8, !tbaa !11
  invoke void @_ZN3tbb10interface58internal9task_base7destroyERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(8) %56)
          to label %57 unwind label %58

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

58:                                               ; preds = %54
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %4, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %5, align 4
  br label %62

62:                                               ; preds = %58, %53, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  br label %63

63:                                               ; preds = %62
  %64 = load ptr, ptr %4, align 8
  %65 = load i32, ptr %5, align 4
  %66 = insertvalue { ptr, i32 } poison, ptr %64, 0
  %67 = insertvalue { ptr, i32 } %66, i32 %65, 1
  resume { ptr, i32 } %67
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN20TaskWithChildToSteal20SpawnAndWaitOnParentEv(ptr noundef nonnull align 8 dereferenceable(13)) #2 align 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 = { 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 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !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 }

@_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 [85 x i8], align 1
@__FUNCTION__._Z30TestDispatchLoopResponsivenessv = external hidden unnamed_addr constant [31 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [97 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

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

declare i32 @__gxx_personality_v0(...)

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

; 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 noundef nonnull align 1 dereferenceable(1) ptr @_ZN3tbb4task14allocate_childEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

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

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

5:                                                ; preds = %0
  %6 = 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 616, ptr noundef nonnull @__FUNCTION__._Z30TestDispatchLoopResponsivenessv)
  tail call void (ptr, ptr, ...) @_ZN7Harness8internal6Tracer5traceEPKcz(ptr noundef nonnull align 8 dereferenceable(33) %6, ptr noundef nonnull @.str.33)
  br label %7

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

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

10:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  %11 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3tbb4task14allocate_childEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %12 = invoke noundef ptr @_ZnwmRKN3tbb8internal20allocate_child_proxyE(i64 noundef 16, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %18 unwind label %31

13:                                               ; preds = %7
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %17

15:                                               ; preds = %9
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvRKN3tbb8internal19allocate_root_proxyE(ptr noundef %8, ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  br label %17

17:                                               ; preds = %15, %13
  %.pn = phi { ptr, i32 } [ %16, %15 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  br label %38

18:                                               ; preds = %10
  invoke void @_ZN20TaskWithChildToStealC2Ei(ptr noundef nonnull align 8 dereferenceable(13) %12, i32 noundef 0)
          to label %19 unwind label %33

19:                                               ; preds = %18
  invoke void @_ZN20TaskWithChildToSteal20SpawnAndWaitOnParentEv(ptr noundef nonnull align 8 dereferenceable(13) %12)
          to label %20 unwind label %31

20:                                               ; preds = %19
  %21 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3tbb4task14allocate_childEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %22 = invoke noundef ptr @_ZnwmRKN3tbb8internal20allocate_child_proxyE(i64 noundef 16, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %23 unwind label %31

23:                                               ; preds = %20
  invoke void @_ZN20TaskWithChildToStealC2Ei(ptr noundef nonnull align 8 dereferenceable(13) %22, i32 noundef 1)
          to label %24 unwind label %33

24:                                               ; preds = %23
  invoke void @_ZN20TaskWithChildToSteal20SpawnAndWaitOnParentEv(ptr noundef nonnull align 8 dereferenceable(13) %22)
          to label %25 unwind label %31

25:                                               ; preds = %24
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN3tbb4task14allocate_childEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %27 = invoke noundef ptr @_ZnwmRKN3tbb8internal20allocate_child_proxyE(i64 noundef 16, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %28 unwind label %31

28:                                               ; preds = %25
  invoke void @_ZN20TaskWithChildToStealC2Ei(ptr noundef nonnull align 8 dereferenceable(13) %27, i32 noundef 2)
          to label %29 unwind label %33

29:                                               ; preds = %28
  invoke void @_ZN20TaskWithChildToSteal20SpawnAndWaitOnParentEv(ptr noundef nonnull align 8 dereferenceable(13) %27)
          to label %30 unwind label %31

30:                                               ; preds = %29
  invoke void @_ZN3tbb10interface58internal9task_base7destroyERNS_4taskE(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %35 unwind label %36

31:                                               ; preds = %29, %25, %24, %20, %19, %10
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %38

33:                                               ; preds = %28, %23, %18
  %.lcssa21 = phi ptr [ %11, %18 ], [ %21, %23 ], [ %26, %28 ]
  %.lcssa = phi ptr [ %12, %18 ], [ %22, %23 ], [ %27, %28 ]
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvRKN3tbb8internal20allocate_child_proxyE(ptr noundef %.lcssa, ptr noundef nonnull align 1 dereferenceable(1) %.lcssa21) #6
  br label %38

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

36:                                               ; preds = %30
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %38

38:                                               ; preds = %31, %33, %36, %17
  %.pn13.pn = phi { ptr, i32 } [ %37, %36 ], [ %.pn, %17 ], [ %32, %31 ], [ %34, %33 ]
  call void @_ZN3tbb19task_scheduler_initD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn13.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN20TaskWithChildToSteal20SpawnAndWaitOnParentEv(ptr noundef nonnull align 8 dereferenceable(13)) local_unnamed_addr #2 align 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 = { 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 = !{}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass