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

; 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.JPH::JobSystem::JobHandle" = type { %"class.JPH::Ref" }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::Color" = type { %union.anon }
%union.anon = type { i32 }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.std::chrono::duration" = type { i64 }
%"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 }

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 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

declare i32 @__gxx_personality_v0(...)

; 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 @_ZN3JPH19JobSystemThreadPool9CreateJobEPKcNS_5ColorERKSt8functionIFvvEEj(ptr dead_on_unwind noalias writable sret(%"class.JPH::JobSystem::JobHandle") align 8 %0, ptr noundef nonnull align 64 dereferenceable(8768) %1, ptr noundef %2, i32 %3, ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca %"class.JPH::Color", align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"struct.JPH::AssertLastParam", align 1
  %16 = alloca %"class.std::chrono::duration", align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i1, align 1
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  store ptr %0, ptr %7, align 8
  %22 = getelementptr inbounds %"class.JPH::Color", ptr %8, i32 0, i32 0
  %23 = getelementptr inbounds %union.anon, ptr %22, i32 0, i32 0
  store i32 %3, ptr %23, align 4
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i32 %5, ptr %12, align 4, !tbaa !9
  %24 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  br label %25

25:                                               ; preds = %38, %6
  %26 = getelementptr inbounds %"class.JPH::JobSystemThreadPool", ptr %24, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr %24, ptr %14, align 8, !tbaa !5
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = call noundef i32 @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE15ConstructObjectIJRPKcRNS_5ColorEPNS_19JobSystemThreadPoolERKSt8functionIFvvEERjEEEjDpOT_(ptr noundef nonnull align 64 dereferenceable(132) %26, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i32 %28, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %29 = load i32, ptr %13, align 4, !tbaa !9
  %30 = icmp ne i32 %29, -1
  br i1 %30, label %31, label %32

31:                                               ; preds = %25
  br label %39

32:                                               ; preds = %25
  br label %33

33:                                               ; preds = %32
  %34 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 131, ptr noundef @.str.3)
  br i1 %34, label %35, label %36

35:                                               ; preds = %33
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !11
  br label %36

36:                                               ; preds = %35, %33
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 100, ptr %17, align 4, !tbaa !9
  call void @_ZNSt6chrono8durationIlSt5ratioILl1ELl1000000EEEC2IivEERKT_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  call void @_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000000EEEEvRKNSt6chrono8durationIT_T0_EE(ptr noundef nonnull align 8 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %25, !llvm.loop !12

39:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %40 = getelementptr inbounds %"class.JPH::JobSystemThreadPool", ptr %24, i32 0, i32 4
  %41 = load i32, ptr %13, align 4, !tbaa !9
  %42 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %40, i32 noundef %41)
  store ptr %42, ptr %18, align 8, !tbaa !5
  store i1 false, ptr %19, align 1
  %43 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN3JPH9JobSystem9JobHandleC2EPNS0_3JobE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %43)
  %44 = load i32, ptr %12, align 4, !tbaa !9
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %53

46:                                               ; preds = %39
  %47 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @_ZN3JPH19JobSystemThreadPool8QueueJobEPNS_9JobSystem3JobE(ptr noundef nonnull align 64 dereferenceable(8768) %24, ptr noundef %47)
          to label %48 unwind label %49

48:                                               ; preds = %46
  br label %53

49:                                               ; preds = %46
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %20, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %21, align 4
  call void @_ZN3JPH3RefINS_9JobSystem3JobEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %57

53:                                               ; preds = %48, %39
  store i1 true, ptr %19, align 1
  %54 = load i1, ptr %19, align 1
  br i1 %54, label %56, label %55

55:                                               ; preds = %53
  call void @_ZN3JPH3RefINS_9JobSystem3JobEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  br label %56

56:                                               ; preds = %55, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  ret void

57:                                               ; preds = %49
  %58 = load ptr, ptr %20, align 8
  %59 = load i32, ptr %21, align 4
  %60 = insertvalue { ptr, i32 } poison, ptr %58, 0
  %61 = insertvalue { ptr, i32 } %60, i32 %59, 1
  resume { ptr, i32 } %61
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE15ConstructObjectIJRPKcRNS_5ColorEPNS_19JobSystemThreadPoolERKSt8functionIFvvEERjEEEjDpOT_(ptr noundef nonnull align 64 dereferenceable(132), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132), i32 noundef) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH19JobSystemThreadPool8QueueJobEPNS_9JobSystem3JobE(ptr noundef nonnull align 64 dereferenceable(8768), ptr noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH3RefINS_9JobSystem3JobEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 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 = { 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 #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 = { 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 = !{i64 2157633227}
!12 = distinct !{!12, !13}
!13 = !{!"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.JPH::JobSystem::JobHandle" = type { %"class.JPH::Ref" }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::Color" = type { %union.anon }
%union.anon = type { i32 }
%"class.std::chrono::duration" = type { i64 }

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 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

declare i32 @__gxx_personality_v0(...)

; 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 @_ZN3JPH19JobSystemThreadPool9CreateJobEPKcNS_5ColorERKSt8functionIFvvEEj(ptr dead_on_unwind noalias writable sret(%"class.JPH::JobSystem::JobHandle") align 8 %0, ptr noundef nonnull align 64 dereferenceable(8768) %1, ptr noundef %2, i32 %3, ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %5) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.JPH::Color", align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::chrono::duration", align 8
  %12 = alloca i32, align 4
  store i32 %3, ptr %7, align 4
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %5, ptr %9, align 4, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %1, i64 128
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  store ptr %1, ptr %10, align 8, !tbaa !5
  %14 = call noundef i32 @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE15ConstructObjectIJRPKcRNS_5ColorEPNS_19JobSystemThreadPoolERKSt8functionIFvvEERjEEEjDpOT_(ptr noundef nonnull align 64 dereferenceable(132) %13, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  %.not9 = icmp eq i32 %14, -1
  br i1 %.not9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6, %17
  %15 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 131, ptr noundef nonnull @.str.3)
  br i1 %15, label %16, label %17

16:                                               ; preds = %.lr.ph
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !11
  br label %17

17:                                               ; preds = %16, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  store i32 100, ptr %12, align 4, !tbaa !9
  call void @_ZNSt6chrono8durationIlSt5ratioILl1ELl1000000EEEC2IivEERKT_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000000EEEEvRKNSt6chrono8durationIT_T0_EE(ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  store ptr %1, ptr %10, align 8, !tbaa !5
  %18 = call noundef i32 @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE15ConstructObjectIJRPKcRNS_5ColorEPNS_19JobSystemThreadPoolERKSt8functionIFvvEERjEEEjDpOT_(ptr noundef nonnull align 64 dereferenceable(132) %13, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  %.not = icmp eq i32 %18, -1
  br i1 %.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %17, %6
  %.lcssa = phi i32 [ %14, %6 ], [ %18, %17 ]
  %19 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %13, i32 noundef %.lcssa)
  call void @_ZN3JPH9JobSystem9JobHandleC2EPNS0_3JobE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %19)
  %20 = load i32, ptr %9, align 4, !tbaa !9
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %25

22:                                               ; preds = %._crit_edge
  invoke void @_ZN3JPH19JobSystemThreadPool8QueueJobEPNS_9JobSystem3JobE(ptr noundef nonnull align 64 dereferenceable(8768) %1, ptr noundef nonnull %19)
          to label %25 unwind label %23

23:                                               ; preds = %22
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH3RefINS_9JobSystem3JobEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  resume { ptr, i32 } %24

25:                                               ; preds = %._crit_edge, %22
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE15ConstructObjectIJRPKcRNS_5ColorEPNS_19JobSystemThreadPoolERKSt8functionIFvvEERjEEEjDpOT_(ptr noundef nonnull align 64 dereferenceable(132), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN3JPH17FixedSizeFreeListINS_9JobSystem3JobEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132), i32 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH19JobSystemThreadPool8QueueJobEPNS_9JobSystem3JobE(ptr noundef nonnull align 64 dereferenceable(8768), ptr noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH3RefINS_9JobSystem3JobEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 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 = { 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 #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 = { 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 = !{i64 2157633227}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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