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

@.str.2 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7, i64 noundef %8, float noundef %9, float noundef %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4 align 2 personality ptr @__gxx_personality_v0 {
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca %"class.JPH::ScopeExit", align 8
  %32 = alloca %class.anon.13, align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca ptr, align 8
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca ptr, align 8
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca ptr, align 8
  %49 = alloca float, align 4
  %50 = alloca float, align 4
  %51 = alloca float, align 4
  %52 = alloca %"class.JPH::Vec3", align 16
  %53 = alloca %"class.JPH::Vec3", align 16
  %54 = alloca %"class.JPH::Vec3", align 16
  %55 = alloca %"class.JPH::Vec3", align 16
  %56 = alloca %"class.JPH::Vec3", align 16
  %57 = alloca %"class.JPH::Vec3", align 16
  %58 = alloca float, align 4
  %59 = alloca %"class.JPH::Vec3", align 16
  %60 = alloca %"class.JPH::Vec3", align 16
  %61 = alloca %"class.JPH::Vec3", align 16
  %62 = alloca %"class.JPH::Vec3", align 16
  %63 = alloca %"class.JPH::Vec3", align 16
  %64 = alloca %"class.JPH::Vec3", align 16
  %65 = alloca %"class.JPH::Vec3", align 16
  %66 = alloca %"class.JPH::Vec3", align 16
  %67 = alloca i32, align 4
  %68 = alloca ptr, align 8
  %69 = alloca i32, align 4
  %70 = alloca i32, align 4
  %71 = alloca i32, align 4
  %72 = alloca ptr, align 8
  %73 = alloca float, align 4
  %74 = alloca float, align 4
  %75 = alloca float, align 4
  %76 = alloca i8, align 1
  %77 = alloca i8, align 1
  %78 = alloca i8, align 1
  %79 = alloca i16, align 2
  %80 = alloca i16, align 2
  %81 = alloca %"class.JPH::Vec3", align 16
  %82 = alloca %"class.JPH::Vec3", align 16
  %83 = alloca %"class.JPH::Vec3", align 16
  %84 = alloca %"class.JPH::Vec3", align 16
  %85 = alloca %"class.JPH::Vec3", align 16
  %86 = alloca %"class.JPH::Vec3", align 16
  %87 = alloca %"class.JPH::Vec3", align 16
  %88 = alloca %"class.JPH::Vec3", align 16
  %89 = alloca %"class.JPH::Vec3", align 16
  %90 = alloca %"class.JPH::Vec3", align 16
  %91 = alloca %"class.JPH::Vec3", align 16
  %92 = alloca %"class.JPH::Vec3", align 16
  %93 = alloca i32, align 4
  %94 = alloca i32, align 4
  %95 = alloca %"struct.JPH::AssertLastParam", align 1
  %96 = alloca ptr, align 8
  %97 = alloca i16, align 2
  store ptr %0, ptr %13, align 8, !tbaa !5
  store i32 %1, ptr %14, align 4, !tbaa !9
  store i32 %2, ptr %15, align 4, !tbaa !9
  store i32 %3, ptr %16, align 4, !tbaa !9
  store i32 %4, ptr %17, align 4, !tbaa !9
  store ptr %5, ptr %18, align 8, !tbaa !5
  store i32 %6, ptr %19, align 4, !tbaa !9
  store i32 %7, ptr %20, align 4, !tbaa !9
  store i64 %8, ptr %21, align 8, !tbaa !11
  store float %9, ptr %22, align 4, !tbaa !13
  store float %10, ptr %23, align 4, !tbaa !13
  store ptr %11, ptr %24, align 8, !tbaa !5
  %98 = load ptr, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 44, ptr %26, align 4, !tbaa !9
  %99 = 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) %26)
  %100 = load i32, ptr %99, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  store i32 %100, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 44, ptr %28, align 4, !tbaa !9
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %102 = load i32, ptr %101, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  store i32 %102, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  %103 = load i32, ptr %25, align 4, !tbaa !9
  %104 = add i32 %103, 1
  %105 = mul i32 2, %104
  %106 = load i32, ptr %27, align 4, !tbaa !9
  %107 = add i32 %106, 1
  %108 = mul i32 %105, %107
  %109 = zext i32 %108 to i64
  %110 = mul i64 %109, 16
  %111 = trunc i64 %110 to i32
  store i32 %111, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %112 = load ptr, ptr %24, align 8, !tbaa !5
  %113 = load i32, ptr %29, align 4, !tbaa !9
  %114 = load ptr, ptr %112, align 8, !tbaa !15
  %115 = getelementptr inbounds ptr, ptr %114, i64 2
  %116 = load ptr, ptr %115, align 8
  %117 = call noundef ptr %116(ptr noundef nonnull align 8 dereferenceable(8) %112, i32 noundef %113)
  store ptr %117, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %32) #8
  %118 = getelementptr inbounds %class.anon.13, ptr %32, i32 0, i32 0
  %119 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %119, ptr %118, align 8, !tbaa !5
  %120 = getelementptr inbounds %class.anon.13, ptr %32, i32 0, i32 1
  %121 = load ptr, ptr %30, align 8, !tbaa !5
  store ptr %121, ptr %120, align 8, !tbaa !17
  %122 = getelementptr inbounds %class.anon.13, ptr %32, i32 0, i32 2
  %123 = load i32, ptr %29, align 4, !tbaa !9
  store i32 %123, ptr %122, align 8, !tbaa !19
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0EC2EOS6_"(ptr noundef nonnull align 8 dereferenceable(25) %31, ptr noundef nonnull align 8 dereferenceable(20) %32)
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %751, %12
  %125 = load i32, ptr %33, align 4, !tbaa !9
  %126 = load i32, ptr %17, align 4, !tbaa !9
  %127 = icmp ult i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 2, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %755

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

130:                                              ; preds = %743, %129
  %131 = load i32, ptr %35, align 4, !tbaa !9
  %132 = load i32, ptr %16, align 4, !tbaa !9
  %133 = icmp ult i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  store i32 5, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %750

135:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %136 = load i32, ptr %35, align 4, !tbaa !9
  %137 = load i32, ptr %25, align 4, !tbaa !9
  %138 = add i32 %136, %137
  store i32 %138, ptr %37, align 4, !tbaa !9
  %139 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %37, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %140 unwind label %153

140:                                              ; preds = %135
  %141 = load i32, ptr %139, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  store i32 %141, ptr %36, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #8
  %142 = load i32, ptr %33, align 4, !tbaa !9
  %143 = load i32, ptr %27, align 4, !tbaa !9
  %144 = add i32 %142, %143
  store i32 %144, ptr %41, align 4, !tbaa !9
  %145 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %146 unwind label %157

146:                                              ; preds = %140
  %147 = load i32, ptr %145, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  store i32 %147, ptr %40, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #8
  %148 = load i32, ptr %35, align 4, !tbaa !9
  %149 = icmp ugt i32 %148, 0
  br i1 %149, label %150, label %161

150:                                              ; preds = %146
  %151 = load i32, ptr %35, align 4, !tbaa !9
  %152 = sub i32 %151, 1
  store i32 %152, ptr %42, align 4, !tbaa !9
  store i32 2, ptr %43, align 4, !tbaa !9
  br label %162

153:                                              ; preds = %135
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %38, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %749

157:                                              ; preds = %140
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %38, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  br label %748

161:                                              ; preds = %146
  store i32 0, ptr %42, align 4, !tbaa !9
  store i32 0, ptr %43, align 4, !tbaa !9
  br label %162

162:                                              ; preds = %161, %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  %163 = load i32, ptr %40, align 4, !tbaa !9
  %164 = load i32, ptr %17, align 4, !tbaa !9
  %165 = icmp ult i32 %163, %164
  br i1 %165, label %166, label %169

166:                                              ; preds = %162
  %167 = load i32, ptr %40, align 4, !tbaa !9
  %168 = add i32 %167, 1
  br label %171

169:                                              ; preds = %162
  %170 = load i32, ptr %17, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %169, %166
  %172 = phi i32 [ %168, %166 ], [ %170, %169 ]
  store i32 %172, ptr %44, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %173 = load ptr, ptr %30, align 8, !tbaa !5
  store ptr %173, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #8
  %174 = load i32, ptr %33, align 4, !tbaa !9
  store i32 %174, ptr %46, align 4, !tbaa !9
  br label %175

175:                                              ; preds = %413, %171
  %176 = load i32, ptr %46, align 4, !tbaa !9
  %177 = load i32, ptr %44, align 4, !tbaa !9
  %178 = icmp ult i32 %176, %177
  br i1 %178, label %180, label %179

179:                                              ; preds = %175
  store i32 8, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  br label %416

180:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  %181 = load i32, ptr %42, align 4, !tbaa !9
  store i32 %181, ptr %47, align 4, !tbaa !9
  br label %182

182:                                              ; preds = %408, %180
  %183 = load i32, ptr %47, align 4, !tbaa !9
  %184 = load i32, ptr %36, align 4, !tbaa !9
  %185 = icmp ult i32 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %182
  store i32 11, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  br label %412

187:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #8
  %188 = load ptr, ptr %18, align 8, !tbaa !5
  %189 = load i32, ptr %15, align 4, !tbaa !9
  %190 = load i32, ptr %20, align 4, !tbaa !9
  %191 = sub i32 %189, %190
  %192 = load i32, ptr %46, align 4, !tbaa !9
  %193 = add i32 %191, %192
  %194 = zext i32 %193 to i64
  %195 = load i64, ptr %21, align 8, !tbaa !11
  %196 = mul nsw i64 %194, %195
  %197 = getelementptr inbounds float, ptr %188, i64 %196
  %198 = load i32, ptr %14, align 4, !tbaa !9
  %199 = load i32, ptr %19, align 4, !tbaa !9
  %200 = sub i32 %198, %199
  %201 = load i32, ptr %47, align 4, !tbaa !9
  %202 = add i32 %200, %201
  %203 = zext i32 %202 to i64
  %204 = getelementptr inbounds float, ptr %197, i64 %203
  store ptr %204, ptr %48, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #8
  %205 = load ptr, ptr %48, align 8, !tbaa !5
  %206 = getelementptr inbounds float, ptr %205, i64 0
  %207 = load float, ptr %206, align 4, !tbaa !13
  store float %207, ptr %49, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #8
  %208 = load ptr, ptr %48, align 8, !tbaa !5
  %209 = load i64, ptr %21, align 8, !tbaa !11
  %210 = add nsw i64 %209, 1
  %211 = getelementptr inbounds float, ptr %208, i64 %210
  %212 = load float, ptr %211, align 4, !tbaa !13
  store float %212, ptr %50, align 4, !tbaa !13
  %213 = load float, ptr %49, align 4, !tbaa !13
  %214 = fcmp une float %213, 0x47EFFFFFE0000000
  br i1 %214, label %215, label %376

215:                                              ; preds = %187
  %216 = load float, ptr %50, align 4, !tbaa !13
  %217 = fcmp une float %216, 0x47EFFFFFE0000000
  br i1 %217, label %218, label %376

218:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #8
  %219 = load ptr, ptr %48, align 8, !tbaa !5
  %220 = load i64, ptr %21, align 8, !tbaa !11
  %221 = getelementptr inbounds float, ptr %219, i64 %220
  %222 = load float, ptr %221, align 4, !tbaa !13
  store float %222, ptr %51, align 4, !tbaa !13
  %223 = load float, ptr %51, align 4, !tbaa !13
  %224 = fcmp une float %223, 0x47EFFFFFE0000000
  br i1 %224, label %225, label %281

225:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 16, ptr %52) #8
  %226 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 3
  %227 = invoke noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %226)
          to label %228 unwind label %267

228:                                              ; preds = %225
  %229 = load float, ptr %22, align 4, !tbaa !13
  %230 = load float, ptr %50, align 4, !tbaa !13
  %231 = load float, ptr %51, align 4, !tbaa !13
  %232 = fsub float %230, %231
  %233 = fmul float %229, %232
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %52, float noundef %227, float noundef %233, float noundef 0.000000e+00)
          to label %234 unwind label %267

234:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 16, ptr %53) #8
  %235 = load float, ptr %22, align 4, !tbaa !13
  %236 = load float, ptr %49, align 4, !tbaa !13
  %237 = load float, ptr %51, align 4, !tbaa !13
  %238 = fsub float %236, %237
  %239 = fmul float %235, %238
  %240 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 3
  %241 = invoke noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %240)
          to label %242 unwind label %271

242:                                              ; preds = %234
  %243 = fneg float %241
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %53, float noundef 0.000000e+00, float noundef %239, float noundef %243)
          to label %244 unwind label %271

244:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 16, ptr %54) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %55) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %56, ptr align 16 %53, i64 16, i1 false), !tbaa.struct !20
  %245 = getelementptr inbounds { double, double }, ptr %56, i32 0, i32 0
  %246 = load double, ptr %245, align 16
  %247 = getelementptr inbounds { double, double }, ptr %56, i32 0, i32 1
  %248 = load double, ptr %247, align 8
  %249 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %52, double %246, double %248)
          to label %250 unwind label %275

250:                                              ; preds = %244
  %251 = getelementptr inbounds %"class.JPH::Vec3", ptr %55, i32 0, i32 0
  %252 = getelementptr inbounds %union.anon.3, ptr %251, i32 0, i32 0
  %253 = getelementptr inbounds { double, double }, ptr %252, i32 0, i32 0
  %254 = extractvalue { double, double } %249, 0
  store double %254, ptr %253, align 16
  %255 = getelementptr inbounds { double, double }, ptr %252, i32 0, i32 1
  %256 = extractvalue { double, double } %249, 1
  store double %256, ptr %255, align 8
  %257 = invoke { double, double } @_ZNK3JPH4Vec310NormalizedEv(ptr noundef nonnull align 16 dereferenceable(16) %55)
          to label %258 unwind label %275

258:                                              ; preds = %250
  %259 = getelementptr inbounds %"class.JPH::Vec3", ptr %54, i32 0, i32 0
  %260 = getelementptr inbounds %union.anon.3, ptr %259, i32 0, i32 0
  %261 = getelementptr inbounds { double, double }, ptr %260, i32 0, i32 0
  %262 = extractvalue { double, double } %257, 0
  store double %262, ptr %261, align 16
  %263 = getelementptr inbounds { double, double }, ptr %260, i32 0, i32 1
  %264 = extractvalue { double, double } %257, 1
  store double %264, ptr %263, align 8
  %265 = load ptr, ptr %45, align 8, !tbaa !5
  %266 = getelementptr inbounds %"class.JPH::Vec3", ptr %265, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %266, ptr align 16 %54, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %55) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %54) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %53) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %52) #8
  br label %296

267:                                              ; preds = %228, %225
  %268 = landingpad { ptr, i32 }
          cleanup
  %269 = extractvalue { ptr, i32 } %268, 0
  store ptr %269, ptr %38, align 8
  %270 = extractvalue { ptr, i32 } %268, 1
  store i32 %270, ptr %39, align 4
  br label %280

271:                                              ; preds = %242, %234
  %272 = landingpad { ptr, i32 }
          cleanup
  %273 = extractvalue { ptr, i32 } %272, 0
  store ptr %273, ptr %38, align 8
  %274 = extractvalue { ptr, i32 } %272, 1
  store i32 %274, ptr %39, align 4
  br label %279

275:                                              ; preds = %250, %244
  %276 = landingpad { ptr, i32 }
          cleanup
  %277 = extractvalue { ptr, i32 } %276, 0
  store ptr %277, ptr %38, align 8
  %278 = extractvalue { ptr, i32 } %276, 1
  store i32 %278, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %55) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %54) #8
  br label %279

279:                                              ; preds = %275, %271
  call void @llvm.lifetime.end.p0(i64 16, ptr %53) #8
  br label %280

280:                                              ; preds = %279, %267
  call void @llvm.lifetime.end.p0(i64 16, ptr %52) #8
  br label %375

281:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 16, ptr %57) #8
  %282 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %283 unwind label %292

283:                                              ; preds = %281
  %284 = getelementptr inbounds %"class.JPH::Vec3", ptr %57, i32 0, i32 0
  %285 = getelementptr inbounds %union.anon.3, ptr %284, i32 0, i32 0
  %286 = getelementptr inbounds { double, double }, ptr %285, i32 0, i32 0
  %287 = extractvalue { double, double } %282, 0
  store double %287, ptr %286, align 16
  %288 = getelementptr inbounds { double, double }, ptr %285, i32 0, i32 1
  %289 = extractvalue { double, double } %282, 1
  store double %289, ptr %288, align 8
  %290 = load ptr, ptr %45, align 8, !tbaa !5
  %291 = getelementptr inbounds %"class.JPH::Vec3", ptr %290, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %291, ptr align 16 %57, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %57) #8
  br label %296

292:                                              ; preds = %281
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %38, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %57) #8
  br label %375

296:                                              ; preds = %283, %258
  call void @llvm.lifetime.start.p0(i64 4, ptr %58) #8
  %297 = load ptr, ptr %48, align 8, !tbaa !5
  %298 = getelementptr inbounds float, ptr %297, i64 1
  %299 = load float, ptr %298, align 4, !tbaa !13
  store float %299, ptr %58, align 4, !tbaa !13
  %300 = load float, ptr %58, align 4, !tbaa !13
  %301 = fcmp une float %300, 0x47EFFFFFE0000000
  br i1 %301, label %302, label %358

302:                                              ; preds = %296
  call void @llvm.lifetime.start.p0(i64 16, ptr %59) #8
  %303 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 3
  %304 = invoke noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %303)
          to label %305 unwind label %344

305:                                              ; preds = %302
  %306 = fneg float %304
  %307 = load float, ptr %22, align 4, !tbaa !13
  %308 = load float, ptr %49, align 4, !tbaa !13
  %309 = load float, ptr %58, align 4, !tbaa !13
  %310 = fsub float %308, %309
  %311 = fmul float %307, %310
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %59, float noundef %306, float noundef %311, float noundef 0.000000e+00)
          to label %312 unwind label %344

312:                                              ; preds = %305
  call void @llvm.lifetime.start.p0(i64 16, ptr %60) #8
  %313 = load float, ptr %22, align 4, !tbaa !13
  %314 = load float, ptr %50, align 4, !tbaa !13
  %315 = load float, ptr %58, align 4, !tbaa !13
  %316 = fsub float %314, %315
  %317 = fmul float %313, %316
  %318 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 3
  %319 = invoke noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %318)
          to label %320 unwind label %348

320:                                              ; preds = %312
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %60, float noundef 0.000000e+00, float noundef %317, float noundef %319)
          to label %321 unwind label %348

321:                                              ; preds = %320
  call void @llvm.lifetime.start.p0(i64 16, ptr %61) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %62) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %63, ptr align 16 %60, i64 16, i1 false), !tbaa.struct !20
  %322 = getelementptr inbounds { double, double }, ptr %63, i32 0, i32 0
  %323 = load double, ptr %322, align 16
  %324 = getelementptr inbounds { double, double }, ptr %63, i32 0, i32 1
  %325 = load double, ptr %324, align 8
  %326 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %59, double %323, double %325)
          to label %327 unwind label %352

327:                                              ; preds = %321
  %328 = getelementptr inbounds %"class.JPH::Vec3", ptr %62, i32 0, i32 0
  %329 = getelementptr inbounds %union.anon.3, ptr %328, i32 0, i32 0
  %330 = getelementptr inbounds { double, double }, ptr %329, i32 0, i32 0
  %331 = extractvalue { double, double } %326, 0
  store double %331, ptr %330, align 16
  %332 = getelementptr inbounds { double, double }, ptr %329, i32 0, i32 1
  %333 = extractvalue { double, double } %326, 1
  store double %333, ptr %332, align 8
  %334 = invoke { double, double } @_ZNK3JPH4Vec310NormalizedEv(ptr noundef nonnull align 16 dereferenceable(16) %62)
          to label %335 unwind label %352

335:                                              ; preds = %327
  %336 = getelementptr inbounds %"class.JPH::Vec3", ptr %61, i32 0, i32 0
  %337 = getelementptr inbounds %union.anon.3, ptr %336, i32 0, i32 0
  %338 = getelementptr inbounds { double, double }, ptr %337, i32 0, i32 0
  %339 = extractvalue { double, double } %334, 0
  store double %339, ptr %338, align 16
  %340 = getelementptr inbounds { double, double }, ptr %337, i32 0, i32 1
  %341 = extractvalue { double, double } %334, 1
  store double %341, ptr %340, align 8
  %342 = load ptr, ptr %45, align 8, !tbaa !5
  %343 = getelementptr inbounds %"class.JPH::Vec3", ptr %342, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %343, ptr align 16 %61, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %62) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %61) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %60) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %59) #8
  br label %373

344:                                              ; preds = %305, %302
  %345 = landingpad { ptr, i32 }
          cleanup
  %346 = extractvalue { ptr, i32 } %345, 0
  store ptr %346, ptr %38, align 8
  %347 = extractvalue { ptr, i32 } %345, 1
  store i32 %347, ptr %39, align 4
  br label %357

348:                                              ; preds = %320, %312
  %349 = landingpad { ptr, i32 }
          cleanup
  %350 = extractvalue { ptr, i32 } %349, 0
  store ptr %350, ptr %38, align 8
  %351 = extractvalue { ptr, i32 } %349, 1
  store i32 %351, ptr %39, align 4
  br label %356

352:                                              ; preds = %327, %321
  %353 = landingpad { ptr, i32 }
          cleanup
  %354 = extractvalue { ptr, i32 } %353, 0
  store ptr %354, ptr %38, align 8
  %355 = extractvalue { ptr, i32 } %353, 1
  store i32 %355, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %62) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %61) #8
  br label %356

356:                                              ; preds = %352, %348
  call void @llvm.lifetime.end.p0(i64 16, ptr %60) #8
  br label %357

357:                                              ; preds = %356, %344
  call void @llvm.lifetime.end.p0(i64 16, ptr %59) #8
  br label %374

358:                                              ; preds = %296
  call void @llvm.lifetime.start.p0(i64 16, ptr %64) #8
  %359 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %360 unwind label %369

360:                                              ; preds = %358
  %361 = getelementptr inbounds %"class.JPH::Vec3", ptr %64, i32 0, i32 0
  %362 = getelementptr inbounds %union.anon.3, ptr %361, i32 0, i32 0
  %363 = getelementptr inbounds { double, double }, ptr %362, i32 0, i32 0
  %364 = extractvalue { double, double } %359, 0
  store double %364, ptr %363, align 16
  %365 = getelementptr inbounds { double, double }, ptr %362, i32 0, i32 1
  %366 = extractvalue { double, double } %359, 1
  store double %366, ptr %365, align 8
  %367 = load ptr, ptr %45, align 8, !tbaa !5
  %368 = getelementptr inbounds %"class.JPH::Vec3", ptr %367, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %368, ptr align 16 %64, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %64) #8
  br label %373

369:                                              ; preds = %358
  %370 = landingpad { ptr, i32 }
          cleanup
  %371 = extractvalue { ptr, i32 } %370, 0
  store ptr %371, ptr %38, align 8
  %372 = extractvalue { ptr, i32 } %370, 1
  store i32 %372, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %64) #8
  br label %374

373:                                              ; preds = %360, %335
  call void @llvm.lifetime.end.p0(i64 4, ptr %58) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #8
  br label %405

374:                                              ; preds = %369, %357
  call void @llvm.lifetime.end.p0(i64 4, ptr %58) #8
  br label %375

375:                                              ; preds = %374, %292, %280
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #8
  br label %411

376:                                              ; preds = %215, %187
  call void @llvm.lifetime.start.p0(i64 16, ptr %65) #8
  %377 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %378 unwind label %397

378:                                              ; preds = %376
  %379 = getelementptr inbounds %"class.JPH::Vec3", ptr %65, i32 0, i32 0
  %380 = getelementptr inbounds %union.anon.3, ptr %379, i32 0, i32 0
  %381 = getelementptr inbounds { double, double }, ptr %380, i32 0, i32 0
  %382 = extractvalue { double, double } %377, 0
  store double %382, ptr %381, align 16
  %383 = getelementptr inbounds { double, double }, ptr %380, i32 0, i32 1
  %384 = extractvalue { double, double } %377, 1
  store double %384, ptr %383, align 8
  %385 = load ptr, ptr %45, align 8, !tbaa !5
  %386 = getelementptr inbounds %"class.JPH::Vec3", ptr %385, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %386, ptr align 16 %65, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %65) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %66) #8
  %387 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %388 unwind label %401

388:                                              ; preds = %378
  %389 = getelementptr inbounds %"class.JPH::Vec3", ptr %66, i32 0, i32 0
  %390 = getelementptr inbounds %union.anon.3, ptr %389, i32 0, i32 0
  %391 = getelementptr inbounds { double, double }, ptr %390, i32 0, i32 0
  %392 = extractvalue { double, double } %387, 0
  store double %392, ptr %391, align 16
  %393 = getelementptr inbounds { double, double }, ptr %390, i32 0, i32 1
  %394 = extractvalue { double, double } %387, 1
  store double %394, ptr %393, align 8
  %395 = load ptr, ptr %45, align 8, !tbaa !5
  %396 = getelementptr inbounds %"class.JPH::Vec3", ptr %395, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %396, ptr align 16 %66, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %66) #8
  br label %405

397:                                              ; preds = %376
  %398 = landingpad { ptr, i32 }
          cleanup
  %399 = extractvalue { ptr, i32 } %398, 0
  store ptr %399, ptr %38, align 8
  %400 = extractvalue { ptr, i32 } %398, 1
  store i32 %400, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %65) #8
  br label %411

401:                                              ; preds = %378
  %402 = landingpad { ptr, i32 }
          cleanup
  %403 = extractvalue { ptr, i32 } %402, 0
  store ptr %403, ptr %38, align 8
  %404 = extractvalue { ptr, i32 } %402, 1
  store i32 %404, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %66) #8
  br label %411

405:                                              ; preds = %388, %373
  %406 = load ptr, ptr %45, align 8, !tbaa !5
  %407 = getelementptr inbounds %"class.JPH::Vec3", ptr %406, i64 2
  store ptr %407, ptr %45, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  br label %408

408:                                              ; preds = %405
  %409 = load i32, ptr %47, align 4, !tbaa !9
  %410 = add i32 %409, 1
  store i32 %410, ptr %47, align 4, !tbaa !9
  br label %182, !llvm.loop !22

411:                                              ; preds = %401, %397, %375
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  br label %747

412:                                              ; preds = %186
  br label %413

413:                                              ; preds = %412
  %414 = load i32, ptr %46, align 4, !tbaa !9
  %415 = add i32 %414, 1
  store i32 %415, ptr %46, align 4, !tbaa !9
  br label %175, !llvm.loop !24

416:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %67) #8
  %417 = load i32, ptr %36, align 4, !tbaa !9
  %418 = load i32, ptr %42, align 4, !tbaa !9
  %419 = sub i32 %417, %418
  %420 = mul i32 2, %419
  store i32 %420, ptr %67, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %68) #8
  %421 = load ptr, ptr %30, align 8, !tbaa !5
  store ptr %421, ptr %68, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %69) #8
  %422 = load i32, ptr %15, align 4, !tbaa !9
  %423 = load i32, ptr %33, align 4, !tbaa !9
  %424 = add i32 %422, %423
  %425 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 4
  %426 = load i32, ptr %425, align 16, !tbaa !25
  %427 = sub i32 %426, 1
  %428 = mul i32 %424, %427
  %429 = load i32, ptr %14, align 4, !tbaa !9
  %430 = load i32, ptr %35, align 4, !tbaa !9
  %431 = add i32 %429, %430
  %432 = add i32 %428, %431
  %433 = mul i32 3, %432
  store i32 %433, ptr %69, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %70) #8
  %434 = load i32, ptr %33, align 4, !tbaa !9
  store i32 %434, ptr %70, align 4, !tbaa !9
  br label %435

435:                                              ; preds = %739, %416
  %436 = load i32, ptr %70, align 4, !tbaa !9
  %437 = load i32, ptr %40, align 4, !tbaa !9
  %438 = icmp ult i32 %436, %437
  br i1 %438, label %440, label %439

439:                                              ; preds = %435
  store i32 14, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %70) #8
  br label %742

440:                                              ; preds = %435
  %441 = load i32, ptr %43, align 4, !tbaa !9
  %442 = load ptr, ptr %68, align 8, !tbaa !5
  %443 = zext i32 %441 to i64
  %444 = getelementptr inbounds %"class.JPH::Vec3", ptr %442, i64 %443
  store ptr %444, ptr %68, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %71) #8
  %445 = load i32, ptr %35, align 4, !tbaa !9
  store i32 %445, ptr %71, align 4, !tbaa !9
  br label %446

446:                                              ; preds = %724, %440
  %447 = load i32, ptr %71, align 4, !tbaa !9
  %448 = load i32, ptr %36, align 4, !tbaa !9
  %449 = icmp ult i32 %447, %448
  br i1 %449, label %451, label %450

450:                                              ; preds = %446
  store i32 17, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %71) #8
  br label %728

451:                                              ; preds = %446
  call void @llvm.lifetime.start.p0(i64 8, ptr %72) #8
  %452 = load ptr, ptr %18, align 8, !tbaa !5
  %453 = load i32, ptr %15, align 4, !tbaa !9
  %454 = load i32, ptr %20, align 4, !tbaa !9
  %455 = sub i32 %453, %454
  %456 = load i32, ptr %70, align 4, !tbaa !9
  %457 = add i32 %455, %456
  %458 = zext i32 %457 to i64
  %459 = load i64, ptr %21, align 8, !tbaa !11
  %460 = mul nsw i64 %458, %459
  %461 = getelementptr inbounds float, ptr %452, i64 %460
  %462 = load i32, ptr %14, align 4, !tbaa !9
  %463 = load i32, ptr %19, align 4, !tbaa !9
  %464 = sub i32 %462, %463
  %465 = load i32, ptr %71, align 4, !tbaa !9
  %466 = add i32 %464, %465
  %467 = zext i32 %466 to i64
  %468 = getelementptr inbounds float, ptr %461, i64 %467
  store ptr %468, ptr %72, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %73) #8
  %469 = load ptr, ptr %72, align 8, !tbaa !5
  %470 = getelementptr inbounds float, ptr %469, i64 0
  %471 = load float, ptr %470, align 4, !tbaa !13
  store float %471, ptr %73, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %74) #8
  %472 = load ptr, ptr %72, align 8, !tbaa !5
  %473 = load i64, ptr %21, align 8, !tbaa !11
  %474 = getelementptr inbounds float, ptr %472, i64 %473
  %475 = load float, ptr %474, align 4, !tbaa !13
  store float %475, ptr %74, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %75) #8
  %476 = load ptr, ptr %72, align 8, !tbaa !5
  %477 = load i64, ptr %21, align 8, !tbaa !11
  %478 = add nsw i64 %477, 1
  %479 = getelementptr inbounds float, ptr %476, i64 %478
  %480 = load float, ptr %479, align 4, !tbaa !13
  store float %480, ptr %75, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %76) #8
  %481 = load float, ptr %73, align 4, !tbaa !13
  %482 = fcmp une float %481, 0x47EFFFFFE0000000
  %483 = zext i1 %482 to i8
  store i8 %483, ptr %76, align 1, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 1, ptr %77) #8
  %484 = load float, ptr %74, align 4, !tbaa !13
  %485 = fcmp une float %484, 0x47EFFFFFE0000000
  %486 = zext i1 %485 to i8
  store i8 %486, ptr %77, align 1, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 1, ptr %78) #8
  %487 = load float, ptr %75, align 4, !tbaa !13
  %488 = fcmp une float %487, 0x47EFFFFFE0000000
  %489 = zext i1 %488 to i8
  store i8 %489, ptr %78, align 1, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 2, ptr %79) #8
  store i16 7, ptr %79, align 2, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 2, ptr %80) #8
  store i16 0, ptr %80, align 2, !tbaa !39
  %490 = load i32, ptr %71, align 4, !tbaa !9
  %491 = icmp eq i32 %490, 0
  br i1 %491, label %492, label %497

492:                                              ; preds = %451
  %493 = load i16, ptr %79, align 2, !tbaa !39
  %494 = zext i16 %493 to i32
  %495 = and i32 %494, 6
  %496 = trunc i32 %495 to i16
  store i16 %496, ptr %79, align 2, !tbaa !39
  br label %543

497:                                              ; preds = %451
  %498 = load i8, ptr %76, align 1, !tbaa !37, !range !40, !noundef !41
  %499 = trunc i8 %498 to i1
  br i1 %499, label %500, label %542

500:                                              ; preds = %497
  %501 = load i8, ptr %77, align 1, !tbaa !37, !range !40, !noundef !41
  %502 = trunc i8 %501 to i1
  br i1 %502, label %503, label %542

503:                                              ; preds = %500
  call void @llvm.lifetime.start.p0(i64 16, ptr %81) #8
  %504 = load float, ptr %22, align 4, !tbaa !13
  %505 = load float, ptr %74, align 4, !tbaa !13
  %506 = load float, ptr %73, align 4, !tbaa !13
  %507 = fsub float %505, %506
  %508 = fmul float %504, %507
  %509 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 3
  %510 = invoke noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %509)
          to label %511 unwind label %537

511:                                              ; preds = %503
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %81, float noundef 0.000000e+00, float noundef %508, float noundef %510)
          to label %512 unwind label %537

512:                                              ; preds = %511
  %513 = load ptr, ptr %68, align 8, !tbaa !5
  %514 = getelementptr inbounds %"class.JPH::Vec3", ptr %513, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %82, ptr align 16 %514, i64 16, i1 false), !tbaa.struct !20
  %515 = load ptr, ptr %68, align 8, !tbaa !5
  %516 = getelementptr inbounds %"class.JPH::Vec3", ptr %515, i64 -1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %83, ptr align 16 %516, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %84, ptr align 16 %81, i64 16, i1 false), !tbaa.struct !20
  %517 = load float, ptr %23, align 4, !tbaa !13
  %518 = getelementptr inbounds { double, double }, ptr %82, i32 0, i32 0
  %519 = load double, ptr %518, align 16
  %520 = getelementptr inbounds { double, double }, ptr %82, i32 0, i32 1
  %521 = load double, ptr %520, align 8
  %522 = getelementptr inbounds { double, double }, ptr %83, i32 0, i32 0
  %523 = load double, ptr %522, align 16
  %524 = getelementptr inbounds { double, double }, ptr %83, i32 0, i32 1
  %525 = load double, ptr %524, align 8
  %526 = getelementptr inbounds { double, double }, ptr %84, i32 0, i32 0
  %527 = load double, ptr %526, align 16
  %528 = getelementptr inbounds { double, double }, ptr %84, i32 0, i32 1
  %529 = load double, ptr %528, align 8
  %530 = invoke noundef zeroext i1 @_ZN3JPH11ActiveEdgesL12IsEdgeActiveENS_4Vec3ES1_S1_f(double %519, double %521, double %523, double %525, double %527, double %529, float noundef %517)
          to label %531 unwind label %537

531:                                              ; preds = %512
  br i1 %530, label %532, label %541

532:                                              ; preds = %531
  %533 = load i16, ptr %80, align 2, !tbaa !39
  %534 = zext i16 %533 to i32
  %535 = or i32 %534, 1
  %536 = trunc i32 %535 to i16
  store i16 %536, ptr %80, align 2, !tbaa !39
  br label %541

537:                                              ; preds = %512, %511, %503
  %538 = landingpad { ptr, i32 }
          cleanup
  %539 = extractvalue { ptr, i32 } %538, 0
  store ptr %539, ptr %38, align 8
  %540 = extractvalue { ptr, i32 } %538, 1
  store i32 %540, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %81) #8
  br label %727

541:                                              ; preds = %532, %531
  call void @llvm.lifetime.end.p0(i64 16, ptr %81) #8
  br label %542

542:                                              ; preds = %541, %500, %497
  br label %543

543:                                              ; preds = %542, %492
  %544 = load i32, ptr %70, align 4, !tbaa !9
  %545 = load i32, ptr %17, align 4, !tbaa !9
  %546 = sub i32 %545, 1
  %547 = icmp eq i32 %544, %546
  br i1 %547, label %548, label %553

548:                                              ; preds = %543
  %549 = load i16, ptr %79, align 2, !tbaa !39
  %550 = zext i16 %549 to i32
  %551 = and i32 %550, 5
  %552 = trunc i32 %551 to i16
  store i16 %552, ptr %79, align 2, !tbaa !39
  br label %602

553:                                              ; preds = %543
  %554 = load i8, ptr %77, align 1, !tbaa !37, !range !40, !noundef !41
  %555 = trunc i8 %554 to i1
  br i1 %555, label %556, label %601

556:                                              ; preds = %553
  %557 = load i8, ptr %78, align 1, !tbaa !37, !range !40, !noundef !41
  %558 = trunc i8 %557 to i1
  br i1 %558, label %559, label %601

559:                                              ; preds = %556
  call void @llvm.lifetime.start.p0(i64 16, ptr %85) #8
  %560 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 3
  %561 = invoke noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %560)
          to label %562 unwind label %596

562:                                              ; preds = %559
  %563 = load float, ptr %22, align 4, !tbaa !13
  %564 = load float, ptr %75, align 4, !tbaa !13
  %565 = load float, ptr %74, align 4, !tbaa !13
  %566 = fsub float %564, %565
  %567 = fmul float %563, %566
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %85, float noundef %561, float noundef %567, float noundef 0.000000e+00)
          to label %568 unwind label %596

568:                                              ; preds = %562
  %569 = load ptr, ptr %68, align 8, !tbaa !5
  %570 = getelementptr inbounds %"class.JPH::Vec3", ptr %569, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %86, ptr align 16 %570, i64 16, i1 false), !tbaa.struct !20
  %571 = load ptr, ptr %68, align 8, !tbaa !5
  %572 = load i32, ptr %67, align 4, !tbaa !9
  %573 = add i32 %572, 1
  %574 = zext i32 %573 to i64
  %575 = getelementptr inbounds %"class.JPH::Vec3", ptr %571, i64 %574
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %87, ptr align 16 %575, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %88, ptr align 16 %85, i64 16, i1 false), !tbaa.struct !20
  %576 = load float, ptr %23, align 4, !tbaa !13
  %577 = getelementptr inbounds { double, double }, ptr %86, i32 0, i32 0
  %578 = load double, ptr %577, align 16
  %579 = getelementptr inbounds { double, double }, ptr %86, i32 0, i32 1
  %580 = load double, ptr %579, align 8
  %581 = getelementptr inbounds { double, double }, ptr %87, i32 0, i32 0
  %582 = load double, ptr %581, align 16
  %583 = getelementptr inbounds { double, double }, ptr %87, i32 0, i32 1
  %584 = load double, ptr %583, align 8
  %585 = getelementptr inbounds { double, double }, ptr %88, i32 0, i32 0
  %586 = load double, ptr %585, align 16
  %587 = getelementptr inbounds { double, double }, ptr %88, i32 0, i32 1
  %588 = load double, ptr %587, align 8
  %589 = invoke noundef zeroext i1 @_ZN3JPH11ActiveEdgesL12IsEdgeActiveENS_4Vec3ES1_S1_f(double %578, double %580, double %582, double %584, double %586, double %588, float noundef %576)
          to label %590 unwind label %596

590:                                              ; preds = %568
  br i1 %589, label %591, label %600

591:                                              ; preds = %590
  %592 = load i16, ptr %80, align 2, !tbaa !39
  %593 = zext i16 %592 to i32
  %594 = or i32 %593, 2
  %595 = trunc i32 %594 to i16
  store i16 %595, ptr %80, align 2, !tbaa !39
  br label %600

596:                                              ; preds = %568, %562, %559
  %597 = landingpad { ptr, i32 }
          cleanup
  %598 = extractvalue { ptr, i32 } %597, 0
  store ptr %598, ptr %38, align 8
  %599 = extractvalue { ptr, i32 } %597, 1
  store i32 %599, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %85) #8
  br label %727

600:                                              ; preds = %591, %590
  call void @llvm.lifetime.end.p0(i64 16, ptr %85) #8
  br label %601

601:                                              ; preds = %600, %556, %553
  br label %602

602:                                              ; preds = %601, %548
  %603 = load i8, ptr %76, align 1, !tbaa !37, !range !40, !noundef !41
  %604 = trunc i8 %603 to i1
  br i1 %604, label %605, label %652

605:                                              ; preds = %602
  %606 = load i8, ptr %78, align 1, !tbaa !37, !range !40, !noundef !41
  %607 = trunc i8 %606 to i1
  br i1 %607, label %608, label %652

608:                                              ; preds = %605
  call void @llvm.lifetime.start.p0(i64 16, ptr %89) #8
  %609 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 3
  %610 = invoke noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %609)
          to label %611 unwind label %647

611:                                              ; preds = %608
  %612 = fneg float %610
  %613 = load float, ptr %22, align 4, !tbaa !13
  %614 = load float, ptr %73, align 4, !tbaa !13
  %615 = load float, ptr %75, align 4, !tbaa !13
  %616 = fsub float %614, %615
  %617 = fmul float %613, %616
  %618 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 3
  %619 = invoke noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %618)
          to label %620 unwind label %647

620:                                              ; preds = %611
  %621 = fneg float %619
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %89, float noundef %612, float noundef %617, float noundef %621)
          to label %622 unwind label %647

622:                                              ; preds = %620
  %623 = load ptr, ptr %68, align 8, !tbaa !5
  %624 = getelementptr inbounds %"class.JPH::Vec3", ptr %623, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %90, ptr align 16 %624, i64 16, i1 false), !tbaa.struct !20
  %625 = load ptr, ptr %68, align 8, !tbaa !5
  %626 = getelementptr inbounds %"class.JPH::Vec3", ptr %625, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %91, ptr align 16 %626, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %92, ptr align 16 %89, i64 16, i1 false), !tbaa.struct !20
  %627 = load float, ptr %23, align 4, !tbaa !13
  %628 = getelementptr inbounds { double, double }, ptr %90, i32 0, i32 0
  %629 = load double, ptr %628, align 16
  %630 = getelementptr inbounds { double, double }, ptr %90, i32 0, i32 1
  %631 = load double, ptr %630, align 8
  %632 = getelementptr inbounds { double, double }, ptr %91, i32 0, i32 0
  %633 = load double, ptr %632, align 16
  %634 = getelementptr inbounds { double, double }, ptr %91, i32 0, i32 1
  %635 = load double, ptr %634, align 8
  %636 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 0
  %637 = load double, ptr %636, align 16
  %638 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 1
  %639 = load double, ptr %638, align 8
  %640 = invoke noundef zeroext i1 @_ZN3JPH11ActiveEdgesL12IsEdgeActiveENS_4Vec3ES1_S1_f(double %629, double %631, double %633, double %635, double %637, double %639, float noundef %627)
          to label %641 unwind label %647

641:                                              ; preds = %622
  br i1 %640, label %642, label %651

642:                                              ; preds = %641
  %643 = load i16, ptr %80, align 2, !tbaa !39
  %644 = zext i16 %643 to i32
  %645 = or i32 %644, 4
  %646 = trunc i32 %645 to i16
  store i16 %646, ptr %80, align 2, !tbaa !39
  br label %651

647:                                              ; preds = %622, %620, %611, %608
  %648 = landingpad { ptr, i32 }
          cleanup
  %649 = extractvalue { ptr, i32 } %648, 0
  store ptr %649, ptr %38, align 8
  %650 = extractvalue { ptr, i32 } %648, 1
  store i32 %650, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %89) #8
  br label %727

651:                                              ; preds = %642, %641
  call void @llvm.lifetime.end.p0(i64 16, ptr %89) #8
  br label %652

652:                                              ; preds = %651, %605, %602
  call void @llvm.lifetime.start.p0(i64 4, ptr %93) #8
  %653 = load i32, ptr %69, align 4, !tbaa !9
  %654 = lshr i32 %653, 3
  store i32 %654, ptr %93, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %94) #8
  %655 = load i32, ptr %69, align 4, !tbaa !9
  %656 = and i32 %655, 7
  store i32 %656, ptr %94, align 4, !tbaa !9
  br label %657

657:                                              ; preds = %652
  %658 = load i32, ptr %93, align 4, !tbaa !9
  %659 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 8
  %660 = load i32, ptr %659, align 16, !tbaa !42
  %661 = icmp ult i32 %658, %660
  br i1 %661, label %670, label %662

662:                                              ; preds = %657
  %663 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 338)
          to label %664 unwind label %666

664:                                              ; preds = %662
  br i1 %663, label %665, label %670

665:                                              ; preds = %664
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !43
  br label %670

666:                                              ; preds = %662
  %667 = landingpad { ptr, i32 }
          cleanup
  %668 = extractvalue { ptr, i32 } %667, 0
  store ptr %668, ptr %38, align 8
  %669 = extractvalue { ptr, i32 } %667, 1
  store i32 %669, ptr %39, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %94) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %93) #8
  br label %727

670:                                              ; preds = %665, %664, %657
  br label %671

671:                                              ; preds = %670
  br label %672

672:                                              ; preds = %671
  call void @llvm.lifetime.start.p0(i64 8, ptr %96) #8
  %673 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 16
  %674 = load ptr, ptr %673, align 16, !tbaa !44
  %675 = load i32, ptr %93, align 4, !tbaa !9
  %676 = zext i32 %675 to i64
  %677 = getelementptr inbounds i8, ptr %674, i64 %676
  store ptr %677, ptr %96, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %97) #8
  %678 = load ptr, ptr %96, align 8, !tbaa !5
  %679 = getelementptr inbounds i8, ptr %678, i64 0
  %680 = load i8, ptr %679, align 1, !tbaa !21
  %681 = zext i8 %680 to i16
  %682 = zext i16 %681 to i32
  %683 = load ptr, ptr %96, align 8, !tbaa !5
  %684 = getelementptr inbounds i8, ptr %683, i64 1
  %685 = load i8, ptr %684, align 1, !tbaa !21
  %686 = zext i8 %685 to i16
  %687 = zext i16 %686 to i32
  %688 = shl i32 %687, 8
  %689 = trunc i32 %688 to i16
  %690 = zext i16 %689 to i32
  %691 = or i32 %682, %690
  %692 = trunc i32 %691 to i16
  store i16 %692, ptr %97, align 2, !tbaa !39
  %693 = load i16, ptr %79, align 2, !tbaa !39
  %694 = zext i16 %693 to i32
  %695 = load i32, ptr %94, align 4, !tbaa !9
  %696 = shl i32 %694, %695
  %697 = xor i32 %696, -1
  %698 = load i16, ptr %97, align 2, !tbaa !39
  %699 = zext i16 %698 to i32
  %700 = and i32 %699, %697
  %701 = trunc i32 %700 to i16
  store i16 %701, ptr %97, align 2, !tbaa !39
  %702 = load i16, ptr %80, align 2, !tbaa !39
  %703 = zext i16 %702 to i32
  %704 = load i32, ptr %94, align 4, !tbaa !9
  %705 = shl i32 %703, %704
  %706 = load i16, ptr %97, align 2, !tbaa !39
  %707 = zext i16 %706 to i32
  %708 = or i32 %707, %705
  %709 = trunc i32 %708 to i16
  store i16 %709, ptr %97, align 2, !tbaa !39
  %710 = load i16, ptr %97, align 2, !tbaa !39
  %711 = trunc i16 %710 to i8
  %712 = load ptr, ptr %96, align 8, !tbaa !5
  %713 = getelementptr inbounds i8, ptr %712, i64 0
  store i8 %711, ptr %713, align 1, !tbaa !21
  %714 = load i16, ptr %97, align 2, !tbaa !39
  %715 = zext i16 %714 to i32
  %716 = ashr i32 %715, 8
  %717 = trunc i32 %716 to i8
  %718 = load ptr, ptr %96, align 8, !tbaa !5
  %719 = getelementptr inbounds i8, ptr %718, i64 1
  store i8 %717, ptr %719, align 1, !tbaa !21
  %720 = load ptr, ptr %68, align 8, !tbaa !5
  %721 = getelementptr inbounds %"class.JPH::Vec3", ptr %720, i64 2
  store ptr %721, ptr %68, align 8, !tbaa !5
  %722 = load i32, ptr %69, align 4, !tbaa !9
  %723 = add i32 %722, 3
  store i32 %723, ptr %69, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %97) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %96) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %94) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %93) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %80) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %79) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %78) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %77) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %76) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %75) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %74) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %73) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %72) #8
  br label %724

724:                                              ; preds = %672
  %725 = load i32, ptr %71, align 4, !tbaa !9
  %726 = add i32 %725, 1
  store i32 %726, ptr %71, align 4, !tbaa !9
  br label %446, !llvm.loop !45

727:                                              ; preds = %666, %647, %596, %537
  call void @llvm.lifetime.end.p0(i64 2, ptr %80) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr %79) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %78) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %77) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %76) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %75) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %74) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %73) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %72) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %71) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %70) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %69) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %67) #8
  br label %747

728:                                              ; preds = %450
  %729 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %98, i32 0, i32 4
  %730 = load i32, ptr %729, align 16, !tbaa !25
  %731 = sub i32 %730, 1
  %732 = load i32, ptr %36, align 4, !tbaa !9
  %733 = load i32, ptr %35, align 4, !tbaa !9
  %734 = sub i32 %732, %733
  %735 = sub i32 %731, %734
  %736 = mul i32 3, %735
  %737 = load i32, ptr %69, align 4, !tbaa !9
  %738 = add i32 %737, %736
  store i32 %738, ptr %69, align 4, !tbaa !9
  br label %739

739:                                              ; preds = %728
  %740 = load i32, ptr %70, align 4, !tbaa !9
  %741 = add i32 %740, 1
  store i32 %741, ptr %70, align 4, !tbaa !9
  br label %435, !llvm.loop !46

742:                                              ; preds = %439
  call void @llvm.lifetime.end.p0(i64 4, ptr %69) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %67) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %743

743:                                              ; preds = %742
  %744 = load i32, ptr %25, align 4, !tbaa !9
  %745 = load i32, ptr %35, align 4, !tbaa !9
  %746 = add i32 %745, %744
  store i32 %746, ptr %35, align 4, !tbaa !9
  br label %130, !llvm.loop !47

747:                                              ; preds = %727, %411
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  br label %748

748:                                              ; preds = %747, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  br label %749

749:                                              ; preds = %748, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %31) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %756

750:                                              ; preds = %134
  br label %751

751:                                              ; preds = %750
  %752 = load i32, ptr %27, align 4, !tbaa !9
  %753 = load i32, ptr %33, align 4, !tbaa !9
  %754 = add i32 %753, %752
  store i32 %754, ptr %33, align 4, !tbaa !9
  br label %124, !llvm.loop !48

755:                                              ; preds = %128
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %31) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  ret void

756:                                              ; preds = %749
  %757 = load ptr, ptr %38, align 8
  %758 = load i32, ptr %39, align 4
  %759 = insertvalue { ptr, i32 } poison, ptr %757, 0
  %760 = insertvalue { ptr, i32 } %759, i32 %758, 1
  resume { ptr, i32 } %760
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0EC2EOS6_"(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #5 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN3JPH11ActiveEdgesL12IsEdgeActiveENS_4Vec3ES1_S1_f(double, double, double, double, double, double, float noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #5 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"_ZTSZN3JPH16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0", !6, i64 0, !6, i64 8, !10, i64 16}
!19 = !{!18, !10, i64 16}
!20 = !{i64 0, i64 16, !21}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!26, !10, i64 64}
!26 = !{!"_ZTSN3JPH16HeightFieldShapeE", !27, i64 0, !33, i64 32, !33, i64 48, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !7, i64 84, !7, i64 85, !34, i64 86, !34, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !35, i64 120, !36, i64 144, !10, i64 168}
!27 = !{!"_ZTSN3JPH5ShapeE", !28, i64 8, !12, i64 16, !31, i64 24, !32, i64 25}
!28 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !29, i64 0}
!29 = !{!"_ZTSSt6atomicIjE", !30, i64 0}
!30 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!31 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!32 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!33 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!34 = !{!"short", !7, i64 0}
!35 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !12, i64 0, !12, i64 8, !6, i64 16}
!36 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !12, i64 0, !12, i64 8, !6, i64 16}
!37 = !{!38, !38, i64 0}
!38 = !{!"bool", !7, i64 0}
!39 = !{!34, !34, i64 0}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = !{!26, !10, i64 80}
!43 = !{i64 2158604958}
!44 = !{!26, !6, i64 112}
!45 = distinct !{!45, !23}
!46 = distinct !{!46, !23}
!47 = distinct !{!47, !23}
!48 = distinct !{!48, !23}


; 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::ScopeExit" = type { %class.anon.13, i8, [7 x i8] }
%class.anon.13 = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.JPH::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }

@.str.2 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; 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: mustprogress uwtable
define dso_local void @_ZN3JPH16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr nocapture noundef readonly %5, i32 noundef %6, i32 noundef %7, i64 noundef %8, float noundef %9, float noundef %10, ptr noundef nonnull align 8 dereferenceable(8) %11) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.JPH::ScopeExit", align 8
  %18 = alloca %class.anon.13, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca %"class.JPH::Vec3", align 16
  %28 = alloca %"class.JPH::Vec3", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  store i32 %3, ptr %13, align 4, !tbaa !5
  store i32 %4, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  store i32 44, ptr %15, align 4, !tbaa !5
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %31 = load i32, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #8
  store i32 44, ptr %16, align 4, !tbaa !5
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %33 = load i32, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  %34 = shl i32 %31, 5
  %35 = add i32 %33, 1
  %36 = add i32 %34, 32
  %37 = mul i32 %36, %35
  %38 = load ptr, ptr %11, align 8, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = load ptr, ptr %39, align 8
  %41 = call noundef ptr %40(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef %37)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %17) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #8
  store ptr %11, ptr %18, align 8, !tbaa !11
  %42 = getelementptr inbounds i8, ptr %18, i64 8
  store ptr %41, ptr %42, align 8, !tbaa !13
  %43 = getelementptr inbounds i8, ptr %18, i64 16
  store i32 %37, ptr %43, align 8, !tbaa !15
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0EC2EOS6_"(ptr noundef nonnull align 8 dereferenceable(25) %17, ptr noundef nonnull align 8 dereferenceable(20) %18)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  %44 = load i32, ptr %14, align 4, !tbaa !5
  %.not329 = icmp eq i32 %44, 0
  br i1 %.not329, label %._crit_edge328, label %.preheader254.lr.ph

.preheader254.lr.ph:                              ; preds = %12
  %45 = sub i32 %2, %7
  %46 = sub i32 %1, %6
  %47 = getelementptr inbounds i8, ptr %0, i64 48
  %.sroa.289.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  %48 = getelementptr inbounds i8, ptr %23, i64 8
  %.sroa.280.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 8
  %49 = getelementptr inbounds i8, ptr %26, i64 8
  %50 = getelementptr inbounds i8, ptr %0, i64 64
  %.sroa.223.0..sroa_idx = getelementptr inbounds i8, ptr %27, i64 8
  %.sroa.217.0..sroa_idx = getelementptr inbounds i8, ptr %28, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %29, i64 8
  %51 = getelementptr inbounds i8, ptr %0, i64 80
  %52 = getelementptr inbounds i8, ptr %0, i64 112
  %53 = load i32, ptr %13, align 4, !tbaa !5
  %.not330 = icmp eq i32 %53, 0
  br i1 %.not330, label %._crit_edge328, label %.preheader254

.preheader254:                                    ; preds = %.preheader254.lr.ph, %._crit_edge
  %54 = phi i32 [ %60, %._crit_edge ], [ %44, %.preheader254.lr.ph ]
  %55 = phi i32 [ %61, %._crit_edge ], [ 1, %.preheader254.lr.ph ]
  %.0327 = phi i32 [ %.pre347, %._crit_edge ], [ 0, %.preheader254.lr.ph ]
  %56 = zext i32 %.0327 to i64
  %.not331 = icmp eq i32 %55, 0
  %.pre347 = add i32 %.0327, %33
  br i1 %.not331, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader254
  %57 = add i32 %.0327, %2
  br label %63

._crit_edge328:                                   ; preds = %._crit_edge, %.preheader254.lr.ph, %12
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #8
  ret void

.loopexit:                                        ; preds = %._crit_edge.us314, %.lr.ph313, %._crit_edge277
  %58 = load i32, ptr %13, align 4, !tbaa !5
  %59 = icmp ult i32 %68, %58
  br i1 %59, label %63, label %._crit_edge.loopexit, !llvm.loop !16

._crit_edge.loopexit:                             ; preds = %.loopexit
  %.pre = load i32, ptr %14, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader254, %._crit_edge.loopexit
  %60 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %54, %.preheader254 ]
  %61 = phi i32 [ %58, %._crit_edge.loopexit ], [ 0, %.preheader254 ]
  %62 = icmp ult i32 %.pre347, %60
  br i1 %62, label %.preheader254, label %._crit_edge328, !llvm.loop !18

63:                                               ; preds = %.lr.ph, %.loopexit
  %.0187326 = phi i32 [ 0, %.lr.ph ], [ %68, %.loopexit ]
  %64 = zext i32 %.0187326 to i64
  %65 = icmp ne i32 %.0187326, 0
  %umin.neg = sext i1 %65 to i32
  %66 = add i32 %.0187326, %umin.neg
  %67 = zext i32 %66 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #8
  %68 = add i32 %.0187326, %31
  store i32 %68, ptr %19, align 4, !tbaa !5
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #8
  store i32 %.pre347, ptr %20, align 4, !tbaa !5
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #8
  %.not = icmp eq i32 %.0187326, 0
  %.0199 = select i1 %.not, i64 0, i64 2
  %.0198 = call i32 @llvm.usub.sat.i32(i32 %.0187326, i32 1)
  %73 = load i32, ptr %14, align 4
  %74 = icmp ult i32 %72, %73
  %75 = add i32 %72, 1
  %76 = select i1 %74, i32 %75, i32 %73
  %77 = icmp ult i32 %.0327, %76
  %78 = icmp ult i32 %.0198, %70
  %or.cond = select i1 %77, i1 %78, i1 false
  br i1 %or.cond, label %.preheader.us.preheader, label %._crit_edge277

.preheader.us.preheader:                          ; preds = %63
  %79 = zext i32 %70 to i64
  %80 = zext i32 %76 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv338 = phi i64 [ %56, %.preheader.us.preheader ], [ %indvars.iv.next339, %._crit_edge.us ]
  %.0200276.us = phi ptr [ %41, %.preheader.us.preheader ], [ %165, %._crit_edge.us ]
  %81 = trunc nuw i64 %indvars.iv338 to i32
  %82 = add i32 %45, %81
  %83 = zext i32 %82 to i64
  %84 = mul nsw i64 %83, %8
  %85 = getelementptr inbounds float, ptr %5, i64 %84
  br label %86

86:                                               ; preds = %.preheader.us, %164
  %indvars.iv = phi i64 [ %67, %.preheader.us ], [ %indvars.iv.next, %164 ]
  %.1201274.us = phi ptr [ %.0200276.us, %.preheader.us ], [ %165, %164 ]
  %87 = trunc nuw i64 %indvars.iv to i32
  %88 = add i32 %46, %87
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds float, ptr %85, i64 %89
  %91 = load float, ptr %90, align 4, !tbaa !20
  %92 = getelementptr float, ptr %90, i64 %8
  %93 = getelementptr i8, ptr %92, i64 4
  %94 = load float, ptr %93, align 4, !tbaa !20
  %95 = fcmp une float %91, 0x47EFFFFFE0000000
  %96 = fcmp une float %94, 0x47EFFFFFE0000000
  %or.cond.us = select i1 %95, i1 %96, i1 false
  br i1 %or.cond.us, label %107, label %97

97:                                               ; preds = %86
  %98 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %99 unwind label %.split.us

99:                                               ; preds = %97
  %100 = extractvalue { double, double } %98, 0
  %101 = extractvalue { double, double } %98, 1
  store double %100, ptr %.1201274.us, align 16
  %.sroa.576.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1201274.us, i64 8
  store double %101, ptr %.sroa.576.0..sroa_idx.us, align 8, !tbaa !22
  %102 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %103 unwind label %.split279.us

103:                                              ; preds = %99
  %104 = extractvalue { double, double } %102, 0
  %105 = extractvalue { double, double } %102, 1
  %106 = getelementptr inbounds i8, ptr %.1201274.us, i64 16
  store double %104, ptr %106, align 16
  %.sroa.5.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1201274.us, i64 24
  store double %105, ptr %.sroa.5.0..sroa_idx.us, align 8, !tbaa !22
  br label %164

107:                                              ; preds = %86
  %108 = load float, ptr %92, align 4, !tbaa !20
  %109 = fcmp une float %108, 0x47EFFFFFE0000000
  br i1 %109, label %115, label %110

110:                                              ; preds = %107
  %111 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %112 unwind label %.split282.us

112:                                              ; preds = %110
  %113 = extractvalue { double, double } %111, 0
  %114 = extractvalue { double, double } %111, 1
  store double %113, ptr %.1201274.us, align 16
  %.sroa.587.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1201274.us, i64 8
  store double %114, ptr %.sroa.587.0..sroa_idx.us, align 8, !tbaa !22
  br label %134

115:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #8
  %116 = invoke noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %47)
          to label %117 unwind label %.split285.us

117:                                              ; preds = %115
  %118 = fsub float %94, %108
  %119 = fmul float %118, %9
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %21, float noundef %116, float noundef %119, float noundef 0.000000e+00)
          to label %120 unwind label %.split285.us

120:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %22) #8
  %121 = fsub float %91, %108
  %122 = fmul float %121, %9
  %123 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %47)
  %124 = fneg float %123
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %22, float noundef 0.000000e+00, float noundef %122, float noundef %124)
          to label %125 unwind label %.split288.us

125:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %23) #8
  %.sroa.088.0.copyload.us = load double, ptr %22, align 16
  %.sroa.289.0.copyload.us = load double, ptr %.sroa.289.0..sroa_idx, align 8, !tbaa !22
  %126 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %21, double %.sroa.088.0.copyload.us, double %.sroa.289.0.copyload.us)
          to label %127 unwind label %.split291.us

127:                                              ; preds = %125
  %128 = extractvalue { double, double } %126, 0
  store double %128, ptr %23, align 16
  %129 = extractvalue { double, double } %126, 1
  store double %129, ptr %48, align 8
  %130 = invoke { double, double } @_ZNK3JPH4Vec310NormalizedEv(ptr noundef nonnull align 16 dereferenceable(16) %23)
          to label %131 unwind label %.split291.us

131:                                              ; preds = %127
  %132 = extractvalue { double, double } %130, 0
  %133 = extractvalue { double, double } %130, 1
  store double %132, ptr %.1201274.us, align 16
  %.sroa.591.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1201274.us, i64 8
  store double %133, ptr %.sroa.591.0..sroa_idx.us, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #8
  br label %134

134:                                              ; preds = %131, %112
  %135 = getelementptr inbounds i8, ptr %90, i64 4
  %136 = load float, ptr %135, align 4, !tbaa !20
  %137 = fcmp une float %136, 0x47EFFFFFE0000000
  br i1 %137, label %144, label %138

138:                                              ; preds = %134
  %139 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %140 unwind label %.split294.us

140:                                              ; preds = %138
  %141 = extractvalue { double, double } %139, 0
  %142 = extractvalue { double, double } %139, 1
  %143 = getelementptr inbounds i8, ptr %.1201274.us, i64 16
  store double %141, ptr %143, align 16
  %.sroa.578.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1201274.us, i64 24
  store double %142, ptr %.sroa.578.0..sroa_idx.us, align 8, !tbaa !22
  br label %164

144:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %24) #8
  %145 = invoke noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %47)
          to label %146 unwind label %.split297.us

146:                                              ; preds = %144
  %147 = fneg float %145
  %148 = fsub float %91, %136
  %149 = fmul float %148, %9
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %24, float noundef %147, float noundef %149, float noundef 0.000000e+00)
          to label %150 unwind label %.split297.us

150:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %25) #8
  %151 = fsub float %94, %136
  %152 = fmul float %151, %9
  %153 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %47)
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %25, float noundef 0.000000e+00, float noundef %152, float noundef %153)
          to label %154 unwind label %.split300.us

154:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %26) #8
  %.sroa.079.0.copyload.us = load double, ptr %25, align 16
  %.sroa.280.0.copyload.us = load double, ptr %.sroa.280.0..sroa_idx, align 8, !tbaa !22
  %155 = invoke { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %24, double %.sroa.079.0.copyload.us, double %.sroa.280.0.copyload.us)
          to label %156 unwind label %.split303.us

156:                                              ; preds = %154
  %157 = extractvalue { double, double } %155, 0
  store double %157, ptr %26, align 16
  %158 = extractvalue { double, double } %155, 1
  store double %158, ptr %49, align 8
  %159 = invoke { double, double } @_ZNK3JPH4Vec310NormalizedEv(ptr noundef nonnull align 16 dereferenceable(16) %26)
          to label %160 unwind label %.split303.us

160:                                              ; preds = %156
  %161 = extractvalue { double, double } %159, 0
  %162 = extractvalue { double, double } %159, 1
  %163 = getelementptr inbounds i8, ptr %.1201274.us, i64 16
  store double %161, ptr %163, align 16
  %.sroa.582.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1201274.us, i64 24
  store double %162, ptr %.sroa.582.0..sroa_idx.us, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #8
  br label %164

164:                                              ; preds = %160, %140, %103
  %165 = getelementptr inbounds i8, ptr %.1201274.us, i64 32
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %166 = icmp ult i64 %indvars.iv.next, %79
  br i1 %166, label %86, label %._crit_edge.us, !llvm.loop !23

._crit_edge.us:                                   ; preds = %164
  %indvars.iv.next339 = add nuw nsw i64 %indvars.iv338, 1
  %167 = icmp ult i64 %indvars.iv.next339, %80
  br i1 %167, label %.preheader.us, label %._crit_edge277, !llvm.loop !24

.split.us:                                        ; preds = %97
  %168 = landingpad { ptr, i32 }
          cleanup
  br label %295

.split279.us:                                     ; preds = %99
  %169 = landingpad { ptr, i32 }
          cleanup
  br label %295

.split282.us:                                     ; preds = %110
  %170 = landingpad { ptr, i32 }
          cleanup
  br label %295

.split285.us:                                     ; preds = %117, %115
  %171 = landingpad { ptr, i32 }
          cleanup
  br label %292

.split288.us:                                     ; preds = %120
  %172 = landingpad { ptr, i32 }
          cleanup
  br label %291

.split291.us:                                     ; preds = %127, %125
  %173 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #8
  br label %291

.split294.us:                                     ; preds = %138
  %174 = landingpad { ptr, i32 }
          cleanup
  br label %295

.split297.us:                                     ; preds = %146, %144
  %175 = landingpad { ptr, i32 }
          cleanup
  br label %294

.split300.us:                                     ; preds = %150
  %176 = landingpad { ptr, i32 }
          cleanup
  br label %293

.split303.us:                                     ; preds = %156, %154
  %177 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #8
  br label %293

._crit_edge277:                                   ; preds = %._crit_edge.us, %63
  %178 = icmp ult i32 %.0327, %72
  br i1 %178, label %.lr.ph313, label %.loopexit

.lr.ph313:                                        ; preds = %._crit_edge277
  %179 = sub i32 %70, %.0198
  %180 = shl i32 %179, 1
  %181 = icmp ult i32 %.0187326, %70
  %182 = or disjoint i32 %180, 1
  %183 = zext i32 %182 to i64
  %184 = xor i32 %70, -1
  %.neg = add i32 %.0187326, %184
  br i1 %181, label %.lr.ph.us.preheader, label %.loopexit

.lr.ph.us.preheader:                              ; preds = %.lr.ph313
  %185 = add i32 %.0187326, %1
  %186 = load i32, ptr %50, align 16, !tbaa !25
  %187 = add i32 %186, -1
  %188 = mul i32 %187, %57
  %189 = add i32 %185, %188
  %190 = mul i32 %189, 3
  %191 = zext i32 %70 to i64
  %192 = zext i32 %72 to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us314
  %indvars.iv344 = phi i64 [ %56, %.lr.ph.us.preheader ], [ %indvars.iv.next345, %._crit_edge.us314 ]
  %.0204311.us = phi ptr [ %41, %.lr.ph.us.preheader ], [ %279, %._crit_edge.us314 ]
  %.0206310.us = phi i32 [ %190, %.lr.ph.us.preheader ], [ %285, %._crit_edge.us314 ]
  %193 = getelementptr inbounds %"class.JPH::Vec3", ptr %.0204311.us, i64 %.0199
  %194 = trunc nuw i64 %indvars.iv344 to i32
  %195 = add i32 %45, %194
  %196 = zext i32 %195 to i64
  %197 = mul nsw i64 %196, %8
  %198 = getelementptr inbounds float, ptr %5, i64 %197
  br label %199

199:                                              ; preds = %.lr.ph.us, %262
  %indvars.iv341 = phi i64 [ %64, %.lr.ph.us ], [ %indvars.iv.next342, %262 ]
  %.1205307.us = phi ptr [ %193, %.lr.ph.us ], [ %279, %262 ]
  %.1207306.us = phi i32 [ %.0206310.us, %.lr.ph.us ], [ %280, %262 ]
  %200 = trunc nuw i64 %indvars.iv341 to i32
  %201 = add i32 %46, %200
  %202 = zext i32 %201 to i64
  %203 = getelementptr inbounds float, ptr %198, i64 %202
  %204 = load float, ptr %203, align 4, !tbaa !20
  %205 = getelementptr inbounds float, ptr %203, i64 %8
  %206 = load float, ptr %205, align 4, !tbaa !20
  %207 = getelementptr i8, ptr %205, i64 4
  %208 = load float, ptr %207, align 4, !tbaa !20
  %209 = fcmp oeq float %204, 0x47EFFFFFE0000000
  %210 = fcmp oeq float %206, 0x47EFFFFFE0000000
  %211 = fcmp oeq float %208, 0x47EFFFFFE0000000
  %212 = icmp eq i64 %indvars.iv341, 0
  %brmerge.us = select i1 %212, i1 true, i1 %209
  %brmerge242.us = select i1 %brmerge.us, i1 true, i1 %210
  %.mux.mux.us = select i1 %212, i16 6, i16 7
  br i1 %brmerge242.us, label %221, label %213

213:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %27) #8
  %214 = fsub float %206, %204
  %215 = fmul float %214, %9
  %216 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %47)
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %27, float noundef 0.000000e+00, float noundef %215, float noundef %216)
          to label %217 unwind label %.split.us316

217:                                              ; preds = %213
  %.sroa.026.0.copyload.us = load double, ptr %.1205307.us, align 16
  %.sroa.227.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1205307.us, i64 8
  %.sroa.227.0.copyload.us = load double, ptr %.sroa.227.0..sroa_idx.us, align 8, !tbaa !22
  %218 = getelementptr inbounds i8, ptr %.1205307.us, i64 -16
  %.sroa.024.0.copyload.us = load double, ptr %218, align 16
  %.sroa.225.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1205307.us, i64 -8
  %.sroa.225.0.copyload.us = load double, ptr %.sroa.225.0..sroa_idx.us, align 8, !tbaa !22
  %.sroa.022.0.copyload.us = load double, ptr %27, align 16
  %.sroa.223.0.copyload.us = load double, ptr %.sroa.223.0..sroa_idx, align 8, !tbaa !22
  %219 = invoke noundef zeroext i1 @_ZN3JPH11ActiveEdgesL12IsEdgeActiveENS_4Vec3ES1_S1_f(double %.sroa.026.0.copyload.us, double %.sroa.227.0.copyload.us, double %.sroa.024.0.copyload.us, double %.sroa.225.0.copyload.us, double %.sroa.022.0.copyload.us, double %.sroa.223.0.copyload.us, float noundef %10)
          to label %220 unwind label %.split.us316

220:                                              ; preds = %217
  %spec.select.us = zext i1 %219 to i16
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #8
  br label %221

221:                                              ; preds = %220, %199
  %.1213.us = phi i16 [ %spec.select.us, %220 ], [ 0, %199 ]
  %.0210.us = phi i16 [ 7, %220 ], [ %.mux.mux.us, %199 ]
  %222 = load i32, ptr %14, align 4, !tbaa !5
  %223 = add i32 %222, -1
  %224 = zext i32 %223 to i64
  %225 = icmp eq i64 %indvars.iv344, %224
  br i1 %225, label %237, label %226

226:                                              ; preds = %221
  %brmerge245.us = select i1 %210, i1 true, i1 %211
  br i1 %brmerge245.us, label %239, label %227

227:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %28) #8
  %228 = invoke noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %47)
          to label %229 unwind label %.split318.us

229:                                              ; preds = %227
  %230 = fsub float %208, %206
  %231 = fmul float %230, %9
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %28, float noundef %228, float noundef %231, float noundef 0.000000e+00)
          to label %232 unwind label %.split318.us

232:                                              ; preds = %229
  %.sroa.020.0.copyload.us = load double, ptr %.1205307.us, align 16
  %.sroa.221.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1205307.us, i64 8
  %.sroa.221.0.copyload.us = load double, ptr %.sroa.221.0..sroa_idx.us, align 8, !tbaa !22
  %233 = getelementptr inbounds %"class.JPH::Vec3", ptr %.1205307.us, i64 %183
  %.sroa.018.0.copyload.us = load double, ptr %233, align 16
  %.sroa.219.0..sroa_idx.us = getelementptr inbounds i8, ptr %233, i64 8
  %.sroa.219.0.copyload.us = load double, ptr %.sroa.219.0..sroa_idx.us, align 8, !tbaa !22
  %.sroa.016.0.copyload.us = load double, ptr %28, align 16
  %.sroa.217.0.copyload.us = load double, ptr %.sroa.217.0..sroa_idx, align 8, !tbaa !22
  %234 = invoke noundef zeroext i1 @_ZN3JPH11ActiveEdgesL12IsEdgeActiveENS_4Vec3ES1_S1_f(double %.sroa.020.0.copyload.us, double %.sroa.221.0.copyload.us, double %.sroa.018.0.copyload.us, double %.sroa.219.0.copyload.us, double %.sroa.016.0.copyload.us, double %.sroa.217.0.copyload.us, float noundef %10)
          to label %235 unwind label %.split318.us

235:                                              ; preds = %232
  %236 = or disjoint i16 %.1213.us, 2
  %spec.select246.us = select i1 %234, i16 %236, i16 %.1213.us
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #8
  br label %239

237:                                              ; preds = %221
  %238 = and i16 %.0210.us, 5
  br label %239

239:                                              ; preds = %237, %235, %226
  %.3215.us = phi i16 [ %.1213.us, %237 ], [ %spec.select246.us, %235 ], [ %.1213.us, %226 ]
  %.1211.us = phi i16 [ %238, %237 ], [ %.0210.us, %235 ], [ %.0210.us, %226 ]
  %brmerge249.us = select i1 %209, i1 true, i1 %211
  br i1 %brmerge249.us, label %253, label %240

240:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %29) #8
  %241 = invoke noundef float @_ZNK3JPH4Vec34GetXEv(ptr noundef nonnull align 16 dereferenceable(16) %47)
          to label %242 unwind label %.split321.us

242:                                              ; preds = %240
  %243 = fneg float %241
  %244 = fsub float %204, %208
  %245 = fmul float %244, %9
  %246 = call noundef float @_ZNK3JPH4Vec34GetZEv(ptr noundef nonnull align 16 dereferenceable(16) %47)
  %247 = fneg float %246
  invoke void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %29, float noundef %243, float noundef %245, float noundef %247)
          to label %248 unwind label %.split321.us

248:                                              ; preds = %242
  %.sroa.014.0.copyload.us = load double, ptr %.1205307.us, align 16
  %.sroa.215.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1205307.us, i64 8
  %.sroa.215.0.copyload.us = load double, ptr %.sroa.215.0..sroa_idx.us, align 8, !tbaa !22
  %249 = getelementptr inbounds i8, ptr %.1205307.us, i64 16
  %.sroa.012.0.copyload.us = load double, ptr %249, align 16
  %.sroa.213.0..sroa_idx.us = getelementptr inbounds i8, ptr %.1205307.us, i64 24
  %.sroa.213.0.copyload.us = load double, ptr %.sroa.213.0..sroa_idx.us, align 8, !tbaa !22
  %.sroa.0.0.copyload.us = load double, ptr %29, align 16
  %.sroa.2.0.copyload.us = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !22
  %250 = invoke noundef zeroext i1 @_ZN3JPH11ActiveEdgesL12IsEdgeActiveENS_4Vec3ES1_S1_f(double %.sroa.014.0.copyload.us, double %.sroa.215.0.copyload.us, double %.sroa.012.0.copyload.us, double %.sroa.213.0.copyload.us, double %.sroa.0.0.copyload.us, double %.sroa.2.0.copyload.us, float noundef %10)
          to label %251 unwind label %.split321.us

251:                                              ; preds = %248
  %252 = or i16 %.3215.us, 4
  %spec.select250.us = select i1 %250, i16 %252, i16 %.3215.us
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %29) #8
  br label %253

253:                                              ; preds = %251, %239
  %.5217.us = phi i16 [ %spec.select250.us, %251 ], [ %.3215.us, %239 ]
  %254 = lshr i32 %.1207306.us, 3
  %255 = and i32 %.1207306.us, 7
  %256 = load i32, ptr %51, align 16, !tbaa !38
  %257 = icmp ult i32 %254, %256
  br i1 %257, label %262, label %258

258:                                              ; preds = %253
  %259 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 338)
          to label %260 unwind label %.split324.us

260:                                              ; preds = %258
  br i1 %259, label %261, label %262

261:                                              ; preds = %260
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !39
  br label %262

262:                                              ; preds = %261, %260, %253
  %263 = load ptr, ptr %52, align 16, !tbaa !40
  %264 = zext nneg i32 %254 to i64
  %265 = getelementptr inbounds i8, ptr %263, i64 %264
  %266 = load i16, ptr %265, align 1
  %267 = zext i16 %266 to i32
  %268 = getelementptr inbounds i8, ptr %265, i64 1
  %269 = zext nneg i16 %.1211.us to i32
  %270 = shl nuw nsw i32 %269, %255
  %271 = xor i32 %270, -1
  %272 = and i32 %267, %271
  %273 = zext nneg i16 %.5217.us to i32
  %274 = shl nuw nsw i32 %273, %255
  %275 = or i32 %272, %274
  %276 = trunc i32 %275 to i8
  store i8 %276, ptr %265, align 1, !tbaa !22
  %277 = lshr i32 %275, 8
  %278 = trunc nuw i32 %277 to i8
  store i8 %278, ptr %268, align 1, !tbaa !22
  %279 = getelementptr inbounds i8, ptr %.1205307.us, i64 32
  %280 = add i32 %.1207306.us, 3
  %indvars.iv.next342 = add nuw nsw i64 %indvars.iv341, 1
  %281 = icmp ult i64 %indvars.iv.next342, %191
  br i1 %281, label %199, label %._crit_edge.us314, !llvm.loop !41

._crit_edge.us314:                                ; preds = %262
  %282 = load i32, ptr %50, align 16, !tbaa !25
  %283 = add i32 %.neg, %282
  %284 = mul i32 %283, 3
  %285 = add i32 %284, %280
  %indvars.iv.next345 = add nuw nsw i64 %indvars.iv344, 1
  %286 = icmp ult i64 %indvars.iv.next345, %192
  br i1 %286, label %.lr.ph.us, label %.loopexit, !llvm.loop !42

.split.us316:                                     ; preds = %217, %213
  %287 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #8
  br label %295

.split318.us:                                     ; preds = %232, %229, %227
  %288 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #8
  br label %295

.split321.us:                                     ; preds = %248, %242, %240
  %289 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %29) #8
  br label %295

.split324.us:                                     ; preds = %258
  %290 = landingpad { ptr, i32 }
          cleanup
  br label %295

291:                                              ; preds = %.split291.us, %.split288.us
  %.pn230 = phi { ptr, i32 } [ %173, %.split291.us ], [ %172, %.split288.us ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #8
  br label %292

292:                                              ; preds = %291, %.split285.us
  %.pn230.pn = phi { ptr, i32 } [ %.pn230, %291 ], [ %171, %.split285.us ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #8
  br label %295

293:                                              ; preds = %.split303.us, %.split300.us
  %.pn233 = phi { ptr, i32 } [ %177, %.split303.us ], [ %176, %.split300.us ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #8
  br label %294

294:                                              ; preds = %293, %.split297.us
  %.pn233.pn = phi { ptr, i32 } [ %.pn233, %293 ], [ %175, %.split297.us ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #8
  br label %295

295:                                              ; preds = %.split.us316, %.split318.us, %.split321.us, %.split324.us, %.split.us, %.split279.us, %294, %.split294.us, %.split282.us, %292
  %.pn233.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %169, %.split279.us ], [ %168, %.split.us ], [ %.pn230.pn, %292 ], [ %170, %.split282.us ], [ %.pn233.pn, %294 ], [ %174, %.split294.us ], [ %290, %.split324.us ], [ %289, %.split321.us ], [ %288, %.split318.us ], [ %287, %.split.us316 ]
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %17) #8
  resume { ptr, i32 } %.pn233.pn.pn.pn.pn.pn
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0EC2EOS6_"(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #4 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN3JPH11ActiveEdgesL12IsEdgeActiveENS_4Vec3ES1_S1_f(double, double, double, double, double, double, float noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #4 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.usub.sat.i32(i32, i32) #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"_ZTSZN3JPH16HeightFieldShape20CalculateActiveEdgesEjjjjPKfjjlffRNS_13TempAllocatorEE3$_0", !12, i64 0, !12, i64 8, !6, i64 16}
!15 = !{!14, !6, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !17}
!24 = distinct !{!24, !17}
!25 = !{!26, !6, i64 64}
!26 = !{!"_ZTSN3JPH16HeightFieldShapeE", !27, i64 0, !34, i64 32, !34, i64 48, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !7, i64 84, !7, i64 85, !35, i64 86, !35, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !36, i64 120, !37, i64 144, !6, i64 168}
!27 = !{!"_ZTSN3JPH5ShapeE", !28, i64 8, !31, i64 16, !32, i64 24, !33, i64 25}
!28 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !29, i64 0}
!29 = !{!"_ZTSSt6atomicIjE", !30, i64 0}
!30 = !{!"_ZTSSt13__atomic_baseIjE", !6, i64 0}
!31 = !{!"long", !7, i64 0}
!32 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!33 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!34 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!35 = !{!"short", !7, i64 0}
!36 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !31, i64 0, !31, i64 8, !12, i64 16}
!37 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !31, i64 0, !31, i64 8, !12, i64 16}
!38 = !{!26, !6, i64 80}
!39 = !{i64 2158604958}
!40 = !{!26, !12, i64 112}
!41 = distinct !{!41, !17}
!42 = distinct !{!42, !17}


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