; LLVM IR from turi-code/SFrame :: oss_src/parallel/thread_pool.ll (ZN8graphlab11thread_pool18spawn_thread_groupEv)

; 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.boost::function" = type { %"class.boost::function0" }
%"class.boost::function0" = type { %"class.boost::function_base" }
%"class.boost::function_base" = type { ptr, %"union.boost::detail::function::function_buffer" }
%"union.boost::detail::function::function_buffer" = type { %"union.boost::detail::function::function_buffer_members" }
%"union.boost::detail::function::function_buffer_members" = type { %"struct.boost::detail::function::function_buffer_members::bound_memfunc_ptr_t" }
%"struct.boost::detail::function::function_buffer_members::bound_memfunc_ptr_t" = type { { i64, i64 }, ptr }
%"class.boost::_bi::bind_t" = type { %"class.boost::_mfi::mf0", %"class.boost::_bi::list1" }
%"class.boost::_mfi::mf0" = type { { i64, i64 } }
%"class.boost::_bi::list1" = type { %"struct.boost::_bi::storage1" }
%"struct.boost::_bi::storage1" = type { %"class.boost::_bi::value" }
%"class.boost::_bi::value" = type { ptr }
%"class.graphlab::thread_pool" = type <{ %"class.graphlab::thread_group", %"class.graphlab::blocking_queue", i64, %"class.graphlab::mutex", %"class.graphlab::conditional", i64, i64, i8, i8, [6 x i8] }>
%"class.graphlab::thread_group" = type { i64, i64, %"class.graphlab::mutex", %"class.graphlab::conditional", %"class.std::queue.0" }
%"class.std::queue.0" = type { %"class.std::deque.1" }
%"class.std::deque.1" = type { %"class.std::_Deque_base.2" }
%"class.std::_Deque_base.2" = type { %"struct.std::_Deque_base<std::pair<unsigned long, const char *>, std::allocator<std::pair<unsigned long, const char *>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<unsigned long, const char *>, std::allocator<std::pair<unsigned long, const char *>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<unsigned long, const char *>, std::allocator<std::pair<unsigned long, const char *>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<unsigned long, const char *>, std::allocator<std::pair<unsigned long, const char *>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.6", %"struct.std::_Deque_iterator.6" }
%"struct.std::_Deque_iterator.6" = type { ptr, ptr, ptr, ptr }
%"class.graphlab::blocking_queue" = type <{ i8, [7 x i8], %"class.std::deque.7", %"class.graphlab::mutex", %"class.graphlab::conditional", %"class.graphlab::conditional", i16, i16, [4 x i8] }>
%"class.std::deque.7" = type { %"class.std::_Deque_base.8" }
%"class.std::_Deque_base.8" = type { %"struct.std::_Deque_base<std::pair<boost::function<void ()>, int>, std::allocator<std::pair<boost::function<void ()>, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<boost::function<void ()>, int>, std::allocator<std::pair<boost::function<void ()>, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<boost::function<void ()>, int>, std::allocator<std::pair<boost::function<void ()>, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<boost::function<void ()>, int>, std::allocator<std::pair<boost::function<void ()>, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.12", %"struct.std::_Deque_iterator.12" }
%"struct.std::_Deque_iterator.12" = type { ptr, ptr, ptr, ptr }
%"class.graphlab::mutex" = 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.graphlab::conditional" = 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 }

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab11thread_pool18spawn_thread_groupEv(ptr noundef nonnull align 8 dereferenceable(530) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.boost::function", align 8
  %6 = alloca %"class.boost::_bi::bind_t", align 8
  %7 = alloca { i64, i64 }, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.boost::function", align 8
  %11 = alloca %"class.boost::_bi::bind_t", align 8
  %12 = alloca { i64, i64 }, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %14 = call noundef i64 @_ZN8graphlab6thread9cpu_countEv()
  store i64 %14, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store i64 0, ptr %4, align 8, !tbaa !9
  br label %15

15:                                               ; preds = %51, %1
  %16 = load i64, ptr %4, align 8, !tbaa !9
  %17 = getelementptr inbounds %"class.graphlab::thread_pool", ptr %13, i32 0, i32 2
  %18 = load i64, ptr %17, align 8, !tbaa !11
  %19 = icmp ult i64 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %55

21:                                               ; preds = %15
  %22 = getelementptr inbounds %"class.graphlab::thread_pool", ptr %13, i32 0, i32 8
  %23 = load i8, ptr %22, align 1, !tbaa !30, !range !31, !noundef !32
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %39

25:                                               ; preds = %21
  %26 = getelementptr inbounds %"class.graphlab::thread_pool", ptr %13, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #4
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN8graphlab11thread_pool13wait_for_taskEv to i64), i64 0 }, ptr %7, align 8, !tbaa !33
  %27 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  %28 = load i64, ptr %27, align 8
  %29 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  %30 = load i64, ptr %29, align 8
  call void @_ZN5boost4bindIvN8graphlab11thread_poolEPS2_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS6_T0_EENS4_9list_av_1IT1_E4typeEEEMS9_FS6_vESC_(ptr dead_on_unwind writable sret(%"class.boost::_bi::bind_t") align 8 %6, i64 %28, i64 %30, ptr noundef %13)
  call void @_ZN5boost8functionIFvvEEC2INS_3_bi6bind_tIvNS_4_mfi3mf0IvN8graphlab11thread_poolEEENS4_5list1INS4_5valueIPS9_EEEEEEEET_NS_10enable_if_IXntsr11is_integralISH_EE5valueEiE4typeE(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef byval(%"class.boost::_bi::bind_t") align 8 %6, i32 noundef 0)
  %31 = load i64, ptr %4, align 8, !tbaa !9
  %32 = load i64, ptr %3, align 8, !tbaa !9
  %33 = urem i64 %31, %32
  invoke void @_ZN8graphlab12thread_group6launchERKN5boost8functionIFvvEEEm(ptr noundef nonnull align 8 dereferenceable(184) %26, ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %33)
          to label %34 unwind label %35

34:                                               ; preds = %25
  call void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  br label %50

35:                                               ; preds = %25
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %8, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %9, align 4
  call void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  br label %54

39:                                               ; preds = %21
  %40 = getelementptr inbounds %"class.graphlab::thread_pool", ptr %13, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN8graphlab11thread_pool13wait_for_taskEv to i64), i64 0 }, ptr %12, align 8, !tbaa !33
  %41 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %42 = load i64, ptr %41, align 8
  %43 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %44 = load i64, ptr %43, align 8
  call void @_ZN5boost4bindIvN8graphlab11thread_poolEPS2_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS6_T0_EENS4_9list_av_1IT1_E4typeEEEMS9_FS6_vESC_(ptr dead_on_unwind writable sret(%"class.boost::_bi::bind_t") align 8 %11, i64 %42, i64 %44, ptr noundef %13)
  call void @_ZN5boost8functionIFvvEEC2INS_3_bi6bind_tIvNS_4_mfi3mf0IvN8graphlab11thread_poolEEENS4_5list1INS4_5valueIPS9_EEEEEEEET_NS_10enable_if_IXntsr11is_integralISH_EE5valueEiE4typeE(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef byval(%"class.boost::_bi::bind_t") align 8 %11, i32 noundef 0)
  invoke void @_ZN8graphlab12thread_group6launchERKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(184) %40, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %45 unwind label %46

45:                                               ; preds = %39
  call void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  br label %50

46:                                               ; preds = %39
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %8, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %9, align 4
  call void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  br label %54

50:                                               ; preds = %45, %34
  br label %51

51:                                               ; preds = %50
  %52 = load i64, ptr %4, align 8, !tbaa !9
  %53 = add i64 %52, 1
  store i64 %53, ptr %4, align 8, !tbaa !9
  br label %15, !llvm.loop !34

54:                                               ; preds = %46, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %56

55:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void

56:                                               ; preds = %54
  %57 = load ptr, ptr %8, align 8
  %58 = load i32, ptr %9, align 4
  %59 = insertvalue { ptr, i32 } poison, ptr %57, 0
  %60 = insertvalue { ptr, i32 } %59, i32 %58, 1
  resume { ptr, i32 } %60
}

declare noundef i64 @_ZN8graphlab6thread9cpu_countEv() #2

declare void @_ZN8graphlab12thread_group6launchERKN5boost8functionIFvvEEEm(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost4bindIvN8graphlab11thread_poolEPS2_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS6_T0_EENS4_9list_av_1IT1_E4typeEEEMS9_FS6_vESC_(ptr dead_on_unwind noalias writable sret(%"class.boost::_bi::bind_t") align 8, i64, i64, ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost8functionIFvvEEC2INS_3_bi6bind_tIvNS_4_mfi3mf0IvN8graphlab11thread_poolEEENS4_5list1INS4_5valueIPS9_EEEEEEEET_NS_10enable_if_IXntsr11is_integralISH_EE5valueEiE4typeE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%"class.boost::_bi::bind_t") align 8, i32 noundef) unnamed_addr #1 align 2

declare void @_ZN8graphlab12thread_group6launchERKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 8 dereferenceable(32)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 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 = { "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 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 #4 = { 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, !10, i64 416}
!12 = !{!"_ZTSN8graphlab11thread_poolE", !13, i64 0, !22, i64 184, !10, i64 416, !14, i64 424, !15, i64 464, !10, i64 512, !10, i64 520, !23, i64 528, !23, i64 529}
!13 = !{!"_ZTSN8graphlab12thread_groupE", !10, i64 0, !10, i64 8, !14, i64 16, !15, i64 56, !16, i64 104}
!14 = !{!"_ZTSN8graphlab5mutexE", !7, i64 0}
!15 = !{!"_ZTSN8graphlab11conditionalE", !7, i64 0}
!16 = !{!"_ZTSSt5queueISt4pairImPKcESt5dequeIS3_SaIS3_EEE", !17, i64 0}
!17 = !{!"_ZTSSt5dequeISt4pairImPKcESaIS3_EE", !18, i64 0}
!18 = !{!"_ZTSSt11_Deque_baseISt4pairImPKcESaIS3_EE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseISt4pairImPKcESaIS3_EE11_Deque_implE", !20, i64 0}
!20 = !{!"_ZTSNSt11_Deque_baseISt4pairImPKcESaIS3_EE16_Deque_impl_dataE", !6, i64 0, !10, i64 8, !21, i64 16, !21, i64 48}
!21 = !{!"_ZTSSt15_Deque_iteratorISt4pairImPKcERS3_PS3_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSN8graphlab14blocking_queueISt4pairIN5boost8functionIFvvEEEiEEE", !23, i64 0, !24, i64 8, !14, i64 88, !15, i64 128, !15, i64 176, !29, i64 224, !29, i64 226}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSSt5dequeISt4pairIN5boost8functionIFvvEEEiESaIS5_EE", !25, i64 0}
!25 = !{!"_ZTSSt11_Deque_baseISt4pairIN5boost8functionIFvvEEEiESaIS5_EE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseISt4pairIN5boost8functionIFvvEEEiESaIS5_EE11_Deque_implE", !27, i64 0}
!27 = !{!"_ZTSNSt11_Deque_baseISt4pairIN5boost8functionIFvvEEEiESaIS5_EE16_Deque_impl_dataE", !6, i64 0, !10, i64 8, !28, i64 16, !28, i64 48}
!28 = !{!"_ZTSSt15_Deque_iteratorISt4pairIN5boost8functionIFvvEEEiERS5_PS5_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!29 = !{!"short", !7, i64 0}
!30 = !{!12, !23, i64 529}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!7, !7, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"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.boost::function" = type { %"class.boost::function0" }
%"class.boost::function0" = type { %"class.boost::function_base" }
%"class.boost::function_base" = type { ptr, %"union.boost::detail::function::function_buffer" }
%"union.boost::detail::function::function_buffer" = type { %"union.boost::detail::function::function_buffer_members" }
%"union.boost::detail::function::function_buffer_members" = type { %"struct.boost::detail::function::function_buffer_members::bound_memfunc_ptr_t" }
%"struct.boost::detail::function::function_buffer_members::bound_memfunc_ptr_t" = type { { i64, i64 }, ptr }
%"class.boost::_bi::bind_t" = type { %"class.boost::_mfi::mf0", %"class.boost::_bi::list1" }
%"class.boost::_mfi::mf0" = type { { i64, i64 } }
%"class.boost::_bi::list1" = type { %"struct.boost::_bi::storage1" }
%"struct.boost::_bi::storage1" = type { %"class.boost::_bi::value" }
%"class.boost::_bi::value" = type { ptr }

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab11thread_pool18spawn_thread_groupEv(ptr noundef nonnull align 8 dereferenceable(530) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.boost::function", align 8
  %3 = alloca %"class.boost::_bi::bind_t", align 8
  %4 = alloca %"class.boost::function", align 8
  %5 = alloca %"class.boost::_bi::bind_t", align 8
  %6 = tail call noundef i64 @_ZN8graphlab6thread9cpu_countEv()
  %7 = getelementptr inbounds i8, ptr %0, i64 416
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 529
  br label %10

._crit_edge:                                      ; preds = %22, %1
  ret void

10:                                               ; preds = %.lr.ph, %22
  %.011 = phi i64 [ 0, %.lr.ph ], [ %23, %22 ]
  %11 = load i8, ptr %9, align 1, !tbaa !28, !range !29, !noundef !30
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %13, label %18

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #4
  call void @_ZN5boost4bindIvN8graphlab11thread_poolEPS2_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS6_T0_EENS4_9list_av_1IT1_E4typeEEEMS9_FS6_vESC_(ptr dead_on_unwind nonnull writable sret(%"class.boost::_bi::bind_t") align 8 %3, i64 ptrtoint (ptr @_ZN8graphlab11thread_pool13wait_for_taskEv to i64), i64 0, ptr noundef nonnull %0)
  call void @_ZN5boost8functionIFvvEEC2INS_3_bi6bind_tIvNS_4_mfi3mf0IvN8graphlab11thread_poolEEENS4_5list1INS4_5valueIPS9_EEEEEEEET_NS_10enable_if_IXntsr11is_integralISH_EE5valueEiE4typeE(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull byval(%"class.boost::_bi::bind_t") align 8 %3, i32 noundef 0)
  %14 = urem i64 %.011, %6
  invoke void @_ZN8graphlab12thread_group6launchERKN5boost8functionIFvvEEEm(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %14)
          to label %15 unwind label %16

15:                                               ; preds = %13
  call void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #4
  br label %22

16:                                               ; preds = %13
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #4
  br label %26

18:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @_ZN5boost4bindIvN8graphlab11thread_poolEPS2_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS6_T0_EENS4_9list_av_1IT1_E4typeEEEMS9_FS6_vESC_(ptr dead_on_unwind nonnull writable sret(%"class.boost::_bi::bind_t") align 8 %5, i64 ptrtoint (ptr @_ZN8graphlab11thread_pool13wait_for_taskEv to i64), i64 0, ptr noundef nonnull %0)
  call void @_ZN5boost8functionIFvvEEC2INS_3_bi6bind_tIvNS_4_mfi3mf0IvN8graphlab11thread_poolEEENS4_5list1INS4_5valueIPS9_EEEEEEEET_NS_10enable_if_IXntsr11is_integralISH_EE5valueEiE4typeE(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull byval(%"class.boost::_bi::bind_t") align 8 %5, i32 noundef 0)
  invoke void @_ZN8graphlab12thread_group6launchERKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %19 unwind label %20

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

20:                                               ; preds = %18
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %26

22:                                               ; preds = %15, %19
  %23 = add nuw i64 %.011, 1
  %24 = load i64, ptr %7, align 8, !tbaa !5
  %25 = icmp ult i64 %23, %24
  br i1 %25, label %10, label %._crit_edge, !llvm.loop !31

26:                                               ; preds = %20, %16
  %.pn = phi { ptr, i32 } [ %17, %16 ], [ %21, %20 ]
  resume { ptr, i32 } %.pn
}

declare noundef i64 @_ZN8graphlab6thread9cpu_countEv() local_unnamed_addr #2

declare void @_ZN8graphlab12thread_group6launchERKN5boost8functionIFvvEEEm(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost4bindIvN8graphlab11thread_poolEPS2_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS6_T0_EENS4_9list_av_1IT1_E4typeEEEMS9_FS6_vESC_(ptr dead_on_unwind noalias writable sret(%"class.boost::_bi::bind_t") align 8, i64, i64, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost8functionIFvvEEC2INS_3_bi6bind_tIvNS_4_mfi3mf0IvN8graphlab11thread_poolEEENS4_5list1INS4_5valueIPS9_EEEEEEEET_NS_10enable_if_IXntsr11is_integralISH_EE5valueEiE4typeE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%"class.boost::_bi::bind_t") align 8, i32 noundef) unnamed_addr #1 align 2

declare void @_ZN8graphlab12thread_group6launchERKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost9function0IvED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 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 = { "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 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 #4 = { 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, !8, i64 416}
!6 = !{!"_ZTSN8graphlab11thread_poolE", !7, i64 0, !20, i64 184, !8, i64 416, !11, i64 424, !12, i64 464, !8, i64 512, !8, i64 520, !21, i64 528, !21, i64 529}
!7 = !{!"_ZTSN8graphlab12thread_groupE", !8, i64 0, !8, i64 8, !11, i64 16, !12, i64 56, !13, i64 104}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN8graphlab5mutexE", !9, i64 0}
!12 = !{!"_ZTSN8graphlab11conditionalE", !9, i64 0}
!13 = !{!"_ZTSSt5queueISt4pairImPKcESt5dequeIS3_SaIS3_EEE", !14, i64 0}
!14 = !{!"_ZTSSt5dequeISt4pairImPKcESaIS3_EE", !15, i64 0}
!15 = !{!"_ZTSSt11_Deque_baseISt4pairImPKcESaIS3_EE", !16, i64 0}
!16 = !{!"_ZTSNSt11_Deque_baseISt4pairImPKcESaIS3_EE11_Deque_implE", !17, i64 0}
!17 = !{!"_ZTSNSt11_Deque_baseISt4pairImPKcESaIS3_EE16_Deque_impl_dataE", !18, i64 0, !8, i64 8, !19, i64 16, !19, i64 48}
!18 = !{!"any pointer", !9, i64 0}
!19 = !{!"_ZTSSt15_Deque_iteratorISt4pairImPKcERS3_PS3_E", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24}
!20 = !{!"_ZTSN8graphlab14blocking_queueISt4pairIN5boost8functionIFvvEEEiEEE", !21, i64 0, !22, i64 8, !11, i64 88, !12, i64 128, !12, i64 176, !27, i64 224, !27, i64 226}
!21 = !{!"bool", !9, i64 0}
!22 = !{!"_ZTSSt5dequeISt4pairIN5boost8functionIFvvEEEiESaIS5_EE", !23, i64 0}
!23 = !{!"_ZTSSt11_Deque_baseISt4pairIN5boost8functionIFvvEEEiESaIS5_EE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseISt4pairIN5boost8functionIFvvEEEiESaIS5_EE11_Deque_implE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt4pairIN5boost8functionIFvvEEEiESaIS5_EE16_Deque_impl_dataE", !18, i64 0, !8, i64 8, !26, i64 16, !26, i64 48}
!26 = !{!"_ZTSSt15_Deque_iteratorISt4pairIN5boost8functionIFvvEEEiERS5_PS5_E", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24}
!27 = !{!"short", !9, i64 0}
!28 = !{!6, !21, i64 529}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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