; LLVM IR from NVIDIA/DALI :: dali/core/exec/tasking/scheduler.ll (ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE)

; 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.std::lock_guard" = type { ptr }
%"class.dali::SmallVector.19" = type { %union.anon.22, i64 }
%union.anon.22 = type { %struct.anon.23, [112 x i8] }
%struct.anon.23 = type { ptr, i64 }
%class.anon = type { ptr }
%"class.dali::tasking::Scheduler" = type <{ %"class.std::mutex", %"class.std::condition_variable", %"class.std::condition_variable", %"class.dali::tasking::detail::TaskList", %"class.std::priority_queue", i8, [7 x i8] }>
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::condition_variable" = type { %"class.std::__condvar" }
%"class.std::__condvar" = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%"class.dali::tasking::detail::TaskList" = type { %"class.std::shared_ptr", ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<dali::tasking::Task>, std::allocator<std::shared_ptr<dali::tasking::Task>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<dali::tasking::Task>, std::allocator<std::shared_ptr<dali::tasking::Task>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<dali::tasking::Task>, std::allocator<std::shared_ptr<dali::tasking::Task>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<dali::tasking::Task>, std::allocator<std::shared_ptr<dali::tasking::Task>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.dali::tasking::Waitable" = type { ptr, %"class.std::enable_shared_from_this", %"class.dali::SmallVector" }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"class.dali::SmallVector" = type { %union.anon, i64 }
%union.anon = type { %struct.anon, [112 x i8] }
%struct.anon = type { ptr, i64 }
%"class.dali::tasking::Task" = type { %"class.dali::tasking::CompletionEvent.base", i32, %"class.std::shared_ptr", ptr, ptr, %"class.dali::tasking::TaskResults", double, %"class.std::function", %"class.dali::SmallVector.5", %"class.dali::SmallVector.0", %"class.dali::SmallVector.10" }
%"class.dali::tasking::CompletionEvent.base" = type <{ %"class.dali::tasking::Waitable", %"struct.std::atomic" }>
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.dali::tasking::TaskResults" = type <{ %"class.dali::SmallVector.0", i8, i8, [6 x i8] }>
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.dali::SmallVector.5" = type { %union.anon.8, i64 }
%union.anon.8 = type { %struct.anon.9, [48 x i8] }
%struct.anon.9 = type { ptr, i64 }
%"class.dali::SmallVector.0" = type { %union.anon.3, i64 }
%union.anon.3 = type { %struct.anon.4, [48 x i8] }
%struct.anon.4 = type { ptr, i64 }
%"class.dali::SmallVector.10" = type { %union.anon.13, i64 }
%union.anon.13 = type { %struct.anon.14, [48 x i8] }
%struct.anon.14 = type { ptr, i64 }

@.str.1 = external hidden unnamed_addr constant [81 x i8], align 1
@_ZTIN4dali7tasking8WaitableE = external dso_local constant { ptr, ptr, i32, i32, ptr, i64 }, align 8
@_ZTIN4dali7tasking15CompletionEventE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN4dali7tasking4TaskE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.3 = external hidden unnamed_addr constant [77 x i8], align 1
@__PRETTY_FUNCTION__._ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE = external hidden unnamed_addr constant [50 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4dali7tasking9Scheduler24AcquireAllAndMoveToReadyERSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(193), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4dali7tasking8Waitable10TryAcquireERKSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4dali7tasking6detail8TaskList6RemoveERKSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt10shared_ptrIN4dali7tasking4TaskEESt6vectorIS4_SaIS4_EENS2_9Scheduler16TaskPriorityLessEE4pushEOS4_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE(ptr noundef nonnull align 8 dereferenceable(193) %0, ptr noundef %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::lock_guard", align 8
  %9 = alloca %"class.dali::SmallVector.19", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %class.anon, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #8
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %26, label %24

24:                                               ; preds = %2
  %25 = call ptr @__dynamic_cast(ptr %22, ptr @_ZTIN4dali7tasking8WaitableE, ptr @_ZTIN4dali7tasking15CompletionEventE, i64 0) #8
  br label %27

26:                                               ; preds = %2
  br label %27

27:                                               ; preds = %26, %24
  %28 = phi ptr [ %25, %24 ], [ null, %26 ]
  %29 = icmp ne ptr %28, null
  %30 = zext i1 %29 to i8
  store i8 %30, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #8
  %31 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %32 = trunc i8 %31 to i1
  br i1 %32, label %33, label %42

33:                                               ; preds = %27
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = icmp eq ptr %34, null
  br i1 %35, label %38, label %36

36:                                               ; preds = %33
  %37 = call ptr @__dynamic_cast(ptr %34, ptr @_ZTIN4dali7tasking8WaitableE, ptr @_ZTIN4dali7tasking4TaskE, i64 0) #8
  br label %39

38:                                               ; preds = %33
  br label %39

39:                                               ; preds = %38, %36
  %40 = phi ptr [ %37, %36 ], [ null, %38 ]
  %41 = icmp ne ptr %40, null
  br label %42

42:                                               ; preds = %39, %27
  %43 = phi i1 [ false, %27 ], [ %41, %39 ]
  %44 = zext i1 %43 to i8
  store i8 %44, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %45 = getelementptr inbounds %"class.dali::tasking::Scheduler", ptr %21, i32 0, i32 0
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(40) %45)
  %46 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %47 = trunc i8 %46 to i1
  br i1 %47, label %48, label %50

48:                                               ; preds = %42
  %49 = getelementptr inbounds %"class.dali::tasking::Scheduler", ptr %21, i32 0, i32 2
  call void @_ZNSt18condition_variable10notify_allEv(ptr noundef nonnull align 8 dereferenceable(48) %49) #8
  br label %50

50:                                               ; preds = %48, %42
  call void @llvm.lifetime.start.p0(i64 136, ptr %9) #8
  invoke void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(136) %9)
          to label %51 unwind label %65

51:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.dali::tasking::Waitable", ptr %52, i32 0, i32 2
  %54 = invoke noundef i64 @_ZNK4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(136) %53)
          to label %55 unwind label %69

55:                                               ; preds = %51
  %56 = trunc i64 %54 to i32
  store i32 %56, ptr %12, align 4, !tbaa !13
  %57 = load i32, ptr %12, align 4, !tbaa !13
  %58 = sext i32 %57 to i64
  invoke void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(136) %9, i64 noundef %58)
          to label %59 unwind label %69

59:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !13
  br label %60

60:                                               ; preds = %81, %59
  %61 = load i32, ptr %13, align 4, !tbaa !13
  %62 = load i32, ptr %12, align 4, !tbaa !13
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %73, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %88

65:                                               ; preds = %50
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %10, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %11, align 4
  br label %257

69:                                               ; preds = %55, %51
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %10, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %11, align 4
  br label %256

73:                                               ; preds = %60
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %"class.dali::tasking::Waitable", ptr %74, i32 0, i32 2
  %76 = load i32, ptr %13, align 4, !tbaa !13
  %77 = sext i32 %76 to i64
  %78 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EEixEl(ptr noundef nonnull align 8 dereferenceable(136) %75, i64 noundef %77)
          to label %79 unwind label %84

79:                                               ; preds = %73
  invoke void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE12emplace_backIJRSt8weak_ptrIS3_EEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(136) %9, ptr noundef nonnull align 8 dereferenceable(16) %78)
          to label %80 unwind label %84

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %13, align 4, !tbaa !13
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %13, align 4, !tbaa !13
  br label %60, !llvm.loop !15

84:                                               ; preds = %79, %73
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %10, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %256

88:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store ptr %9, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(136) %89)
          to label %91 unwind label %100

91:                                               ; preds = %88
  store ptr %90, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(136) %92)
          to label %94 unwind label %104

94:                                               ; preds = %91
  store ptr %93, ptr %16, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %244, %94
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = load ptr, ptr %16, align 8, !tbaa !5
  %98 = icmp ne ptr %96, %97
  br i1 %98, label %108, label %99

99:                                               ; preds = %95
  store i32 5, ptr %17, align 4
  br label %248

100:                                              ; preds = %88
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %10, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %11, align 4
  br label %250

104:                                              ; preds = %91
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %10, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %11, align 4
  br label %249

108:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %109, ptr %18, align 8, !tbaa !5
  %110 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %111 = trunc i8 %110 to i1
  br i1 %111, label %124, label %112

112:                                              ; preds = %108
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = load ptr, ptr %113, align 8, !tbaa !17
  %115 = getelementptr inbounds ptr, ptr %114, i64 0
  %116 = load ptr, ptr %115, align 8
  %117 = invoke noundef zeroext i1 %116(ptr noundef nonnull align 8 dereferenceable(160) %113)
          to label %118 unwind label %120

118:                                              ; preds = %112
  br i1 %117, label %124, label %119

119:                                              ; preds = %118
  store i32 5, ptr %17, align 4
  br label %241

120:                                              ; preds = %161, %154, %149, %140, %133, %124, %112
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %10, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %11, align 4
  br label %247

124:                                              ; preds = %118, %108
  %125 = load ptr, ptr %18, align 8, !tbaa !5
  %126 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %125) #8
  %127 = invoke noundef zeroext i1 @_ZN4dali7tasking4Task5ReadyEv(ptr noundef nonnull align 8 dereferenceable(536) %126)
          to label %128 unwind label %120

128:                                              ; preds = %124
  br i1 %127, label %129, label %130

129:                                              ; preds = %128
  store i32 6, ptr %17, align 4
  br label %241

130:                                              ; preds = %128
  %131 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %132 = trunc i8 %131 to i1
  br i1 %132, label %149, label %133

133:                                              ; preds = %130
  %134 = load ptr, ptr %18, align 8, !tbaa !5
  %135 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %134) #8
  %136 = getelementptr inbounds %"class.dali::tasking::Task", ptr %135, i32 0, i32 8
  %137 = invoke noundef i64 @_ZNK4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72) %136)
          to label %138 unwind label %120

138:                                              ; preds = %133
  %139 = icmp eq i64 %137, 1
  br i1 %139, label %140, label %234

140:                                              ; preds = %138
  %141 = load ptr, ptr %18, align 8, !tbaa !5
  %142 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %141) #8
  %143 = getelementptr inbounds %"class.dali::tasking::Task", ptr %142, i32 0, i32 8
  %144 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(72) %143)
          to label %145 unwind label %120

145:                                              ; preds = %140
  %146 = call noundef ptr @_ZNKSt12__shared_ptrIN4dali7tasking8WaitableELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %144) #8
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = icmp eq ptr %146, %147
  br i1 %148, label %149, label %234

149:                                              ; preds = %145, %130
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = load ptr, ptr %18, align 8, !tbaa !5
  %152 = invoke noundef zeroext i1 @_ZN4dali7tasking8Waitable10TryAcquireERKSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(160) %150, ptr noundef nonnull align 8 dereferenceable(16) %151)
          to label %153 unwind label %120

153:                                              ; preds = %149
  br i1 %152, label %176, label %154

154:                                              ; preds = %153
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %155) #8
  %157 = getelementptr inbounds %"class.dali::tasking::Task", ptr %156, i32 0, i32 8
  %158 = invoke noundef i64 @_ZNK4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72) %157)
          to label %159 unwind label %120

159:                                              ; preds = %154
  %160 = icmp ne i64 %158, 1
  br i1 %160, label %170, label %161

161:                                              ; preds = %159
  %162 = load ptr, ptr %18, align 8, !tbaa !5
  %163 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %162) #8
  %164 = getelementptr inbounds %"class.dali::tasking::Task", ptr %163, i32 0, i32 8
  %165 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(72) %164)
          to label %166 unwind label %120

166:                                              ; preds = %161
  %167 = call noundef ptr @_ZNKSt12__shared_ptrIN4dali7tasking8WaitableELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %165) #8
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = icmp ne ptr %167, %168
  br label %170

170:                                              ; preds = %166, %159
  %171 = phi i1 [ true, %159 ], [ %169, %166 ]
  br i1 %171, label %172, label %173

172:                                              ; preds = %170
  br label %175

173:                                              ; preds = %170
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 79, ptr noundef @__PRETTY_FUNCTION__._ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE) #9
  unreachable

174:                                              ; No predecessors!
  br label %175

175:                                              ; preds = %174, %172
  store i32 6, ptr %17, align 4
  br label %241

176:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %177 = load ptr, ptr %18, align 8, !tbaa !5
  %178 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %177) #8
  %179 = getelementptr inbounds %"class.dali::tasking::Task", ptr %178, i32 0, i32 8
  %180 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(72) %179)
          to label %181 unwind label %202

181:                                              ; preds = %176
  %182 = load ptr, ptr %18, align 8, !tbaa !5
  %183 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %182) #8
  %184 = getelementptr inbounds %"class.dali::tasking::Task", ptr %183, i32 0, i32 8
  %185 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(72) %184)
          to label %186 unwind label %202

186:                                              ; preds = %181
  %187 = getelementptr inbounds %class.anon, ptr %20, i32 0, i32 0
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %188, ptr %187, align 8, !tbaa !19
  %189 = getelementptr inbounds %class.anon, ptr %20, i32 0, i32 0
  %190 = load ptr, ptr %189, align 8
  %191 = invoke noundef ptr @"_ZSt7find_ifIPSt10shared_ptrIN4dali7tasking8WaitableEEZNS2_9Scheduler6NotifyEPS3_E3$_0ET_S9_S9_T0_"(ptr noundef %180, ptr noundef %185, ptr %190)
          to label %192 unwind label %202

192:                                              ; preds = %186
  store ptr %191, ptr %19, align 8, !tbaa !5
  %193 = load ptr, ptr %19, align 8, !tbaa !5
  %194 = load ptr, ptr %18, align 8, !tbaa !5
  %195 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %194) #8
  %196 = getelementptr inbounds %"class.dali::tasking::Task", ptr %195, i32 0, i32 8
  %197 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(72) %196)
          to label %198 unwind label %202

198:                                              ; preds = %192
  %199 = icmp ne ptr %193, %197
  br i1 %199, label %200, label %201

200:                                              ; preds = %198
  br label %207

201:                                              ; preds = %198
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 84, ptr noundef @__PRETTY_FUNCTION__._ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE) #9
  unreachable

202:                                              ; preds = %221, %218, %213, %207, %192, %186, %181, %176
  %203 = landingpad { ptr, i32 }
          cleanup
  %204 = extractvalue { ptr, i32 } %203, 0
  store ptr %204, ptr %10, align 8
  %205 = extractvalue { ptr, i32 } %203, 1
  store i32 %205, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %247

206:                                              ; No predecessors!
  br label %207

207:                                              ; preds = %206, %200
  %208 = load ptr, ptr %18, align 8, !tbaa !5
  %209 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %208) #8
  %210 = getelementptr inbounds %"class.dali::tasking::Task", ptr %209, i32 0, i32 8
  %211 = load ptr, ptr %19, align 8, !tbaa !5
  %212 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5eraseEPKS4_(ptr noundef nonnull align 8 dereferenceable(72) %210, ptr noundef %211)
          to label %213 unwind label %202

213:                                              ; preds = %207
  %214 = load ptr, ptr %18, align 8, !tbaa !5
  %215 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %214) #8
  %216 = invoke noundef zeroext i1 @_ZN4dali7tasking4Task5ReadyEv(ptr noundef nonnull align 8 dereferenceable(536) %215)
          to label %217 unwind label %202

217:                                              ; preds = %213
  br i1 %216, label %218, label %230

218:                                              ; preds = %217
  %219 = getelementptr inbounds %"class.dali::tasking::Scheduler", ptr %21, i32 0, i32 3
  %220 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @_ZN4dali7tasking6detail8TaskList6RemoveERKSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(24) %219, ptr noundef nonnull align 8 dereferenceable(16) %220)
          to label %221 unwind label %202

221:                                              ; preds = %218
  %222 = load ptr, ptr %18, align 8, !tbaa !5
  %223 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %222) #8
  %224 = getelementptr inbounds %"class.dali::tasking::Task", ptr %223, i32 0, i32 1
  store i32 2, ptr %224, align 4, !tbaa !21
  %225 = getelementptr inbounds %"class.dali::tasking::Scheduler", ptr %21, i32 0, i32 4
  %226 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @_ZNSt14priority_queueISt10shared_ptrIN4dali7tasking4TaskEESt6vectorIS4_SaIS4_EENS2_9Scheduler16TaskPriorityLessEE4pushEOS4_(ptr noundef nonnull align 8 dereferenceable(25) %225, ptr noundef nonnull align 8 dereferenceable(16) %226)
          to label %227 unwind label %202

227:                                              ; preds = %221
  %228 = load i32, ptr %7, align 4, !tbaa !13
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %7, align 4, !tbaa !13
  store i32 6, ptr %17, align 4
  br label %231

230:                                              ; preds = %217
  store i32 0, ptr %17, align 4
  br label %231

231:                                              ; preds = %230, %227
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  %232 = load i32, ptr %17, align 4
  switch i32 %232, label %241 [
    i32 0, label %233
  ]

233:                                              ; preds = %231
  br label %234

234:                                              ; preds = %233, %145, %138
  %235 = load ptr, ptr %18, align 8, !tbaa !5
  %236 = call noundef zeroext i1 @_ZN4dali7tasking9Scheduler24AcquireAllAndMoveToReadyERSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(193) %21, ptr noundef nonnull align 8 dereferenceable(16) %235) #8
  br i1 %236, label %237, label %240

237:                                              ; preds = %234
  %238 = load i32, ptr %7, align 4, !tbaa !13
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %7, align 4, !tbaa !13
  br label %240

240:                                              ; preds = %237, %234
  store i32 0, ptr %17, align 4
  br label %241

241:                                              ; preds = %240, %231, %175, %129, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  %242 = load i32, ptr %17, align 4
  switch i32 %242, label %248 [
    i32 0, label %243
    i32 6, label %244
  ]

243:                                              ; preds = %241
  br label %244

244:                                              ; preds = %243, %241
  %245 = load ptr, ptr %15, align 8, !tbaa !5
  %246 = getelementptr inbounds %"class.std::shared_ptr", ptr %245, i32 1
  store ptr %246, ptr %15, align 8, !tbaa !5
  br label %95

247:                                              ; preds = %202, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %249

248:                                              ; preds = %241, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %251

249:                                              ; preds = %247, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %250

250:                                              ; preds = %249, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %256

251:                                              ; preds = %248
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(136) %9) #8
  call void @llvm.lifetime.end.p0(i64 136, ptr %9) #8
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %252 = load i32, ptr %7, align 4, !tbaa !13
  %253 = icmp eq i32 %252, 1
  br i1 %253, label %254, label %258

254:                                              ; preds = %251
  %255 = getelementptr inbounds %"class.dali::tasking::Scheduler", ptr %21, i32 0, i32 1
  call void @_ZNSt18condition_variable10notify_oneEv(ptr noundef nonnull align 8 dereferenceable(48) %255) #8
  br label %264

256:                                              ; preds = %250, %84, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(136) %9) #8
  br label %257

257:                                              ; preds = %256, %65
  call void @llvm.lifetime.end.p0(i64 136, ptr %9) #8
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #8
  br label %265

258:                                              ; preds = %251
  %259 = load i32, ptr %7, align 4, !tbaa !13
  %260 = icmp sgt i32 %259, 1
  br i1 %260, label %261, label %263

261:                                              ; preds = %258
  %262 = getelementptr inbounds %"class.dali::tasking::Scheduler", ptr %21, i32 0, i32 1
  call void @_ZNSt18condition_variable10notify_allEv(ptr noundef nonnull align 8 dereferenceable(48) %262) #8
  br label %263

263:                                              ; preds = %261, %258
  br label %264

264:                                              ; preds = %263, %254
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #8
  ret void

265:                                              ; preds = %257
  %266 = load ptr, ptr %10, align 8
  %267 = load i32, ptr %11, align 4
  %268 = insertvalue { ptr, i32 } poison, ptr %266, 0
  %269 = insertvalue { ptr, i32 } %268, i32 %267, 1
  resume { ptr, i32 } %269
}

; Function Attrs: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #5

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

; Function Attrs: nounwind
declare void @_ZNSt18condition_variable10notify_allEv(ptr noundef nonnull align 8 dereferenceable(48)) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(136)) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(136), i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE12emplace_backIJRSt8weak_ptrIS3_EEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EEixEl(ptr noundef nonnull align 8 dereferenceable(136), i64 noundef) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4dali7tasking4Task5ReadyEv(ptr noundef nonnull align 8 dereferenceable(536)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72)) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt12__shared_ptrIN4dali7tasking8WaitableELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef ptr @"_ZSt7find_ifIPSt10shared_ptrIN4dali7tasking8WaitableEEZNS2_9Scheduler6NotifyEPS3_E3$_0ET_S9_S9_T0_"(ptr noundef, ptr noundef, ptr) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5eraseEPKS4_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef) #3 align 2

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

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

; Function Attrs: nounwind
declare void @_ZNSt18condition_variable10notify_oneEv(ptr noundef nonnull align 8 dereferenceable(48)) #6

attributes #0 = { 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 #1 = { noreturn 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind willreturn memory(read) }
attributes #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn 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 = !{!"any pointer", !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 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!20, !6, i64 0}
!20 = !{!"_ZTSZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableEE3$_0", !6, i64 0}
!21 = !{!22, !33, i64 164}
!22 = !{!"_ZTSN4dali7tasking4TaskE", !23, i64 0, !33, i64 164, !34, i64 168, !6, i64 184, !6, i64 192, !37, i64 200, !39, i64 280, !40, i64 288, !42, i64 320, !38, i64 392, !43, i64 464}
!23 = !{!"_ZTSN4dali7tasking15CompletionEventE", !24, i64 0, !31, i64 160}
!24 = !{!"_ZTSN4dali7tasking8WaitableE", !25, i64 8, !29, i64 24}
!25 = !{!"_ZTSSt23enable_shared_from_thisIN4dali7tasking8WaitableEE", !26, i64 0}
!26 = !{!"_ZTSSt8weak_ptrIN4dali7tasking8WaitableEE", !27, i64 0}
!27 = !{!"_ZTSSt10__weak_ptrIN4dali7tasking8WaitableELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !28, i64 8}
!28 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!29 = !{!"_ZTSN4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EEE", !7, i64 0, !30, i64 128}
!30 = !{!"long", !7, i64 0}
!31 = !{!"_ZTSSt6atomicIbE", !32, i64 0}
!32 = !{!"_ZTSSt13__atomic_baseIbE", !10, i64 0}
!33 = !{!"_ZTSN4dali7tasking9TaskStateE", !7, i64 0}
!34 = !{!"_ZTSSt10shared_ptrIN4dali7tasking4TaskEE", !35, i64 0}
!35 = !{!"_ZTSSt12__shared_ptrIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !36, i64 8}
!36 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!37 = !{!"_ZTSN4dali7tasking11TaskResultsE", !38, i64 0, !10, i64 72, !10, i64 73}
!38 = !{!"_ZTSN4dali11SmallVectorISt10shared_ptrINS_7tasking10TaskResultEELm4ESaIS4_EEE", !7, i64 0, !30, i64 64}
!39 = !{!"double", !7, i64 0}
!40 = !{!"_ZTSSt8functionIFvPN4dali7tasking4TaskEEE", !41, i64 0, !6, i64 24}
!41 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!42 = !{!"_ZTSN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EEE", !7, i64 0, !30, i64 64}
!43 = !{!"_ZTSN4dali11SmallVectorISt10shared_ptrINS_7tasking10ReleasableEELm4ESaIS4_EEE", !7, i64 0, !30, i64 64}


; 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.std::lock_guard" = type { ptr }
%"class.dali::SmallVector.19" = type { %union.anon.22, i64 }
%union.anon.22 = type { %struct.anon.23, [112 x i8] }
%struct.anon.23 = type { ptr, i64 }

@.str.1 = external hidden unnamed_addr constant [81 x i8], align 1
@_ZTIN4dali7tasking8WaitableE = external dso_local constant { ptr, ptr, i32, i32, ptr, i64 }, align 8
@_ZTIN4dali7tasking15CompletionEventE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN4dali7tasking4TaskE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.3 = external hidden unnamed_addr constant [77 x i8], align 1
@__PRETTY_FUNCTION__._ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE = external hidden unnamed_addr constant [50 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [33 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4dali7tasking8Waitable10TryAcquireERKSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4dali7tasking6detail8TaskList6RemoveERKSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt10shared_ptrIN4dali7tasking4TaskEESt6vectorIS4_SaIS4_EENS2_9Scheduler16TaskPriorityLessEE4pushEOS4_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE(ptr noundef nonnull align 8 dereferenceable(193) %0, ptr noundef %1) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::lock_guard", align 8
  %4 = alloca %"class.dali::SmallVector.19", align 8
  %5 = icmp eq ptr %1, null
  br i1 %5, label %.critedge74, label %6

6:                                                ; preds = %2
  %7 = tail call ptr @__dynamic_cast(ptr nonnull %1, ptr nonnull @_ZTIN4dali7tasking8WaitableE, ptr nonnull @_ZTIN4dali7tasking15CompletionEventE, i64 0) #8
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %.critedge74, label %8

8:                                                ; preds = %6
  %9 = tail call ptr @__dynamic_cast(ptr nonnull %1, ptr nonnull @_ZTIN4dali7tasking8WaitableE, ptr nonnull @_ZTIN4dali7tasking4TaskE, i64 0) #8
  %.not84 = icmp eq ptr %9, null
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(40) %0)
  br i1 %.not84, label %12, label %10

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %0, i64 88
  call void @_ZNSt18condition_variable10notify_allEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #8
  br label %12

.critedge74:                                      ; preds = %2, %6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(40) %0)
  br label %12

12:                                               ; preds = %.critedge74, %10, %8
  %.not76 = phi i1 [ true, %.critedge74 ], [ false, %10 ], [ false, %8 ]
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %4) #8
  call void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(136) %4)
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = call noundef i64 @_ZNK4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(136) %13)
  %sext = shl i64 %14, 32
  %15 = ashr exact i64 %sext, 32
  invoke void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(136) %4, i64 noundef %15)
          to label %.preheader85 unwind label %19

.preheader85:                                     ; preds = %12
  %16 = trunc i64 %14 to i32
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader85
  %wide.trip.count = and i64 %14, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %23, %.preheader85
  %18 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(136) %4)
          to label %26 unwind label %30

19:                                               ; preds = %12
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %109

.lr.ph:                                           ; preds = %.lr.ph.preheader, %23
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %23 ]
  %21 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EEixEl(ptr noundef nonnull align 8 dereferenceable(136) %13, i64 noundef %indvars.iv)
          to label %22 unwind label %24

22:                                               ; preds = %.lr.ph
  invoke void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE12emplace_backIJRSt8weak_ptrIS3_EEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(136) %4, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %23 unwind label %24

23:                                               ; preds = %22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

24:                                               ; preds = %22, %.lr.ph
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %109

26:                                               ; preds = %._crit_edge
  %27 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(136) %4)
          to label %.preheader unwind label %32

.preheader:                                       ; preds = %26
  %.not6491 = icmp eq ptr %18, %27
  br i1 %.not6491, label %.critedge, label %.lr.ph94

.lr.ph94:                                         ; preds = %.preheader
  %28 = getelementptr inbounds i8, ptr %0, i64 136
  %29 = getelementptr inbounds i8, ptr %0, i64 160
  br label %34

30:                                               ; preds = %._crit_edge
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %109

32:                                               ; preds = %26
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %109

34:                                               ; preds = %.lr.ph94, %104
  %.093 = phi i32 [ 0, %.lr.ph94 ], [ %.4.ph, %104 ]
  %.06092 = phi ptr [ %18, %.lr.ph94 ], [ %105, %104 ]
  br i1 %.not76, label %35, label %42

35:                                               ; preds = %34
  %36 = load ptr, ptr %1, align 8, !tbaa !7
  %37 = load ptr, ptr %36, align 8
  %38 = invoke noundef zeroext i1 %37(ptr noundef nonnull align 8 dereferenceable(160) %1)
          to label %39 unwind label %40

39:                                               ; preds = %35
  br i1 %38, label %42, label %.critedge

40:                                               ; preds = %66, %59, %52, %42, %35
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %109

42:                                               ; preds = %39, %34
  %43 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %44 = invoke noundef zeroext i1 @_ZN4dali7tasking4Task5ReadyEv(ptr noundef nonnull align 8 dereferenceable(536) %43)
          to label %45 unwind label %40

45:                                               ; preds = %42
  br i1 %44, label %104, label %46

46:                                               ; preds = %45
  br i1 %.not76, label %47, label %59

47:                                               ; preds = %46
  %48 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %49 = getelementptr inbounds i8, ptr %48, i64 320
  %50 = call noundef i64 @_ZNK4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72) %49)
  %51 = icmp eq i64 %50, 1
  br i1 %51, label %52, label %101

52:                                               ; preds = %47
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %54 = getelementptr inbounds i8, ptr %53, i64 320
  %55 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(72) %54)
          to label %56 unwind label %40

56:                                               ; preds = %52
  %57 = call noundef ptr @_ZNKSt12__shared_ptrIN4dali7tasking8WaitableELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %55) #8
  %58 = icmp eq ptr %57, %1
  br i1 %58, label %59, label %101

59:                                               ; preds = %56, %46
  %60 = invoke noundef zeroext i1 @_ZN4dali7tasking8Waitable10TryAcquireERKSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(160) %1, ptr noundef nonnull align 8 dereferenceable(16) %.06092)
          to label %61 unwind label %40

61:                                               ; preds = %59
  %62 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %63 = getelementptr inbounds i8, ptr %62, i64 320
  br i1 %60, label %73, label %64

64:                                               ; preds = %61
  %65 = call noundef i64 @_ZNK4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72) %63)
  %.not65 = icmp eq i64 %65, 1
  br i1 %.not65, label %66, label %104

66:                                               ; preds = %64
  %67 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %68 = getelementptr inbounds i8, ptr %67, i64 320
  %69 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(72) %68)
          to label %70 unwind label %40

70:                                               ; preds = %66
  %71 = call noundef ptr @_ZNKSt12__shared_ptrIN4dali7tasking8WaitableELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %69) #8
  %.not66 = icmp eq ptr %71, %1
  br i1 %.not66, label %72, label %104

72:                                               ; preds = %70
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 79, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE) #9
  unreachable

73:                                               ; preds = %61
  %74 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(72) %63)
          to label %75 unwind label %87

75:                                               ; preds = %73
  %76 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %77 = getelementptr inbounds i8, ptr %76, i64 320
  %78 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(72) %77)
          to label %79 unwind label %87

79:                                               ; preds = %75
  %80 = invoke noundef ptr @"_ZSt7find_ifIPSt10shared_ptrIN4dali7tasking8WaitableEEZNS2_9Scheduler6NotifyEPS3_E3$_0ET_S9_S9_T0_"(ptr noundef %74, ptr noundef %78, ptr nonnull %1)
          to label %81 unwind label %87

81:                                               ; preds = %79
  %82 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %83 = getelementptr inbounds i8, ptr %82, i64 320
  %84 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(72) %83)
          to label %85 unwind label %87

85:                                               ; preds = %81
  %.not67 = icmp eq ptr %80, %84
  br i1 %.not67, label %86, label %89

86:                                               ; preds = %85
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 84, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali7tasking9Scheduler6NotifyEPNS0_8WaitableE) #9
  unreachable

87:                                               ; preds = %97, %93, %89, %81, %79, %75, %73
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %109

89:                                               ; preds = %85
  %90 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %91 = getelementptr inbounds i8, ptr %90, i64 320
  %92 = invoke noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5eraseEPKS4_(ptr noundef nonnull align 8 dereferenceable(72) %91, ptr noundef %80)
          to label %93 unwind label %87

93:                                               ; preds = %89
  %94 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %95 = invoke noundef zeroext i1 @_ZN4dali7tasking4Task5ReadyEv(ptr noundef nonnull align 8 dereferenceable(536) %94)
          to label %96 unwind label %87

96:                                               ; preds = %93
  br i1 %95, label %97, label %101

97:                                               ; preds = %96
  call void @_ZN4dali7tasking6detail8TaskList6RemoveERKSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(16) %.06092)
  %98 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %.06092) #8
  %99 = getelementptr inbounds i8, ptr %98, i64 164
  store i32 2, ptr %99, align 4, !tbaa !10
  invoke void @_ZNSt14priority_queueISt10shared_ptrIN4dali7tasking4TaskEESt6vectorIS4_SaIS4_EENS2_9Scheduler16TaskPriorityLessEE4pushEOS4_(ptr noundef nonnull align 8 dereferenceable(25) %29, ptr noundef nonnull align 8 dereferenceable(16) %.06092)
          to label %.thread78 unwind label %87

.thread78:                                        ; preds = %97
  %100 = add nsw i32 %.093, 1
  br label %104

101:                                              ; preds = %96, %56, %47
  %102 = call noundef zeroext i1 @_ZN4dali7tasking9Scheduler24AcquireAllAndMoveToReadyERSt10shared_ptrINS0_4TaskEE(ptr noundef nonnull align 8 dereferenceable(193) %0, ptr noundef nonnull align 8 dereferenceable(16) %.06092) #8
  %103 = zext i1 %102 to i32
  %spec.select = add nsw i32 %.093, %103
  br label %104

104:                                              ; preds = %101, %45, %64, %70, %.thread78
  %.4.ph = phi i32 [ %100, %.thread78 ], [ %.093, %70 ], [ %.093, %64 ], [ %.093, %45 ], [ %spec.select, %101 ]
  %105 = getelementptr inbounds i8, ptr %.06092, i64 16
  %.not64 = icmp eq ptr %105, %27
  br i1 %.not64, label %.critedge, label %34

.critedge:                                        ; preds = %104, %39, %.preheader
  %.0.lcssa = phi i32 [ 0, %.preheader ], [ %.093, %39 ], [ %.4.ph, %104 ]
  call void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(136) %4) #8
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %4) #8
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %106 = icmp eq i32 %.0.lcssa, 1
  br i1 %106, label %107, label %110

107:                                              ; preds = %.critedge
  %108 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt18condition_variable10notify_oneEv(ptr noundef nonnull align 8 dereferenceable(48) %108) #8
  br label %114

109:                                              ; preds = %30, %40, %87, %32, %24, %19
  %.pn71 = phi { ptr, i32 } [ %25, %24 ], [ %20, %19 ], [ %31, %30 ], [ %33, %32 ], [ %88, %87 ], [ %41, %40 ]
  call void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(136) %4) #8
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %4) #8
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn71

110:                                              ; preds = %.critedge
  %111 = icmp sgt i32 %.0.lcssa, 1
  br i1 %111, label %112, label %114

112:                                              ; preds = %110
  %113 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt18condition_variable10notify_allEv(ptr noundef nonnull align 8 dereferenceable(48) %113) #8
  br label %114

114:                                              ; preds = %110, %112, %107
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #5

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

; Function Attrs: nounwind
declare void @_ZNSt18condition_variable10notify_allEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(136), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE12emplace_backIJRSt8weak_ptrIS3_EEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EEixEl(ptr noundef nonnull align 8 dereferenceable(136), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking4TaskEELm8ESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4dali7tasking4Task5ReadyEv(ptr noundef nonnull align 8 dereferenceable(536)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt12__shared_ptrIN4dali7tasking8WaitableELN9__gnu_cxx12_Lock_policyE2EE3getEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef ptr @"_ZSt7find_ifIPSt10shared_ptrIN4dali7tasking8WaitableEEZNS2_9Scheduler6NotifyEPS3_E3$_0ET_S9_S9_T0_"(ptr noundef, ptr noundef, ptr) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EE5eraseEPKS4_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: nounwind
declare void @_ZNSt18condition_variable10notify_oneEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #6

attributes #0 = { 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 #1 = { noreturn 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(read) }
attributes #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"vtable pointer", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !25, i64 164}
!11 = !{!"_ZTSN4dali7tasking4TaskE", !12, i64 0, !25, i64 164, !26, i64 168, !17, i64 184, !17, i64 192, !29, i64 200, !31, i64 280, !32, i64 288, !34, i64 320, !30, i64 392, !35, i64 464}
!12 = !{!"_ZTSN4dali7tasking15CompletionEventE", !13, i64 0, !22, i64 160}
!13 = !{!"_ZTSN4dali7tasking8WaitableE", !14, i64 8, !20, i64 24}
!14 = !{!"_ZTSSt23enable_shared_from_thisIN4dali7tasking8WaitableEE", !15, i64 0}
!15 = !{!"_ZTSSt8weak_ptrIN4dali7tasking8WaitableEE", !16, i64 0}
!16 = !{!"_ZTSSt10__weak_ptrIN4dali7tasking8WaitableELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !19, i64 8}
!17 = !{!"any pointer", !18, i64 0}
!18 = !{!"omnipotent char", !9, i64 0}
!19 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0}
!20 = !{!"_ZTSN4dali11SmallVectorISt8weak_ptrINS_7tasking4TaskEELm8ESaIS4_EEE", !18, i64 0, !21, i64 128}
!21 = !{!"long", !18, i64 0}
!22 = !{!"_ZTSSt6atomicIbE", !23, i64 0}
!23 = !{!"_ZTSSt13__atomic_baseIbE", !24, i64 0}
!24 = !{!"bool", !18, i64 0}
!25 = !{!"_ZTSN4dali7tasking9TaskStateE", !18, i64 0}
!26 = !{!"_ZTSSt10shared_ptrIN4dali7tasking4TaskEE", !27, i64 0}
!27 = !{!"_ZTSSt12__shared_ptrIN4dali7tasking4TaskELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !28, i64 8}
!28 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0}
!29 = !{!"_ZTSN4dali7tasking11TaskResultsE", !30, i64 0, !24, i64 72, !24, i64 73}
!30 = !{!"_ZTSN4dali11SmallVectorISt10shared_ptrINS_7tasking10TaskResultEELm4ESaIS4_EEE", !18, i64 0, !21, i64 64}
!31 = !{!"double", !18, i64 0}
!32 = !{!"_ZTSSt8functionIFvPN4dali7tasking4TaskEEE", !33, i64 0, !17, i64 24}
!33 = !{!"_ZTSSt14_Function_base", !18, i64 0, !17, i64 16}
!34 = !{!"_ZTSN4dali11SmallVectorISt10shared_ptrINS_7tasking8WaitableEELm4ESaIS4_EEE", !18, i64 0, !21, i64 64}
!35 = !{!"_ZTSN4dali11SmallVectorISt10shared_ptrINS_7tasking10ReleasableEELm4ESaIS4_EEE", !18, i64 0, !21, i64 64}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass