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

; 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::Color" = type { %union.anon.14 }
%union.anon.14 = type { i32 }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SubShapeID" = 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] }>
%class.HeightFieldShapeTest = type { %class.Test, %"class.JPH::Array", %"class.JPH::Array.4", %"class.JPH::Array.7", i32, %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::RefConst", %"class.JPH::Vec3" }
%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::Array.4" = type { i64, i64, ptr }
%"class.JPH::Array.7" = type { i64, i64, ptr }
%"class.JPH::RefConst" = type { ptr }

@_ZN3JPH5Color6sWhiteE = external global %"class.JPH::Color", align 4
@_ZN3JPH5Color4sRedE = external global %"class.JPH::Color", align 4
@_ZN20HeightFieldShapeTest20sShowOriginalTerrainE = external dso_local global i8, align 1

; 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: 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: mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5roundf(float noundef) #2

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

; 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 noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16)) #4 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) #5

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

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

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

; 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
define dso_local void @_ZN20HeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 16 dereferenceable(256) %0, ptr noundef nonnull align 16 dereferenceable(80) %1) unnamed_addr #8 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.JPH::Vec3", align 16
  %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::SubShapeID", align 4
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::Color", align 4
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Color", align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca float, align 4
  %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 float, align 4
  %29 = alloca float, align 4
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca i8, align 1
  %33 = alloca float, align 4
  %34 = alloca float, align 4
  %35 = alloca %"class.JPH::Vec3", align 16
  %36 = alloca %"class.JPH::Color", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %37 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #9
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.Test::PreUpdateParams", ptr %38, i32 0, i32 2
  %40 = getelementptr inbounds %struct.CameraState, ptr %39, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 %40, i64 16, i1 false), !tbaa.struct !9
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.Test::PreUpdateParams", ptr %41, i32 0, i32 2
  %43 = getelementptr inbounds %struct.CameraState, ptr %42, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 %43, i64 16, i1 false), !tbaa.struct !9
  %44 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %45 = load double, ptr %44, align 16
  %46 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %47 = load double, ptr %46, align 8
  %48 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef 1.000000e+01, double %45, double %47)
  %49 = getelementptr inbounds %"class.JPH::Vec3", ptr %7, i32 0, i32 0
  %50 = getelementptr inbounds %union.anon, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds { double, double }, ptr %50, i32 0, i32 0
  %52 = extractvalue { double, double } %48, 0
  store double %52, ptr %51, align 16
  %53 = getelementptr inbounds { double, double }, ptr %50, i32 0, i32 1
  %54 = extractvalue { double, double } %48, 1
  store double %54, ptr %53, align 8
  %55 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  %56 = load double, ptr %55, align 16
  %57 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  %58 = load double, ptr %57, align 8
  %59 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %56, double %58)
  %60 = getelementptr inbounds %"class.JPH::Vec3", ptr %5, i32 0, i32 0
  %61 = getelementptr inbounds %union.anon, 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
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  call void @_ZN3JPH10SubShapeIDC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %10) #9
  %66 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 7
  %67 = call noundef ptr @_ZNK3JPH8RefConstINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %66)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 %5, i64 16, i1 false), !tbaa.struct !9
  %68 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %69 = load double, ptr %68, align 16
  %70 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %71 = load double, ptr %70, align 8
  %72 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape18ProjectOntoSurfaceENS_4Vec3ERS1_RNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(176) %67, double %69, double %71, ptr noundef nonnull align 16 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  br i1 %72, label %73, label %120

73:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #9
  %74 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 7
  %75 = call noundef ptr @_ZNK3JPH8RefConstINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %74)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !9
  %76 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %77 = load double, ptr %76, align 16
  %78 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %79 = load double, ptr %78, align 8
  %80 = call { double, double } @_ZNK3JPH16HeightFieldShape16GetSurfaceNormalERKNS_10SubShapeIDENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(176) %75, ptr noundef nonnull align 4 dereferenceable(4) %10, double %77, double %79)
  %81 = getelementptr inbounds %"class.JPH::Vec3", ptr %12, i32 0, i32 0
  %82 = getelementptr inbounds %union.anon, ptr %81, i32 0, i32 0
  %83 = getelementptr inbounds { double, double }, ptr %82, i32 0, i32 0
  %84 = extractvalue { double, double } %80, 0
  store double %84, ptr %83, align 16
  %85 = getelementptr inbounds { double, double }, ptr %82, i32 0, i32 1
  %86 = extractvalue { double, double } %80, 1
  store double %86, ptr %85, align 8
  %87 = getelementptr inbounds %class.Test, ptr %37, i32 0, i32 4
  %88 = load ptr, ptr %87, align 16, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 @_ZN3JPH5Color6sWhiteE, i64 4, i1 false), !tbaa.struct !20
  %89 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %90 = load double, ptr %89, align 16
  %91 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %92 = load double, ptr %91, align 8
  %93 = getelementptr inbounds %"class.JPH::Color", ptr %15, i32 0, i32 0
  %94 = getelementptr inbounds %union.anon.14, ptr %93, i32 0, i32 0
  %95 = load i32, ptr %94, align 4
  call void @_Z12DrawMarkerSPPN3JPH13DebugRendererENS_4Vec3ENS_5ColorEf(ptr noundef %88, double %90, double %92, i32 %95, float noundef 1.000000e+00)
  %96 = getelementptr inbounds %class.Test, ptr %37, i32 0, i32 4
  %97 = load ptr, ptr %96, align 16, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %12, i64 16, i1 false), !tbaa.struct !9
  %98 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %99 = load double, ptr %98, align 16
  %100 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %101 = load double, ptr %100, align 8
  %102 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %9, double %99, double %101)
  %103 = getelementptr inbounds %"class.JPH::Vec3", ptr %17, i32 0, i32 0
  %104 = getelementptr inbounds %union.anon, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds { double, double }, ptr %104, i32 0, i32 0
  %106 = extractvalue { double, double } %102, 0
  store double %106, ptr %105, align 16
  %107 = getelementptr inbounds { double, double }, ptr %104, i32 0, i32 1
  %108 = extractvalue { double, double } %102, 1
  store double %108, ptr %107, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 @_ZN3JPH5Color4sRedE, i64 4, i1 false), !tbaa.struct !20
  %109 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %110 = load double, ptr %109, align 16
  %111 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %112 = load double, ptr %111, align 8
  %113 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %114 = load double, ptr %113, align 16
  %115 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %116 = load double, ptr %115, align 8
  %117 = getelementptr inbounds %"class.JPH::Color", ptr %19, i32 0, i32 0
  %118 = getelementptr inbounds %union.anon.14, ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 4
  call void @_Z11DrawArrowSPPN3JPH13DebugRendererENS_4Vec3ES2_NS_5ColorEf(ptr noundef %97, double %110, double %112, double %114, double %116, i32 %119, float noundef 0x3FB99999A0000000)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #9
  br label %120

120:                                              ; preds = %73, %2
  %121 = load i8, ptr @_ZN20HeightFieldShapeTest20sShowOriginalTerrainE, align 1, !tbaa !21, !range !22, !noundef !23
  %122 = trunc i8 %121 to i1
  br i1 %122, label %123, label %236

123:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 0, ptr %20, align 4, !tbaa !24
  br label %124

124:                                              ; preds = %232, %123
  %125 = load i32, ptr %20, align 4, !tbaa !24
  %126 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 4
  %127 = load i32, ptr %126, align 8, !tbaa !26
  %128 = icmp ult i32 %125, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %124
  store i32 2, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %235

130:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !24
  br label %131

131:                                              ; preds = %228, %130
  %132 = load i32, ptr %22, align 4, !tbaa !24
  %133 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 4
  %134 = load i32, ptr %133, align 8, !tbaa !26
  %135 = icmp ult i32 %132, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %131
  store i32 5, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %231

137:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  %138 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 1
  %139 = load i32, ptr %20, align 4, !tbaa !24
  %140 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 4
  %141 = load i32, ptr %140, align 8, !tbaa !26
  %142 = mul i32 %139, %141
  %143 = load i32, ptr %22, align 4, !tbaa !24
  %144 = add i32 %142, %143
  %145 = zext i32 %144 to i64
  %146 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %138, i64 noundef %145)
  %147 = load float, ptr %146, align 4, !tbaa !33
  store float %147, ptr %23, align 4, !tbaa !33
  %148 = load float, ptr %23, align 4, !tbaa !33
  %149 = fcmp oeq float %148, 0x47EFFFFFE0000000
  br i1 %149, label %150, label %151

150:                                              ; preds = %137
  store i32 7, ptr %21, align 4
  br label %225

151:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #9
  %152 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 5
  %153 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 6
  %154 = load i32, ptr %22, align 4, !tbaa !24
  %155 = uitofp i32 %154 to float
  %156 = load float, ptr %23, align 4, !tbaa !33
  %157 = load i32, ptr %20, align 4, !tbaa !24
  %158 = uitofp i32 %157 to float
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %26, float noundef %155, float noundef %156, float noundef %158)
  %159 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %160 = load double, ptr %159, align 16
  %161 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %162 = load double, ptr %161, align 8
  %163 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %153, double %160, double %162)
  %164 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %165 = getelementptr inbounds %union.anon, ptr %164, i32 0, i32 0
  %166 = getelementptr inbounds { double, double }, ptr %165, i32 0, i32 0
  %167 = extractvalue { double, double } %163, 0
  store double %167, ptr %166, align 16
  %168 = getelementptr inbounds { double, double }, ptr %165, i32 0, i32 1
  %169 = extractvalue { double, double } %163, 1
  store double %169, ptr %168, align 8
  %170 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %171 = load double, ptr %170, align 16
  %172 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %173 = load double, ptr %172, align 8
  %174 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %152, double %171, double %173)
  %175 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %176 = getelementptr inbounds %union.anon, ptr %175, i32 0, i32 0
  %177 = getelementptr inbounds { double, double }, ptr %176, i32 0, i32 0
  %178 = extractvalue { double, double } %174, 0
  store double %178, ptr %177, align 16
  %179 = getelementptr inbounds { double, double }, ptr %176, i32 0, i32 1
  %180 = extractvalue { double, double } %174, 1
  store double %180, ptr %179, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #9
  %181 = getelementptr inbounds %class.HeightFieldShapeTest, ptr %37, i32 0, i32 7
  %182 = call noundef ptr @_ZNK3JPH8RefConstINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %181)
  %183 = load i32, ptr %22, align 4, !tbaa !24
  %184 = load i32, ptr %20, align 4, !tbaa !24
  %185 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %182, i32 noundef %183, i32 noundef %184)
  %186 = getelementptr inbounds %"class.JPH::Vec3", ptr %27, i32 0, i32 0
  %187 = getelementptr inbounds %union.anon, ptr %186, i32 0, i32 0
  %188 = getelementptr inbounds { double, double }, ptr %187, i32 0, i32 0
  %189 = extractvalue { double, double } %185, 0
  store double %189, ptr %188, align 16
  %190 = getelementptr inbounds { double, double }, ptr %187, i32 0, i32 1
  %191 = extractvalue { double, double } %185, 1
  store double %191, ptr %190, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  store float 0x3FB99999A0000000, ptr %28, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %31, ptr align 16 %27, i64 16, i1 false), !tbaa.struct !9
  %192 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %193 = load double, ptr %192, align 16
  %194 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %195 = load double, ptr %194, align 8
  %196 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %24, double %193, double %195)
  %197 = getelementptr inbounds %"class.JPH::Vec3", ptr %30, i32 0, i32 0
  %198 = getelementptr inbounds %union.anon, ptr %197, i32 0, i32 0
  %199 = getelementptr inbounds { double, double }, ptr %198, i32 0, i32 0
  %200 = extractvalue { double, double } %196, 0
  store double %200, ptr %199, align 16
  %201 = getelementptr inbounds { double, double }, ptr %198, i32 0, i32 1
  %202 = extractvalue { double, double } %196, 1
  store double %202, ptr %201, align 8
  %203 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %30)
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #9
  store float %203, ptr %29, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  %204 = load float, ptr %29, align 4, !tbaa !33
  %205 = fdiv float %204, 0x3FB99999A0000000
  store float %205, ptr %33, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  store float 1.000000e+00, ptr %34, align 4, !tbaa !33
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 4 dereferenceable(4) %34)
  %207 = load float, ptr %206, align 4, !tbaa !33
  %208 = fmul float 2.550000e+02, %207
  %209 = call noundef float @_ZSt5roundf(float noundef %208)
  %210 = fptoui float %209 to i8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  store i8 %210, ptr %32, align 1, !tbaa !10
  %211 = getelementptr inbounds %class.Test, ptr %37, i32 0, i32 4
  %212 = load ptr, ptr %211, align 16, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %35, ptr align 16 %24, i64 16, i1 false), !tbaa.struct !9
  %213 = load i8, ptr %32, align 1, !tbaa !10
  %214 = load i8, ptr %32, align 1, !tbaa !10
  %215 = zext i8 %214 to i32
  %216 = sub nsw i32 255, %215
  %217 = trunc i32 %216 to i8
  call void @_ZN3JPH5ColorC2Ehhhh(ptr noundef nonnull align 4 dereferenceable(4) %36, i8 noundef zeroext %213, i8 noundef zeroext %217, i8 noundef zeroext 0, i8 noundef zeroext -1)
  %218 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 0
  %219 = load double, ptr %218, align 16
  %220 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 1
  %221 = load double, ptr %220, align 8
  %222 = getelementptr inbounds %"class.JPH::Color", ptr %36, i32 0, i32 0
  %223 = getelementptr inbounds %union.anon.14, ptr %222, i32 0, i32 0
  %224 = load i32, ptr %223, align 4
  call void @_Z12DrawMarkerSPPN3JPH13DebugRendererENS_4Vec3ENS_5ColorEf(ptr noundef %212, double %219, double %221, i32 %224, float noundef 0x3FB99999A0000000)
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #9
  store i32 0, ptr %21, align 4
  br label %225

225:                                              ; preds = %151, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  %226 = load i32, ptr %21, align 4
  switch i32 %226, label %237 [
    i32 0, label %227
    i32 7, label %228
  ]

227:                                              ; preds = %225
  br label %228

228:                                              ; preds = %227, %225
  %229 = load i32, ptr %22, align 4, !tbaa !24
  %230 = add i32 %229, 1
  store i32 %230, ptr %22, align 4, !tbaa !24
  br label %131, !llvm.loop !34

231:                                              ; preds = %136
  br label %232

232:                                              ; preds = %231
  %233 = load i32, ptr %20, align 4, !tbaa !24
  %234 = add i32 %233, 1
  store i32 %234, ptr %20, align 4, !tbaa !24
  br label %124, !llvm.loop !36

235:                                              ; preds = %129
  br label %236

236:                                              ; preds = %235, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #9
  ret void

237:                                              ; preds = %225
  unreachable
}

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

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

declare noundef zeroext i1 @_ZNK3JPH16HeightFieldShape18ProjectOntoSurfaceENS_4Vec3ERS1_RNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(176), double, double, ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #7

declare { double, double } @_ZNK3JPH16HeightFieldShape16GetSurfaceNormalERKNS_10SubShapeIDENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(176), ptr noundef nonnull align 4 dereferenceable(4), double, double) unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z12DrawMarkerSPPN3JPH13DebugRendererENS_4Vec3ENS_5ColorEf(ptr noundef, double, double, i32, float noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z11DrawArrowSPPN3JPH13DebugRendererENS_4Vec3ES2_NS_5ColorEf(ptr noundef, double, double, double, double, i32, float noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ColorC2Ehhhh(ptr noundef nonnull align 4 dereferenceable(4), i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #2 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 = { 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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 16, !10}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"_ZTS4Test", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !13, i64 48, !14, i64 56}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !15, i64 0}
!15 = !{!"_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, !16, i64 8, !17, i64 16, !16, i64 24, !18, i64 32, !6, i64 48}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!18 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !19, i64 0, !16, i64 8}
!19 = !{!"float", !7, i64 0}
!20 = !{i64 0, i64 4, !10}
!21 = !{!13, !13, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !7, i64 0}
!26 = !{!27, !25, i64 184}
!27 = !{!"_ZTS20HeightFieldShapeTest", !12, i64 0, !28, i64 112, !29, i64 136, !30, i64 160, !25, i64 184, !31, i64 192, !31, i64 208, !32, i64 224, !31, i64 240}
!28 = !{!"_ZTSN3JPH5ArrayIfNS_12STLAllocatorIfEEEE", !16, i64 0, !16, i64 8, !6, i64 16}
!29 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !16, i64 0, !16, i64 8, !6, i64 16}
!30 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !16, i64 0, !16, i64 8, !6, i64 16}
!31 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!32 = !{!"_ZTSN3JPH8RefConstINS_16HeightFieldShapeEEE", !6, i64 0}
!33 = !{!19, !19, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}


; 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::Color" = type { %union.anon.14 }
%union.anon.14 = type { i32 }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SubShapeID" = type { i32 }

@_ZN3JPH5Color6sWhiteE = external local_unnamed_addr global %"class.JPH::Color", align 4
@_ZN3JPH5Color4sRedE = external local_unnamed_addr global %"class.JPH::Color", align 4
@_ZN20HeightFieldShapeTest20sShowOriginalTerrainE = external dso_local local_unnamed_addr global i8, align 1

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5roundf(float noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress 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) #5

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN20HeightFieldShapeTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 16 dereferenceable(256) %0, ptr nocapture noundef nonnull readonly align 16 dereferenceable(80) %1) unnamed_addr #8 align 2 {
  %3 = alloca %"class.JPH::Vec3", align 16
  %4 = alloca %"class.JPH::Vec3", align 16
  %5 = alloca %"class.JPH::SubShapeID", align 4
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca %"class.JPH::Color", align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #9
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 16 dereferenceable(16) %12, i64 16, i1 false), !tbaa.struct !5
  %13 = getelementptr inbounds i8, ptr %1, i64 32
  %.sroa.035.0.copyload = load double, ptr %13, align 16
  %.sroa.236.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 40
  %.sroa.236.0.copyload = load double, ptr %.sroa.236.0..sroa_idx, align 8, !tbaa !6
  %14 = tail call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef 1.000000e+01, double %.sroa.035.0.copyload, double %.sroa.236.0.copyload)
  %15 = extractvalue { double, double } %14, 0
  %16 = extractvalue { double, double } %14, 1
  %17 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %3, double %15, double %16)
  %18 = extractvalue { double, double } %17, 0
  %19 = extractvalue { double, double } %17, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  call void @_ZN3JPH10SubShapeIDC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %5) #9
  %20 = getelementptr inbounds i8, ptr %0, i64 224
  %21 = call noundef ptr @_ZNK3JPH8RefConstINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %22 = call noundef zeroext i1 @_ZNK3JPH16HeightFieldShape18ProjectOntoSurfaceENS_4Vec3ERS1_RNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(176) %21, double %18, double %19, ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br i1 %22, label %23, label %34

23:                                               ; preds = %2
  %24 = call noundef ptr @_ZNK3JPH8RefConstINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %.sroa.029.0.copyload = load double, ptr %4, align 16
  %.sroa.230.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.230.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !6
  %25 = call { double, double } @_ZNK3JPH16HeightFieldShape16GetSurfaceNormalERKNS_10SubShapeIDENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(176) %24, ptr noundef nonnull align 4 dereferenceable(4) %5, double %.sroa.029.0.copyload, double %.sroa.230.0.copyload)
  %26 = extractvalue { double, double } %25, 0
  %27 = extractvalue { double, double } %25, 1
  %28 = getelementptr inbounds i8, ptr %0, i64 32
  %29 = load ptr, ptr %28, align 16, !tbaa !9
  %.sroa.027.0.copyload = load double, ptr %4, align 16
  %.sroa.228.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !6
  %.sroa.026.0.copyload = load i32, ptr @_ZN3JPH5Color6sWhiteE, align 4, !tbaa !6
  call void @_Z12DrawMarkerSPPN3JPH13DebugRendererENS_4Vec3ENS_5ColorEf(ptr noundef %29, double %.sroa.027.0.copyload, double %.sroa.228.0.copyload, i32 %.sroa.026.0.copyload, float noundef 1.000000e+00)
  %30 = load ptr, ptr %28, align 16, !tbaa !9
  %.sroa.024.0.copyload = load double, ptr %4, align 16
  %.sroa.225.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !6
  %31 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %4, double %26, double %27)
  %32 = extractvalue { double, double } %31, 0
  %33 = extractvalue { double, double } %31, 1
  %.sroa.019.0.copyload = load i32, ptr @_ZN3JPH5Color4sRedE, align 4, !tbaa !6
  call void @_Z11DrawArrowSPPN3JPH13DebugRendererENS_4Vec3ES2_NS_5ColorEf(ptr noundef %30, double %.sroa.024.0.copyload, double %.sroa.225.0.copyload, double %32, double %33, i32 %.sroa.019.0.copyload, float noundef 0x3FB99999A0000000)
  br label %34

34:                                               ; preds = %23, %2
  %35 = load i8, ptr @_ZN20HeightFieldShapeTest20sShowOriginalTerrainE, align 1, !tbaa !19, !range !20, !noundef !21
  %36 = trunc nuw i8 %35 to i1
  br i1 %36, label %.preheader47, label %.loopexit

.preheader47:                                     ; preds = %34
  %37 = getelementptr inbounds i8, ptr %0, i64 184
  %38 = load i32, ptr %37, align 8, !tbaa !22
  %.not = icmp eq i32 %38, 0
  br i1 %.not, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader47
  %39 = getelementptr inbounds i8, ptr %0, i64 112
  %40 = getelementptr inbounds i8, ptr %0, i64 192
  %41 = getelementptr inbounds i8, ptr %0, i64 208
  %42 = getelementptr inbounds i8, ptr %7, i64 8
  %43 = getelementptr inbounds i8, ptr %6, i64 8
  %44 = getelementptr inbounds i8, ptr %8, i64 8
  %45 = getelementptr inbounds i8, ptr %0, i64 32
  br label %.lr.ph

.lr.ph:                                           ; preds = %._crit_edge, %.preheader.preheader
  %46 = phi i32 [ %87, %._crit_edge ], [ %38, %.preheader.preheader ]
  %.049 = phi i32 [ %48, %._crit_edge ], [ 0, %.preheader.preheader ]
  %47 = uitofp i32 %.049 to float
  br label %50

._crit_edge:                                      ; preds = %85
  %48 = add nuw i32 %.049, 1
  %49 = icmp ult i32 %48, %87
  br i1 %49, label %.lr.ph, label %.loopexit, !llvm.loop !30

50:                                               ; preds = %.lr.ph, %85
  %51 = phi i32 [ %46, %.lr.ph ], [ %87, %85 ]
  %.04448 = phi i32 [ 0, %.lr.ph ], [ %86, %85 ]
  %52 = mul i32 %51, %.049
  %53 = add i32 %52, %.04448
  %54 = zext i32 %53 to i64
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %54)
  %56 = load float, ptr %55, align 4, !tbaa !33
  %57 = fcmp oeq float %56, 0x47EFFFFFE0000000
  br i1 %57, label %85, label %58

58:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #9
  %59 = uitofp i32 %.04448 to float
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %7, float noundef %59, float noundef %56, float noundef %47)
  %60 = load double, ptr %7, align 16
  %61 = load double, ptr %42, align 8
  %62 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %41, double %60, double %61)
  %63 = extractvalue { double, double } %62, 0
  %64 = extractvalue { double, double } %62, 1
  %65 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %40, double %63, double %64)
  %66 = extractvalue { double, double } %65, 0
  store double %66, ptr %6, align 16
  %67 = extractvalue { double, double } %65, 1
  store double %67, ptr %43, align 8
  %68 = call noundef ptr @_ZNK3JPH8RefConstINS_16HeightFieldShapeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %69 = call { double, double } @_ZNK3JPH16HeightFieldShape11GetPositionEjj(ptr noundef nonnull align 16 dereferenceable(176) %68, i32 noundef %.04448, i32 noundef %.049)
  %70 = extractvalue { double, double } %69, 0
  %71 = extractvalue { double, double } %69, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #9
  %72 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %70, double %71)
  %73 = extractvalue { double, double } %72, 0
  store double %73, ptr %8, align 16
  %74 = extractvalue { double, double } %72, 1
  store double %74, ptr %44, align 8
  %75 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  %76 = fdiv float %75, 0x3FB99999A0000000
  store float %76, ptr %9, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #9
  store float 1.000000e+00, ptr %10, align 4, !tbaa !33
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %78 = load float, ptr %77, align 4, !tbaa !33
  %79 = fmul float %78, 2.550000e+02
  %80 = call noundef float @_ZSt5roundf(float noundef %79)
  %81 = fptoui float %80 to i8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  %82 = load ptr, ptr %45, align 16, !tbaa !9
  %.sroa.0.0.copyload = load double, ptr %6, align 16
  %.sroa.2.0.copyload = load double, ptr %43, align 8, !tbaa !6
  %83 = xor i8 %81, -1
  call void @_ZN3JPH5ColorC2Ehhhh(ptr noundef nonnull align 4 dereferenceable(4) %11, i8 noundef zeroext %81, i8 noundef zeroext %83, i8 noundef zeroext 0, i8 noundef zeroext -1)
  %84 = load i32, ptr %11, align 4
  call void @_Z12DrawMarkerSPPN3JPH13DebugRendererENS_4Vec3ENS_5ColorEf(ptr noundef %82, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, i32 %84, float noundef 0x3FB99999A0000000)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #9
  br label %85

85:                                               ; preds = %50, %58
  %86 = add nuw i32 %.04448, 1
  %87 = load i32, ptr %37, align 8, !tbaa !22
  %88 = icmp ult i32 %86, %87
  br i1 %88, label %50, label %._crit_edge, !llvm.loop !34

.loopexit:                                        ; preds = %._crit_edge, %.preheader47, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  ret void
}

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

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

declare noundef zeroext i1 @_ZNK3JPH16HeightFieldShape18ProjectOntoSurfaceENS_4Vec3ERS1_RNS_10SubShapeIDE(ptr noundef nonnull align 16 dereferenceable(176), double, double, ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #7

declare { double, double } @_ZNK3JPH16HeightFieldShape16GetSurfaceNormalERKNS_10SubShapeIDENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(176), ptr noundef nonnull align 4 dereferenceable(4), double, double) unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z12DrawMarkerSPPN3JPH13DebugRendererENS_4Vec3ENS_5ColorEf(ptr noundef, double, double, i32, float noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z11DrawArrowSPPN3JPH13DebugRendererENS_4Vec3ES2_NS_5ColorEf(ptr noundef, double, double, double, double, i32, float noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ColorC2Ehhhh(ptr noundef nonnull align 4 dereferenceable(4), i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #2 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 = { 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 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = { 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 #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 = !{i64 0, i64 16, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 32}
!10 = !{!"_ZTS4Test", !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !13, i64 56}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !14, i64 0}
!14 = !{!"_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", !11, i64 0, !15, i64 8, !16, i64 16, !15, i64 24, !17, i64 32, !11, i64 48}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !11, i64 0}
!17 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !18, i64 0, !15, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!12, !12, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!23, !27, i64 184}
!23 = !{!"_ZTS20HeightFieldShapeTest", !10, i64 0, !24, i64 112, !25, i64 136, !26, i64 160, !27, i64 184, !28, i64 192, !28, i64 208, !29, i64 224, !28, i64 240}
!24 = !{!"_ZTSN3JPH5ArrayIfNS_12STLAllocatorIfEEEE", !15, i64 0, !15, i64 8, !11, i64 16}
!25 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !15, i64 0, !15, i64 8, !11, i64 16}
!26 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !15, i64 0, !15, i64 8, !11, i64 16}
!27 = !{!"int", !7, i64 0}
!28 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!29 = !{!"_ZTSN3JPH8RefConstINS_16HeightFieldShapeEEE", !11, i64 0}
!30 = distinct !{!30, !31, !32}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!"llvm.loop.unswitch.partial.disable"}
!33 = !{!18, !18, i64 0}
!34 = distinct !{!34, !31}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass