; LLVM IR from simbody/simbody :: SimTKcommon/src/ParallelExecutor.ll (ZN5SimTK20ParallelExecutorImplD2Ev)

; 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_lock" = type <{ ptr, i8, [7 x i8] }>
%"class.SimTK::ParallelExecutorImpl" = type <{ %"class.SimTK::PIMPLImplementation.base", i8, [3 x i8], %"class.std::mutex", %"class.std::condition_variable", %"class.std::condition_variable", %"class.SimTK::Array_", %"class.SimTK::Array_.0", ptr, i32, i32, i32, [4 x i8] }>
%"class.SimTK::PIMPLImplementation.base" = type <{ ptr, i32 }>
%"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::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.SimTK::Array_" = type { %"class.SimTK::ArrayView_" }
%"class.SimTK::ArrayView_" = type { %"class.SimTK::ArrayViewConst_" }
%"class.SimTK::ArrayViewConst_" = type { ptr, i32, i32 }
%"class.SimTK::Array_.0" = type { %"class.SimTK::ArrayView_.1" }
%"class.SimTK::ArrayView_.1" = type { %"class.SimTK::ArrayViewConst_.2" }
%"class.SimTK::ArrayViewConst_.2" = type { ptr, i32, i32 }
%"class.SimTK::ThreadInfo" = type <{ i32, [4 x i8], ptr, i8, [7 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5SimTK20ParallelExecutorImplD2Ev(ptr noundef nonnull align 8 dereferenceable(204) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::unique_lock", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  %7 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 3
  invoke void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %3, ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %8 unwind label %50

8:                                                ; preds = %1
  %9 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 1
  store i8 1, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !24
  br label %10

10:                                               ; preds = %23, %8
  %11 = load i32, ptr %4, align 4, !tbaa !24
  %12 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 6
  %13 = invoke noundef i32 @_ZNK5SimTK6Array_ISt6threadjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %14 unwind label %50

14:                                               ; preds = %10
  %15 = icmp slt i32 %11, %13
  br i1 %15, label %17, label %16

16:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %26

17:                                               ; preds = %14
  %18 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 7
  %19 = load i32, ptr %4, align 4, !tbaa !24
  %20 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN5SimTK6Array_INS_10ThreadInfoEjEixEj(ptr noundef nonnull align 8 dereferenceable(16) %18, i32 noundef %19)
          to label %21 unwind label %50

21:                                               ; preds = %17
  %22 = getelementptr inbounds %"class.SimTK::ThreadInfo", ptr %20, i32 0, i32 3
  store i8 1, ptr %22, align 8, !tbaa !25
  br label %23

23:                                               ; preds = %21
  %24 = load i32, ptr %4, align 4, !tbaa !24
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %4, align 4, !tbaa !24
  br label %10, !llvm.loop !27

26:                                               ; preds = %16
  %27 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 4
  call void @_ZNSt18condition_variable10notify_allEv(ptr noundef nonnull align 8 dereferenceable(48) %27) #7
  invoke void @_ZNSt11unique_lockISt5mutexE6unlockEv(ptr noundef nonnull align 8 dereferenceable(9) %3)
          to label %28 unwind label %50

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !24
  br label %29

29:                                               ; preds = %42, %28
  %30 = load i32, ptr %5, align 4, !tbaa !24
  %31 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 6
  %32 = invoke noundef i32 @_ZNK5SimTK6Array_ISt6threadjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %31)
          to label %33 unwind label %50

33:                                               ; preds = %29
  %34 = icmp slt i32 %30, %32
  br i1 %34, label %36, label %35

35:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %45

36:                                               ; preds = %33
  %37 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 6
  %38 = load i32, ptr %5, align 4, !tbaa !24
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5SimTK6Array_ISt6threadjEixEj(ptr noundef nonnull align 8 dereferenceable(16) %37, i32 noundef %38)
          to label %40 unwind label %50

40:                                               ; preds = %36
  invoke void @_ZNSt6thread4joinEv(ptr noundef nonnull align 8 dereferenceable(8) %39)
          to label %41 unwind label %50

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %5, align 4, !tbaa !24
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %5, align 4, !tbaa !24
  br label %29, !llvm.loop !29

45:                                               ; preds = %35
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  %46 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 7
  call void @_ZN5SimTK6Array_INS_10ThreadInfoEjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %46) #7
  %47 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 6
  call void @_ZN5SimTK6Array_ISt6threadjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %47) #7
  %48 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 5
  call void @_ZNSt18condition_variableD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %48) #7
  %49 = getelementptr inbounds %"class.SimTK::ParallelExecutorImpl", ptr %6, i32 0, i32 4
  call void @_ZNSt18condition_variableD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %49) #7
  call void @_ZN5SimTK19PIMPLImplementationINS_16ParallelExecutorENS_20ParallelExecutorImplEED2Ev(ptr noundef nonnull align 8 dereferenceable(12) %6) #7
  ret void

50:                                               ; preds = %40, %36, %29, %26, %17, %10, %1
  %51 = landingpad { ptr, i32 }
          catch ptr null
  %52 = extractvalue { ptr, i32 } %51, 0
  call void @__clang_call_terminate(ptr %52) #8
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 #3 align 2

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #4

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZNK5SimTK6Array_ISt6threadjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(17) ptr @_ZN5SimTK6Array_INS_10ThreadInfoEjEixEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN5SimTK6Array_ISt6threadjEixEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

declare void @_ZNSt6thread4joinEv(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

attributes #0 = { 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 #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { noinline noreturn nounwind uwtable "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 = { alwaysinline 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 = { "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 #7 = { nounwind }
attributes #8 = { noreturn 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, !13, i64 12}
!10 = !{!"_ZTSN5SimTK20ParallelExecutorImplE", !11, i64 0, !13, i64 12, !14, i64 16, !16, i64 56, !16, i64 104, !18, i64 152, !21, i64 168, !6, i64 184, !12, i64 192, !12, i64 196, !12, i64 200}
!11 = !{!"_ZTSN5SimTK19PIMPLImplementationINS_16ParallelExecutorENS_20ParallelExecutorImplEEE", !6, i64 0, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSSt5mutex", !15, i64 0}
!15 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!16 = !{!"_ZTSSt18condition_variable", !17, i64 0}
!17 = !{!"_ZTSSt9__condvar", !7, i64 0}
!18 = !{!"_ZTSN5SimTK6Array_ISt6threadjEE", !19, i64 0}
!19 = !{!"_ZTSN5SimTK10ArrayView_ISt6threadjEE", !20, i64 0}
!20 = !{!"_ZTSN5SimTK15ArrayViewConst_ISt6threadjEE", !6, i64 0, !12, i64 8, !12, i64 12}
!21 = !{!"_ZTSN5SimTK6Array_INS_10ThreadInfoEjEE", !22, i64 0}
!22 = !{!"_ZTSN5SimTK10ArrayView_INS_10ThreadInfoEjEE", !23, i64 0}
!23 = !{!"_ZTSN5SimTK15ArrayViewConst_INS_10ThreadInfoEjEE", !6, i64 0, !12, i64 8, !12, i64 12}
!24 = !{!12, !12, i64 0}
!25 = !{!26, !13, i64 16}
!26 = !{!"_ZTSN5SimTK10ThreadInfoE", !12, i64 0, !6, i64 8, !13, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}


; 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_lock" = type <{ ptr, i8, [7 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5SimTK20ParallelExecutorImplD2Ev(ptr noundef nonnull align 8 dereferenceable(204) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::unique_lock", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  invoke void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %2, ptr noundef nonnull align 8 dereferenceable(40) %3)
          to label %4 unwind label %.loopexit.split-lp.loopexit.split-lp

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  store i8 1, ptr %5, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 152
  %7 = getelementptr inbounds i8, ptr %0, i64 168
  br label %8

8:                                                ; preds = %16, %4
  %.06 = phi i32 [ 0, %4 ], [ %18, %16 ]
  %9 = invoke noundef i32 @_ZNK5SimTK6Array_ISt6threadjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %10 unwind label %.loopexit.split-lp.loopexit

10:                                               ; preds = %8
  %11 = icmp slt i32 %.06, %9
  br i1 %11, label %14, label %12

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  call void @_ZNSt18condition_variable10notify_allEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  invoke void @_ZNSt11unique_lockISt5mutexE6unlockEv(ptr noundef nonnull align 8 dereferenceable(9) %2)
          to label %.preheader unwind label %.loopexit.split-lp.loopexit.split-lp

14:                                               ; preds = %10
  %15 = invoke noundef nonnull align 8 dereferenceable(17) ptr @_ZN5SimTK6Array_INS_10ThreadInfoEjEixEj(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %.06)
          to label %16 unwind label %.loopexit.split-lp.loopexit

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %15, i64 16
  store i8 1, ptr %17, align 8, !tbaa !23
  %18 = add nuw nsw i32 %.06, 1
  br label %8, !llvm.loop !25

.preheader:                                       ; preds = %12, %27
  %.0 = phi i32 [ %28, %27 ], [ 0, %12 ]
  %19 = invoke noundef i32 @_ZNK5SimTK6Array_ISt6threadjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %20 unwind label %.loopexit

20:                                               ; preds = %.preheader
  %21 = icmp slt i32 %.0, %19
  br i1 %21, label %24, label %22

22:                                               ; preds = %20
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  call void @_ZN5SimTK6Array_INS_10ThreadInfoEjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @_ZN5SimTK6Array_ISt6threadjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  %23 = getelementptr inbounds i8, ptr %0, i64 104
  call void @_ZNSt18condition_variableD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %23) #7
  call void @_ZNSt18condition_variableD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #7
  call void @_ZN5SimTK19PIMPLImplementationINS_16ParallelExecutorENS_20ParallelExecutorImplEED2Ev(ptr noundef nonnull align 8 dereferenceable(12) %0) #7
  ret void

24:                                               ; preds = %20
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5SimTK6Array_ISt6threadjEixEj(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %.0)
          to label %26 unwind label %.loopexit

26:                                               ; preds = %24
  invoke void @_ZNSt6thread4joinEv(ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %27 unwind label %.loopexit

27:                                               ; preds = %26
  %28 = add nuw nsw i32 %.0, 1
  br label %.preheader, !llvm.loop !27

.loopexit:                                        ; preds = %.preheader, %24, %26
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %14, %8
  %lpad.loopexit7 = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %12, %1
  %lpad.loopexit.split-lp8 = landingpad { ptr, i32 }
          catch ptr null
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit7, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp8, %.loopexit.split-lp.loopexit.split-lp ]
  %29 = extractvalue { ptr, i32 } %lpad.phi, 0
  call void @__clang_call_terminate(ptr %29) #8
  unreachable
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 #3 align 2

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #4

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZNK5SimTK6Array_ISt6threadjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(17) ptr @_ZN5SimTK6Array_INS_10ThreadInfoEjEixEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #5 align 2

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN5SimTK6Array_ISt6threadjEixEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #5 align 2

declare void @_ZNSt6thread4joinEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

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

attributes #0 = { 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 #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { noinline noreturn nounwind uwtable "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 = { alwaysinline 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 = { "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 #7 = { nounwind }
attributes #8 = { noreturn 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, !12, i64 12}
!6 = !{!"_ZTSN5SimTK20ParallelExecutorImplE", !7, i64 0, !12, i64 12, !13, i64 16, !15, i64 56, !15, i64 104, !17, i64 152, !20, i64 168, !8, i64 184, !11, i64 192, !11, i64 196, !11, i64 200}
!7 = !{!"_ZTSN5SimTK19PIMPLImplementationINS_16ParallelExecutorENS_20ParallelExecutorImplEEE", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTSSt5mutex", !14, i64 0}
!14 = !{!"_ZTSSt12__mutex_base", !9, i64 0}
!15 = !{!"_ZTSSt18condition_variable", !16, i64 0}
!16 = !{!"_ZTSSt9__condvar", !9, i64 0}
!17 = !{!"_ZTSN5SimTK6Array_ISt6threadjEE", !18, i64 0}
!18 = !{!"_ZTSN5SimTK10ArrayView_ISt6threadjEE", !19, i64 0}
!19 = !{!"_ZTSN5SimTK15ArrayViewConst_ISt6threadjEE", !8, i64 0, !11, i64 8, !11, i64 12}
!20 = !{!"_ZTSN5SimTK6Array_INS_10ThreadInfoEjEE", !21, i64 0}
!21 = !{!"_ZTSN5SimTK10ArrayView_INS_10ThreadInfoEjEE", !22, i64 0}
!22 = !{!"_ZTSN5SimTK15ArrayViewConst_INS_10ThreadInfoEjEE", !8, i64 0, !11, i64 8, !11, i64 12}
!23 = !{!24, !12, i64 16}
!24 = !{!"_ZTSN5SimTK10ThreadInfoE", !11, i64 0, !8, i64 8, !12, i64 16}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


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