; LLVM IR from jrouwe/JoltPhysics :: Jolt/Core/JobSystemThreadPool.ll (ZN3JPH19JobSystemThreadPool12StartThreadsEi)

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

%"struct.JPH::AssertLastParam" = type { i8 }
%class.anon.10 = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::JobSystemThreadPool" = type <{ %"class.JPH::JobSystemWithBarrier", %"class.std::function", %"class.std::function", [40 x i8], %"class.JPH::FixedSizeFreeList", %"class.JPH::Array", [1024 x %"struct.std::atomic.2"], ptr, [32 x i8], %"struct.std::atomic", [60 x i8], %"class.JPH::Semaphore", %"struct.std::atomic.6", [63 x i8] }>
%"class.JPH::JobSystemWithBarrier" = type { %"class.JPH::JobSystem", i32, ptr }
%"class.JPH::JobSystem" = type { ptr }
%"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.JPH::FixedSizeFreeList" = type <{ i32, i32, i32, i32, i32, [4 x i8], ptr, [32 x i8], %"class.JPH::Mutex", %"struct.std::atomic", %"struct.std::atomic", %"struct.std::atomic.0", %"struct.std::atomic", [60 x i8] }>
%"class.JPH::Mutex" = type { %"class.std::mutex", %"class.std::thread::id" }
%"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::thread::id" = type { i64 }
%"struct.std::atomic.0" = type { %"struct.std::__atomic_base.1" }
%"struct.std::__atomic_base.1" = type { i64 }
%"class.JPH::Array" = type { i64, i64, ptr }
%"struct.std::atomic.2" = type { %"struct.std::__atomic_base.3" }
%"struct.std::__atomic_base.3" = type { ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Semaphore" = type { %"struct.std::atomic.4", %union.sem_t, [24 x i8] }
%"struct.std::atomic.4" = type { %"struct.std::__atomic_base.5" }
%"struct.std::__atomic_base.5" = type { i32 }
%union.sem_t = type { i64, [24 x i8] }
%"struct.std::atomic.6" = type { %"struct.std::__atomic_base.7" }
%"struct.std::__atomic_base.7" = type { i8 }

@_ZN3JPH8AllocateE = external global ptr, align 8
@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1

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

; Function Attrs: 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 @_ZN3JPH19JobSystemThreadPool12StartThreadsEi(ptr noundef nonnull align 64 dereferenceable(8768) %0, i32 noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.JPH::AssertLastParam", align 1
  %7 = alloca i32, align 4
  %8 = alloca %class.anon.10, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %9 = load ptr, ptr %3, align 8
  %10 = load i32, ptr %4, align 4, !tbaa !9
  %11 = icmp slt i32 %10, 0
  br i1 %11, label %12, label %15

12:                                               ; preds = %2
  %13 = call noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #6
  %14 = sub i32 %13, 1
  store i32 %14, ptr %4, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %12, %2
  %16 = load i32, ptr %4, align 4, !tbaa !9
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %19

18:                                               ; preds = %15
  br label %69

19:                                               ; preds = %15
  %20 = getelementptr inbounds %"class.JPH::JobSystemThreadPool", ptr %9, i32 0, i32 12
  %21 = call noundef zeroext i1 @_ZNSt6atomicIbEaSEb(ptr noundef nonnull align 1 dereferenceable(1) %20, i1 noundef zeroext false) #6
  %22 = load ptr, ptr @_ZN3JPH8AllocateE, align 8, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = mul i64 4, %24
  %26 = call noundef ptr %22(i64 noundef %25)
  %27 = getelementptr inbounds %"class.JPH::JobSystemThreadPool", ptr %9, i32 0, i32 7
  store ptr %26, ptr %27, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %40, %19
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = load i32, ptr %4, align 4, !tbaa !9
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %43

33:                                               ; preds = %28
  %34 = getelementptr inbounds %"class.JPH::JobSystemThreadPool", ptr %9, i32 0, i32 7
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %"struct.std::atomic", ptr %35, i64 %37
  %39 = call noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4) %38, i32 noundef 0) #6
  br label %40

40:                                               ; preds = %33
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %5, align 4, !tbaa !9
  br label %28, !llvm.loop !34

43:                                               ; preds = %32
  br label %44

44:                                               ; preds = %43
  %45 = getelementptr inbounds %"class.JPH::JobSystemThreadPool", ptr %9, i32 0, i32 5
  %46 = call noundef zeroext i1 @_ZNK3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %45)
  br i1 %46, label %50, label %47

47:                                               ; preds = %44
  %48 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 71)
  br i1 %48, label %49, label %50

49:                                               ; preds = %47
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !36
  br label %50

50:                                               ; preds = %49, %47, %44
  br label %51

51:                                               ; preds = %50
  %52 = getelementptr inbounds %"class.JPH::JobSystemThreadPool", ptr %9, i32 0, i32 5
  %53 = load i32, ptr %4, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  call void @_ZN3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %54)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %66, %51
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = load i32, ptr %4, align 4, !tbaa !9
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

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

60:                                               ; preds = %55
  %61 = getelementptr inbounds %"class.JPH::JobSystemThreadPool", ptr %9, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  %62 = getelementptr inbounds %class.anon.10, ptr %8, i32 0, i32 0
  store ptr %9, ptr %62, align 8, !tbaa !37
  %63 = getelementptr inbounds %class.anon.10, ptr %8, i32 0, i32 1
  %64 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %64, ptr %63, align 8, !tbaa !39
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @"_ZN3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEE12emplace_backIJZNS_19JobSystemThreadPool12StartThreadsEiE3$_0EEERS1_DpOT_"(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 8 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  br label %66

66:                                               ; preds = %60
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %7, align 4, !tbaa !9
  br label %55, !llvm.loop !40

69:                                               ; preds = %59, %18
  ret void
}

; Function Attrs: nounwind
declare noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt6atomicIbEaSEb(ptr noundef nonnull align 1 dereferenceable(1), i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(8) ptr @"_ZN3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEE12emplace_backIJZNS_19JobSystemThreadPool12StartThreadsEiE3$_0EEERS1_DpOT_"(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(12)) #5 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 = { 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8536}
!12 = !{!"_ZTSN3JPH19JobSystemThreadPoolE", !13, i64 0, !15, i64 24, !15, i64 56, !17, i64 128, !27, i64 320, !7, i64 344, !6, i64 8536, !23, i64 8576, !28, i64 8640, !31, i64 8704}
!13 = !{!"_ZTSN3JPH20JobSystemWithBarrierE", !14, i64 0, !10, i64 8, !6, i64 16}
!14 = !{!"_ZTSN3JPH9JobSystemE"}
!15 = !{!"_ZTSSt8functionIFviEE", !16, i64 0, !6, i64 24}
!16 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!17 = !{!"_ZTSN3JPH17FixedSizeFreeListINS_9JobSystem3JobEEE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !18, i64 64, !23, i64 112, !23, i64 116, !25, i64 120, !23, i64 128}
!18 = !{!"_ZTSN3JPH5MutexE", !19, i64 0, !21, i64 40}
!19 = !{!"_ZTSSt5mutex", !20, i64 0}
!20 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!21 = !{!"_ZTSNSt6thread2idE", !22, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSSt6atomicIjE", !24, i64 0}
!24 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!25 = !{!"_ZTSSt6atomicImE", !26, i64 0}
!26 = !{!"_ZTSSt13__atomic_baseImE", !22, i64 0}
!27 = !{!"_ZTSN3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEEE", !22, i64 0, !22, i64 8, !6, i64 16}
!28 = !{!"_ZTSN3JPH9SemaphoreE", !29, i64 0, !7, i64 8}
!29 = !{!"_ZTSSt6atomicIiE", !30, i64 0}
!30 = !{!"_ZTSSt13__atomic_baseIiE", !10, i64 0}
!31 = !{!"_ZTSSt6atomicIbE", !32, i64 0}
!32 = !{!"_ZTSSt13__atomic_baseIbE", !33, i64 0}
!33 = !{!"bool", !7, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{i64 2157632902}
!37 = !{!38, !6, i64 0}
!38 = !{!"_ZTSZN3JPH19JobSystemThreadPool12StartThreadsEiE3$_0", !6, i64 0, !10, i64 8}
!39 = !{!38, !10, i64 8}
!40 = distinct !{!40, !35}


; 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.anon.10 = type <{ ptr, i32, [4 x i8] }>
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }

@_ZN3JPH8AllocateE = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1

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

; Function Attrs: mustprogress 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 @_ZN3JPH19JobSystemThreadPool12StartThreadsEi(ptr noundef nonnull align 64 dereferenceable(8768) %0, i32 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %class.anon.10, align 8
  %4 = icmp slt i32 %1, 0
  br i1 %4, label %5, label %8

5:                                                ; preds = %2
  %6 = tail call noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #6
  %7 = add i32 %6, -1
  br label %8

8:                                                ; preds = %5, %2
  %.013 = phi i32 [ %7, %5 ], [ %1, %2 ]
  %9 = icmp eq i32 %.013, 0
  br i1 %9, label %.loopexit, label %10

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %0, i64 8704
  %12 = tail call noundef zeroext i1 @_ZNSt6atomicIbEaSEb(ptr noundef nonnull align 1 dereferenceable(1) %11, i1 noundef zeroext false) #6
  %13 = load ptr, ptr @_ZN3JPH8AllocateE, align 8, !tbaa !5
  %14 = sext i32 %.013 to i64
  %15 = shl nsw i64 %14, 2
  %16 = tail call noundef ptr %13(i64 noundef %15)
  %17 = getelementptr inbounds i8, ptr %0, i64 8536
  store ptr %16, ptr %17, align 8, !tbaa !9
  %18 = icmp sgt i32 %.013, 0
  br i1 %18, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %10
  %wide.trip.count = zext nneg i32 %.013 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %10
  %19 = getelementptr inbounds i8, ptr %0, i64 320
  %20 = tail call noundef zeroext i1 @_ZNK3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %19)
  br i1 %20, label %27, label %24

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %21 = load ptr, ptr %17, align 8, !tbaa !9
  %22 = getelementptr inbounds %"struct.std::atomic", ptr %21, i64 %indvars.iv
  %23 = tail call noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4) %22, i32 noundef 0) #6
  %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 !33

24:                                               ; preds = %._crit_edge
  %25 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 71)
  br i1 %25, label %26, label %27

26:                                               ; preds = %24
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !35
  br label %27

27:                                               ; preds = %._crit_edge, %24, %26
  tail call void @_ZN3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %14)
  br i1 %18, label %.lr.ph18, label %.loopexit

.lr.ph18:                                         ; preds = %27
  %28 = getelementptr inbounds i8, ptr %3, i64 8
  br label %29

29:                                               ; preds = %.lr.ph18, %29
  %.016 = phi i32 [ 0, %.lr.ph18 ], [ %31, %29 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  store ptr %0, ptr %3, align 8, !tbaa !36
  store i32 %.016, ptr %28, align 8, !tbaa !38
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @"_ZN3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEE12emplace_backIJZNS_19JobSystemThreadPool12StartThreadsEiE3$_0EEERS1_DpOT_"(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(12) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  %31 = add nuw nsw i32 %.016, 1
  %exitcond20.not = icmp eq i32 %31, %.013
  br i1 %exitcond20.not, label %.loopexit, label %29, !llvm.loop !39

.loopexit:                                        ; preds = %29, %27, %8
  ret void
}

; Function Attrs: nounwind
declare noundef i32 @_ZNSt6thread20hardware_concurrencyEv() local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt6atomicIbEaSEb(ptr noundef nonnull align 1 dereferenceable(1), i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(8) ptr @"_ZN3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEE12emplace_backIJZNS_19JobSystemThreadPool12StartThreadsEiE3$_0EEERS1_DpOT_"(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #5 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 = { 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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, !6, i64 8536}
!10 = !{!"_ZTSN3JPH19JobSystemThreadPoolE", !11, i64 0, !14, i64 24, !14, i64 56, !16, i64 128, !26, i64 320, !7, i64 344, !6, i64 8536, !22, i64 8576, !27, i64 8640, !30, i64 8704}
!11 = !{!"_ZTSN3JPH20JobSystemWithBarrierE", !12, i64 0, !13, i64 8, !6, i64 16}
!12 = !{!"_ZTSN3JPH9JobSystemE"}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt8functionIFviEE", !15, i64 0, !6, i64 24}
!15 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!16 = !{!"_ZTSN3JPH17FixedSizeFreeListINS_9JobSystem3JobEEE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !6, i64 24, !17, i64 64, !22, i64 112, !22, i64 116, !24, i64 120, !22, i64 128}
!17 = !{!"_ZTSN3JPH5MutexE", !18, i64 0, !20, i64 40}
!18 = !{!"_ZTSSt5mutex", !19, i64 0}
!19 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!20 = !{!"_ZTSNSt6thread2idE", !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSSt6atomicIjE", !23, i64 0}
!23 = !{!"_ZTSSt13__atomic_baseIjE", !13, i64 0}
!24 = !{!"_ZTSSt6atomicImE", !25, i64 0}
!25 = !{!"_ZTSSt13__atomic_baseImE", !21, i64 0}
!26 = !{!"_ZTSN3JPH5ArrayISt6threadNS_12STLAllocatorIS1_EEEE", !21, i64 0, !21, i64 8, !6, i64 16}
!27 = !{!"_ZTSN3JPH9SemaphoreE", !28, i64 0, !7, i64 8}
!28 = !{!"_ZTSSt6atomicIiE", !29, i64 0}
!29 = !{!"_ZTSSt13__atomic_baseIiE", !13, i64 0}
!30 = !{!"_ZTSSt6atomicIbE", !31, i64 0}
!31 = !{!"_ZTSSt13__atomic_baseIbE", !32, i64 0}
!32 = !{!"bool", !7, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{i64 2157632902}
!36 = !{!37, !6, i64 0}
!37 = !{!"_ZTSZN3JPH19JobSystemThreadPool12StartThreadsEiE3$_0", !6, i64 0, !13, i64 8}
!38 = !{!37, !13, i64 8}
!39 = distinct !{!39, !34}


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