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

; 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::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.4" }
%"struct.std::_Head_base.4" = type { ptr }
%"class.std::unique_lock" = type <{ ptr, i8, [7 x i8] }>
%class.anon = type { ptr }
%"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 }

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) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ocs210ThreadPool6workerEi(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::unique_ptr", align 8
  %6 = alloca %"class.std::unique_lock", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %class.anon, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %11 = load ptr, ptr %3, align 8
  br label %12

12:                                               ; preds = %63, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  %13 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %11, i32 0, i32 3
  invoke void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %6, ptr noundef nonnull align 8 dereferenceable(40) %13)
          to label %14 unwind label %24

14:                                               ; preds = %12
  %15 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %11, i32 0, i32 2
  %16 = getelementptr inbounds %class.anon, ptr %9, i32 0, i32 0
  store ptr %11, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds %class.anon, ptr %9, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8
  invoke void @"_ZNSt18condition_variable4waitIZN4ocs210ThreadPool6workerEiE3$_0EEvRSt11unique_lockISt5mutexET_"(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 8 dereferenceable(9) %6, ptr %18)
          to label %19 unwind label %28

19:                                               ; preds = %14
  %20 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %11, i32 0, i32 0
  %21 = load i8, ptr %20, align 8, !tbaa !13, !range !31, !noundef !32
  %22 = trunc i8 %21 to i1
  br i1 %22, label %23, label %32

23:                                               ; preds = %19
  store i32 3, ptr %10, align 4
  br label %44

24:                                               ; preds = %12
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %7, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %8, align 4
  br label %55

28:                                               ; preds = %39, %36, %32, %14
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %7, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %8, align 4
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %6) #3
  br label %55

32:                                               ; preds = %19
  %33 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %11, i32 0, i32 1
  %34 = invoke noundef zeroext i1 @_ZNKSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %33)
          to label %35 unwind label %28

35:                                               ; preds = %32
  br i1 %34, label %43, label %36

36:                                               ; preds = %35
  %37 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %11, i32 0, i32 1
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %37)
          to label %39 unwind label %28

39:                                               ; preds = %36
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EEaSEOS5_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %38) #3
  %41 = getelementptr inbounds %"class.ocs2::ThreadPool", ptr %11, i32 0, i32 1
  invoke void @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %41)
          to label %42 unwind label %28

42:                                               ; preds = %39
  br label %43

43:                                               ; preds = %42, %35
  store i32 0, ptr %10, align 4
  br label %44

44:                                               ; preds = %43, %23
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  %45 = load i32, ptr %10, align 4
  switch i32 %45, label %61 [
    i32 0, label %46
  ]

46:                                               ; preds = %44
  %47 = call noundef zeroext i1 @_ZNKSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %47, label %48, label %60

48:                                               ; preds = %46
  %49 = call noundef ptr @_ZNKSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %50 = load i32, ptr %4, align 4, !tbaa !9
  %51 = load ptr, ptr %49, align 8, !tbaa !33
  %52 = getelementptr inbounds ptr, ptr %51, i64 2
  %53 = load ptr, ptr %52, align 8
  invoke void %53(ptr noundef nonnull align 8 dereferenceable(8) %49, i32 noundef %50)
          to label %54 unwind label %56

54:                                               ; preds = %48
  br label %60

55:                                               ; preds = %28, %24
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  br label %64

56:                                               ; preds = %48
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %7, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %8, align 4
  br label %64

60:                                               ; preds = %54, %46
  store i32 0, ptr %10, align 4
  br label %61

61:                                               ; preds = %60, %44
  call void @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %62 = load i32, ptr %10, align 4
  switch i32 %62, label %71 [
    i32 0, label %63
    i32 3, label %65
  ]

63:                                               ; preds = %61
  br label %12, !llvm.loop !35

64:                                               ; preds = %56, %55
  call void @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br label %66

65:                                               ; preds = %61
  ret void

66:                                               ; preds = %64
  %67 = load ptr, ptr %7, align 8
  %68 = load i32, ptr %8, align 4
  %69 = insertvalue { ptr, i32 } poison, ptr %67, 0
  %70 = insertvalue { ptr, i32 } %69, i32 %68, 1
  resume { ptr, i32 } %70

71:                                               ; preds = %61
  unreachable
}

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt18condition_variable4waitIZN4ocs210ThreadPool6workerEiE3$_0EEvRSt11unique_lockISt5mutexET_"(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(9), ptr) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSZN4ocs210ThreadPool6workerEiE3$_0", !6, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN4ocs210ThreadPoolE", !15, i64 0, !16, i64 8, !23, i64 88, !25, i64 136, !27, 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, !21, i64 8, !22, i64 16, !22, i64 48}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSSt15_Deque_iteratorISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EERS6_PS6_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!"_ZTSSt18condition_variable", !24, i64 0}
!24 = !{!"_ZTSSt9__condvar", !7, i64 0}
!25 = !{!"_ZTSSt5mutex", !26, i64 0}
!26 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!27 = !{!"_ZTSSt6vectorISt6threadSaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseISt6threadSaIS0_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseISt6threadSaIS0_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseISt6threadSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!34, !34, i64 0}
!34 = !{!"vtable pointer", !8, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


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

%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.4" }
%"struct.std::_Head_base.4" = type { ptr }
%"class.std::unique_lock" = type <{ ptr, i8, [7 x i8] }>

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) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ocs210ThreadPool6workerEi(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::unique_ptr", align 8
  %4 = alloca %"class.std::unique_lock", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 136
  %6 = getelementptr inbounds i8, ptr %0, i64 88
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  br label %8

8:                                                ; preds = %32, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  invoke void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %4, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %9 unwind label %13

9:                                                ; preds = %8
  invoke void @"_ZNSt18condition_variable4waitIZN4ocs210ThreadPool6workerEiE3$_0EEvRSt11unique_lockISt5mutexET_"(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(9) %4, ptr nonnull %0)
          to label %10 unwind label %15

10:                                               ; preds = %9
  %11 = load i8, ptr %0, align 8, !tbaa !5, !range !26, !noundef !27
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %34, label %17

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

15:                                               ; preds = %9
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #3
  br label %29

17:                                               ; preds = %10
  %18 = call noundef zeroext i1 @_ZNKSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br i1 %18, label %22, label %19

19:                                               ; preds = %17
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EEaSEOS5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %20) #3
  call void @_ZNSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br label %22

22:                                               ; preds = %17, %19
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  %23 = call noundef zeroext i1 @_ZNKSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  br i1 %23, label %24, label %32

24:                                               ; preds = %22
  %25 = call noundef ptr @_ZNKSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %26 = load ptr, ptr %25, align 8, !tbaa !28
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %28 = load ptr, ptr %27, align 8
  invoke void %28(ptr noundef nonnull align 8 dereferenceable(8) %25, i32 noundef %1)
          to label %32 unwind label %30

29:                                               ; preds = %15, %13
  %.pn = phi { ptr, i32 } [ %16, %15 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  br label %33

30:                                               ; preds = %24
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %33

32:                                               ; preds = %22, %24
  call void @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %8

33:                                               ; preds = %30, %29
  %.pn10 = phi { ptr, i32 } [ %31, %30 ], [ %.pn, %29 ]
  call void @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  resume { ptr, i32 } %.pn10

34:                                               ; preds = %10
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  call void @_ZNSt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt18condition_variable4waitIZN4ocs210ThreadPool6workerEiE3$_0EEvRSt11unique_lockISt5mutexET_"(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(9), ptr) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueISt10unique_ptrIN4ocs210ThreadPool8TaskBaseESt14default_deleteIS3_EESt5dequeIS6_SaIS6_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!29, !29, i64 0}
!29 = !{!"vtable pointer", !9, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,SROAPass,SimplifyCFGPass