; LLVM IR from jrouwe/JoltPhysics :: Samples/Tests/Shapes (DeformedHeightFieldShapeTest)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%class.anon.34 = type { float }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::DefaultBroadPhaseLayerFilter" = type <{ %"class.JPH::BroadPhaseLayerFilter", ptr, i16, [6 x i8] }>
%"class.JPH::BroadPhaseLayerFilter" = type { ptr }
%"class.JPH::DefaultObjectLayerFilter" = type <{ %"class.JPH::ObjectLayerFilter", ptr, i16, [6 x i8] }>
%"class.JPH::ObjectLayerFilter" = type { ptr }
%class.DeformedHeightFieldShapeTest = type { %class.Test, %"class.JPH::Array", %"class.JPH::Ref", %"class.JPH::BodyID", float }
%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.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::BodyID" = type { i32 }
%"class.Test::PreUpdateParams" = type { float, [12 x i8], %struct.CameraState }
%struct.CameraState = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, [12 x i8] }>

@_ZN28DeformedHeightFieldShapeTest12cSampleCountE = external dso_local constant i32, align 4

; 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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #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) #3

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK28DeformedHeightFieldShapeTest13GetPathCenterEf(ptr noundef nonnull align 8 dereferenceable(152), float noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN28DeformedHeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr noundef nonnull align 16 dereferenceable(80) %1) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca float, align 4
  %21 = alloca %class.anon.34, align 4
  %22 = alloca %"class.JPH::AABox", align 16
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca float, align 4
  %27 = alloca %"class.JPH::Vec3", align 16
  %28 = alloca %"class.JPH::Vec3", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::DefaultBroadPhaseLayerFilter", align 8
  %31 = alloca %"class.JPH::DefaultObjectLayerFilter", align 8
  %32 = alloca ptr, align 8
  %33 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %34 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #10
  store float 6.000000e+00, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #10
  store float 1.000000e+00, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #10
  store float 2.000000e+00, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #10
  %35 = getelementptr inbounds %class.DeformedHeightFieldShapeTest, ptr %34, i32 0, i32 4
  %36 = load float, ptr %35, align 4, !tbaa !11
  %37 = fmul float 2.000000e+00, %36
  %38 = call { double, double } @_ZNK28DeformedHeightFieldShapeTest13GetPathCenterEf(ptr noundef nonnull align 8 dereferenceable(152) %34, float noundef %37)
  %39 = getelementptr inbounds %"class.JPH::Vec3", ptr %8, i32 0, i32 0
  %40 = getelementptr inbounds %union.anon, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds { double, double }, ptr %40, i32 0, i32 0
  %42 = extractvalue { double, double } %38, 0
  store double %42, ptr %41, align 16
  %43 = getelementptr inbounds { double, double }, ptr %40, i32 0, i32 1
  %44 = extractvalue { double, double } %38, 1
  store double %44, ptr %43, align 8
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.Test::PreUpdateParams", ptr %45, i32 0, i32 0
  %47 = load float, ptr %46, align 16, !tbaa !24
  %48 = getelementptr inbounds %class.DeformedHeightFieldShapeTest, ptr %34, i32 0, i32 4
  %49 = load float, ptr %48, align 4, !tbaa !11
  %50 = fadd float %49, %47
  store float %50, ptr %48, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  %51 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %52 = fsub float %51, 6.000000e+00
  %53 = call noundef float @_ZSt5floorf(float noundef %52)
  %54 = fptosi float %53 to i32
  %55 = and i32 %54, -4
  store i32 %55, ptr %10, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  store i32 0, ptr %11, align 4, !tbaa !28
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %57 = load i32, ptr %56, align 4, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  store i32 %57, ptr %9, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  %58 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %59 = fsub float %58, 6.000000e+00
  %60 = call noundef float @_ZSt5floorf(float noundef %59)
  %61 = fptosi float %60 to i32
  %62 = and i32 %61, -4
  store i32 %62, ptr %13, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  store i32 0, ptr %14, align 4, !tbaa !28
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %64 = load i32, ptr %63, align 4, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  store i32 %64, ptr %12, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  %65 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %66 = fadd float %65, 6.000000e+00
  %67 = call noundef float @_ZSt4ceilf(float noundef %66)
  %68 = fptosi float %67 to i32
  %69 = add nsw i32 %68, 3
  %70 = and i32 %69, -4
  store i32 %70, ptr %16, align 4, !tbaa !28
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) @_ZN28DeformedHeightFieldShapeTest12cSampleCountE)
  %72 = load i32, ptr %71, align 4, !tbaa !28
  %73 = load i32, ptr %9, align 4, !tbaa !28
  %74 = sub nsw i32 %72, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  store i32 %74, ptr %15, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  %75 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %76 = fadd float %75, 6.000000e+00
  %77 = call noundef float @_ZSt4ceilf(float noundef %76)
  %78 = fptosi float %77 to i32
  %79 = add nsw i32 %78, 3
  %80 = and i32 %79, -4
  store i32 %80, ptr %18, align 4, !tbaa !28
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) @_ZN28DeformedHeightFieldShapeTest12cSampleCountE)
  %82 = load i32, ptr %81, align 4, !tbaa !28
  %83 = load i32, ptr %12, align 4, !tbaa !28
  %84 = sub nsw i32 %82, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  store i32 %84, ptr %17, align 4, !tbaa !28
  %85 = load i32, ptr %15, align 4, !tbaa !28
  %86 = icmp sgt i32 %85, 0
  br i1 %86, label %87, label %222

87:                                               ; preds = %2
  %88 = load i32, ptr %17, align 4, !tbaa !28
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %222

90:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #10
  %91 = getelementptr inbounds %class.DeformedHeightFieldShapeTest, ptr %34, i32 0, i32 2
  %92 = call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %91)
  %93 = call { double, double } @_ZNK3JPH5Shape15GetCenterOfMassEv(ptr noundef nonnull align 8 dereferenceable(26) %92)
  %94 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %95 = getelementptr inbounds %union.anon, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds { double, double }, ptr %95, i32 0, i32 0
  %97 = extractvalue { double, double } %93, 0
  store double %97, ptr %96, align 16
  %98 = getelementptr inbounds { double, double }, ptr %95, i32 0, i32 1
  %99 = extractvalue { double, double } %93, 1
  store double %99, ptr %98, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  store float 0x3FF921FB60000000, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #10
  %100 = getelementptr inbounds %class.anon.34, ptr %21, i32 0, i32 0
  store float 0x3FF921FB60000000, ptr %100, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #10
  call void @_ZN3JPH5AABoxC2Ev(ptr noundef nonnull align 16 dereferenceable(32) %22)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  store i32 0, ptr %23, align 4, !tbaa !28
  br label %101

101:                                              ; preds = %166, %90
  %102 = load i32, ptr %23, align 4, !tbaa !28
  %103 = load i32, ptr %17, align 4, !tbaa !28
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  store i32 2, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %169

106:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  store i32 0, ptr %25, align 4, !tbaa !28
  br label %107

107:                                              ; preds = %162, %106
  %108 = load i32, ptr %25, align 4, !tbaa !28
  %109 = load i32, ptr %15, align 4, !tbaa !28
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 5, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  br label %165

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #10
  %113 = load i32, ptr %9, align 4, !tbaa !28
  %114 = sitofp i32 %113 to float
  %115 = load i32, ptr %25, align 4, !tbaa !28
  %116 = sitofp i32 %115 to float
  %117 = fadd float %114, %116
  %118 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %119 = fsub float %117, %118
  %120 = load i32, ptr %12, align 4, !tbaa !28
  %121 = sitofp i32 %120 to float
  %122 = load i32, ptr %23, align 4, !tbaa !28
  %123 = sitofp i32 %122 to float
  %124 = fadd float %121, %123
  %125 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %126 = fsub float %124, %125
  %127 = call noundef float @"_ZZN28DeformedHeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsEENK3$_0clEff"(ptr noundef nonnull align 4 dereferenceable(4) %21, float noundef %119, float noundef %126)
  %128 = fmul float %127, 1.000000e+00
  store float %128, ptr %26, align 4, !tbaa !9
  %129 = load float, ptr %26, align 4, !tbaa !9
  %130 = getelementptr inbounds %class.DeformedHeightFieldShapeTest, ptr %34, i32 0, i32 1
  %131 = load i32, ptr %12, align 4, !tbaa !28
  %132 = load i32, ptr %23, align 4, !tbaa !28
  %133 = add nsw i32 %131, %132
  %134 = mul nsw i32 %133, 128
  %135 = load i32, ptr %9, align 4, !tbaa !28
  %136 = add nsw i32 %134, %135
  %137 = load i32, ptr %25, align 4, !tbaa !28
  %138 = add nsw i32 %136, %137
  %139 = sext i32 %138 to i64
  %140 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %130, i64 noundef %139)
  %141 = load float, ptr %140, align 4, !tbaa !9
  %142 = fsub float %141, %129
  store float %142, ptr %140, align 4, !tbaa !9
  %143 = getelementptr inbounds %class.DeformedHeightFieldShapeTest, ptr %34, i32 0, i32 2
  %144 = call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %143)
  %145 = load i32, ptr %9, align 4, !tbaa !28
  %146 = load i32, ptr %25, align 4, !tbaa !28
  %147 = add nsw i32 %145, %146
  %148 = load i32, ptr %12, align 4, !tbaa !28
  %149 = load i32, ptr %23, align 4, !tbaa !28
  %150 = add nsw i32 %148, %149
  %151 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %144, i32 noundef %147, i32 noundef %150)
  %152 = getelementptr inbounds %"class.JPH::Vec3", ptr %27, i32 0, i32 0
  %153 = getelementptr inbounds %union.anon, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds { double, double }, ptr %153, i32 0, i32 0
  %155 = extractvalue { double, double } %151, 0
  store double %155, ptr %154, align 16
  %156 = getelementptr inbounds { double, double }, ptr %153, i32 0, i32 1
  %157 = extractvalue { double, double } %151, 1
  store double %157, ptr %156, align 8
  %158 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %159 = load double, ptr %158, align 16
  %160 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %161 = load double, ptr %160, align 8
  call void @_ZN3JPH5AABox11EncapsulateENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32) %22, double %159, double %161)
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  br label %162

162:                                              ; preds = %112
  %163 = load i32, ptr %25, align 4, !tbaa !28
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %25, align 4, !tbaa !28
  br label %107, !llvm.loop !31

165:                                              ; preds = %111
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %23, align 4, !tbaa !28
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %23, align 4, !tbaa !28
  br label %101, !llvm.loop !33

169:                                              ; preds = %105
  %170 = getelementptr inbounds %class.DeformedHeightFieldShapeTest, ptr %34, i32 0, i32 2
  %171 = call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %170)
  %172 = load i32, ptr %9, align 4, !tbaa !28
  %173 = load i32, ptr %12, align 4, !tbaa !28
  %174 = load i32, ptr %15, align 4, !tbaa !28
  %175 = load i32, ptr %17, align 4, !tbaa !28
  %176 = getelementptr inbounds %class.DeformedHeightFieldShapeTest, ptr %34, i32 0, i32 1
  %177 = call noundef ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %176)
  %178 = load i32, ptr %12, align 4, !tbaa !28
  %179 = mul nsw i32 %178, 128
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds float, ptr %177, i64 %180
  %182 = load i32, ptr %9, align 4, !tbaa !28
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds float, ptr %181, i64 %183
  %185 = getelementptr inbounds %class.Test, ptr %34, i32 0, i32 5
  %186 = load ptr, ptr %185, align 8, !tbaa !34
  call void @_ZN3JPH16HeightFieldShape10SetHeightsEjjjjPKflRNS_13TempAllocatorEf(ptr noundef nonnull align 16 dereferenceable(176) %171, i32 noundef %172, i32 noundef %173, i32 noundef %174, i32 noundef %175, ptr noundef %184, i64 noundef 128, ptr noundef nonnull align 8 dereferenceable(8) %186, float noundef 0x3FEFE0D460000000)
  %187 = getelementptr inbounds %class.Test, ptr %34, i32 0, i32 3
  %188 = load ptr, ptr %187, align 8, !tbaa !35
  %189 = getelementptr inbounds %class.DeformedHeightFieldShapeTest, ptr %34, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %28, ptr align 16 %19, i64 16, i1 false), !tbaa.struct !36
  %190 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %191 = load double, ptr %190, align 16
  %192 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %193 = load double, ptr %192, align 8
  call void @_ZNK3JPH13BodyInterface18NotifyShapeChangedERKNS_6BodyIDENS_4Vec3EbNS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24) %188, ptr noundef nonnull align 4 dereferenceable(4) %189, double %191, double %193, i1 noundef zeroext false, i32 noundef 1)
  %194 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0x3FB99999A0000000)
  %195 = getelementptr inbounds %"class.JPH::Vec3", ptr %29, i32 0, i32 0
  %196 = getelementptr inbounds %union.anon, ptr %195, i32 0, i32 0
  %197 = getelementptr inbounds { double, double }, ptr %196, i32 0, i32 0
  %198 = extractvalue { double, double } %194, 0
  store double %198, ptr %197, align 16
  %199 = getelementptr inbounds { double, double }, ptr %196, i32 0, i32 1
  %200 = extractvalue { double, double } %194, 1
  store double %200, ptr %199, align 8
  %201 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %202 = load double, ptr %201, align 16
  %203 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %204 = load double, ptr %203, align 8
  call void @_ZN3JPH5AABox8ExpandByENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32) %22, double %202, double %204)
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #10
  %205 = getelementptr inbounds %class.Test, ptr %34, i32 0, i32 2
  %206 = load ptr, ptr %205, align 8, !tbaa !38
  call void @_ZNK3JPH13PhysicsSystem31GetDefaultBroadPhaseLayerFilterEt(ptr dead_on_unwind writable sret(%"class.JPH::DefaultBroadPhaseLayerFilter") align 8 %30, ptr noundef nonnull align 16 dereferenceable(1172) %206, i16 noundef zeroext 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #10
  %207 = getelementptr inbounds %class.Test, ptr %34, i32 0, i32 2
  %208 = load ptr, ptr %207, align 8, !tbaa !38
  invoke void @_ZNK3JPH13PhysicsSystem21GetDefaultLayerFilterEt(ptr dead_on_unwind writable sret(%"class.JPH::DefaultObjectLayerFilter") align 8 %31, ptr noundef nonnull align 16 dereferenceable(1172) %208, i16 noundef zeroext 1)
          to label %209 unwind label %213

209:                                              ; preds = %169
  %210 = getelementptr inbounds %class.Test, ptr %34, i32 0, i32 3
  %211 = load ptr, ptr %210, align 8, !tbaa !35
  invoke void @_ZN3JPH13BodyInterface21ActivateBodiesInAABoxERKNS_5AABoxERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterE(ptr noundef nonnull align 8 dereferenceable(24) %211, ptr noundef nonnull align 16 dereferenceable(32) %22, ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %212 unwind label %217

212:                                              ; preds = %209
  call void @_ZN3JPH17ObjectLayerFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(18) %31) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #10
  call void @_ZN3JPH21BroadPhaseLayerFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(18) %30) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #10
  br label %222

213:                                              ; preds = %169
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %32, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %33, align 4
  br label %221

217:                                              ; preds = %209
  %218 = landingpad { ptr, i32 }
          cleanup
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %32, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %33, align 4
  call void @_ZN3JPH17ObjectLayerFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(18) %31) #10
  br label %221

221:                                              ; preds = %217, %213
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #10
  call void @_ZN3JPH21BroadPhaseLayerFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(18) %30) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #10
  br label %223

222:                                              ; preds = %212, %87, %2
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #10
  ret void

223:                                              ; preds = %221
  %224 = load ptr, ptr %32, align 8
  %225 = load i32, ptr %33, align 4
  %226 = insertvalue { ptr, i32 } poison, ptr %224, 0
  %227 = insertvalue { ptr, i32 } %226, i32 %225, 1
  resume { ptr, i32 } %227
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16)) #5 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16)) #6 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4ceilf(float noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Shape15GetCenterOfMassEv(ptr noundef nonnull align 8 dereferenceable(26)) unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef float @"_ZZN28DeformedHeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsEENK3$_0clEff"(ptr noundef nonnull align 4 dereferenceable(4), float noundef, float noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox11EncapsulateENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32), double, double) #4 align 2

declare { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef) #7

declare void @_ZN3JPH16HeightFieldShape10SetHeightsEjjjjPKflRNS_13TempAllocatorEf(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), float noundef) #7

declare void @_ZNK3JPH13BodyInterface18NotifyShapeChangedERKNS_6BodyIDENS_4Vec3EbNS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), double, double, i1 noundef zeroext, i32 noundef) #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox8ExpandByENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32), double, double) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef) #8 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH13PhysicsSystem31GetDefaultBroadPhaseLayerFilterEt(ptr dead_on_unwind noalias writable sret(%"class.JPH::DefaultBroadPhaseLayerFilter") align 8, ptr noundef nonnull align 16 dereferenceable(1172), i16 noundef zeroext) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH13PhysicsSystem21GetDefaultLayerFilterEt(ptr dead_on_unwind noalias writable sret(%"class.JPH::DefaultObjectLayerFilter") align 8, ptr noundef nonnull align 16 dereferenceable(1172), i16 noundef zeroext) #4 align 2

declare void @_ZN3JPH13BodyInterface21ActivateBodiesInAABoxERKNS_5AABoxERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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"="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 #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 = { 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 #9 = { 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 #10 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 148}
!12 = !{!"_ZTS28DeformedHeightFieldShapeTest", !13, i64 0, !20, i64 112, !21, i64 136, !22, i64 144, !10, i64 148}
!13 = !{!"_ZTS4Test", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !14, i64 48, !15, i64 56}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !16, i64 0}
!16 = !{!"_ZTSSt10_HashtableIN3JPH6BodyIDESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEEESaISB_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSD_18_Mod_range_hashingENSD_20_Default_ranged_hashENSD_20_Prime_rehash_policyENSD_17_Hashtable_traitsILb1ELb0ELb1EEEE", !6, i64 0, !17, i64 8, !18, i64 16, !17, i64 24, !19, i64 32, !6, i64 48}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!19 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !10, i64 0, !17, i64 8}
!20 = !{!"_ZTSN3JPH5ArrayIfNS_12STLAllocatorIfEEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!21 = !{!"_ZTSN3JPH3RefINS_16HeightFieldShapeEEE", !6, i64 0}
!22 = !{!"_ZTSN3JPH6BodyIDE", !23, i64 0}
!23 = !{!"int", !7, i64 0}
!24 = !{!25, !10, i64 0}
!25 = !{!"_ZTSN4Test15PreUpdateParamsE", !10, i64 0, !26, i64 16}
!26 = !{!"_ZTS11CameraState", !27, i64 0, !27, i64 16, !27, i64 32, !10, i64 48}
!27 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!28 = !{!23, !23, i64 0}
!29 = !{!30, !10, i64 0}
!30 = !{!"_ZTSZN28DeformedHeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsEE3$_0", !10, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}
!34 = !{!13, !6, i64 40}
!35 = !{!13, !6, i64 24}
!36 = !{i64 0, i64 16, !37}
!37 = !{!7, !7, i64 0}
!38 = !{!13, !6, i64 16}


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

%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%class.anon.34 = type { float }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::DefaultBroadPhaseLayerFilter" = type <{ %"class.JPH::BroadPhaseLayerFilter", ptr, i16, [6 x i8] }>
%"class.JPH::BroadPhaseLayerFilter" = type { ptr }
%"class.JPH::DefaultObjectLayerFilter" = type <{ %"class.JPH::ObjectLayerFilter", ptr, i16, [6 x i8] }>
%"class.JPH::ObjectLayerFilter" = type { ptr }

@_ZN28DeformedHeightFieldShapeTest12cSampleCountE = external dso_local constant i32, align 4

; 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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK28DeformedHeightFieldShapeTest13GetPathCenterEf(ptr noundef nonnull align 8 dereferenceable(152), float noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN28DeformedHeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 8 dereferenceable(152) %0, ptr nocapture noundef nonnull readonly align 16 dereferenceable(80) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.JPH::Vec3", align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %class.anon.34, align 4
  %11 = alloca %"class.JPH::AABox", align 16
  %12 = alloca %"class.JPH::DefaultBroadPhaseLayerFilter", align 8
  %13 = alloca %"class.JPH::DefaultObjectLayerFilter", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #9
  %14 = getelementptr inbounds i8, ptr %0, i64 148
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = fmul float %15, 2.000000e+00
  %17 = tail call { double, double } @_ZNK28DeformedHeightFieldShapeTest13GetPathCenterEf(ptr noundef nonnull align 8 dereferenceable(152) %0, float noundef %16)
  %18 = extractvalue { double, double } %17, 0
  store double %18, ptr %3, align 16
  %19 = getelementptr inbounds i8, ptr %3, i64 8
  %20 = extractvalue { double, double } %17, 1
  store double %20, ptr %19, align 8
  %21 = load float, ptr %1, align 16, !tbaa !22
  %22 = load float, ptr %14, align 4, !tbaa !5
  %23 = fadd float %21, %22
  store float %23, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %24 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %3)
  %25 = fadd float %24, -6.000000e+00
  %26 = call noundef float @_ZSt5floorf(float noundef %25)
  %27 = fptosi float %26 to i32
  %28 = and i32 %27, -4
  store i32 %28, ptr %4, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  store i32 0, ptr %5, align 4, !tbaa !26
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %30 = load i32, ptr %29, align 4, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  %31 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %3)
  %32 = fadd float %31, -6.000000e+00
  %33 = call noundef float @_ZSt5floorf(float noundef %32)
  %34 = fptosi float %33 to i32
  %35 = and i32 %34, -4
  store i32 %35, ptr %6, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  store i32 0, ptr %7, align 4, !tbaa !26
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %37 = load i32, ptr %36, align 4, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  %38 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %3)
  %39 = fadd float %38, 6.000000e+00
  %40 = call noundef float @_ZSt4ceilf(float noundef %39)
  %41 = fptosi float %40 to i32
  %42 = add nsw i32 %41, 3
  %43 = and i32 %42, -4
  store i32 %43, ptr %8, align 4, !tbaa !26
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) @_ZN28DeformedHeightFieldShapeTest12cSampleCountE)
  %45 = load i32, ptr %44, align 4, !tbaa !26
  %46 = sub i32 %45, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  %47 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %3)
  %48 = fadd float %47, 6.000000e+00
  %49 = call noundef float @_ZSt4ceilf(float noundef %48)
  %50 = fptosi float %49 to i32
  %51 = add nsw i32 %50, 3
  %52 = and i32 %51, -4
  store i32 %52, ptr %9, align 4, !tbaa !26
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) @_ZN28DeformedHeightFieldShapeTest12cSampleCountE)
  %54 = load i32, ptr %53, align 4, !tbaa !26
  %55 = sub i32 %54, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  %56 = icmp sgt i32 %46, 0
  %57 = icmp sgt i32 %55, 0
  %or.cond = select i1 %56, i1 %57, i1 false
  br i1 %or.cond, label %.split.us, label %119

.split.us:                                        ; preds = %2
  %58 = getelementptr inbounds i8, ptr %0, i64 136
  %59 = call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %58)
  %60 = call { double, double } @_ZNK3JPH5Shape15GetCenterOfMassEv(ptr noundef nonnull align 8 dereferenceable(26) %59)
  %61 = extractvalue { double, double } %60, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #9
  store float 0x3FF921FB60000000, ptr %10, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #9
  call void @_ZN3JPH5AABoxC2Ev(ptr noundef nonnull align 16 dereferenceable(32) %11)
  %62 = sitofp i32 %30 to float
  %63 = sitofp i32 %37 to float
  %64 = getelementptr inbounds i8, ptr %0, i64 112
  %65 = sext i32 %30 to i64
  %66 = sext i32 %37 to i64
  %wide.trip.count52 = zext nneg i32 %55 to i64
  %wide.trip.count = zext nneg i32 %46 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge.us, %.split.us
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %._crit_edge.us ], [ 0, %.split.us ]
  %67 = trunc nuw nsw i64 %indvars.iv49 to i32
  %68 = uitofp nneg i32 %67 to float
  %69 = fadd float %63, %68
  %70 = add nsw i64 %indvars.iv49, %66
  %71 = shl nsw i64 %70, 7
  %72 = add nsw i64 %71, %65
  %73 = trunc nsw i64 %70 to i32
  br label %74

74:                                               ; preds = %.preheader.us, %74
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %74 ]
  %75 = trunc nuw nsw i64 %indvars.iv to i32
  %76 = uitofp nneg i32 %75 to float
  %77 = fadd float %62, %76
  %78 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %3)
  %79 = fsub float %77, %78
  %80 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %3)
  %81 = fsub float %69, %80
  %82 = call noundef float @"_ZZN28DeformedHeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsEENK3$_0clEff"(ptr noundef nonnull align 4 dereferenceable(4) %10, float noundef %79, float noundef %81)
  %83 = add nsw i64 %72, %indvars.iv
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %83)
  %85 = load float, ptr %84, align 4, !tbaa !29
  %86 = fsub float %85, %82
  store float %86, ptr %84, align 4, !tbaa !29
  %87 = call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %58)
  %88 = trunc i64 %indvars.iv to i32
  %89 = add i32 %30, %88
  %90 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %87, i32 noundef %89, i32 noundef %73)
  %91 = extractvalue { double, double } %90, 0
  %92 = extractvalue { double, double } %90, 1
  call void @_ZN3JPH5AABox11EncapsulateENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32) %11, double %91, double %92)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %74, !llvm.loop !30

._crit_edge.us:                                   ; preds = %74
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %exitcond53.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count52
  br i1 %exitcond53.not, label %.split47.us, label %.preheader.us, !llvm.loop !32

.split47.us:                                      ; preds = %._crit_edge.us
  %93 = extractvalue { double, double } %60, 1
  %94 = call noundef ptr @_ZNK3JPH3RefINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %58)
  %95 = call noundef ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %64)
  %96 = shl nsw i32 %37, 7
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds float, ptr %95, i64 %97
  %99 = getelementptr inbounds float, ptr %98, i64 %65
  %100 = getelementptr inbounds i8, ptr %0, i64 40
  %101 = load ptr, ptr %100, align 8, !tbaa !33
  call void @_ZN3JPH16HeightFieldShape10SetHeightsEjjjjPKflRNS_13TempAllocatorEf(ptr noundef nonnull align 16 dereferenceable(176) %94, i32 noundef %30, i32 noundef %37, i32 noundef %46, i32 noundef %55, ptr noundef %99, i64 noundef 128, ptr noundef nonnull align 8 dereferenceable(8) %101, float noundef 0x3FEFE0D460000000)
  %102 = getelementptr inbounds i8, ptr %0, i64 24
  %103 = load ptr, ptr %102, align 8, !tbaa !34
  %104 = getelementptr inbounds i8, ptr %0, i64 144
  call void @_ZNK3JPH13BodyInterface18NotifyShapeChangedERKNS_6BodyIDENS_4Vec3EbNS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24) %103, ptr noundef nonnull align 4 dereferenceable(4) %104, double %61, double %93, i1 noundef zeroext false, i32 noundef 1)
  %105 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0x3FB99999A0000000)
  %106 = extractvalue { double, double } %105, 0
  %107 = extractvalue { double, double } %105, 1
  call void @_ZN3JPH5AABox8ExpandByENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32) %11, double %106, double %107)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #9
  %108 = getelementptr inbounds i8, ptr %0, i64 16
  %109 = load ptr, ptr %108, align 8, !tbaa !35
  call void @_ZNK3JPH13PhysicsSystem31GetDefaultBroadPhaseLayerFilterEt(ptr dead_on_unwind nonnull writable sret(%"class.JPH::DefaultBroadPhaseLayerFilter") align 8 %12, ptr noundef nonnull align 16 dereferenceable(1172) %109, i16 noundef zeroext 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #9
  %110 = load ptr, ptr %108, align 8, !tbaa !35
  invoke void @_ZNK3JPH13PhysicsSystem21GetDefaultLayerFilterEt(ptr dead_on_unwind nonnull writable sret(%"class.JPH::DefaultObjectLayerFilter") align 8 %13, ptr noundef nonnull align 16 dereferenceable(1172) %110, i16 noundef zeroext 1)
          to label %111 unwind label %114

111:                                              ; preds = %.split47.us
  %112 = load ptr, ptr %102, align 8, !tbaa !34
  invoke void @_ZN3JPH13BodyInterface21ActivateBodiesInAABoxERKNS_5AABoxERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterE(ptr noundef nonnull align 8 dereferenceable(24) %112, ptr noundef nonnull align 16 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %113 unwind label %116

113:                                              ; preds = %111
  call void @_ZN3JPH17ObjectLayerFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(18) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  call void @_ZN3JPH21BroadPhaseLayerFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(18) %12) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  br label %119

114:                                              ; preds = %.split47.us
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %118

116:                                              ; preds = %111
  %117 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH17ObjectLayerFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(18) %13) #9
  br label %118

118:                                              ; preds = %116, %114
  %.pn = phi { ptr, i32 } [ %117, %116 ], [ %115, %114 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  call void @_ZN3JPH21BroadPhaseLayerFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(18) %12) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn

119:                                              ; preds = %113, %2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #9
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4ceilf(float noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Shape15GetCenterOfMassEv(ptr noundef nonnull align 8 dereferenceable(26)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef float @"_ZZN28DeformedHeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsEENK3$_0clEff"(ptr noundef nonnull align 4 dereferenceable(4), float noundef, float noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox11EncapsulateENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32), double, double) local_unnamed_addr #3 align 2

declare { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef) local_unnamed_addr #6

declare void @_ZN3JPH16HeightFieldShape10SetHeightsEjjjjPKflRNS_13TempAllocatorEf(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), float noundef) local_unnamed_addr #6

declare void @_ZNK3JPH13BodyInterface18NotifyShapeChangedERKNS_6BodyIDENS_4Vec3EbNS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), double, double, i1 noundef zeroext, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox8ExpandByENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32), double, double) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH13PhysicsSystem31GetDefaultBroadPhaseLayerFilterEt(ptr dead_on_unwind noalias writable sret(%"class.JPH::DefaultBroadPhaseLayerFilter") align 8, ptr noundef nonnull align 16 dereferenceable(1172), i16 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH13PhysicsSystem21GetDefaultLayerFilterEt(ptr dead_on_unwind noalias writable sret(%"class.JPH::DefaultObjectLayerFilter") align 8, ptr noundef nonnull align 16 dereferenceable(1172), i16 noundef zeroext) local_unnamed_addr #3 align 2

declare void @_ZN3JPH13BodyInterface21ActivateBodiesInAABoxERKNS_5AABoxERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { alwaysinline mustprogress nounwind 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 #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 = { 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 #8 = { 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 #9 = { 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, !17, i64 148}
!6 = !{!"_ZTS28DeformedHeightFieldShapeTest", !7, i64 0, !18, i64 112, !19, i64 136, !20, i64 144, !17, i64 148}
!7 = !{!"_ZTS4Test", !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !11, i64 48, !12, i64 56}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !13, i64 0}
!13 = !{!"_ZTSSt10_HashtableIN3JPH6BodyIDESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEEESaISB_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSD_18_Mod_range_hashingENSD_20_Default_ranged_hashENSD_20_Prime_rehash_policyENSD_17_Hashtable_traitsILb1ELb0ELb1EEEE", !8, i64 0, !14, i64 8, !15, i64 16, !14, i64 24, !16, i64 32, !8, i64 48}
!14 = !{!"long", !9, i64 0}
!15 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !8, i64 0}
!16 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !17, i64 0, !14, i64 8}
!17 = !{!"float", !9, i64 0}
!18 = !{!"_ZTSN3JPH5ArrayIfNS_12STLAllocatorIfEEEE", !14, i64 0, !14, i64 8, !8, i64 16}
!19 = !{!"_ZTSN3JPH3RefINS_16HeightFieldShapeEEE", !8, i64 0}
!20 = !{!"_ZTSN3JPH6BodyIDE", !21, i64 0}
!21 = !{!"int", !9, i64 0}
!22 = !{!23, !17, i64 0}
!23 = !{!"_ZTSN4Test15PreUpdateParamsE", !17, i64 0, !24, i64 16}
!24 = !{!"_ZTS11CameraState", !25, i64 0, !25, i64 16, !25, i64 32, !17, i64 48}
!25 = !{!"_ZTSN3JPH4Vec3E", !9, i64 0}
!26 = !{!21, !21, i64 0}
!27 = !{!28, !17, i64 0}
!28 = !{!"_ZTSZN28DeformedHeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsEE3$_0", !17, i64 0}
!29 = !{!17, !17, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = !{!7, !8, i64 40}
!34 = !{!7, !8, i64 24}
!35 = !{!7, !8, i64 16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass