; LLVM IR from leggedrobotics/ocs2 :: ocs2_core/src/thread_support/ThreadPool.ll (ZN4ocs210ThreadPoolC2Emi)

; 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.ocs2::ThreadPool" = type { i8, %"class.std::queue", %"class.std::condition_variable", %"class.std::mutex", %"class.std::vector" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::unique_ptr<ocs2::ThreadPool::TaskBase>, std::allocator<std::unique_ptr<ocs2::ThreadPool::TaskBase>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::unique_ptr<ocs2::ThreadPool::TaskBase>, std::allocator<std::unique_ptr<ocs2::ThreadPool::TaskBase>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::unique_ptr<ocs2::ThreadPool::TaskBase>, std::allocator<std::unique_ptr<ocs2::ThreadPool::TaskBase>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::unique_ptr<ocs2::ThreadPool::TaskBase>, std::allocator<std::unique_ptr<ocs2::ThreadPool::TaskBase>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, 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.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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::thread, std::allocator<std::thread>>::_Vector_impl" }
%"struct.std::_Vector_base<std::thread, std::allocator<std::thread>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::thread, std::allocator<std::thread>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::thread, std::allocator<std::thread>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ocs210ThreadPoolC2Emi(ptr noundef nonnull align 8 dereferenceable(200) %0, i64 noundef %1, i32 noundef %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca { i64, i64 }, align 8
  %11 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !11
  %12 = load ptr, ptr %4, align 8
  %13 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %12, i32 0, i32 0
  store i8 0, ptr %13, align 8, !tbaa !13
  %14 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %12, i32 0, i32 1
  call void @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEEC2IS9_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
  %15 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %12, i32 0, i32 2
  call void @_ZNSt18condition_variableC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  %16 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %12, i32 0, i32 3
  call void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #6
  %17 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %12, i32 0, i32 4
  call void @_ZNSt6vectorISt6threadSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  %18 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %12, i32 0, i32 4
  %19 = load i64, ptr %5, align 8, !tbaa !9
  invoke void @_ZNSt6vectorISt6threadSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %19)
          to label %20 unwind label %26

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %21

21:                                               ; preds = %38, %20
  %22 = load i64, ptr %9, align 8, !tbaa !9
  %23 = load i64, ptr %5, align 8, !tbaa !9
  %24 = icmp ult i64 %22, %23
  br i1 %24, label %30, label %25

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

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

30:                                               ; preds = %21
  %31 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %12, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN4ocs210ThreadPool6workerEi to i64), i64 0 }, ptr %10, align 8, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr %12, ptr %11, align 8, !tbaa !5
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJMN4ocs210ThreadPoolEFviEPS5_RmEEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %33 unwind label %41

33:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  %34 = load i32, ptr %6, align 4, !tbaa !11
  %35 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %12, i32 0, i32 4
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt6threadSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #6
  invoke void @_ZN4ocs217setThreadPriorityEiRSt6thread(i32 noundef %34, ptr noundef nonnull align 8 dereferenceable(8) %36)
          to label %37 unwind label %45

37:                                               ; preds = %33
  br label %38

38:                                               ; preds = %37
  %39 = load i64, ptr %9, align 8, !tbaa !9
  %40 = add i64 %39, 1
  store i64 %40, ptr %9, align 8, !tbaa !9
  br label %21, !llvm.loop !31

41:                                               ; preds = %30
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %7, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  br label %49

45:                                               ; preds = %33
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  br label %49

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

50:                                               ; preds = %25
  ret void

51:                                               ; preds = %49, %26
  call void @_ZNSt6vectorISt6threadSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  call void @_ZNSt18condition_variableD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  call void @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #6
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %7, align 8
  %54 = load i32, ptr %8, align 4
  %55 = insertvalue { ptr, i32 } poison, ptr %53, 0
  %56 = insertvalue { ptr, i32 } %55, i32 %54, 1
  resume { ptr, i32 } %56
}

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

; Function Attrs: nounwind
declare void @_ZNSt18condition_variableC1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare void @_ZNSt18condition_variableD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

attributes #0 = { 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 #1 = { 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN4ocs210ThreadPoolE", !15, i64 0, !16, i64 8, !22, i64 88, !24, i64 136, !26, i64 176}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE", !17, i64 0}
!17 = !{!"_ZTSSt5dequeISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESaIS6_EE", !18, i64 0}
!18 = !{!"_ZTSSt11_Deque_baseISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESaIS6_EE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESaIS6_EE11_Deque_implE", !20, i64 0}
!20 = !{!"_ZTSNSt11_Deque_baseISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESaIS6_EE16_Deque_impl_dataE", !6, i64 0, !10, i64 8, !21, i64 16, !21, i64 48}
!21 = !{!"_ZTSSt15_Deque_iteratorISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EERS6_PS6_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSSt18condition_variable", !23, i64 0}
!23 = !{!"_ZTSSt9__condvar", !7, i64 0}
!24 = !{!"_ZTSSt5mutex", !25, i64 0}
!25 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!26 = !{!"_ZTSSt6vectorISt6threadSaIS0_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseISt6threadSaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt6threadSaIS0_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseISt6threadSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!7, !7, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"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"

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ocs210ThreadPoolC2Emi(ptr noundef nonnull align 8 dereferenceable(200) %0, i64 noundef %1, i32 noundef %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i64, align 8
  %5 = alloca { i64, i64 }, align 8
  %6 = alloca ptr, align 8
  store i8 0, ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEEC2IS9_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @_ZNSt18condition_variableC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 136
  tail call void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  %10 = getelementptr inbounds i8, ptr %0, i64 176
  tail call void @_ZNSt6vectorISt6threadSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  invoke void @_ZNSt6vectorISt6threadSaIS0_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %1)
          to label %11 unwind label %12

11:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store i64 0, ptr %4, align 8, !tbaa !26
  %.not = icmp eq i64 %1, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11
  %.fca.1.gep = getelementptr inbounds i8, ptr %5, i64 8
  br label %14

._crit_edge:                                      ; preds = %18, %11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret void

12:                                               ; preds = %3
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %27

14:                                               ; preds = %.lr.ph, %18
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  store i64 ptrtoint (ptr @_ZN4ocs210ThreadPool6workerEi to i64), ptr %5, align 8, !tbaa !27
  store i64 0, ptr %.fca.1.gep, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store ptr %0, ptr %6, align 8, !tbaa !28
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt6threadSaIS0_EE12emplace_backIJMN4ocs210ThreadPoolEFviEPS5_RmEEERS0_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %16 unwind label %22

16:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt6threadSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  invoke void @_ZN4ocs217setThreadPriorityEiRSt6thread(i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %18 unwind label %24

18:                                               ; preds = %16
  %19 = load i64, ptr %4, align 8, !tbaa !26
  %20 = add i64 %19, 1
  store i64 %20, ptr %4, align 8, !tbaa !26
  %21 = icmp ult i64 %20, %1
  br i1 %21, label %14, label %._crit_edge, !llvm.loop !29

22:                                               ; preds = %14
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  br label %26

24:                                               ; preds = %16
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %26

26:                                               ; preds = %24, %22
  %.pn = phi { ptr, i32 } [ %25, %24 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %27

27:                                               ; preds = %26, %12
  %.pn.pn = phi { ptr, i32 } [ %.pn, %26 ], [ %13, %12 ]
  call void @_ZNSt6vectorISt6threadSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @_ZNSt18condition_variableD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: nounwind
declare void @_ZNSt18condition_variableC1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare void @_ZNSt18condition_variableD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

attributes #0 = { 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 #1 = { 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #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, !7, i64 0}
!6 = !{!"_ZTSN4ocs210ThreadPoolE", !7, i64 0, !10, i64 8, !18, i64 88, !20, i64 136, !22, i64 176}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE", !11, i64 0}
!11 = !{!"_ZTSSt5dequeISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESaIS6_EE", !12, i64 0}
!12 = !{!"_ZTSSt11_Deque_baseISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESaIS6_EE", !13, i64 0}
!13 = !{!"_ZTSNSt11_Deque_baseISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESaIS6_EE11_Deque_implE", !14, i64 0}
!14 = !{!"_ZTSNSt11_Deque_baseISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESaIS6_EE16_Deque_impl_dataE", !15, i64 0, !16, i64 8, !17, i64 16, !17, i64 48}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!"_ZTSSt15_Deque_iteratorISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EERS6_PS6_E", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!18 = !{!"_ZTSSt18condition_variable", !19, i64 0}
!19 = !{!"_ZTSSt9__condvar", !8, i64 0}
!20 = !{!"_ZTSSt5mutex", !21, i64 0}
!21 = !{!"_ZTSSt12__mutex_base", !8, i64 0}
!22 = !{!"_ZTSSt6vectorISt6threadSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseISt6threadSaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt6threadSaIS0_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseISt6threadSaIS0_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!26 = !{!16, !16, i64 0}
!27 = !{!8, !8, i64 0}
!28 = !{!15, !15, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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