; 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::HeightFieldShapeSettings" = type <{ %"class.JPH::ShapeSettings", %"class.JPH::Vec3", %"class.JPH::Vec3", i32, float, float, i32, i32, i32, %"class.JPH::Array", %"class.JPH::Array.6", %"class.JPH::Array.9", float, [12 x i8] }>
%"class.JPH::ShapeSettings" = type { %"class.JPH::SerializableObject", %"class.JPH::RefTarget", i64, %"class.JPH::Result" }
%"class.JPH::SerializableObject" = type { ptr }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Result" = type <{ %union.anon, i8, [7 x i8] }>
%union.anon = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.2 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.2 = type { i64, [8 x i8] }
%"class.JPH::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.6" = type { i64, i64, ptr }
%"class.JPH::Array.9" = 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: mustprogress uwtable
declare dso_local void @_ZNK3JPH24HeightFieldShapeSettings24DetermineMinAndMaxSampleERfS1_S1_(ptr noundef nonnull align 16 dereferenceable(208), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3JPH24HeightFieldShapeSettings30CalculateBitsPerSampleForErrorEf(ptr noundef nonnull align 16 dereferenceable(208) %0, float noundef %1) #1 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca float, align 4
  %24 = alloca i32, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store float %1, ptr %5, align 4, !tbaa !9
  %27 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @_ZNK3JPH24HeightFieldShapeSettings24DetermineMinAndMaxSampleERfS1_S1_(ptr noundef nonnull align 16 dereferenceable(208) %27, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %28 = load float, ptr %7, align 4, !tbaa !9
  %29 = load float, ptr %8, align 4, !tbaa !9
  %30 = fcmp olt float %28, %29
  br i1 %30, label %31, label %245

31:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %32

32:                                               ; preds = %237, %31
  %33 = load i32, ptr %10, align 4, !tbaa !11
  %34 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 3
  %35 = load i32, ptr %34, align 16, !tbaa !13
  %36 = icmp ult i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  store i32 2, ptr %11, align 4
  br label %242

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %39

39:                                               ; preds = %229, %38
  %40 = load i32, ptr %12, align 4, !tbaa !11
  %41 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 3
  %42 = load i32, ptr %41, align 16, !tbaa !13
  %43 = icmp ult i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  store i32 5, ptr %11, align 4
  br label %234

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store float 0x47EFFFFFE0000000, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store float 0xC7EFFFFFE0000000, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %46 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %46, ptr %15, align 4, !tbaa !11
  br label %47

47:                                               ; preds = %96, %45
  %48 = load i32, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %49 = load i32, ptr %12, align 4, !tbaa !11
  %50 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 7
  %51 = load i32, ptr %50, align 16, !tbaa !27
  %52 = add i32 %49, %51
  %53 = add i32 %52, 1
  store i32 %53, ptr %16, align 4, !tbaa !11
  %54 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 3
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %54)
  %56 = load i32, ptr %55, align 4, !tbaa !11
  %57 = icmp ult i32 %48, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br i1 %57, label %59, label %58

58:                                               ; preds = %47
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %99

59:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %60 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %60, ptr %17, align 4, !tbaa !11
  br label %61

61:                                               ; preds = %92, %59
  %62 = load i32, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %63 = load i32, ptr %10, align 4, !tbaa !11
  %64 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 7
  %65 = load i32, ptr %64, align 16, !tbaa !27
  %66 = add i32 %63, %65
  %67 = add i32 %66, 1
  store i32 %67, ptr %18, align 4, !tbaa !11
  %68 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 3
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %68)
  %70 = load i32, ptr %69, align 4, !tbaa !11
  %71 = icmp ult i32 %62, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br i1 %71, label %73, label %72

72:                                               ; preds = %61
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %95

73:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %74 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 9
  %75 = load i32, ptr %17, align 4, !tbaa !11
  %76 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 3
  %77 = load i32, ptr %76, align 16, !tbaa !13
  %78 = mul i32 %75, %77
  %79 = load i32, ptr %15, align 4, !tbaa !11
  %80 = add i32 %78, %79
  %81 = zext i32 %80 to i64
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %81)
  %83 = load float, ptr %82, align 4, !tbaa !9
  store float %83, ptr %19, align 4, !tbaa !9
  %84 = load float, ptr %19, align 4, !tbaa !9
  %85 = fcmp une float %84, 0x47EFFFFFE0000000
  br i1 %85, label %86, label %91

86:                                               ; preds = %73
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %88 = load float, ptr %87, align 4, !tbaa !9
  store float %88, ptr %13, align 4, !tbaa !9
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %90 = load float, ptr %89, align 4, !tbaa !9
  store float %90, ptr %14, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %86, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %17, align 4, !tbaa !11
  %94 = add i32 %93, 1
  store i32 %94, ptr %17, align 4, !tbaa !11
  br label %61, !llvm.loop !28

95:                                               ; preds = %72
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %15, align 4, !tbaa !11
  %98 = add i32 %97, 1
  store i32 %98, ptr %15, align 4, !tbaa !11
  br label %47, !llvm.loop !30

99:                                               ; preds = %58
  %100 = load float, ptr %13, align 4, !tbaa !9
  %101 = load float, ptr %14, align 4, !tbaa !9
  %102 = fcmp olt float %100, %101
  br i1 %102, label %103, label %225

103:                                              ; preds = %99
  %104 = load float, ptr %7, align 4, !tbaa !9
  %105 = load float, ptr %13, align 4, !tbaa !9
  %106 = load float, ptr %7, align 4, !tbaa !9
  %107 = fsub float %105, %106
  %108 = load float, ptr %9, align 4, !tbaa !9
  %109 = fmul float %107, %108
  %110 = call noundef float @_ZSt5floorf(float noundef %109)
  %111 = load float, ptr %9, align 4, !tbaa !9
  %112 = fdiv float %110, %111
  %113 = fadd float %104, %112
  store float %113, ptr %13, align 4, !tbaa !9
  %114 = load float, ptr %7, align 4, !tbaa !9
  %115 = load float, ptr %14, align 4, !tbaa !9
  %116 = load float, ptr %7, align 4, !tbaa !9
  %117 = fsub float %115, %116
  %118 = load float, ptr %9, align 4, !tbaa !9
  %119 = fmul float %117, %118
  %120 = call noundef float @_ZSt4ceilf(float noundef %119)
  %121 = load float, ptr %9, align 4, !tbaa !9
  %122 = fdiv float %120, %121
  %123 = fadd float %114, %122
  store float %123, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %124 = load float, ptr %14, align 4, !tbaa !9
  %125 = load float, ptr %13, align 4, !tbaa !9
  %126 = fsub float %124, %125
  store float %126, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %127 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %127, ptr %21, align 4, !tbaa !11
  br label %128

128:                                              ; preds = %216, %103
  %129 = load i32, ptr %21, align 4, !tbaa !11
  %130 = load i32, ptr %12, align 4, !tbaa !11
  %131 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 7
  %132 = load i32, ptr %131, align 16, !tbaa !27
  %133 = add i32 %130, %132
  %134 = icmp ult i32 %129, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %128
  store i32 14, ptr %11, align 4
  br label %219

136:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %137 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %137, ptr %22, align 4, !tbaa !11
  br label %138

138:                                              ; preds = %210, %136
  %139 = load i32, ptr %22, align 4, !tbaa !11
  %140 = load i32, ptr %10, align 4, !tbaa !11
  %141 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 7
  %142 = load i32, ptr %141, align 16, !tbaa !27
  %143 = add i32 %140, %142
  %144 = icmp ult i32 %139, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %138
  store i32 17, ptr %11, align 4
  br label %213

146:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %147 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 9
  %148 = load i32, ptr %22, align 4, !tbaa !11
  %149 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 3
  %150 = load i32, ptr %149, align 16, !tbaa !13
  %151 = mul i32 %148, %150
  %152 = load i32, ptr %21, align 4, !tbaa !11
  %153 = add i32 %151, %152
  %154 = zext i32 %153 to i64
  %155 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %147, i64 noundef %154)
  %156 = load float, ptr %155, align 4, !tbaa !9
  store float %156, ptr %23, align 4, !tbaa !9
  %157 = load float, ptr %23, align 4, !tbaa !9
  %158 = fcmp une float %157, 0x47EFFFFFE0000000
  br i1 %158, label %159, label %206

159:                                              ; preds = %146
  br label %160

160:                                              ; preds = %204, %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %161 = load i32, ptr %6, align 4, !tbaa !11
  %162 = shl i32 1, %161
  %163 = sub nsw i32 %162, 1
  store i32 %163, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %164 = load float, ptr %23, align 4, !tbaa !9
  %165 = load float, ptr %13, align 4, !tbaa !9
  %166 = fsub float %164, %165
  %167 = load i32, ptr %24, align 4, !tbaa !11
  %168 = uitofp i32 %167 to float
  %169 = fmul float %166, %168
  %170 = load float, ptr %20, align 4, !tbaa !9
  %171 = fdiv float %169, %170
  %172 = call noundef float @_ZSt5floorf(float noundef %171)
  store float %172, ptr %25, align 4, !tbaa !9
  %173 = load float, ptr %25, align 4, !tbaa !9
  %174 = load i32, ptr %24, align 4, !tbaa !11
  %175 = sub i32 %174, 1
  %176 = uitofp i32 %175 to float
  %177 = call noundef float @_ZN3JPH5ClampIfEET_S1_S1_S1_(float noundef %173, float noundef 0.000000e+00, float noundef %176)
  store float %177, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %178 = load float, ptr %13, align 4, !tbaa !9
  %179 = load float, ptr %25, align 4, !tbaa !9
  %180 = fadd float %179, 5.000000e-01
  %181 = load float, ptr %20, align 4, !tbaa !9
  %182 = fmul float %180, %181
  %183 = load i32, ptr %24, align 4, !tbaa !11
  %184 = uitofp i32 %183 to float
  %185 = fdiv float %182, %184
  %186 = fadd float %178, %185
  store float %186, ptr %26, align 4, !tbaa !9
  %187 = load float, ptr %26, align 4, !tbaa !9
  %188 = load float, ptr %23, align 4, !tbaa !9
  %189 = fsub float %187, %188
  %190 = call noundef float @_ZSt3absf(float noundef %189)
  %191 = load float, ptr %5, align 4, !tbaa !9
  %192 = fcmp ole float %190, %191
  br i1 %192, label %193, label %194

193:                                              ; preds = %160
  store i32 20, ptr %11, align 4
  br label %202

194:                                              ; preds = %160
  %195 = load i32, ptr %6, align 4, !tbaa !11
  %196 = add i32 %195, 1
  store i32 %196, ptr %6, align 4, !tbaa !11
  %197 = load i32, ptr %6, align 4, !tbaa !11
  %198 = icmp eq i32 %197, 8
  br i1 %198, label %199, label %201

199:                                              ; preds = %194
  %200 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %200, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %202

201:                                              ; preds = %194
  store i32 0, ptr %11, align 4
  br label %202

202:                                              ; preds = %201, %199, %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  %203 = load i32, ptr %11, align 4
  switch i32 %203, label %207 [
    i32 0, label %204
    i32 20, label %205
  ]

204:                                              ; preds = %202
  br label %160, !llvm.loop !31

205:                                              ; preds = %202
  br label %206

206:                                              ; preds = %205, %146
  store i32 0, ptr %11, align 4
  br label %207

207:                                              ; preds = %206, %202
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  %208 = load i32, ptr %11, align 4
  switch i32 %208, label %213 [
    i32 0, label %209
  ]

209:                                              ; preds = %207
  br label %210

210:                                              ; preds = %209
  %211 = load i32, ptr %22, align 4, !tbaa !11
  %212 = add i32 %211, 1
  store i32 %212, ptr %22, align 4, !tbaa !11
  br label %138, !llvm.loop !32

213:                                              ; preds = %207, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  %214 = load i32, ptr %11, align 4
  switch i32 %214, label %219 [
    i32 17, label %215
  ]

215:                                              ; preds = %213
  br label %216

216:                                              ; preds = %215
  %217 = load i32, ptr %21, align 4, !tbaa !11
  %218 = add i32 %217, 1
  store i32 %218, ptr %21, align 4, !tbaa !11
  br label %128, !llvm.loop !33

219:                                              ; preds = %213, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  %220 = load i32, ptr %11, align 4
  switch i32 %220, label %222 [
    i32 14, label %221
  ]

221:                                              ; preds = %219
  store i32 0, ptr %11, align 4
  br label %222

222:                                              ; preds = %221, %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  %223 = load i32, ptr %11, align 4
  switch i32 %223, label %226 [
    i32 0, label %224
  ]

224:                                              ; preds = %222
  br label %225

225:                                              ; preds = %224, %99
  store i32 0, ptr %11, align 4
  br label %226

226:                                              ; preds = %225, %222
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %227 = load i32, ptr %11, align 4
  switch i32 %227, label %234 [
    i32 0, label %228
  ]

228:                                              ; preds = %226
  br label %229

229:                                              ; preds = %228
  %230 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 7
  %231 = load i32, ptr %230, align 16, !tbaa !27
  %232 = load i32, ptr %12, align 4, !tbaa !11
  %233 = add i32 %232, %231
  store i32 %233, ptr %12, align 4, !tbaa !11
  br label %39, !llvm.loop !34

234:                                              ; preds = %226, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %235 = load i32, ptr %11, align 4
  switch i32 %235, label %242 [
    i32 5, label %236
  ]

236:                                              ; preds = %234
  br label %237

237:                                              ; preds = %236
  %238 = getelementptr inbounds %"class.JPH::HeightFieldShapeSettings", ptr %27, i32 0, i32 7
  %239 = load i32, ptr %238, align 16, !tbaa !27
  %240 = load i32, ptr %10, align 4, !tbaa !11
  %241 = add i32 %240, %239
  store i32 %241, ptr %10, align 4, !tbaa !11
  br label %32, !llvm.loop !35

242:                                              ; preds = %234, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %243 = load i32, ptr %11, align 4
  switch i32 %243, label %247 [
    i32 2, label %244
  ]

244:                                              ; preds = %242
  br label %245

245:                                              ; preds = %244, %2
  %246 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %246, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %247

247:                                              ; preds = %245, %242
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %248 = load i32, ptr %3, align 4
  ret i32 %248
}

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

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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH5ClampIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) #4

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 96}
!14 = !{!"_ZTSN3JPH24HeightFieldShapeSettingsE", !15, i64 0, !23, i64 64, !23, i64 80, !12, i64 96, !10, i64 100, !10, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !24, i64 120, !25, i64 144, !26, i64 168, !10, i64 192}
!15 = !{!"_ZTSN3JPH13ShapeSettingsE", !16, i64 0, !17, i64 8, !20, i64 16, !21, i64 24}
!16 = !{!"_ZTSN3JPH18SerializableObjectE"}
!17 = !{!"_ZTSN3JPH9RefTargetINS_13ShapeSettingsEEE", !18, i64 0}
!18 = !{!"_ZTSSt6atomicIjE", !19, i64 0}
!19 = !{!"_ZTSSt13__atomic_baseIjE", !12, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSN3JPH6ResultINS_3RefINS_5ShapeEEEEE", !7, i64 0, !22, i64 32}
!22 = !{!"_ZTSN3JPH6ResultINS_3RefINS_5ShapeEEEE6EStateE", !7, i64 0}
!23 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!24 = !{!"_ZTSN3JPH5ArrayIfNS_12STLAllocatorIfEEEE", !20, i64 0, !20, i64 8, !6, i64 16}
!25 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !20, i64 0, !20, i64 8, !6, i64 16}
!26 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !20, i64 0, !20, i64 8, !6, i64 16}
!27 = !{!14, !12, i64 112}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = distinct !{!31, !29}
!32 = distinct !{!32, !29}
!33 = distinct !{!33, !29}
!34 = distinct !{!34, !29}
!35 = distinct !{!35, !29}


; 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"

; 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: mustprogress uwtable
declare dso_local void @_ZNK3JPH24HeightFieldShapeSettings24DetermineMinAndMaxSampleERfS1_S1_(ptr noundef nonnull align 16 dereferenceable(208), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; 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 #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3JPH24HeightFieldShapeSettings30CalculateBitsPerSampleForErrorEf(ptr noundef nonnull align 16 dereferenceable(208) %0, float noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @_ZNK3JPH24HeightFieldShapeSettings24DetermineMinAndMaxSampleERfS1_S1_(ptr noundef nonnull align 16 dereferenceable(208) %0, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %11 = load float, ptr %3, align 4, !tbaa !5
  %12 = load float, ptr %4, align 4, !tbaa !5
  %13 = fcmp olt float %11, %12
  br i1 %13, label %.preheader123, label %.loopexit124

.preheader123:                                    ; preds = %2
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  %15 = load i32, ptr %14, align 16, !tbaa !9
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %.loopexit124, label %.preheader122.preheader

.preheader122.preheader:                          ; preds = %.preheader123
  %16 = getelementptr inbounds i8, ptr %0, i64 112
  %17 = getelementptr inbounds i8, ptr %0, i64 120
  br label %.lr.ph146

.lr.ph146:                                        ; preds = %._crit_edge147, %.preheader122.preheader
  %.056149 = phi i32 [ %.1167.ph, %._crit_edge147 ], [ 1, %.preheader122.preheader ]
  %.071148 = phi i32 [ %123, %._crit_edge147 ], [ 0, %.preheader122.preheader ]
  %18 = add nuw i32 %.071148, 1
  %.pre = load i32, ptr %16, align 16, !tbaa !25
  br label %19

19:                                               ; preds = %.lr.ph146, %.loopexit
  %20 = phi i32 [ %.pre, %.lr.ph146 ], [ %120, %.loopexit ]
  %.157145 = phi i32 [ %.056149, %.lr.ph146 ], [ %.1167.ph, %.loopexit ]
  %.081143 = phi i32 [ 0, %.lr.ph146 ], [ %.pre-phi, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store float 0x47EFFFFFE0000000, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store float 0xC7EFFFFFE0000000, ptr %7, align 4, !tbaa !5
  %21 = add nuw i32 %.081143, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %22 = add i32 %21, %20
  store i32 %22, ptr %8, align 4, !tbaa !26
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %24 = load i32, ptr %23, align 4, !tbaa !26
  %25 = icmp ult i32 %.081143, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br i1 %25, label %.preheader121, label %._crit_edge134

.preheader121:                                    ; preds = %19, %._crit_edge
  %.083133 = phi i32 [ %34, %._crit_edge ], [ %.081143, %19 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %26 = load i32, ptr %16, align 16, !tbaa !25
  %27 = add i32 %18, %26
  store i32 %27, ptr %9, align 4, !tbaa !26
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %29 = load i32, ptr %28, align 4, !tbaa !26
  %30 = icmp ult i32 %.071148, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br i1 %30, label %.lr.ph, label %._crit_edge

._crit_edge134:                                   ; preds = %._crit_edge, %19
  %31 = load float, ptr %6, align 4, !tbaa !5
  %32 = load float, ptr %7, align 4, !tbaa !5
  %33 = fcmp olt float %31, %32
  br i1 %33, label %59, label %._crit_edge134..loopexit_crit_edge

._crit_edge134..loopexit_crit_edge:               ; preds = %._crit_edge134
  %.pre156 = load i32, ptr %16, align 16, !tbaa !25
  %.pre158 = add i32 %.pre156, %.081143
  br label %.loopexit

._crit_edge:                                      ; preds = %52, %.preheader121
  %34 = add nuw i32 %.083133, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %35 = load i32, ptr %16, align 16, !tbaa !25
  %36 = add i32 %21, %35
  store i32 %36, ptr %8, align 4, !tbaa !26
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %38 = load i32, ptr %37, align 4, !tbaa !26
  %39 = icmp ult i32 %34, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br i1 %39, label %.preheader121, label %._crit_edge134, !llvm.loop !27

.lr.ph:                                           ; preds = %.preheader121, %52
  %.082132 = phi i32 [ %53, %52 ], [ %.071148, %.preheader121 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  %40 = load i32, ptr %14, align 16, !tbaa !9
  %41 = mul i32 %40, %.082132
  %42 = add i32 %41, %.083133
  %43 = zext i32 %42 to i64
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %43)
  %45 = load float, ptr %44, align 4, !tbaa !5
  store float %45, ptr %10, align 4, !tbaa !5
  %46 = fcmp une float %45, 0x47EFFFFFE0000000
  br i1 %46, label %47, label %52

47:                                               ; preds = %.lr.ph
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %49 = load float, ptr %48, align 4, !tbaa !5
  store float %49, ptr %6, align 4, !tbaa !5
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %51 = load float, ptr %50, align 4, !tbaa !5
  store float %51, ptr %7, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %47, %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %53 = add nuw i32 %.082132, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %54 = load i32, ptr %16, align 16, !tbaa !25
  %55 = add i32 %18, %54
  store i32 %55, ptr %9, align 4, !tbaa !26
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %57 = load i32, ptr %56, align 4, !tbaa !26
  %58 = icmp ult i32 %53, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br i1 %58, label %.lr.ph, label %._crit_edge, !llvm.loop !29

59:                                               ; preds = %._crit_edge134
  %60 = load float, ptr %3, align 4, !tbaa !5
  %61 = fsub float %31, %60
  %62 = load float, ptr %5, align 4, !tbaa !5
  %63 = fmul float %61, %62
  %64 = call noundef float @_ZSt5floorf(float noundef %63)
  %65 = load float, ptr %5, align 4, !tbaa !5
  %66 = fdiv float %64, %65
  %67 = fadd float %60, %66
  store float %67, ptr %6, align 4, !tbaa !5
  %68 = load float, ptr %3, align 4, !tbaa !5
  %69 = load float, ptr %7, align 4, !tbaa !5
  %70 = fsub float %69, %68
  %71 = fmul float %65, %70
  %72 = call noundef float @_ZSt4ceilf(float noundef %71)
  %73 = load float, ptr %5, align 4, !tbaa !5
  %74 = fdiv float %72, %73
  %75 = fadd float %68, %74
  store float %75, ptr %7, align 4, !tbaa !5
  %76 = load float, ptr %6, align 4, !tbaa !5
  %77 = fsub float %75, %76
  %78 = load i32, ptr %16, align 16, !tbaa !25
  %79 = add i32 %78, %.081143
  %80 = icmp ult i32 %.081143, %79
  br i1 %80, label %.preheader120, label %.loopexit

.preheader120:                                    ; preds = %59, %._crit_edge138
  %81 = phi i32 [ %116, %._crit_edge138 ], [ %78, %59 ]
  %.258141 = phi i32 [ %.359.lcssa, %._crit_edge138 ], [ %.157145, %59 ]
  %.080140 = phi i32 [ %117, %._crit_edge138 ], [ %.081143, %59 ]
  %82 = add i32 %81, %.071148
  %83 = icmp ult i32 %.071148, %82
  br i1 %83, label %.lr.ph137, label %._crit_edge138

.lr.ph137:                                        ; preds = %.preheader120, %.thread
  %.359136 = phi i32 [ %.76392, %.thread ], [ %.258141, %.preheader120 ]
  %.079135 = phi i32 [ %112, %.thread ], [ %.071148, %.preheader120 ]
  %84 = load i32, ptr %14, align 16, !tbaa !9
  %85 = mul i32 %84, %.079135
  %86 = add i32 %85, %.080140
  %87 = zext i32 %86 to i64
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH5ArrayIfNS_12STLAllocatorIfEEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %87)
  %89 = load float, ptr %88, align 4, !tbaa !5
  %90 = fcmp une float %89, 0x47EFFFFFE0000000
  br i1 %90, label %.preheader, label %.thread

.preheader:                                       ; preds = %.lr.ph137, %.preheader
  %.460 = phi i32 [ %.561, %.preheader ], [ %.359136, %.lr.ph137 ]
  %notmask = shl nsw i32 -1, %.460
  %91 = xor i32 %notmask, -1
  %92 = load float, ptr %6, align 4, !tbaa !5
  %93 = fsub float %89, %92
  %94 = uitofp nneg i32 %91 to float
  %95 = fmul float %93, %94
  %96 = fdiv float %95, %77
  %97 = call noundef float @_ZSt5floorf(float noundef %96)
  %98 = sub nsw i32 -2, %notmask
  %99 = uitofp i32 %98 to float
  %100 = call noundef float @_ZN3JPH5ClampIfEET_S1_S1_S1_(float noundef %97, float noundef 0.000000e+00, float noundef %99)
  %101 = load float, ptr %6, align 4, !tbaa !5
  %102 = fadd float %100, 5.000000e-01
  %103 = fmul float %77, %102
  %104 = fdiv float %103, %94
  %105 = fadd float %101, %104
  %106 = fsub float %105, %89
  %107 = call noundef float @_ZSt3absf(float noundef %106)
  %108 = fcmp ugt float %107, %1
  %109 = add i32 %.460, 1
  %110 = icmp eq i32 %109, 8
  %. = zext i1 %110 to i32
  %.072 = select i1 %108, i32 %., i32 20
  %.561 = select i1 %108, i32 %109, i32 %.460
  switch i32 %.072, label %111 [
    i32 0, label %.preheader
    i32 20, label %.thread
  ], !llvm.loop !30

111:                                              ; preds = %.preheader
  br i1 %110, label %125, label %.thread

.thread:                                          ; preds = %.preheader, %.lr.ph137, %111
  %.76392 = phi i32 [ %.561, %111 ], [ %.359136, %.lr.ph137 ], [ %.561, %.preheader ]
  %112 = add nuw i32 %.079135, 1
  %113 = load i32, ptr %16, align 16, !tbaa !25
  %114 = add i32 %113, %.071148
  %115 = icmp ult i32 %112, %114
  br i1 %115, label %.lr.ph137, label %._crit_edge138, !llvm.loop !31

._crit_edge138:                                   ; preds = %.thread, %.preheader120
  %116 = phi i32 [ %81, %.preheader120 ], [ %113, %.thread ]
  %.359.lcssa = phi i32 [ %.258141, %.preheader120 ], [ %.76392, %.thread ]
  %117 = add nuw i32 %.080140, 1
  %118 = add i32 %116, %.081143
  %119 = icmp ult i32 %117, %118
  br i1 %119, label %.preheader120, label %.loopexit, !llvm.loop !32

.loopexit:                                        ; preds = %._crit_edge138, %._crit_edge134..loopexit_crit_edge, %59
  %.pre-phi = phi i32 [ %.pre158, %._crit_edge134..loopexit_crit_edge ], [ %79, %59 ], [ %118, %._crit_edge138 ]
  %120 = phi i32 [ %.pre156, %._crit_edge134..loopexit_crit_edge ], [ %78, %59 ], [ %116, %._crit_edge138 ]
  %.1167.ph = phi i32 [ %.157145, %._crit_edge134..loopexit_crit_edge ], [ %.157145, %59 ], [ %.359.lcssa, %._crit_edge138 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %121 = load i32, ptr %14, align 16, !tbaa !9
  %122 = icmp ult i32 %.pre-phi, %121
  br i1 %122, label %19, label %._crit_edge147, !llvm.loop !33

._crit_edge147:                                   ; preds = %.loopexit
  %123 = add i32 %120, %.071148
  %124 = icmp ult i32 %123, %121
  br i1 %124, label %.lr.ph146, label %.loopexit124, !llvm.loop !34

125:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  br label %.loopexit124

.loopexit124:                                     ; preds = %._crit_edge147, %.preheader123, %125, %2
  %.14 = phi i32 [ 1, %2 ], [ 8, %125 ], [ 1, %.preheader123 ], [ %.1167.ph, %._crit_edge147 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret i32 %.14
}

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

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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH5ClampIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) local_unnamed_addr #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !16, i64 96}
!10 = !{!"_ZTSN3JPH24HeightFieldShapeSettingsE", !11, i64 0, !20, i64 64, !20, i64 80, !16, i64 96, !6, i64 100, !6, i64 104, !16, i64 108, !16, i64 112, !16, i64 116, !21, i64 120, !23, i64 144, !24, i64 168, !6, i64 192}
!11 = !{!"_ZTSN3JPH13ShapeSettingsE", !12, i64 0, !13, i64 8, !17, i64 16, !18, i64 24}
!12 = !{!"_ZTSN3JPH18SerializableObjectE"}
!13 = !{!"_ZTSN3JPH9RefTargetINS_13ShapeSettingsEEE", !14, i64 0}
!14 = !{!"_ZTSSt6atomicIjE", !15, i64 0}
!15 = !{!"_ZTSSt13__atomic_baseIjE", !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN3JPH6ResultINS_3RefINS_5ShapeEEEEE", !7, i64 0, !19, i64 32}
!19 = !{!"_ZTSN3JPH6ResultINS_3RefINS_5ShapeEEEE6EStateE", !7, i64 0}
!20 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!21 = !{!"_ZTSN3JPH5ArrayIfNS_12STLAllocatorIfEEEE", !17, i64 0, !17, i64 8, !22, i64 16}
!22 = !{!"any pointer", !7, i64 0}
!23 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !17, i64 0, !17, i64 8, !22, i64 16}
!24 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !17, i64 0, !17, i64 8, !22, i64 16}
!25 = !{!10, !16, i64 112}
!26 = !{!16, !16, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = distinct !{!30, !28}
!31 = distinct !{!31, !28}
!32 = distinct !{!32, !28}
!33 = distinct !{!33, !28}
!34 = distinct !{!34, !28, !35}
!35 = !{!"llvm.loop.unswitch.partial.disable"}


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