; LLVM IR from jrouwe/JoltPhysics :: Samples/Tests/General/MultithreadedTest.ll (ZN17MultithreadedTest10BoxSpawnerEv)

; 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::linear_congruential_engine" = type { i64 }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::BodyID" = type { i32 }
%"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.anon.12 = type { ptr, ptr, ptr }
%class.anon.13 = type <{ ptr, %"class.JPH::BodyID", [4 x i8] }>
%"class.std::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<float>::param_type" }
%"struct.std::uniform_real_distribution<float>::param_type" = type { float, float }
%"class.std::uniform_int_distribution" = type { %"struct.std::uniform_int_distribution<unsigned long>::param_type" }
%"struct.std::uniform_int_distribution<unsigned long>::param_type" = type { i64, i64 }
%class.anon.15 = type <{ ptr, %"class.JPH::BodyID", [4 x i8] }>
%"class.std::chrono::duration" = type { i64 }
%class.MultithreadedTest = type <{ %class.Test, %"class.std::thread", %"class.std::thread", %"class.std::thread", %"struct.std::atomic", [7 x i8] }>
%class.Test = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, %"class.std::unordered_map" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::thread" = type { %"class.std::thread::id" }
%"class.std::thread::id" = type { i64 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }

@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 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
declare dso_local void @_ZN17MultithreadedTest7ExecuteERSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEPKcSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(137), ptr noundef nonnull align 1, ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 1) #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt8literals15chrono_literalsli2msIJLc49EEEENSt6chrono8durationIlSt5ratioILl1ELl1000EEEEv() #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17MultithreadedTest10BoxSpawnerEv(ptr noundef nonnull align 8 dereferenceable(137) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::linear_congruential_engine", align 8
  %5 = alloca %"class.JPH::Array", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.JPH::BodyID", align 4
  %9 = alloca %"class.std::function", align 8
  %10 = alloca %class.anon.12, align 8
  %11 = alloca %"class.std::function", align 8
  %12 = alloca %class.anon.13, align 8
  %13 = alloca %"class.std::uniform_real_distribution", align 4
  %14 = alloca %"class.std::uniform_int_distribution", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"class.JPH::BodyID", align 4
  %17 = alloca %"class.std::function", align 8
  %18 = alloca %class.anon.15, align 8
  %19 = alloca %"class.std::chrono::duration", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %20 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 100, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #6
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %21

21:                                               ; preds = %117, %1
  %22 = getelementptr inbounds %class.MultithreadedTest, ptr %20, i32 0, i32 4
  %23 = call noundef zeroext i1 @_ZNKSt6atomicIbEcvbEv(ptr noundef nonnull align 1 dereferenceable(1) %22) #6
  %24 = xor i1 %23, true
  br i1 %24, label %25, label %123

25:                                               ; preds = %21
  %26 = invoke noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %27 unwind label %40

27:                                               ; preds = %25
  %28 = icmp ult i64 %26, 100
  br i1 %28, label %29, label %62

29:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  invoke void @_ZN3JPH6BodyIDC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %30 unwind label %44

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  %31 = getelementptr inbounds %class.anon.12, ptr %10, i32 0, i32 0
  store ptr %20, ptr %31, align 8, !tbaa !11
  %32 = getelementptr inbounds %class.anon.12, ptr %10, i32 0, i32 1
  store ptr %8, ptr %32, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.anon.12, ptr %10, i32 0, i32 2
  store ptr %4, ptr %33, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %34 unwind label %48

34:                                               ; preds = %30
  invoke void @_ZN17MultithreadedTest7ExecuteERSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEPKcSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(137) %20, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef @.str.1, ptr noundef %9)
          to label %35 unwind label %52

35:                                               ; preds = %34
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %36 = getelementptr inbounds %class.anon.13, ptr %12, i32 0, i32 0
  store ptr %20, ptr %36, align 8, !tbaa !13
  %37 = getelementptr inbounds %class.anon.13, ptr %12, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 4 %8, i64 4, i1 false), !tbaa.struct !16
  call void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(12) %12) #6
  invoke void @_ZN17MultithreadedTest7ExecuteERSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEPKcSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(137) %20, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef @.str.2, ptr noundef %11)
          to label %38 unwind label %57

38:                                               ; preds = %35
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  invoke void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %39 unwind label %44

39:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %62

40:                                               ; preds = %25
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %6, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %7, align 4
  br label %124

44:                                               ; preds = %38, %29
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %6, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %7, align 4
  br label %61

48:                                               ; preds = %30
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %6, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %7, align 4
  br label %56

52:                                               ; preds = %34
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %6, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %7, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  br label %56

56:                                               ; preds = %52, %48
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  br label %61

57:                                               ; preds = %35
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %6, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %7, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %61

61:                                               ; preds = %57, %56, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %124

62:                                               ; preds = %39, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  invoke void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %13, float noundef 0.000000e+00, float noundef 1.000000e+00)
          to label %63 unwind label %90

63:                                               ; preds = %62
  %64 = invoke noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %65 unwind label %90

65:                                               ; preds = %63
  %66 = icmp ugt i64 %64, 0
  br i1 %66, label %67, label %113

67:                                               ; preds = %65
  %68 = invoke noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %69 unwind label %90

69:                                               ; preds = %67
  %70 = fcmp olt float %68, 5.000000e-01
  br i1 %70, label %71, label %113

71:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %72 = invoke noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %73 unwind label %94

73:                                               ; preds = %71
  %74 = sub i64 %72, 1
  invoke void @_ZNSt24uniform_int_distributionImEC2Emm(ptr noundef nonnull align 8 dereferenceable(16) %14, i64 noundef 0, i64 noundef %74)
          to label %75 unwind label %94

75:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %76 = invoke noundef i64 @_ZNSt24uniform_int_distributionImEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEmRT_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %77 unwind label %98

77:                                               ; preds = %75
  store i64 %76, ptr %15, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %78 = load i64, ptr %15, align 8, !tbaa !17
  %79 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %78)
          to label %80 unwind label %102

80:                                               ; preds = %77
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %79, i64 4, i1 false), !tbaa.struct !16
  %81 = invoke noundef ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %82 unwind label %102

82:                                               ; preds = %80
  %83 = load i64, ptr %15, align 8, !tbaa !17
  %84 = getelementptr inbounds %"class.JPH::BodyID", ptr %81, i64 %83
  %85 = invoke noundef ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5eraseEPKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef %84)
          to label %86 unwind label %102

86:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %87 = getelementptr inbounds %class.anon.15, ptr %18, i32 0, i32 0
  store ptr %20, ptr %87, align 8, !tbaa !19
  %88 = getelementptr inbounds %class.anon.15, ptr %18, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %88, ptr align 4 %16, i64 4, i1 false), !tbaa.struct !16
  call void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(12) %18) #6
  invoke void @_ZN17MultithreadedTest7ExecuteERSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEPKcSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(137) %20, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef @.str.3, ptr noundef %17)
          to label %89 unwind label %106

89:                                               ; preds = %86
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %113

90:                                               ; preds = %67, %63, %62
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %6, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %7, align 4
  br label %122

94:                                               ; preds = %73, %71
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %6, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %7, align 4
  br label %112

98:                                               ; preds = %75
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %6, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %7, align 4
  br label %111

102:                                              ; preds = %82, %80, %77
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %6, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %7, align 4
  br label %110

106:                                              ; preds = %86
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %6, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %7, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %110

110:                                              ; preds = %106, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %111

111:                                              ; preds = %110, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %112

112:                                              ; preds = %111, %94
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %122

113:                                              ; preds = %89, %69, %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %114 = invoke i64 @_ZNSt8literals15chrono_literalsli2msIJLc49EEEENSt6chrono8durationIlSt5ratioILl1ELl1000EEEEv()
          to label %115 unwind label %118

115:                                              ; preds = %113
  %116 = getelementptr inbounds %"class.std::chrono::duration", ptr %19, i32 0, i32 0
  store i64 %114, ptr %116, align 8
  invoke void @_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE(ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %117 unwind label %118

117:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %21, !llvm.loop !21

118:                                              ; preds = %115, %113
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %6, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %122

122:                                              ; preds = %118, %112, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %124

123:                                              ; preds = %21
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void

124:                                              ; preds = %122, %61, %40
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %6, align 8
  %127 = load i32, ptr %7, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt24uniform_int_distributionImEC2Emm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt24uniform_int_distributionImEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEmRT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 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 #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 0}
!12 = !{!"_ZTSZN17MultithreadedTest10BoxSpawnerEvE3$_0", !6, i64 0, !6, i64 8, !6, i64 16}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSZN17MultithreadedTest10BoxSpawnerEvE3$_1", !6, i64 0, !15, i64 8}
!15 = !{!"_ZTSN3JPH6BodyIDE", !10, i64 0}
!16 = !{i64 0, i64 4, !9}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!20, !6, i64 0}
!20 = !{!"_ZTSZN17MultithreadedTest10BoxSpawnerEvE3$_2", !6, i64 0, !15, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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

%"class.std::linear_congruential_engine" = type { i64 }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::BodyID" = type { i32 }
%"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.anon.12 = type { ptr, ptr, ptr }
%class.anon.13 = type <{ ptr, %"class.JPH::BodyID", [4 x i8] }>
%"class.std::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<float>::param_type" }
%"struct.std::uniform_real_distribution<float>::param_type" = type { float, float }
%"class.std::uniform_int_distribution" = type { %"struct.std::uniform_int_distribution<unsigned long>::param_type" }
%"struct.std::uniform_int_distribution<unsigned long>::param_type" = type { i64, i64 }
%class.anon.15 = type <{ ptr, %"class.JPH::BodyID", [4 x i8] }>
%"class.std::chrono::duration" = type { i64 }

@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 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
declare dso_local void @_ZN17MultithreadedTest7ExecuteERSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEPKcSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(137), ptr noundef nonnull align 1, ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 1) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt8literals15chrono_literalsli2msIJLc49EEEENSt6chrono8durationIlSt5ratioILl1ELl1000EEEEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17MultithreadedTest10BoxSpawnerEv(ptr noundef nonnull align 8 dereferenceable(137) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::linear_congruential_engine", align 8
  %3 = alloca %"class.JPH::Array", align 8
  %4 = alloca %"class.JPH::BodyID", align 4
  %5 = alloca %"class.std::function", align 8
  %6 = alloca %class.anon.12, align 8
  %7 = alloca %"class.std::function", align 8
  %8 = alloca %class.anon.13, align 8
  %9 = alloca %"class.std::uniform_real_distribution", align 4
  %10 = alloca %"class.std::uniform_int_distribution", align 8
  %11 = alloca %"class.std::function", align 8
  %12 = alloca %class.anon.15, align 8
  %13 = alloca %"class.std::chrono::duration", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %14 = getelementptr inbounds i8, ptr %0, i64 136
  %15 = call noundef zeroext i1 @_ZNKSt6atomicIbEcvbEv(ptr noundef nonnull align 1 dereferenceable(1) %14) #5
  br i1 %15, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %16 = getelementptr inbounds i8, ptr %6, i64 8
  %17 = getelementptr inbounds i8, ptr %6, i64 16
  %18 = getelementptr inbounds i8, ptr %8, i64 8
  %19 = getelementptr inbounds i8, ptr %12, i64 8
  br label %20

20:                                               ; preds = %.lr.ph, %73
  %21 = call noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %22 = icmp ult i64 %21, 100
  br i1 %22, label %23, label %39

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @_ZN3JPH6BodyIDC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %4, ptr %16, align 8, !tbaa !10
  store ptr %2, ptr %17, align 8, !tbaa !10
  invoke void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %24 unwind label %31

24:                                               ; preds = %23
  invoke void @_ZN17MultithreadedTest7ExecuteERSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEPKcSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(137) %0, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.1, ptr noundef nonnull %5)
          to label %25 unwind label %33

25:                                               ; preds = %24
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  store ptr %0, ptr %8, align 8, !tbaa !11
  %26 = load i32, ptr %4, align 4, !tbaa !15
  store i32 %26, ptr %18, align 8, !tbaa !15
  call void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(12) %8) #5
  invoke void @_ZN17MultithreadedTest7ExecuteERSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEPKcSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(137) %0, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.2, ptr noundef nonnull %7)
          to label %27 unwind label %36

27:                                               ; preds = %25
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  invoke void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %28 unwind label %29

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

29:                                               ; preds = %27
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %38

31:                                               ; preds = %23
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %35

33:                                               ; preds = %24
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br label %35

35:                                               ; preds = %33, %31
  %.pn = phi { ptr, i32 } [ %34, %33 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %38

36:                                               ; preds = %25
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  br label %38

38:                                               ; preds = %36, %35, %29
  %.pn13 = phi { ptr, i32 } [ %30, %29 ], [ %37, %36 ], [ %.pn, %35 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %78

39:                                               ; preds = %28, %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  invoke void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %9, float noundef 0.000000e+00, float noundef 1.000000e+00)
          to label %40 unwind label %59

40:                                               ; preds = %39
  %41 = call noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %.not = icmp eq i64 %41, 0
  br i1 %.not, label %70, label %42

42:                                               ; preds = %40
  %43 = invoke noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %44 unwind label %59

44:                                               ; preds = %42
  %45 = fcmp olt float %43, 5.000000e-01
  br i1 %45, label %46, label %70

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  %47 = call noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %48 = add i64 %47, -1
  invoke void @_ZNSt24uniform_int_distributionImEC2Emm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef 0, i64 noundef %48)
          to label %49 unwind label %61

49:                                               ; preds = %46
  %50 = invoke noundef i64 @_ZNSt24uniform_int_distributionImEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEmRT_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %51 unwind label %63

51:                                               ; preds = %49
  %52 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %50)
          to label %53 unwind label %65

53:                                               ; preds = %51
  %.sroa.0.0.copyload = load i32, ptr %52, align 4, !tbaa !15
  %54 = call noundef ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %55 = getelementptr inbounds %"class.JPH::BodyID", ptr %54, i64 %50
  %56 = invoke noundef ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5eraseEPKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef %55)
          to label %57 unwind label %65

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  store ptr %0, ptr %12, align 8, !tbaa !16
  store i32 %.sroa.0.0.copyload, ptr %19, align 8, !tbaa !15
  call void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(12) %12) #5
  invoke void @_ZN17MultithreadedTest7ExecuteERSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEPKcSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(137) %0, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @.str.3, ptr noundef nonnull %11)
          to label %58 unwind label %67

58:                                               ; preds = %57
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %70

59:                                               ; preds = %42, %39
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %77

61:                                               ; preds = %46
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %69

63:                                               ; preds = %49
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %69

65:                                               ; preds = %53, %51
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %69

67:                                               ; preds = %57
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br label %69

69:                                               ; preds = %63, %67, %65, %61
  %.pn15.pn.pn = phi { ptr, i32 } [ %62, %61 ], [ %64, %63 ], [ %68, %67 ], [ %66, %65 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %77

70:                                               ; preds = %58, %44, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %71 = invoke i64 @_ZNSt8literals15chrono_literalsli2msIJLc49EEEENSt6chrono8durationIlSt5ratioILl1ELl1000EEEEv()
          to label %72 unwind label %75

72:                                               ; preds = %70
  store i64 %71, ptr %13, align 8
  invoke void @_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %73 unwind label %75

73:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  %74 = call noundef zeroext i1 @_ZNKSt6atomicIbEcvbEv(ptr noundef nonnull align 1 dereferenceable(1) %14) #5
  br i1 %74, label %._crit_edge, label %20, !llvm.loop !18

75:                                               ; preds = %72, %70
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %77

77:                                               ; preds = %75, %69, %59
  %.pn19 = phi { ptr, i32 } [ %76, %75 ], [ %.pn15.pn.pn, %69 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %78

._crit_edge:                                      ; preds = %73, %1
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret void

78:                                               ; preds = %77, %38
  %.pn19.pn = phi { ptr, i32 } [ %.pn19, %77 ], [ %.pn13, %38 ]
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn19.pn
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt24uniform_int_distributionImEC2Emm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt24uniform_int_distributionImEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEmRT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN17MultithreadedTest10BoxSpawnerEvE3$_2vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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, !7, i64 0}
!6 = !{!"_ZTSZN17MultithreadedTest10BoxSpawnerEvE3$_0", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"_ZTSZN17MultithreadedTest10BoxSpawnerEvE3$_1", !7, i64 0, !13, i64 8}
!13 = !{!"_ZTSN3JPH6BodyIDE", !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"_ZTSZN17MultithreadedTest10BoxSpawnerEvE3$_2", !7, i64 0, !13, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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