; LLVM IR from jrouwe/JoltPhysics :: Samples/Tests/BroadPhase (BroadPhaseTest)

; 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.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.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::BodyCreationSettings" = type { %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Vec3", i64, i16, %"class.JPH::CollisionGroup", i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, float, i32, i32, i8, float, %"class.JPH::MassProperties", %"class.JPH::RefConst.9", %"class.JPH::RefConst.10" }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.8 }
%union.anon.8 = type { <4 x float> }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst", i32, i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::MassProperties" = type { float, %"class.JPH::Mat44" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::RefConst.9" = type { ptr }
%"class.JPH::RefConst.10" = type { ptr }

; 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 @_ZN14BroadPhaseTest26CreateBalancedDistributionEPN3JPH11BodyManagerEif(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr noundef %1, i32 noundef %2, float noundef %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca %"class.std::linear_congruential_engine", align 8
  %10 = alloca %"class.std::uniform_real_distribution", align 4
  %11 = alloca float, align 4
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca i32, align 4
  %18 = alloca %"class.JPH::AABox", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca %"class.JPH::Vec3", align 16
  %28 = alloca %"class.JPH::BodyCreationSettings", align 16
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca %"class.JPH::Vec3", align 16
  %33 = alloca %"class.JPH::Quat", align 16
  %34 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !11
  %35 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef 518504670)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %10, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = sitofp i32 %36 to float
  store float %37, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  %38 = load float, ptr %8, align 4, !tbaa !11
  %39 = load float, ptr %11, align 4, !tbaa !11
  %40 = call noundef float @_ZSt3powff(float noundef %39, float noundef 0xBFD5555560000000)
  %41 = fsub float 1.000000e+00, %40
  %42 = fmul float %38, %41
  %43 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %42)
  %44 = getelementptr inbounds %"class.JPH::Vec3", ptr %12, i32 0, i32 0
  %45 = getelementptr inbounds %union.anon, ptr %44, i32 0, i32 0
  %46 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 0
  %47 = extractvalue { double, double } %43, 0
  store double %47, ptr %46, align 16
  %48 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 1
  %49 = extractvalue { double, double } %43, 1
  store double %49, ptr %48, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #8
  %50 = load float, ptr %8, align 4, !tbaa !11
  %51 = fdiv float 1.000000e+00, %50
  %52 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %51)
  %53 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %54 = getelementptr inbounds %union.anon, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds { double, double }, ptr %54, i32 0, i32 0
  %56 = extractvalue { double, double } %52, 0
  store double %56, ptr %55, align 16
  %57 = getelementptr inbounds { double, double }, ptr %54, i32 0, i32 1
  %58 = extractvalue { double, double } %52, 1
  store double %58, ptr %57, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #8
  %59 = load float, ptr %8, align 4, !tbaa !11
  %60 = load float, ptr %11, align 4, !tbaa !11
  %61 = call noundef float @_ZSt3powff(float noundef %60, float noundef 0xBFD5555560000000)
  %62 = fmul float %59, %61
  %63 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %62)
  %64 = getelementptr inbounds %"class.JPH::Vec3", ptr %15, i32 0, i32 0
  %65 = getelementptr inbounds %union.anon, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 0
  %67 = extractvalue { double, double } %63, 0
  store double %67, ptr %66, align 16
  %68 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 1
  %69 = extractvalue { double, double } %63, 1
  store double %69, ptr %68, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %13, i64 16, i1 false), !tbaa.struct !13
  %70 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %71 = load double, ptr %70, align 16
  %72 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %73 = load double, ptr %72, align 8
  %74 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %15, double %71, double %73)
  %75 = getelementptr inbounds %"class.JPH::Vec3", ptr %14, i32 0, i32 0
  %76 = getelementptr inbounds %union.anon, ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds { double, double }, ptr %76, i32 0, i32 0
  %78 = extractvalue { double, double } %74, 0
  store double %78, ptr %77, align 16
  %79 = getelementptr inbounds { double, double }, ptr %76, i32 0, i32 1
  %80 = extractvalue { double, double } %74, 1
  store double %80, ptr %79, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %209, %4
  %82 = load i32, ptr %17, align 4, !tbaa !9
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %233

86:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #8
  call void @_ZN3JPH5AABoxC2Ev(ptr noundef nonnull align 16 dereferenceable(32) %18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #8
  %87 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %88 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %89 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %21, float noundef %87, float noundef %88, float noundef %89)
  %90 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %91 = load double, ptr %90, align 16
  %92 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %93 = load double, ptr %92, align 8
  %94 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %91, double %93)
  %95 = getelementptr inbounds %"class.JPH::Vec3", ptr %20, i32 0, i32 0
  %96 = getelementptr inbounds %union.anon, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds { double, double }, ptr %96, i32 0, i32 0
  %98 = extractvalue { double, double } %94, 0
  store double %98, ptr %97, align 16
  %99 = getelementptr inbounds { double, double }, ptr %96, i32 0, i32 1
  %100 = extractvalue { double, double } %94, 1
  store double %100, ptr %99, align 8
  %101 = load float, ptr %8, align 4, !tbaa !11
  %102 = fmul float 5.000000e-01, %101
  %103 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %102)
  %104 = getelementptr inbounds %"class.JPH::Vec3", ptr %22, i32 0, i32 0
  %105 = getelementptr inbounds %union.anon, ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds { double, double }, ptr %105, i32 0, i32 0
  %107 = extractvalue { double, double } %103, 0
  store double %107, ptr %106, align 16
  %108 = getelementptr inbounds { double, double }, ptr %105, i32 0, i32 1
  %109 = extractvalue { double, double } %103, 1
  store double %109, ptr %108, align 8
  %110 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %111 = load double, ptr %110, align 16
  %112 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %113 = load double, ptr %112, align 8
  %114 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %20, double %111, double %113)
  %115 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %116 = getelementptr inbounds %union.anon, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds { double, double }, ptr %116, i32 0, i32 0
  %118 = extractvalue { double, double } %114, 0
  store double %118, ptr %117, align 16
  %119 = getelementptr inbounds { double, double }, ptr %116, i32 0, i32 1
  %120 = extractvalue { double, double } %114, 1
  store double %120, ptr %119, align 8
  %121 = getelementptr inbounds %"class.JPH::AABox", ptr %18, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %121, ptr align 16 %19, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #8
  %122 = getelementptr inbounds %"class.JPH::AABox", ptr %18, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %13, i64 16, i1 false), !tbaa.struct !13
  %123 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %124 = load double, ptr %123, align 16
  %125 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %126 = load double, ptr %125, align 8
  %127 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %122, double %124, double %126)
  %128 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %129 = getelementptr inbounds %union.anon, ptr %128, i32 0, i32 0
  %130 = getelementptr inbounds { double, double }, ptr %129, i32 0, i32 0
  %131 = extractvalue { double, double } %127, 0
  store double %131, ptr %130, align 16
  %132 = getelementptr inbounds { double, double }, ptr %129, i32 0, i32 1
  %133 = extractvalue { double, double } %127, 1
  store double %133, ptr %132, align 8
  %134 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %135 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %136 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %27, float noundef %134, float noundef %135, float noundef %136)
  %137 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %138 = load double, ptr %137, align 16
  %139 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %140 = load double, ptr %139, align 8
  %141 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %14, double %138, double %140)
  %142 = getelementptr inbounds %"class.JPH::Vec3", ptr %26, i32 0, i32 0
  %143 = getelementptr inbounds %union.anon, ptr %142, i32 0, i32 0
  %144 = getelementptr inbounds { double, double }, ptr %143, i32 0, i32 0
  %145 = extractvalue { double, double } %141, 0
  store double %145, ptr %144, align 16
  %146 = getelementptr inbounds { double, double }, ptr %143, i32 0, i32 1
  %147 = extractvalue { double, double } %141, 1
  store double %147, ptr %146, align 8
  %148 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %149 = load double, ptr %148, align 16
  %150 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %151 = load double, ptr %150, align 8
  %152 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %24, double %149, double %151)
  %153 = getelementptr inbounds %"class.JPH::Vec3", ptr %23, i32 0, i32 0
  %154 = getelementptr inbounds %union.anon, ptr %153, i32 0, i32 0
  %155 = getelementptr inbounds { double, double }, ptr %154, i32 0, i32 0
  %156 = extractvalue { double, double } %152, 0
  store double %156, ptr %155, align 16
  %157 = getelementptr inbounds { double, double }, ptr %154, i32 0, i32 1
  %158 = extractvalue { double, double } %152, 1
  store double %158, ptr %157, align 8
  %159 = getelementptr inbounds %"class.JPH::AABox", ptr %18, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %159, ptr align 16 %23, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 256, ptr %28) #8
  call void @_ZN3JPH20BodyCreationSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(256) %28)
  %160 = invoke noundef ptr @_ZN3JPH8BoxShapenwEm(i64 noundef 80)
          to label %161 unwind label %212

161:                                              ; preds = %86
  %162 = invoke { double, double } @_ZNK3JPH5AABox9GetExtentEv(ptr noundef nonnull align 16 dereferenceable(32) %18)
          to label %163 unwind label %216

163:                                              ; preds = %161
  %164 = getelementptr inbounds %"class.JPH::Vec3", ptr %31, i32 0, i32 0
  %165 = getelementptr inbounds %union.anon, ptr %164, i32 0, i32 0
  %166 = getelementptr inbounds { double, double }, ptr %165, i32 0, i32 0
  %167 = extractvalue { double, double } %162, 0
  store double %167, ptr %166, align 16
  %168 = getelementptr inbounds { double, double }, ptr %165, i32 0, i32 1
  %169 = extractvalue { double, double } %162, 1
  store double %169, ptr %168, align 8
  %170 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %171 = load double, ptr %170, align 16
  %172 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %173 = load double, ptr %172, align 8
  invoke void @_ZN3JPH8BoxShapeC2ENS_4Vec3EfPKNS_15PhysicsMaterialE(ptr noundef nonnull align 16 dereferenceable(80) %160, double %171, double %173, float noundef 0.000000e+00, ptr noundef null)
          to label %174 unwind label %216

174:                                              ; preds = %163
  invoke void @_ZN3JPH20BodyCreationSettings8SetShapeEPKNS_5ShapeE(ptr noundef nonnull align 16 dereferenceable(256) %28, ptr noundef %160)
          to label %175 unwind label %212

175:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #8
  %176 = invoke { double, double } @_ZNK3JPH5AABox9GetCenterEv(ptr noundef nonnull align 16 dereferenceable(32) %18)
          to label %177 unwind label %220

177:                                              ; preds = %175
  %178 = getelementptr inbounds %"class.JPH::Vec3", ptr %32, i32 0, i32 0
  %179 = getelementptr inbounds %union.anon, ptr %178, i32 0, i32 0
  %180 = getelementptr inbounds { double, double }, ptr %179, i32 0, i32 0
  %181 = extractvalue { double, double } %176, 0
  store double %181, ptr %180, align 16
  %182 = getelementptr inbounds { double, double }, ptr %179, i32 0, i32 1
  %183 = extractvalue { double, double } %176, 1
  store double %183, ptr %182, align 8
  %184 = getelementptr inbounds %"class.JPH::BodyCreationSettings", ptr %28, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %184, ptr align 16 %32, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #8
  %185 = invoke { double, double } @_ZN3JPH4Quat9sIdentityEv()
          to label %186 unwind label %224

186:                                              ; preds = %177
  %187 = getelementptr inbounds %"class.JPH::Quat", ptr %33, i32 0, i32 0
  %188 = getelementptr inbounds %"class.JPH::Vec4", ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds %union.anon.8, ptr %188, i32 0, i32 0
  %190 = getelementptr inbounds { double, double }, ptr %189, i32 0, i32 0
  %191 = extractvalue { double, double } %185, 0
  store double %191, ptr %190, align 16
  %192 = getelementptr inbounds { double, double }, ptr %189, i32 0, i32 1
  %193 = extractvalue { double, double } %185, 1
  store double %193, ptr %192, align 8
  %194 = getelementptr inbounds %"class.JPH::BodyCreationSettings", ptr %28, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %194, ptr align 16 %33, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #8
  %195 = invoke noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEclEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %196 unwind label %212

196:                                              ; preds = %186
  %197 = urem i64 %195, 10
  %198 = icmp eq i64 %197, 0
  %199 = zext i1 %198 to i64
  %200 = select i1 %198, i16 1, i16 0
  %201 = getelementptr inbounds %"class.JPH::BodyCreationSettings", ptr %28, i32 0, i32 5
  store i16 %200, ptr %201, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = invoke noundef ptr @_ZNK3JPH11BodyManager12AllocateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(297) %202, ptr noundef nonnull align 16 dereferenceable(256) %28)
          to label %204 unwind label %228

204:                                              ; preds = %196
  store ptr %203, ptr %34, align 8, !tbaa !5
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = load ptr, ptr %34, align 8, !tbaa !5
  %207 = invoke noundef zeroext i1 @_ZN3JPH11BodyManager7AddBodyEPNS_4BodyE(ptr noundef nonnull align 8 dereferenceable(297) %205, ptr noundef %206)
          to label %208 unwind label %228

208:                                              ; preds = %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256) %28) #8
  call void @llvm.lifetime.end.p0(i64 256, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  br label %209

209:                                              ; preds = %208
  %210 = load i32, ptr %17, align 4, !tbaa !9
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %17, align 4, !tbaa !9
  br label %81, !llvm.loop !33

212:                                              ; preds = %186, %174, %86
  %213 = landingpad { ptr, i32 }
          cleanup
  %214 = extractvalue { ptr, i32 } %213, 0
  store ptr %214, ptr %29, align 8
  %215 = extractvalue { ptr, i32 } %213, 1
  store i32 %215, ptr %30, align 4
  br label %232

216:                                              ; preds = %163, %161
  %217 = landingpad { ptr, i32 }
          cleanup
  %218 = extractvalue { ptr, i32 } %217, 0
  store ptr %218, ptr %29, align 8
  %219 = extractvalue { ptr, i32 } %217, 1
  store i32 %219, ptr %30, align 4
  call void @_ZN3JPH8BoxShapedlEPv(ptr noundef %160) #8
  br label %232

220:                                              ; preds = %175
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %29, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #8
  br label %232

224:                                              ; preds = %177
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %29, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #8
  br label %232

228:                                              ; preds = %204, %196
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %29, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  br label %232

232:                                              ; preds = %228, %224, %220, %216, %212
  call void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256) %28) #8
  call void @llvm.lifetime.end.p0(i64 256, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %234

233:                                              ; preds = %85
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  ret void

234:                                              ; preds = %232
  %235 = load ptr, ptr %29, align 8
  %236 = load i32, ptr %30, align 4
  %237 = insertvalue { ptr, i32 } poison, ptr %235, 0
  %238 = insertvalue { ptr, i32 } %237, i32 %236, 1
  resume { ptr, i32 } %238
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) 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: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3powff(float noundef, float noundef) #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #2 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) #4

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #2 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 8 dereferenceable(8)) #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH20BodyCreationSettings8SetShapeEPKNS_5ShapeE(ptr noundef nonnull align 16 dereferenceable(256), ptr noundef) #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH8BoxShapenwEm(i64 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5AABox9GetExtentEv(ptr noundef nonnull align 16 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH8BoxShapeC2ENS_4Vec3EfPKNS_15PhysicsMaterialE(ptr noundef nonnull align 16 dereferenceable(80), double, double, float noundef, ptr noundef) unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH8BoxShapedlEPv(ptr noundef) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5AABox9GetCenterEv(ptr noundef nonnull align 16 dereferenceable(32)) #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Quat9sIdentityEv() #5 align 2

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

declare noundef ptr @_ZNK3JPH11BodyManager12AllocateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef nonnull align 16 dereferenceable(256)) #7

declare noundef zeroext i1 @_ZN3JPH11BodyManager7AddBodyEPNS_4BodyE(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256)) unnamed_addr #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { alwaysinline 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 #7 = { "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 #8 = { 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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{i64 0, i64 16, !14}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !21, i64 72}
!16 = !{!"_ZTSN3JPH20BodyCreationSettingsE", !17, i64 0, !18, i64 16, !17, i64 32, !17, i64 48, !20, i64 64, !21, i64 72, !22, i64 80, !24, i64 96, !25, i64 97, !26, i64 98, !26, i64 99, !26, i64 100, !26, i64 101, !26, i64 102, !27, i64 103, !26, i64 104, !26, i64 105, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !10, i64 136, !10, i64 140, !28, i64 144, !12, i64 148, !29, i64 160, !31, i64 240, !32, i64 248}
!17 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!18 = !{!"_ZTSN3JPH4QuatE", !19, i64 0}
!19 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"short", !7, i64 0}
!22 = !{!"_ZTSN3JPH14CollisionGroupE", !23, i64 0, !10, i64 8, !10, i64 12}
!23 = !{!"_ZTSN3JPH8RefConstINS_11GroupFilterEEE", !6, i64 0}
!24 = !{!"_ZTSN3JPH11EMotionTypeE", !7, i64 0}
!25 = !{!"_ZTSN3JPH12EAllowedDOFsE", !7, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"_ZTSN3JPH14EMotionQualityE", !7, i64 0}
!28 = !{!"_ZTSN3JPH23EOverrideMassPropertiesE", !7, i64 0}
!29 = !{!"_ZTSN3JPH14MassPropertiesE", !12, i64 0, !30, i64 16}
!30 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!31 = !{!"_ZTSN3JPH8RefConstINS_13ShapeSettingsEEE", !6, i64 0}
!32 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !6, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"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.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.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::BodyCreationSettings" = type { %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Vec3", i64, i16, %"class.JPH::CollisionGroup", i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, float, i32, i32, i8, float, %"class.JPH::MassProperties", %"class.JPH::RefConst.9", %"class.JPH::RefConst.10" }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.8 }
%union.anon.8 = type { <4 x float> }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst", i32, i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::MassProperties" = type { float, %"class.JPH::Mat44" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::RefConst.9" = type { ptr }
%"class.JPH::RefConst.10" = type { ptr }

; 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 @_ZN14BroadPhaseTest26CreateBalancedDistributionEPN3JPH11BodyManagerEif(ptr nocapture noundef nonnull readnone align 8 dereferenceable(144) %0, ptr noundef %1, i32 noundef %2, float noundef %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::linear_congruential_engine", align 8
  %6 = alloca %"class.std::uniform_real_distribution", align 4
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::AABox", align 16
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::BodyCreationSettings", align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 518504670)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %16 = sitofp i32 %2 to float
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  %17 = call noundef float @_ZSt3powff(float noundef %16, float noundef 0xBFD5555560000000)
  %18 = fsub float 1.000000e+00, %17
  %19 = fmul float %18, %3
  %20 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %19)
  %21 = extractvalue { double, double } %20, 0
  store double %21, ptr %7, align 16
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  %23 = extractvalue { double, double } %20, 1
  store double %23, ptr %22, align 8
  %24 = fdiv float 1.000000e+00, %3
  %25 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %24)
  %26 = extractvalue { double, double } %25, 0
  %27 = extractvalue { double, double } %25, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  %28 = call noundef float @_ZSt3powff(float noundef %16, float noundef 0xBFD5555560000000)
  %29 = fmul float %28, %3
  %30 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %29)
  %31 = extractvalue { double, double } %30, 0
  store double %31, ptr %9, align 16
  %32 = getelementptr inbounds i8, ptr %9, i64 8
  %33 = extractvalue { double, double } %30, 1
  store double %33, ptr %32, align 8
  %34 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %9, double %26, double %27)
  %35 = extractvalue { double, double } %34, 0
  store double %35, ptr %8, align 16
  %36 = getelementptr inbounds i8, ptr %8, i64 8
  %37 = extractvalue { double, double } %34, 1
  store double %37, ptr %36, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  %38 = icmp sgt i32 %2, 0
  br i1 %38, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %4
  %39 = getelementptr inbounds i8, ptr %12, i64 8
  %40 = getelementptr inbounds i8, ptr %11, i64 8
  %41 = fmul float %3, 5.000000e-01
  %.sroa.413.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  %42 = getelementptr inbounds i8, ptr %13, i64 8
  %43 = getelementptr inbounds i8, ptr %14, i64 8
  %44 = getelementptr inbounds i8, ptr %10, i64 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 24
  %.sroa.52.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  %45 = getelementptr inbounds i8, ptr %15, i64 16
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 24
  %46 = getelementptr inbounds i8, ptr %15, i64 72
  br label %47

._crit_edge:                                      ; preds = %100, %4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  ret void

47:                                               ; preds = %.lr.ph, %100
  %.036 = phi i32 [ 0, %.lr.ph ], [ %101, %100 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #7
  call void @_ZN3JPH5AABoxC2Ev(ptr noundef nonnull align 16 dereferenceable(32) %10)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %48 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %49 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %50 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %12, float noundef %48, float noundef %49, float noundef %50)
  %51 = load double, ptr %12, align 16
  %52 = load double, ptr %39, align 8
  %53 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %51, double %52)
  %54 = extractvalue { double, double } %53, 0
  store double %54, ptr %11, align 16
  %55 = extractvalue { double, double } %53, 1
  store double %55, ptr %40, align 8
  %56 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %41)
  %57 = extractvalue { double, double } %56, 0
  %58 = extractvalue { double, double } %56, 1
  %59 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %11, double %57, double %58)
  %60 = extractvalue { double, double } %59, 0
  %61 = extractvalue { double, double } %59, 1
  store double %60, ptr %10, align 16
  store double %61, ptr %.sroa.413.0..sroa_idx, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  %62 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %10, double %26, double %27)
  %63 = extractvalue { double, double } %62, 0
  store double %63, ptr %13, align 16
  %64 = extractvalue { double, double } %62, 1
  store double %64, ptr %42, align 8
  %65 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %66 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %67 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %14, float noundef %65, float noundef %66, float noundef %67)
  %68 = load double, ptr %14, align 16
  %69 = load double, ptr %43, align 8
  %70 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %68, double %69)
  %71 = extractvalue { double, double } %70, 0
  %72 = extractvalue { double, double } %70, 1
  %73 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %13, double %71, double %72)
  %74 = extractvalue { double, double } %73, 0
  %75 = extractvalue { double, double } %73, 1
  store double %74, ptr %44, align 16
  store double %75, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %15) #7
  call void @_ZN3JPH20BodyCreationSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(256) %15)
  %76 = invoke noundef ptr @_ZN3JPH8BoxShapenwEm(i64 noundef 80)
          to label %77 unwind label %102

77:                                               ; preds = %47
  %78 = invoke { double, double } @_ZNK3JPH5AABox9GetExtentEv(ptr noundef nonnull align 16 dereferenceable(32) %10)
          to label %79 unwind label %104

79:                                               ; preds = %77
  %80 = extractvalue { double, double } %78, 0
  %81 = extractvalue { double, double } %78, 1
  invoke void @_ZN3JPH8BoxShapeC2ENS_4Vec3EfPKNS_15PhysicsMaterialE(ptr noundef nonnull align 16 dereferenceable(80) %76, double %80, double %81, float noundef 0.000000e+00, ptr noundef null)
          to label %82 unwind label %104

82:                                               ; preds = %79
  invoke void @_ZN3JPH20BodyCreationSettings8SetShapeEPKNS_5ShapeE(ptr noundef nonnull align 16 dereferenceable(256) %15, ptr noundef nonnull %76)
          to label %83 unwind label %102

83:                                               ; preds = %82
  %84 = invoke { double, double } @_ZNK3JPH5AABox9GetCenterEv(ptr noundef nonnull align 16 dereferenceable(32) %10)
          to label %85 unwind label %106

85:                                               ; preds = %83
  %86 = extractvalue { double, double } %84, 0
  %87 = extractvalue { double, double } %84, 1
  store double %86, ptr %15, align 16
  store double %87, ptr %.sroa.52.0..sroa_idx, align 8, !tbaa !5
  %88 = invoke { double, double } @_ZN3JPH4Quat9sIdentityEv()
          to label %89 unwind label %108

89:                                               ; preds = %85
  %90 = extractvalue { double, double } %88, 0
  %91 = extractvalue { double, double } %88, 1
  store double %90, ptr %45, align 16
  store double %91, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !5
  %92 = invoke noundef i64 @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEclEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %93 unwind label %102

93:                                               ; preds = %89
  %94 = urem i64 %92, 10
  %95 = icmp eq i64 %94, 0
  %96 = zext i1 %95 to i16
  store i16 %96, ptr %46, align 8, !tbaa !8
  %97 = invoke noundef ptr @_ZNK3JPH11BodyManager12AllocateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(297) %1, ptr noundef nonnull align 16 dereferenceable(256) %15)
          to label %98 unwind label %110

98:                                               ; preds = %93
  %99 = invoke noundef zeroext i1 @_ZN3JPH11BodyManager7AddBodyEPNS_4BodyE(ptr noundef nonnull align 8 dereferenceable(297) %1, ptr noundef %97)
          to label %100 unwind label %110

100:                                              ; preds = %98
  call void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256) %15) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #7
  %101 = add nuw nsw i32 %.036, 1
  %exitcond.not = icmp eq i32 %101, %2
  br i1 %exitcond.not, label %._crit_edge, label %47, !llvm.loop !29

102:                                              ; preds = %89, %82, %47
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %112

104:                                              ; preds = %79, %77
  %105 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH8BoxShapedlEPv(ptr noundef %76) #7
  br label %112

106:                                              ; preds = %83
  %107 = landingpad { ptr, i32 }
          cleanup
  br label %112

108:                                              ; preds = %85
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %112

110:                                              ; preds = %98, %93
  %111 = landingpad { ptr, i32 }
          cleanup
  br label %112

112:                                              ; preds = %110, %108, %106, %104, %102
  %.pn = phi { ptr, i32 } [ %111, %110 ], [ %103, %102 ], [ %109, %108 ], [ %107, %106 ], [ %105, %104 ]
  call void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256) %15) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) 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: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3powff(float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #2 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #2 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 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH20BodyCreationSettings8SetShapeEPKNS_5ShapeE(ptr noundef nonnull align 16 dereferenceable(256), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH8BoxShapenwEm(i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5AABox9GetExtentEv(ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH8BoxShapeC2ENS_4Vec3EfPKNS_15PhysicsMaterialE(ptr noundef nonnull align 16 dereferenceable(80), double, double, float noundef, ptr noundef) unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH8BoxShapedlEPv(ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5AABox9GetCenterEv(ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Quat9sIdentityEv() local_unnamed_addr #4 align 2

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

declare noundef ptr @_ZNK3JPH11BodyManager12AllocateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef nonnull align 16 dereferenceable(256)) local_unnamed_addr #6

declare noundef zeroext i1 @_ZN3JPH11BodyManager7AddBodyEPNS_4BodyE(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256)) unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 #4 = { 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 #5 = { alwaysinline 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 = { "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 }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !14, i64 72}
!9 = !{!"_ZTSN3JPH20BodyCreationSettingsE", !10, i64 0, !11, i64 16, !10, i64 32, !10, i64 48, !13, i64 64, !14, i64 72, !15, i64 80, !19, i64 96, !20, i64 97, !21, i64 98, !21, i64 99, !21, i64 100, !21, i64 101, !21, i64 102, !22, i64 103, !21, i64 104, !21, i64 105, !23, i64 108, !23, i64 112, !23, i64 116, !23, i64 120, !23, i64 124, !23, i64 128, !23, i64 132, !18, i64 136, !18, i64 140, !24, i64 144, !23, i64 148, !25, i64 160, !27, i64 240, !28, i64 248}
!10 = !{!"_ZTSN3JPH4Vec3E", !6, i64 0}
!11 = !{!"_ZTSN3JPH4QuatE", !12, i64 0}
!12 = !{!"_ZTSN3JPH4Vec4E", !6, i64 0}
!13 = !{!"long", !6, i64 0}
!14 = !{!"short", !6, i64 0}
!15 = !{!"_ZTSN3JPH14CollisionGroupE", !16, i64 0, !18, i64 8, !18, i64 12}
!16 = !{!"_ZTSN3JPH8RefConstINS_11GroupFilterEEE", !17, i64 0}
!17 = !{!"any pointer", !6, i64 0}
!18 = !{!"int", !6, i64 0}
!19 = !{!"_ZTSN3JPH11EMotionTypeE", !6, i64 0}
!20 = !{!"_ZTSN3JPH12EAllowedDOFsE", !6, i64 0}
!21 = !{!"bool", !6, i64 0}
!22 = !{!"_ZTSN3JPH14EMotionQualityE", !6, i64 0}
!23 = !{!"float", !6, i64 0}
!24 = !{!"_ZTSN3JPH23EOverrideMassPropertiesE", !6, i64 0}
!25 = !{!"_ZTSN3JPH14MassPropertiesE", !23, i64 0, !26, i64 16}
!26 = !{!"_ZTSN3JPH5Mat44E", !6, i64 0}
!27 = !{!"_ZTSN3JPH8RefConstINS_13ShapeSettingsEEE", !17, i64 0}
!28 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !17, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


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