; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/Shape (HeightFieldShape)

; 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.3 }
%union.anon.3 = type { <4 x float> }
%"class.JPH::SubShapeIDCreator" = type { %"class.JPH::SubShapeID", i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::HeightFieldShape" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", i32, i32, i32, i32, i32, i8, i8, i16, i16, [6 x i8], ptr, ptr, ptr, %"class.JPH::Array.9", %"class.JPH::Array.6", i32, [4 x i8] }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.12", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.12" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Array.9" = type { i64, i64, ptr }
%"class.JPH::Array.6" = type { i64, i64, ptr }

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

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

; 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) #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3JPH16HeightFieldShape18ProjectOntoSurfaceENS_4Vec3ERS1_RNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(176) %0, double %1, double %2, ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #5 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %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 float, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca float, align 4
  %19 = alloca i32, align 4
  %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::Vec3", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca %"class.JPH::SubShapeIDCreator", align 4
  %32 = alloca %"class.JPH::SubShapeID", align 4
  %33 = alloca %"class.JPH::Vec3", align 16
  %34 = alloca %"class.JPH::Vec3", align 16
  %35 = alloca %"class.JPH::Vec3", align 16
  %36 = alloca %"class.JPH::Vec3", align 16
  %37 = alloca %"class.JPH::Vec3", align 16
  %38 = alloca %"class.JPH::Vec3", align 16
  %39 = alloca %"class.JPH::Vec3", align 16
  %40 = alloca %"class.JPH::Vec3", align 16
  %41 = alloca %"class.JPH::Vec3", align 16
  %42 = alloca %"class.JPH::Vec3", align 16
  %43 = alloca %"class.JPH::Vec3", align 16
  %44 = alloca %"class.JPH::SubShapeIDCreator", align 4
  %45 = alloca %"class.JPH::SubShapeID", align 4
  %46 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  store double %1, ptr %46, align 16
  %47 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  store double %2, ptr %47, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %48 = load ptr, ptr %8, align 8
  %49 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %48, i32 0, i32 6
  %50 = load i32, ptr %49, align 8, !tbaa !9
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %5
  store i1 false, ptr %6, align 1
  br label %355

53:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %54 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %48, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %54, i64 16, i1 false), !tbaa.struct !23
  %55 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %56 = load double, ptr %55, align 16
  %57 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %58 = load double, ptr %57, align 8
  %59 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %56, double %58)
  %60 = getelementptr inbounds %"class.JPH::Vec3", ptr %12, i32 0, i32 0
  %61 = getelementptr inbounds %union.anon.3, ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds { double, double }, ptr %61, i32 0, i32 0
  %63 = extractvalue { double, double } %59, 0
  store double %63, ptr %62, align 16
  %64 = getelementptr inbounds { double, double }, ptr %61, i32 0, i32 1
  %65 = extractvalue { double, double } %59, 1
  store double %65, ptr %64, align 8
  %66 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %48, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %66, i64 16, i1 false), !tbaa.struct !23
  %67 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %68 = load double, ptr %67, align 16
  %69 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %70 = load double, ptr %69, align 8
  %71 = call { double, double } @_ZNK3JPH4Vec3dvES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %68, double %70)
  %72 = getelementptr inbounds %"class.JPH::Vec3", ptr %11, i32 0, i32 0
  %73 = getelementptr inbounds %union.anon.3, ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds { double, double }, ptr %73, i32 0, i32 0
  %75 = extractvalue { double, double } %71, 0
  store double %75, ptr %74, align 16
  %76 = getelementptr inbounds { double, double }, ptr %73, i32 0, i32 1
  %77 = extractvalue { double, double } %71, 1
  store double %77, ptr %76, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %78 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %11)
  store float %78, ptr %15, align 4, !tbaa !25
  %79 = load float, ptr %15, align 4, !tbaa !25
  %80 = fcmp olt float %79, 0.000000e+00
  br i1 %80, label %88, label %81

81:                                               ; preds = %53
  %82 = load float, ptr %15, align 4, !tbaa !25
  %83 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %48, i32 0, i32 4
  %84 = load i32, ptr %83, align 16, !tbaa !27
  %85 = sub i32 %84, 1
  %86 = uitofp i32 %85 to float
  %87 = fcmp oge float %82, %86
  br i1 %87, label %88, label %89

88:                                               ; preds = %81, %53
  store i1 false, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %354

89:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %90 = load float, ptr %15, align 4, !tbaa !25
  %91 = call noundef float @_ZSt5floorf(float noundef %90)
  %92 = fptoui float %91 to i32
  store i32 %92, ptr %17, align 4, !tbaa !28
  %93 = load i32, ptr %17, align 4, !tbaa !28
  %94 = uitofp i32 %93 to float
  %95 = load float, ptr %15, align 4, !tbaa !25
  %96 = fsub float %95, %94
  store float %96, ptr %15, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %97 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %11)
  store float %97, ptr %18, align 4, !tbaa !25
  %98 = load float, ptr %18, align 4, !tbaa !25
  %99 = fcmp olt float %98, 0.000000e+00
  br i1 %99, label %107, label %100

100:                                              ; preds = %89
  %101 = load float, ptr %18, align 4, !tbaa !25
  %102 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %48, i32 0, i32 4
  %103 = load i32, ptr %102, align 16, !tbaa !27
  %104 = sub i32 %103, 1
  %105 = uitofp i32 %104 to float
  %106 = fcmp oge float %101, %105
  br i1 %106, label %107, label %108

107:                                              ; preds = %100, %89
  store i1 false, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %353

108:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %109 = load float, ptr %18, align 4, !tbaa !25
  %110 = call noundef float @_ZSt5floorf(float noundef %109)
  %111 = fptoui float %110 to i32
  store i32 %111, ptr %19, align 4, !tbaa !28
  %112 = load i32, ptr %19, align 4, !tbaa !28
  %113 = uitofp i32 %112 to float
  %114 = load float, ptr %18, align 4, !tbaa !25
  %115 = fsub float %114, %113
  store float %115, ptr %18, align 4, !tbaa !25
  %116 = load i32, ptr %17, align 4, !tbaa !28
  %117 = load i32, ptr %19, align 4, !tbaa !28
  %118 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %116, i32 noundef %117)
  br i1 %118, label %125, label %119

119:                                              ; preds = %108
  %120 = load i32, ptr %17, align 4, !tbaa !28
  %121 = add i32 %120, 1
  %122 = load i32, ptr %19, align 4, !tbaa !28
  %123 = add i32 %122, 1
  %124 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %121, i32 noundef %123)
  br i1 %124, label %125, label %126

125:                                              ; preds = %119, %108
  store i1 false, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %352

126:                                              ; preds = %119
  %127 = load float, ptr %18, align 4, !tbaa !25
  %128 = load float, ptr %15, align 4, !tbaa !25
  %129 = fcmp oge float %127, %128
  br i1 %129, label %130, label %241

130:                                              ; preds = %126
  %131 = load i32, ptr %17, align 4, !tbaa !28
  %132 = load i32, ptr %19, align 4, !tbaa !28
  %133 = add i32 %132, 1
  %134 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %131, i32 noundef %133)
  br i1 %134, label %135, label %136

135:                                              ; preds = %130
  store i1 false, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %352

136:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %137 = load i32, ptr %17, align 4, !tbaa !28
  %138 = load i32, ptr %19, align 4, !tbaa !28
  %139 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %137, i32 noundef %138)
  %140 = getelementptr inbounds %"class.JPH::Vec3", ptr %20, i32 0, i32 0
  %141 = getelementptr inbounds %union.anon.3, ptr %140, i32 0, i32 0
  %142 = getelementptr inbounds { double, double }, ptr %141, i32 0, i32 0
  %143 = extractvalue { double, double } %139, 0
  store double %143, ptr %142, align 16
  %144 = getelementptr inbounds { double, double }, ptr %141, i32 0, i32 1
  %145 = extractvalue { double, double } %139, 1
  store double %145, ptr %144, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %146 = load i32, ptr %17, align 4, !tbaa !28
  %147 = load i32, ptr %19, align 4, !tbaa !28
  %148 = add i32 %147, 1
  %149 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %146, i32 noundef %148)
  %150 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %151 = getelementptr inbounds %union.anon.3, ptr %150, i32 0, i32 0
  %152 = getelementptr inbounds { double, double }, ptr %151, i32 0, i32 0
  %153 = extractvalue { double, double } %149, 0
  store double %153, ptr %152, align 16
  %154 = getelementptr inbounds { double, double }, ptr %151, i32 0, i32 1
  %155 = extractvalue { double, double } %149, 1
  store double %155, ptr %154, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #7
  %156 = load i32, ptr %17, align 4, !tbaa !28
  %157 = add i32 %156, 1
  %158 = load i32, ptr %19, align 4, !tbaa !28
  %159 = add i32 %158, 1
  %160 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %157, i32 noundef %159)
  %161 = getelementptr inbounds %"class.JPH::Vec3", ptr %22, i32 0, i32 0
  %162 = getelementptr inbounds %union.anon.3, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds { double, double }, ptr %162, i32 0, i32 0
  %164 = extractvalue { double, double } %160, 0
  store double %164, ptr %163, align 16
  %165 = getelementptr inbounds { double, double }, ptr %162, i32 0, i32 1
  %166 = extractvalue { double, double } %160, 1
  store double %166, ptr %165, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %167 = load float, ptr %18, align 4, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 16 %20, i64 16, i1 false), !tbaa.struct !23
  %168 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %169 = load double, ptr %168, align 16
  %170 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %171 = load double, ptr %170, align 8
  %172 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %21, double %169, double %171)
  %173 = getelementptr inbounds %"class.JPH::Vec3", ptr %26, i32 0, i32 0
  %174 = getelementptr inbounds %union.anon.3, ptr %173, i32 0, i32 0
  %175 = getelementptr inbounds { double, double }, ptr %174, i32 0, i32 0
  %176 = extractvalue { double, double } %172, 0
  store double %176, ptr %175, align 16
  %177 = getelementptr inbounds { double, double }, ptr %174, i32 0, i32 1
  %178 = extractvalue { double, double } %172, 1
  store double %178, ptr %177, align 8
  %179 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %180 = load double, ptr %179, align 16
  %181 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %182 = load double, ptr %181, align 8
  %183 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %167, double %180, double %182)
  %184 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %185 = getelementptr inbounds %union.anon.3, ptr %184, i32 0, i32 0
  %186 = getelementptr inbounds { double, double }, ptr %185, i32 0, i32 0
  %187 = extractvalue { double, double } %183, 0
  store double %187, ptr %186, align 16
  %188 = getelementptr inbounds { double, double }, ptr %185, i32 0, i32 1
  %189 = extractvalue { double, double } %183, 1
  store double %189, ptr %188, align 8
  %190 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %191 = load double, ptr %190, align 16
  %192 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %193 = load double, ptr %192, align 8
  %194 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %20, double %191, double %193)
  %195 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %196 = getelementptr inbounds %union.anon.3, 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 = load float, ptr %15, align 4, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %30, ptr align 16 %21, i64 16, i1 false), !tbaa.struct !23
  %202 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %203 = load double, ptr %202, align 16
  %204 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %205 = load double, ptr %204, align 8
  %206 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %22, double %203, double %205)
  %207 = getelementptr inbounds %"class.JPH::Vec3", ptr %29, i32 0, i32 0
  %208 = getelementptr inbounds %union.anon.3, ptr %207, i32 0, i32 0
  %209 = getelementptr inbounds { double, double }, ptr %208, i32 0, i32 0
  %210 = extractvalue { double, double } %206, 0
  store double %210, ptr %209, align 16
  %211 = getelementptr inbounds { double, double }, ptr %208, i32 0, i32 1
  %212 = extractvalue { double, double } %206, 1
  store double %212, ptr %211, align 8
  %213 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %214 = load double, ptr %213, align 16
  %215 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %216 = load double, ptr %215, align 8
  %217 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %201, double %214, double %216)
  %218 = getelementptr inbounds %"class.JPH::Vec3", ptr %28, i32 0, i32 0
  %219 = getelementptr inbounds %union.anon.3, ptr %218, i32 0, i32 0
  %220 = getelementptr inbounds { double, double }, ptr %219, i32 0, i32 0
  %221 = extractvalue { double, double } %217, 0
  store double %221, ptr %220, align 16
  %222 = getelementptr inbounds { double, double }, ptr %219, i32 0, i32 1
  %223 = extractvalue { double, double } %217, 1
  store double %223, ptr %222, align 8
  %224 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %225 = load double, ptr %224, align 16
  %226 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %227 = load double, ptr %226, align 8
  %228 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %24, double %225, double %227)
  %229 = getelementptr inbounds %"class.JPH::Vec3", ptr %23, i32 0, i32 0
  %230 = getelementptr inbounds %union.anon.3, ptr %229, i32 0, i32 0
  %231 = getelementptr inbounds { double, double }, ptr %230, i32 0, i32 0
  %232 = extractvalue { double, double } %228, 0
  store double %232, ptr %231, align 16
  %233 = getelementptr inbounds { double, double }, ptr %230, i32 0, i32 1
  %234 = extractvalue { double, double } %228, 1
  store double %234, ptr %233, align 8
  %235 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %235, ptr align 16 %23, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  call void @_ZN3JPH17SubShapeIDCreatorC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %31) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %236 = load i32, ptr %17, align 4, !tbaa !28
  %237 = load i32, ptr %19, align 4, !tbaa !28
  %238 = call i32 @_ZNK3JPH16HeightFieldShape16EncodeSubShapeIDERKNS_17SubShapeIDCreatorEjjj(ptr noundef nonnull align 16 dereferenceable(176) %48, ptr noundef nonnull align 4 dereferenceable(8) %31, i32 noundef %236, i32 noundef %237, i32 noundef 0)
  %239 = getelementptr inbounds %"class.JPH::SubShapeID", ptr %32, i32 0, i32 0
  store i32 %238, ptr %239, align 4
  %240 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %240, ptr align 4 %32, i64 4, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  store i1 true, ptr %6, align 1
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  br label %352

241:                                              ; preds = %126
  %242 = load i32, ptr %17, align 4, !tbaa !28
  %243 = add i32 %242, 1
  %244 = load i32, ptr %19, align 4, !tbaa !28
  %245 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %243, i32 noundef %244)
  br i1 %245, label %246, label %247

246:                                              ; preds = %241
  store i1 false, ptr %6, align 1
  store i32 1, ptr %16, align 4
  br label %352

247:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #7
  %248 = load i32, ptr %17, align 4, !tbaa !28
  %249 = load i32, ptr %19, align 4, !tbaa !28
  %250 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %248, i32 noundef %249)
  %251 = getelementptr inbounds %"class.JPH::Vec3", ptr %33, i32 0, i32 0
  %252 = getelementptr inbounds %union.anon.3, ptr %251, i32 0, i32 0
  %253 = getelementptr inbounds { double, double }, ptr %252, i32 0, i32 0
  %254 = extractvalue { double, double } %250, 0
  store double %254, ptr %253, align 16
  %255 = getelementptr inbounds { double, double }, ptr %252, i32 0, i32 1
  %256 = extractvalue { double, double } %250, 1
  store double %256, ptr %255, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #7
  %257 = load i32, ptr %17, align 4, !tbaa !28
  %258 = add i32 %257, 1
  %259 = load i32, ptr %19, align 4, !tbaa !28
  %260 = add i32 %259, 1
  %261 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %258, i32 noundef %260)
  %262 = getelementptr inbounds %"class.JPH::Vec3", ptr %34, i32 0, i32 0
  %263 = getelementptr inbounds %union.anon.3, ptr %262, i32 0, i32 0
  %264 = getelementptr inbounds { double, double }, ptr %263, i32 0, i32 0
  %265 = extractvalue { double, double } %261, 0
  store double %265, ptr %264, align 16
  %266 = getelementptr inbounds { double, double }, ptr %263, i32 0, i32 1
  %267 = extractvalue { double, double } %261, 1
  store double %267, ptr %266, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #7
  %268 = load i32, ptr %17, align 4, !tbaa !28
  %269 = add i32 %268, 1
  %270 = load i32, ptr %19, align 4, !tbaa !28
  %271 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %48, i32 noundef %269, i32 noundef %270)
  %272 = getelementptr inbounds %"class.JPH::Vec3", ptr %35, i32 0, i32 0
  %273 = getelementptr inbounds %union.anon.3, ptr %272, i32 0, i32 0
  %274 = getelementptr inbounds { double, double }, ptr %273, i32 0, i32 0
  %275 = extractvalue { double, double } %271, 0
  store double %275, ptr %274, align 16
  %276 = getelementptr inbounds { double, double }, ptr %273, i32 0, i32 1
  %277 = extractvalue { double, double } %271, 1
  store double %277, ptr %276, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %37) #7
  %278 = load float, ptr %18, align 4, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %40, ptr align 16 %35, i64 16, i1 false), !tbaa.struct !23
  %279 = getelementptr inbounds { double, double }, ptr %40, i32 0, i32 0
  %280 = load double, ptr %279, align 16
  %281 = getelementptr inbounds { double, double }, ptr %40, i32 0, i32 1
  %282 = load double, ptr %281, align 8
  %283 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %34, double %280, double %282)
  %284 = getelementptr inbounds %"class.JPH::Vec3", ptr %39, i32 0, i32 0
  %285 = getelementptr inbounds %union.anon.3, ptr %284, i32 0, i32 0
  %286 = getelementptr inbounds { double, double }, ptr %285, i32 0, i32 0
  %287 = extractvalue { double, double } %283, 0
  store double %287, ptr %286, align 16
  %288 = getelementptr inbounds { double, double }, ptr %285, i32 0, i32 1
  %289 = extractvalue { double, double } %283, 1
  store double %289, ptr %288, align 8
  %290 = getelementptr inbounds { double, double }, ptr %39, i32 0, i32 0
  %291 = load double, ptr %290, align 16
  %292 = getelementptr inbounds { double, double }, ptr %39, i32 0, i32 1
  %293 = load double, ptr %292, align 8
  %294 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %278, double %291, double %293)
  %295 = getelementptr inbounds %"class.JPH::Vec3", ptr %38, i32 0, i32 0
  %296 = getelementptr inbounds %union.anon.3, ptr %295, i32 0, i32 0
  %297 = getelementptr inbounds { double, double }, ptr %296, i32 0, i32 0
  %298 = extractvalue { double, double } %294, 0
  store double %298, ptr %297, align 16
  %299 = getelementptr inbounds { double, double }, ptr %296, i32 0, i32 1
  %300 = extractvalue { double, double } %294, 1
  store double %300, ptr %299, align 8
  %301 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 0
  %302 = load double, ptr %301, align 16
  %303 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 1
  %304 = load double, ptr %303, align 8
  %305 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %33, double %302, double %304)
  %306 = getelementptr inbounds %"class.JPH::Vec3", ptr %37, i32 0, i32 0
  %307 = getelementptr inbounds %union.anon.3, ptr %306, i32 0, i32 0
  %308 = getelementptr inbounds { double, double }, ptr %307, i32 0, i32 0
  %309 = extractvalue { double, double } %305, 0
  store double %309, ptr %308, align 16
  %310 = getelementptr inbounds { double, double }, ptr %307, i32 0, i32 1
  %311 = extractvalue { double, double } %305, 1
  store double %311, ptr %310, align 8
  %312 = load float, ptr %15, align 4, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %43, ptr align 16 %33, i64 16, i1 false), !tbaa.struct !23
  %313 = getelementptr inbounds { double, double }, ptr %43, i32 0, i32 0
  %314 = load double, ptr %313, align 16
  %315 = getelementptr inbounds { double, double }, ptr %43, i32 0, i32 1
  %316 = load double, ptr %315, align 8
  %317 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %35, double %314, double %316)
  %318 = getelementptr inbounds %"class.JPH::Vec3", ptr %42, i32 0, i32 0
  %319 = getelementptr inbounds %union.anon.3, ptr %318, i32 0, i32 0
  %320 = getelementptr inbounds { double, double }, ptr %319, i32 0, i32 0
  %321 = extractvalue { double, double } %317, 0
  store double %321, ptr %320, align 16
  %322 = getelementptr inbounds { double, double }, ptr %319, i32 0, i32 1
  %323 = extractvalue { double, double } %317, 1
  store double %323, ptr %322, align 8
  %324 = getelementptr inbounds { double, double }, ptr %42, i32 0, i32 0
  %325 = load double, ptr %324, align 16
  %326 = getelementptr inbounds { double, double }, ptr %42, i32 0, i32 1
  %327 = load double, ptr %326, align 8
  %328 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %312, double %325, double %327)
  %329 = getelementptr inbounds %"class.JPH::Vec3", ptr %41, i32 0, i32 0
  %330 = getelementptr inbounds %union.anon.3, ptr %329, i32 0, i32 0
  %331 = getelementptr inbounds { double, double }, ptr %330, i32 0, i32 0
  %332 = extractvalue { double, double } %328, 0
  store double %332, ptr %331, align 16
  %333 = getelementptr inbounds { double, double }, ptr %330, i32 0, i32 1
  %334 = extractvalue { double, double } %328, 1
  store double %334, ptr %333, align 8
  %335 = getelementptr inbounds { double, double }, ptr %41, i32 0, i32 0
  %336 = load double, ptr %335, align 16
  %337 = getelementptr inbounds { double, double }, ptr %41, i32 0, i32 1
  %338 = load double, ptr %337, align 8
  %339 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %37, double %336, double %338)
  %340 = getelementptr inbounds %"class.JPH::Vec3", ptr %36, i32 0, i32 0
  %341 = getelementptr inbounds %union.anon.3, ptr %340, i32 0, i32 0
  %342 = getelementptr inbounds { double, double }, ptr %341, i32 0, i32 0
  %343 = extractvalue { double, double } %339, 0
  store double %343, ptr %342, align 16
  %344 = getelementptr inbounds { double, double }, ptr %341, i32 0, i32 1
  %345 = extractvalue { double, double } %339, 1
  store double %345, ptr %344, align 8
  %346 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %346, ptr align 16 %36, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #7
  call void @_ZN3JPH17SubShapeIDCreatorC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %44) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #7
  %347 = load i32, ptr %17, align 4, !tbaa !28
  %348 = load i32, ptr %19, align 4, !tbaa !28
  %349 = call i32 @_ZNK3JPH16HeightFieldShape16EncodeSubShapeIDERKNS_17SubShapeIDCreatorEjjj(ptr noundef nonnull align 16 dereferenceable(176) %48, ptr noundef nonnull align 4 dereferenceable(8) %44, i32 noundef %347, i32 noundef %348, i32 noundef 1)
  %350 = getelementptr inbounds %"class.JPH::SubShapeID", ptr %45, i32 0, i32 0
  store i32 %349, ptr %350, align 4
  %351 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %351, ptr align 4 %45, i64 4, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #7
  store i1 true, ptr %6, align 1
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #7
  br label %352

352:                                              ; preds = %247, %246, %136, %135, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %353

353:                                              ; preds = %352, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %354

354:                                              ; preds = %353, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %355

355:                                              ; preds = %354, %52
  %356 = load i1, ptr %6, align 1
  ret i1 %356
}

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZNK3JPH16HeightFieldShape16EncodeSubShapeIDERKNS_17SubShapeIDCreatorEjjj(ptr noundef nonnull align 16 dereferenceable(176), ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, i32 noundef, i32 noundef) #6 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 #5 = { 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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !15, i64 72}
!10 = !{!"_ZTSN3JPH16HeightFieldShapeE", !11, i64 0, !19, i64 32, !19, i64 48, !15, i64 64, !15, i64 68, !15, i64 72, !15, i64 76, !15, i64 80, !7, i64 84, !7, i64 85, !20, i64 86, !20, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !21, i64 120, !22, i64 144, !15, i64 168}
!11 = !{!"_ZTSN3JPH5ShapeE", !12, i64 8, !16, i64 16, !17, i64 24, !18, i64 25}
!12 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !13, i64 0}
!13 = !{!"_ZTSSt6atomicIjE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIjE", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!18 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!19 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !16, i64 0, !16, i64 8, !6, i64 16}
!22 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !16, i64 0, !16, i64 8, !6, i64 16}
!23 = !{i64 0, i64 16, !24}
!24 = !{!7, !7, i64 0}
!25 = !{!26, !26, i64 0}
!26 = !{!"float", !7, i64 0}
!27 = !{!10, !15, i64 64}
!28 = !{!15, !15, i64 0}
!29 = !{i64 0, i64 4, !28}


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

%"class.JPH::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }
%"class.JPH::SubShapeIDCreator" = type { %"class.JPH::SubShapeID", i32 }
%"class.JPH::SubShapeID" = type { i32 }

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

; 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 nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef) local_unnamed_addr #4 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 noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3JPH16HeightFieldShape18ProjectOntoSurfaceENS_4Vec3ERS1_RNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(176) %0, double %1, double %2, ptr nocapture noundef nonnull writeonly align 16 dereferenceable(16) %3, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %4) local_unnamed_addr #4 align 2 {
  %6 = alloca %"class.JPH::Vec3", align 16
  %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::Vec3", align 16
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::SubShapeIDCreator", align 4
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::SubShapeIDCreator", align 4
  store double %1, ptr %6, align 16
  %19 = getelementptr inbounds i8, ptr %6, i64 8
  store double %2, ptr %19, align 8
  %20 = getelementptr inbounds i8, ptr %0, i64 72
  %21 = load i32, ptr %20, align 8, !tbaa !5
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %137, label %23

23:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  %.sroa.068.0.copyload = load double, ptr %24, align 16
  %.sroa.269.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 40
  %.sroa.269.0.copyload = load double, ptr %.sroa.269.0..sroa_idx, align 8, !tbaa !22
  %25 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.068.0.copyload, double %.sroa.269.0.copyload)
  %26 = extractvalue { double, double } %25, 0
  store double %26, ptr %8, align 16
  %27 = getelementptr inbounds i8, ptr %8, i64 8
  %28 = extractvalue { double, double } %25, 1
  store double %28, ptr %27, align 8
  %29 = getelementptr inbounds i8, ptr %0, i64 48
  %.sroa.066.0.copyload = load double, ptr %29, align 16
  %.sroa.267.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 56
  %.sroa.267.0.copyload = load double, ptr %.sroa.267.0..sroa_idx, align 8, !tbaa !22
  %30 = call { double, double } @_ZNK3JPH4Vec3dvES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %.sroa.066.0.copyload, double %.sroa.267.0.copyload)
  %31 = extractvalue { double, double } %30, 0
  store double %31, ptr %7, align 16
  %32 = getelementptr inbounds i8, ptr %7, i64 8
  %33 = extractvalue { double, double } %30, 1
  store double %33, ptr %32, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  %34 = call noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %35 = fcmp olt float %34, 0.000000e+00
  br i1 %35, label %136, label %36

36:                                               ; preds = %23
  %37 = getelementptr inbounds i8, ptr %0, i64 64
  %38 = load i32, ptr %37, align 16, !tbaa !23
  %39 = add i32 %38, -1
  %40 = uitofp i32 %39 to float
  %41 = fcmp ult float %34, %40
  br i1 %41, label %42, label %136

42:                                               ; preds = %36
  %43 = call noundef float @_ZSt5floorf(float noundef %34)
  %44 = fptoui float %43 to i32
  %45 = uitofp i32 %44 to float
  %46 = fsub float %34, %45
  %47 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %48 = fcmp olt float %47, 0.000000e+00
  br i1 %48, label %136, label %49

49:                                               ; preds = %42
  %50 = load i32, ptr %37, align 16, !tbaa !23
  %51 = add i32 %50, -1
  %52 = uitofp i32 %51 to float
  %53 = fcmp ult float %47, %52
  br i1 %53, label %54, label %136

54:                                               ; preds = %49
  %55 = call noundef float @_ZSt5floorf(float noundef %47)
  %56 = fptoui float %55 to i32
  %57 = uitofp i32 %56 to float
  %58 = fsub float %47, %57
  %59 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %44, i32 noundef %56)
  br i1 %59, label %136, label %60

60:                                               ; preds = %54
  %61 = add i32 %44, 1
  %62 = add i32 %56, 1
  %63 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %61, i32 noundef %62)
  br i1 %63, label %136, label %64

64:                                               ; preds = %60
  %65 = fcmp ult float %58, %46
  br i1 %65, label %101, label %66

66:                                               ; preds = %64
  %67 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %44, i32 noundef %62)
  br i1 %67, label %136, label %68

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %69 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %44, i32 noundef %56)
  %70 = extractvalue { double, double } %69, 0
  store double %70, ptr %9, align 16
  %71 = getelementptr inbounds i8, ptr %9, i64 8
  %72 = extractvalue { double, double } %69, 1
  store double %72, ptr %71, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  %73 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %44, i32 noundef %62)
  %74 = extractvalue { double, double } %73, 0
  store double %74, ptr %10, align 16
  %75 = getelementptr inbounds i8, ptr %10, i64 8
  %76 = extractvalue { double, double } %73, 1
  store double %76, ptr %75, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  %77 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %61, i32 noundef %62)
  %78 = extractvalue { double, double } %77, 0
  store double %78, ptr %11, align 16
  %79 = getelementptr inbounds i8, ptr %11, i64 8
  %80 = extractvalue { double, double } %77, 1
  store double %80, ptr %79, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  %81 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %10, double %70, double %72)
  %82 = extractvalue { double, double } %81, 0
  %83 = extractvalue { double, double } %81, 1
  %84 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %58, double %82, double %83)
  %85 = extractvalue { double, double } %84, 0
  %86 = extractvalue { double, double } %84, 1
  %87 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %9, double %85, double %86)
  %88 = extractvalue { double, double } %87, 0
  store double %88, ptr %12, align 16
  %89 = getelementptr inbounds i8, ptr %12, i64 8
  %90 = extractvalue { double, double } %87, 1
  store double %90, ptr %89, align 8
  %.sroa.014.0.copyload = load double, ptr %10, align 16
  %.sroa.215.0.copyload = load double, ptr %75, align 8, !tbaa !22
  %91 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %11, double %.sroa.014.0.copyload, double %.sroa.215.0.copyload)
  %92 = extractvalue { double, double } %91, 0
  %93 = extractvalue { double, double } %91, 1
  %94 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %46, double %92, double %93)
  %95 = extractvalue { double, double } %94, 0
  %96 = extractvalue { double, double } %94, 1
  %97 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %95, double %96)
  %98 = extractvalue { double, double } %97, 0
  %99 = extractvalue { double, double } %97, 1
  store double %98, ptr %3, align 16
  %.sroa.427.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store double %99, ptr %.sroa.427.0..sroa_idx, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  call void @_ZN3JPH17SubShapeIDCreatorC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %13) #6
  %100 = call i32 @_ZNK3JPH16HeightFieldShape16EncodeSubShapeIDERKNS_17SubShapeIDCreatorEjjj(ptr noundef nonnull align 16 dereferenceable(176) %0, ptr noundef nonnull align 4 dereferenceable(8) %13, i32 noundef %44, i32 noundef %56, i32 noundef 0)
  store i32 %100, ptr %4, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %136

101:                                              ; preds = %64
  %102 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape13IsNoCollisionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %61, i32 noundef %56)
  br i1 %102, label %136, label %103

103:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #6
  %104 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %44, i32 noundef %56)
  %105 = extractvalue { double, double } %104, 0
  store double %105, ptr %14, align 16
  %106 = getelementptr inbounds i8, ptr %14, i64 8
  %107 = extractvalue { double, double } %104, 1
  store double %107, ptr %106, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #6
  %108 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %61, i32 noundef %62)
  %109 = extractvalue { double, double } %108, 0
  store double %109, ptr %15, align 16
  %110 = getelementptr inbounds i8, ptr %15, i64 8
  %111 = extractvalue { double, double } %108, 1
  store double %111, ptr %110, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #6
  %112 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %61, i32 noundef %56)
  %113 = extractvalue { double, double } %112, 0
  store double %113, ptr %16, align 16
  %114 = getelementptr inbounds i8, ptr %16, i64 8
  %115 = extractvalue { double, double } %112, 1
  store double %115, ptr %114, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #6
  %116 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %15, double %113, double %115)
  %117 = extractvalue { double, double } %116, 0
  %118 = extractvalue { double, double } %116, 1
  %119 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %58, double %117, double %118)
  %120 = extractvalue { double, double } %119, 0
  %121 = extractvalue { double, double } %119, 1
  %122 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %14, double %120, double %121)
  %123 = extractvalue { double, double } %122, 0
  store double %123, ptr %17, align 16
  %124 = getelementptr inbounds i8, ptr %17, i64 8
  %125 = extractvalue { double, double } %122, 1
  store double %125, ptr %124, align 8
  %.sroa.01.0.copyload = load double, ptr %14, align 16
  %.sroa.2.0.copyload = load double, ptr %106, align 8, !tbaa !22
  %126 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %16, double %.sroa.01.0.copyload, double %.sroa.2.0.copyload)
  %127 = extractvalue { double, double } %126, 0
  %128 = extractvalue { double, double } %126, 1
  %129 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %46, double %127, double %128)
  %130 = extractvalue { double, double } %129, 0
  %131 = extractvalue { double, double } %129, 1
  %132 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %17, double %130, double %131)
  %133 = extractvalue { double, double } %132, 0
  %134 = extractvalue { double, double } %132, 1
  store double %133, ptr %3, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store double %134, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #6
  call void @_ZN3JPH17SubShapeIDCreatorC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %18) #6
  %135 = call i32 @_ZNK3JPH16HeightFieldShape16EncodeSubShapeIDERKNS_17SubShapeIDCreatorEjjj(ptr noundef nonnull align 16 dereferenceable(176) %0, ptr noundef nonnull align 4 dereferenceable(8) %18, i32 noundef %44, i32 noundef %56, i32 noundef 1)
  store i32 %135, ptr %4, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  br label %136

136:                                              ; preds = %49, %42, %101, %66, %54, %60, %103, %68, %23, %36
  %.2 = phi i1 [ false, %36 ], [ false, %23 ], [ false, %49 ], [ false, %42 ], [ true, %68 ], [ true, %103 ], [ false, %60 ], [ false, %54 ], [ false, %66 ], [ false, %101 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %137

137:                                              ; preds = %5, %136
  %.3 = phi i1 [ %.2, %136 ], [ false, %5 ]
  ret i1 %.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: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3dvES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #2 align 2

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 72}
!6 = !{!"_ZTSN3JPH16HeightFieldShapeE", !7, i64 0, !17, i64 32, !17, i64 48, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !12, i64 84, !12, i64 85, !18, i64 86, !18, i64 88, !19, i64 96, !19, i64 104, !19, i64 112, !20, i64 120, !21, i64 144, !11, i64 168}
!7 = !{!"_ZTSN3JPH5ShapeE", !8, i64 8, !14, i64 16, !15, i64 24, !16, i64 25}
!8 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !9, i64 0}
!9 = !{!"_ZTSSt6atomicIjE", !10, i64 0}
!10 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"_ZTSN3JPH10EShapeTypeE", !12, i64 0}
!16 = !{!"_ZTSN3JPH13EShapeSubTypeE", !12, i64 0}
!17 = !{!"_ZTSN3JPH4Vec3E", !12, i64 0}
!18 = !{!"short", !12, i64 0}
!19 = !{!"any pointer", !12, i64 0}
!20 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !14, i64 0, !14, i64 8, !19, i64 16}
!21 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !14, i64 0, !14, i64 8, !19, i64 16}
!22 = !{!12, !12, i64 0}
!23 = !{!6, !11, i64 64}
!24 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass