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

%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::ScopeExit.25" = type { %class.anon.26, i8, [7 x i8] }
%class.anon.26 = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.JPH::RefConst" = type { ptr }
%"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::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }
%"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.22 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [66 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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH6SquareIjEET_S1_(i32 noundef) #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 i32 @_ZN3JPH17CountLeadingZerosEj(i32 noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE6resizeEmRKh(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS6_EEEERNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(176) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4 align 2 personality ptr @__gxx_personality_v0 {
  %10 = alloca i1, align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"struct.JPH::AssertLastParam", align 1
  %21 = alloca %"struct.JPH::AssertLastParam", align 1
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca %"class.JPH::ScopeExit.25", align 8
  %25 = alloca %class.anon.26, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca %"class.JPH::RefConst", align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca %"struct.JPH::AssertLastParam", align 1
  %40 = alloca i8, align 1
  %41 = alloca i16, align 2
  %42 = alloca i16, align 2
  %43 = alloca i32, align 4
  %44 = alloca ptr, align 8
  %45 = alloca i32, align 4
  %46 = alloca ptr, align 8
  %47 = alloca i16, align 2
  %48 = alloca i16, align 2
  %49 = alloca i16, align 2
  %50 = alloca i32, align 4
  %51 = alloca ptr, align 8
  %52 = alloca i32, align 4
  %53 = alloca ptr, align 8
  %54 = alloca i32, align 4
  %55 = alloca i16, align 2
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  store i32 %2, ptr %13, align 4, !tbaa !9
  store i32 %3, ptr %14, align 4, !tbaa !9
  store i32 %4, ptr %15, align 4, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !5
  store i64 %6, ptr %17, align 8, !tbaa !11
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  %56 = load ptr, ptr %11, align 8
  %57 = load i32, ptr %14, align 4, !tbaa !9
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %62, label %59

59:                                               ; preds = %9
  %60 = load i32, ptr %15, align 4, !tbaa !9
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %59, %9
  store i1 true, ptr %10, align 1
  br label %585

63:                                               ; preds = %59
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %12, align 4, !tbaa !9
  %66 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 4
  %67 = load i32, ptr %66, align 16, !tbaa !13
  %68 = icmp ult i32 %65, %67
  br i1 %68, label %69, label %74

69:                                               ; preds = %64
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 4
  %72 = load i32, ptr %71, align 16, !tbaa !13
  %73 = icmp ult i32 %70, %72
  br i1 %73, label %77, label %74

74:                                               ; preds = %69, %64
  %75 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.22, ptr noundef @.str.2, i32 noundef 1286)
  br i1 %75, label %76, label %77

76:                                               ; preds = %74
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !25
  br label %77

77:                                               ; preds = %76, %74, %69
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = load i32, ptr %14, align 4, !tbaa !9
  %82 = add i32 %80, %81
  %83 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 4
  %84 = load i32, ptr %83, align 16, !tbaa !13
  %85 = icmp ult i32 %82, %84
  br i1 %85, label %86, label %93

86:                                               ; preds = %79
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = load i32, ptr %15, align 4, !tbaa !9
  %89 = add i32 %87, %88
  %90 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 4
  %91 = load i32, ptr %90, align 16, !tbaa !13
  %92 = icmp ult i32 %89, %91
  br i1 %92, label %96, label %93

93:                                               ; preds = %86, %79
  %94 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.25, ptr noundef @.str.2, i32 noundef 1287)
  br i1 %94, label %95, label %96

95:                                               ; preds = %93
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !26
  br label %96

96:                                               ; preds = %95, %93, %86
  br label %97

97:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %98 = load ptr, ptr %18, align 8, !tbaa !5
  %99 = icmp ne ptr %98, null
  br i1 %99, label %100, label %103

100:                                              ; preds = %97
  %101 = load ptr, ptr %18, align 8, !tbaa !5
  %102 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %101)
  br label %106

103:                                              ; preds = %97
  %104 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %105 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %104)
  br label %106

106:                                              ; preds = %103, %100
  %107 = phi i64 [ %102, %100 ], [ %105, %103 ]
  %108 = trunc i64 %107 to i32
  store i32 %108, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = load i32, ptr %22, align 4, !tbaa !9
  %111 = load ptr, ptr %109, align 8, !tbaa !27
  %112 = getelementptr inbounds ptr, ptr %111, i64 2
  %113 = load ptr, ptr %112, align 8
  %114 = call noundef ptr %113(ptr noundef nonnull align 8 dereferenceable(8) %109, i32 noundef %110)
  store ptr %114, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #5
  %115 = getelementptr inbounds %class.anon.26, ptr %25, i32 0, i32 0
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %116, ptr %115, align 8, !tbaa !5
  %117 = getelementptr inbounds %class.anon.26, ptr %25, i32 0, i32 1
  %118 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %118, ptr %117, align 8, !tbaa !29
  %119 = getelementptr inbounds %class.anon.26, ptr %25, i32 0, i32 2
  %120 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %120, ptr %119, align 8, !tbaa !31
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS7_EEEERNS_13TempAllocatorEE3$_0EC2EOSF_"(ptr noundef nonnull align 8 dereferenceable(25) %24, ptr noundef nonnull align 8 dereferenceable(20) %25)
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #5
  %121 = load ptr, ptr %18, align 8, !tbaa !5
  %122 = icmp ne ptr %121, null
  br i1 %122, label %123, label %246

123:                                              ; preds = %106
  %124 = load ptr, ptr %18, align 8, !tbaa !5
  %125 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %124)
          to label %126 unwind label %137

126:                                              ; preds = %123
  %127 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %128 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %127)
          to label %129 unwind label %137

129:                                              ; preds = %126
  %130 = icmp ugt i64 %125, %128
  br i1 %130, label %131, label %141

131:                                              ; preds = %129
  %132 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %133)
          to label %135 unwind label %137

135:                                              ; preds = %131
  invoke void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %132, i64 noundef %134)
          to label %136 unwind label %137

136:                                              ; preds = %135
  br label %141

137:                                              ; preds = %263, %135, %131, %126, %123
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %26, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %27, align 4
  br label %584

141:                                              ; preds = %136, %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %142 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %142, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %143 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %143, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %144 = load ptr, ptr %29, align 8, !tbaa !5
  %145 = invoke noundef ptr @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %144)
          to label %146 unwind label %155

146:                                              ; preds = %141
  store ptr %145, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %147 = load ptr, ptr %29, align 8, !tbaa !5
  %148 = invoke noundef ptr @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %147)
          to label %149 unwind label %159

149:                                              ; preds = %146
  store ptr %148, ptr %31, align 8, !tbaa !5
  br label %150

150:                                              ; preds = %233, %149
  %151 = load ptr, ptr %30, align 8, !tbaa !5
  %152 = load ptr, ptr %31, align 8, !tbaa !5
  %153 = icmp ne ptr %151, %152
  br i1 %153, label %163, label %154

154:                                              ; preds = %150
  store i32 6, ptr %32, align 4
  br label %238

155:                                              ; preds = %141
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %26, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %27, align 4
  br label %241

159:                                              ; preds = %146
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %26, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %27, align 4
  br label %240

163:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %164 = load ptr, ptr %30, align 8, !tbaa !5
  %165 = invoke noundef ptr @_ZNK3JPH8RefConstINS_15PhysicsMaterialEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %164)
          to label %166 unwind label %191

166:                                              ; preds = %163
  store ptr %165, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  %167 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %168 = invoke noundef ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %167)
          to label %169 unwind label %195

169:                                              ; preds = %166
  %170 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %171 = invoke noundef ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %170)
          to label %172 unwind label %195

172:                                              ; preds = %169
  %173 = invoke noundef ptr @_ZSt4findIPN3JPH8RefConstINS0_15PhysicsMaterialEEEPKS2_ET_S7_S7_RKT0_(ptr noundef %168, ptr noundef %171, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %174 unwind label %195

174:                                              ; preds = %172
  store ptr %173, ptr %34, align 8, !tbaa !5
  %175 = load ptr, ptr %34, align 8, !tbaa !5
  %176 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %177 = invoke noundef ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %176)
          to label %178 unwind label %195

178:                                              ; preds = %174
  %179 = icmp ne ptr %175, %177
  br i1 %179, label %180, label %199

180:                                              ; preds = %178
  %181 = load ptr, ptr %34, align 8, !tbaa !5
  %182 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %183 = invoke noundef ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %182)
          to label %184 unwind label %195

184:                                              ; preds = %180
  %185 = ptrtoint ptr %181 to i64
  %186 = ptrtoint ptr %183 to i64
  %187 = sub i64 %185, %186
  %188 = sdiv exact i64 %187, 8
  %189 = trunc i64 %188 to i8
  %190 = load ptr, ptr %28, align 8, !tbaa !5
  store i8 %189, ptr %190, align 1, !tbaa !32
  br label %224

191:                                              ; preds = %163
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %26, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %27, align 4
  br label %237

195:                                              ; preds = %205, %199, %180, %174, %172, %169, %166
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %26, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %27, align 4
  br label %236

199:                                              ; preds = %178
  %200 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %201 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %200)
          to label %202 unwind label %195

202:                                              ; preds = %199
  %203 = icmp uge i64 %201, 256
  br i1 %203, label %204, label %205

204:                                              ; preds = %202
  store i1 false, ptr %10, align 1
  store i32 1, ptr %32, align 4
  br label %227

205:                                              ; preds = %202
  %206 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %207 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %206)
          to label %208 unwind label %195

208:                                              ; preds = %205
  %209 = trunc i64 %207 to i8
  %210 = load ptr, ptr %28, align 8, !tbaa !5
  store i8 %209, ptr %210, align 1, !tbaa !32
  %211 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %212 = load ptr, ptr %33, align 8, !tbaa !5
  invoke void @_ZN3JPH8RefConstINS_15PhysicsMaterialEEC2EPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef %212)
          to label %213 unwind label %215

213:                                              ; preds = %208
  invoke void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %211, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %214 unwind label %219

214:                                              ; preds = %213
  call void @_ZN3JPH8RefConstINS_15PhysicsMaterialEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br label %224

215:                                              ; preds = %208
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %26, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %27, align 4
  br label %223

219:                                              ; preds = %213
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %26, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %27, align 4
  call void @_ZN3JPH8RefConstINS_15PhysicsMaterialEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %35) #5
  br label %223

223:                                              ; preds = %219, %215
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br label %236

224:                                              ; preds = %214, %184
  %225 = load ptr, ptr %28, align 8, !tbaa !5
  %226 = getelementptr inbounds i8, ptr %225, i32 1
  store ptr %226, ptr %28, align 8, !tbaa !5
  store i32 0, ptr %32, align 4
  br label %227

227:                                              ; preds = %224, %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  %228 = load i32, ptr %32, align 4
  switch i32 %228, label %230 [
    i32 0, label %229
  ]

229:                                              ; preds = %227
  store i32 0, ptr %32, align 4
  br label %230

230:                                              ; preds = %229, %227
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  %231 = load i32, ptr %32, align 4
  switch i32 %231, label %238 [
    i32 0, label %232
  ]

232:                                              ; preds = %230
  br label %233

233:                                              ; preds = %232
  %234 = load ptr, ptr %30, align 8, !tbaa !5
  %235 = getelementptr inbounds %"class.JPH::RefConst", ptr %234, i32 1
  store ptr %235, ptr %30, align 8, !tbaa !5
  br label %150

236:                                              ; preds = %223, %195
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  br label %237

237:                                              ; preds = %236, %191
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  br label %240

238:                                              ; preds = %230, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  %239 = load i32, ptr %32, align 4
  switch i32 %239, label %243 [
    i32 6, label %242
  ]

240:                                              ; preds = %237, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %241

241:                                              ; preds = %240, %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %584

242:                                              ; preds = %238
  store i32 0, ptr %32, align 4
  br label %243

243:                                              ; preds = %242, %238
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  %244 = load i32, ptr %32, align 4
  switch i32 %244, label %583 [
    i32 0, label %245
  ]

245:                                              ; preds = %243
  br label %263

246:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #5
  store i32 0, ptr %36, align 4, !tbaa !9
  br label %247

247:                                              ; preds = %259, %246
  %248 = load i32, ptr %36, align 4, !tbaa !9
  %249 = load i32, ptr %22, align 4, !tbaa !9
  %250 = icmp ult i32 %248, %249
  br i1 %250, label %252, label %251

251:                                              ; preds = %247
  store i32 8, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  br label %262

252:                                              ; preds = %247
  %253 = load i32, ptr %36, align 4, !tbaa !9
  %254 = trunc i32 %253 to i8
  %255 = load ptr, ptr %23, align 8, !tbaa !5
  %256 = load i32, ptr %36, align 4, !tbaa !9
  %257 = zext i32 %256 to i64
  %258 = getelementptr inbounds i8, ptr %255, i64 %257
  store i8 %254, ptr %258, align 1, !tbaa !32
  br label %259

259:                                              ; preds = %252
  %260 = load i32, ptr %36, align 4, !tbaa !9
  %261 = add i32 %260, 1
  store i32 %261, ptr %36, align 4, !tbaa !9
  br label %247, !llvm.loop !33

262:                                              ; preds = %251
  br label %263

263:                                              ; preds = %262, %245
  %264 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %265 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %264)
          to label %266 unwind label %137

266:                                              ; preds = %263
  %267 = icmp eq i64 %265, 1
  br i1 %267, label %268, label %269

268:                                              ; preds = %266
  store i1 true, ptr %10, align 1
  store i32 1, ptr %32, align 4
  br label %583

269:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #5
  %270 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 4
  %271 = load i32, ptr %270, align 16, !tbaa !13
  %272 = sub i32 %271, 1
  store i32 %272, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #5
  %273 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 17
  %274 = invoke noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %273)
          to label %275 unwind label %292

275:                                              ; preds = %269
  %276 = trunc i64 %274 to i32
  %277 = sub i32 %276, 1
  %278 = invoke noundef i32 @_ZN3JPH17CountLeadingZerosEj(i32 noundef %277)
          to label %279 unwind label %292

279:                                              ; preds = %275
  %280 = sub i32 32, %278
  store i32 %280, ptr %38, align 4, !tbaa !9
  br label %281

281:                                              ; preds = %279
  %282 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  %283 = load i32, ptr %282, align 8, !tbaa !35
  %284 = icmp ule i32 %283, 8
  br i1 %284, label %285, label %288

285:                                              ; preds = %281
  %286 = load i32, ptr %38, align 4, !tbaa !9
  %287 = icmp ule i32 %286, 8
  br i1 %287, label %296, label %288

288:                                              ; preds = %285, %281
  %289 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.26, ptr noundef @.str.2, i32 noundef 1340)
          to label %290 unwind label %292

290:                                              ; preds = %288
  br i1 %289, label %291, label %296

291:                                              ; preds = %290
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !36
  br label %296

292:                                              ; preds = %303, %288, %275, %269
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %26, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %27, align 4
  br label %582

296:                                              ; preds = %291, %290, %285
  br label %297

297:                                              ; preds = %296
  br label %298

298:                                              ; preds = %297
  %299 = load i32, ptr %38, align 4, !tbaa !9
  %300 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  %301 = load i32, ptr %300, align 8, !tbaa !35
  %302 = icmp ugt i32 %299, %301
  br i1 %302, label %303, label %467

303:                                              ; preds = %298
  %304 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 18
  %305 = load i32, ptr %37, align 4, !tbaa !9
  %306 = invoke noundef i32 @_ZN3JPH6SquareIjEET_S1_(i32 noundef %305)
          to label %307 unwind label %292

307:                                              ; preds = %303
  %308 = load i32, ptr %38, align 4, !tbaa !9
  %309 = mul i32 %306, %308
  %310 = add i32 %309, 7
  %311 = lshr i32 %310, 3
  %312 = add i32 %311, 1
  %313 = zext i32 %312 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %40) #5
  store i8 0, ptr %40, align 1, !tbaa !32
  invoke void @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE6resizeEmRKh(ptr noundef nonnull align 8 dereferenceable(24) %304, i64 noundef %313, ptr noundef nonnull align 1 dereferenceable(1) %40)
          to label %314 unwind label %451

314:                                              ; preds = %307
  call void @llvm.lifetime.end.p0(i64 1, ptr %40) #5
  call void @llvm.lifetime.start.p0(i64 2, ptr %41) #5
  %315 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  %316 = load i32, ptr %315, align 8, !tbaa !35
  %317 = shl i32 1, %316
  %318 = sub nsw i32 %317, 1
  %319 = trunc i32 %318 to i16
  store i16 %319, ptr %41, align 2, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 2, ptr %42) #5
  %320 = load i32, ptr %38, align 4, !tbaa !9
  %321 = shl i32 1, %320
  %322 = sub nsw i32 %321, 1
  %323 = trunc i32 %322 to i16
  store i16 %323, ptr %42, align 2, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #5
  %324 = load i32, ptr %37, align 4, !tbaa !9
  %325 = load i32, ptr %37, align 4, !tbaa !9
  %326 = mul i32 %324, %325
  %327 = sub i32 %326, 1
  %328 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  %329 = load i32, ptr %328, align 8, !tbaa !35
  %330 = mul i32 %327, %329
  store i32 %330, ptr %43, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #5
  %331 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 18
  %332 = invoke noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %331)
          to label %333 unwind label %455

333:                                              ; preds = %314
  %334 = load i32, ptr %43, align 4, !tbaa !9
  %335 = ashr i32 %334, 3
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds i8, ptr %332, i64 %336
  store ptr %337, ptr %44, align 8, !tbaa !5
  %338 = load i32, ptr %43, align 4, !tbaa !9
  %339 = and i32 %338, 7
  store i32 %339, ptr %43, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #5
  %340 = load i32, ptr %37, align 4, !tbaa !9
  %341 = load i32, ptr %37, align 4, !tbaa !9
  %342 = mul i32 %340, %341
  %343 = sub i32 %342, 1
  %344 = load i32, ptr %38, align 4, !tbaa !9
  %345 = mul i32 %343, %344
  store i32 %345, ptr %45, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #5
  %346 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 18
  %347 = invoke noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %346)
          to label %348 unwind label %459

348:                                              ; preds = %333
  %349 = load i32, ptr %45, align 4, !tbaa !9
  %350 = ashr i32 %349, 3
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds i8, ptr %347, i64 %351
  store ptr %352, ptr %46, align 8, !tbaa !5
  %353 = load i32, ptr %45, align 4, !tbaa !9
  %354 = and i32 %353, 7
  store i32 %354, ptr %45, align 4, !tbaa !9
  br label %355

355:                                              ; preds = %361, %348
  %356 = load ptr, ptr %46, align 8, !tbaa !5
  %357 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 18
  %358 = invoke noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %357)
          to label %359 unwind label %459

359:                                              ; preds = %355
  %360 = icmp uge ptr %356, %358
  br i1 %360, label %361, label %463

361:                                              ; preds = %359
  call void @llvm.lifetime.start.p0(i64 2, ptr %47) #5
  %362 = load ptr, ptr %44, align 8, !tbaa !5
  %363 = getelementptr inbounds i8, ptr %362, i64 0
  %364 = load i8, ptr %363, align 1, !tbaa !32
  %365 = zext i8 %364 to i16
  %366 = zext i16 %365 to i32
  %367 = load ptr, ptr %44, align 8, !tbaa !5
  %368 = getelementptr inbounds i8, ptr %367, i64 1
  %369 = load i8, ptr %368, align 1, !tbaa !32
  %370 = zext i8 %369 to i16
  %371 = zext i16 %370 to i32
  %372 = shl i32 %371, 8
  %373 = trunc i32 %372 to i16
  %374 = zext i16 %373 to i32
  %375 = add nsw i32 %366, %374
  %376 = trunc i32 %375 to i16
  store i16 %376, ptr %47, align 2, !tbaa !37
  %377 = load i32, ptr %43, align 4, !tbaa !9
  %378 = load i16, ptr %47, align 2, !tbaa !37
  %379 = zext i16 %378 to i32
  %380 = ashr i32 %379, %377
  %381 = trunc i32 %380 to i16
  store i16 %381, ptr %47, align 2, !tbaa !37
  %382 = load i16, ptr %41, align 2, !tbaa !37
  %383 = zext i16 %382 to i32
  %384 = load i16, ptr %47, align 2, !tbaa !37
  %385 = zext i16 %384 to i32
  %386 = and i32 %385, %383
  %387 = trunc i32 %386 to i16
  store i16 %387, ptr %47, align 2, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 2, ptr %48) #5
  %388 = load ptr, ptr %46, align 8, !tbaa !5
  %389 = getelementptr inbounds i8, ptr %388, i64 0
  %390 = load i8, ptr %389, align 1, !tbaa !32
  %391 = zext i8 %390 to i16
  %392 = zext i16 %391 to i32
  %393 = load ptr, ptr %46, align 8, !tbaa !5
  %394 = getelementptr inbounds i8, ptr %393, i64 1
  %395 = load i8, ptr %394, align 1, !tbaa !32
  %396 = zext i8 %395 to i16
  %397 = zext i16 %396 to i32
  %398 = shl i32 %397, 8
  %399 = trunc i32 %398 to i16
  %400 = zext i16 %399 to i32
  %401 = add nsw i32 %392, %400
  %402 = trunc i32 %401 to i16
  store i16 %402, ptr %48, align 2, !tbaa !37
  %403 = load i16, ptr %42, align 2, !tbaa !37
  %404 = zext i16 %403 to i32
  %405 = load i32, ptr %45, align 4, !tbaa !9
  %406 = shl i32 %404, %405
  %407 = xor i32 %406, -1
  %408 = load i16, ptr %48, align 2, !tbaa !37
  %409 = zext i16 %408 to i32
  %410 = and i32 %409, %407
  %411 = trunc i32 %410 to i16
  store i16 %411, ptr %48, align 2, !tbaa !37
  %412 = load i16, ptr %47, align 2, !tbaa !37
  %413 = zext i16 %412 to i32
  %414 = load i32, ptr %45, align 4, !tbaa !9
  %415 = shl i32 %413, %414
  %416 = load i16, ptr %48, align 2, !tbaa !37
  %417 = zext i16 %416 to i32
  %418 = or i32 %417, %415
  %419 = trunc i32 %418 to i16
  store i16 %419, ptr %48, align 2, !tbaa !37
  %420 = load i16, ptr %48, align 2, !tbaa !37
  %421 = trunc i16 %420 to i8
  %422 = load ptr, ptr %46, align 8, !tbaa !5
  %423 = getelementptr inbounds i8, ptr %422, i64 0
  store i8 %421, ptr %423, align 1, !tbaa !32
  %424 = load i16, ptr %48, align 2, !tbaa !37
  %425 = zext i16 %424 to i32
  %426 = ashr i32 %425, 8
  %427 = trunc i32 %426 to i8
  %428 = load ptr, ptr %46, align 8, !tbaa !5
  %429 = getelementptr inbounds i8, ptr %428, i64 1
  store i8 %427, ptr %429, align 1, !tbaa !32
  %430 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  %431 = load i32, ptr %430, align 8, !tbaa !35
  %432 = load i32, ptr %43, align 4, !tbaa !9
  %433 = sub nsw i32 %432, %431
  store i32 %433, ptr %43, align 4, !tbaa !9
  %434 = load i32, ptr %43, align 4, !tbaa !9
  %435 = ashr i32 %434, 3
  %436 = load ptr, ptr %44, align 8, !tbaa !5
  %437 = sext i32 %435 to i64
  %438 = getelementptr inbounds i8, ptr %436, i64 %437
  store ptr %438, ptr %44, align 8, !tbaa !5
  %439 = load i32, ptr %43, align 4, !tbaa !9
  %440 = and i32 %439, 7
  store i32 %440, ptr %43, align 4, !tbaa !9
  %441 = load i32, ptr %38, align 4, !tbaa !9
  %442 = load i32, ptr %45, align 4, !tbaa !9
  %443 = sub nsw i32 %442, %441
  store i32 %443, ptr %45, align 4, !tbaa !9
  %444 = load i32, ptr %45, align 4, !tbaa !9
  %445 = ashr i32 %444, 3
  %446 = load ptr, ptr %46, align 8, !tbaa !5
  %447 = sext i32 %445 to i64
  %448 = getelementptr inbounds i8, ptr %446, i64 %447
  store ptr %448, ptr %46, align 8, !tbaa !5
  %449 = load i32, ptr %45, align 4, !tbaa !9
  %450 = and i32 %449, 7
  store i32 %450, ptr %45, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %48) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %47) #5
  br label %355, !llvm.loop !38

451:                                              ; preds = %307
  %452 = landingpad { ptr, i32 }
          cleanup
  %453 = extractvalue { ptr, i32 } %452, 0
  store ptr %453, ptr %26, align 8
  %454 = extractvalue { ptr, i32 } %452, 1
  store i32 %454, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %40) #5
  br label %582

455:                                              ; preds = %314
  %456 = landingpad { ptr, i32 }
          cleanup
  %457 = extractvalue { ptr, i32 } %456, 0
  store ptr %457, ptr %26, align 8
  %458 = extractvalue { ptr, i32 } %456, 1
  store i32 %458, ptr %27, align 4
  br label %466

459:                                              ; preds = %355, %333
  %460 = landingpad { ptr, i32 }
          cleanup
  %461 = extractvalue { ptr, i32 } %460, 0
  store ptr %461, ptr %26, align 8
  %462 = extractvalue { ptr, i32 } %460, 1
  store i32 %462, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #5
  br label %466

463:                                              ; preds = %359
  %464 = load i32, ptr %38, align 4, !tbaa !9
  %465 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  store i32 %464, ptr %465, align 8, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %42) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %41) #5
  br label %467

466:                                              ; preds = %459, %455
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %42) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %41) #5
  br label %582

467:                                              ; preds = %463, %298
  call void @llvm.lifetime.start.p0(i64 2, ptr %49) #5
  %468 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  %469 = load i32, ptr %468, align 8, !tbaa !35
  %470 = shl i32 1, %469
  %471 = sub nsw i32 %470, 1
  %472 = trunc i32 %471 to i16
  store i16 %472, ptr %49, align 2, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #5
  store i32 0, ptr %50, align 4, !tbaa !9
  br label %473

473:                                              ; preds = %578, %467
  %474 = load i32, ptr %50, align 4, !tbaa !9
  %475 = load i32, ptr %15, align 4, !tbaa !9
  %476 = icmp ult i32 %474, %475
  br i1 %476, label %478, label %477

477:                                              ; preds = %473
  store i32 15, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #5
  br label %581

478:                                              ; preds = %473
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #5
  %479 = load ptr, ptr %16, align 8, !tbaa !5
  %480 = load i32, ptr %50, align 4, !tbaa !9
  %481 = zext i32 %480 to i64
  %482 = load i64, ptr %17, align 8, !tbaa !11
  %483 = mul nsw i64 %481, %482
  %484 = getelementptr inbounds i8, ptr %479, i64 %483
  store ptr %484, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #5
  %485 = load i32, ptr %12, align 4, !tbaa !9
  %486 = load i32, ptr %13, align 4, !tbaa !9
  %487 = load i32, ptr %50, align 4, !tbaa !9
  %488 = add i32 %486, %487
  %489 = load i32, ptr %37, align 4, !tbaa !9
  %490 = mul i32 %488, %489
  %491 = add i32 %485, %490
  %492 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  %493 = load i32, ptr %492, align 8, !tbaa !35
  %494 = mul i32 %491, %493
  store i32 %494, ptr %52, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #5
  %495 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 18
  %496 = invoke noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %495)
          to label %497 unwind label %509

497:                                              ; preds = %478
  %498 = load i32, ptr %52, align 4, !tbaa !9
  %499 = lshr i32 %498, 3
  %500 = zext i32 %499 to i64
  %501 = getelementptr inbounds i8, ptr %496, i64 %500
  store ptr %501, ptr %53, align 8, !tbaa !5
  %502 = load i32, ptr %52, align 4, !tbaa !9
  %503 = and i32 %502, 7
  store i32 %503, ptr %52, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #5
  store i32 0, ptr %54, align 4, !tbaa !9
  br label %504

504:                                              ; preds = %574, %497
  %505 = load i32, ptr %54, align 4, !tbaa !9
  %506 = load i32, ptr %14, align 4, !tbaa !9
  %507 = icmp ult i32 %505, %506
  br i1 %507, label %513, label %508

508:                                              ; preds = %504
  store i32 18, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #5
  br label %577

509:                                              ; preds = %478
  %510 = landingpad { ptr, i32 }
          cleanup
  %511 = extractvalue { ptr, i32 } %510, 0
  store ptr %511, ptr %26, align 8
  %512 = extractvalue { ptr, i32 } %510, 1
  store i32 %512, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %49) #5
  br label %582

513:                                              ; preds = %504
  call void @llvm.lifetime.start.p0(i64 2, ptr %55) #5
  %514 = load ptr, ptr %53, align 8, !tbaa !5
  %515 = getelementptr inbounds i8, ptr %514, i64 0
  %516 = load i8, ptr %515, align 1, !tbaa !32
  %517 = zext i8 %516 to i16
  %518 = zext i16 %517 to i32
  %519 = load ptr, ptr %53, align 8, !tbaa !5
  %520 = getelementptr inbounds i8, ptr %519, i64 1
  %521 = load i8, ptr %520, align 1, !tbaa !32
  %522 = zext i8 %521 to i16
  %523 = zext i16 %522 to i32
  %524 = shl i32 %523, 8
  %525 = trunc i32 %524 to i16
  %526 = zext i16 %525 to i32
  %527 = add nsw i32 %518, %526
  %528 = trunc i32 %527 to i16
  store i16 %528, ptr %55, align 2, !tbaa !37
  %529 = load i16, ptr %49, align 2, !tbaa !37
  %530 = zext i16 %529 to i32
  %531 = load i32, ptr %52, align 4, !tbaa !9
  %532 = shl i32 %530, %531
  %533 = xor i32 %532, -1
  %534 = load i16, ptr %55, align 2, !tbaa !37
  %535 = zext i16 %534 to i32
  %536 = and i32 %535, %533
  %537 = trunc i32 %536 to i16
  store i16 %537, ptr %55, align 2, !tbaa !37
  %538 = load ptr, ptr %23, align 8, !tbaa !5
  %539 = load ptr, ptr %51, align 8, !tbaa !5
  %540 = load i8, ptr %539, align 1, !tbaa !32
  %541 = zext i8 %540 to i64
  %542 = getelementptr inbounds i8, ptr %538, i64 %541
  %543 = load i8, ptr %542, align 1, !tbaa !32
  %544 = zext i8 %543 to i32
  %545 = load i32, ptr %52, align 4, !tbaa !9
  %546 = shl i32 %544, %545
  %547 = load i16, ptr %55, align 2, !tbaa !37
  %548 = zext i16 %547 to i32
  %549 = or i32 %548, %546
  %550 = trunc i32 %549 to i16
  store i16 %550, ptr %55, align 2, !tbaa !37
  %551 = load i16, ptr %55, align 2, !tbaa !37
  %552 = trunc i16 %551 to i8
  %553 = load ptr, ptr %53, align 8, !tbaa !5
  %554 = getelementptr inbounds i8, ptr %553, i64 0
  store i8 %552, ptr %554, align 1, !tbaa !32
  %555 = load i16, ptr %55, align 2, !tbaa !37
  %556 = zext i16 %555 to i32
  %557 = ashr i32 %556, 8
  %558 = trunc i32 %557 to i8
  %559 = load ptr, ptr %53, align 8, !tbaa !5
  %560 = getelementptr inbounds i8, ptr %559, i64 1
  store i8 %558, ptr %560, align 1, !tbaa !32
  %561 = load ptr, ptr %51, align 8, !tbaa !5
  %562 = getelementptr inbounds i8, ptr %561, i32 1
  store ptr %562, ptr %51, align 8, !tbaa !5
  %563 = getelementptr inbounds %"class.JPH::HeightFieldShape", ptr %56, i32 0, i32 19
  %564 = load i32, ptr %563, align 8, !tbaa !35
  %565 = load i32, ptr %52, align 4, !tbaa !9
  %566 = add i32 %565, %564
  store i32 %566, ptr %52, align 4, !tbaa !9
  %567 = load i32, ptr %52, align 4, !tbaa !9
  %568 = lshr i32 %567, 3
  %569 = load ptr, ptr %53, align 8, !tbaa !5
  %570 = zext i32 %568 to i64
  %571 = getelementptr inbounds i8, ptr %569, i64 %570
  store ptr %571, ptr %53, align 8, !tbaa !5
  %572 = load i32, ptr %52, align 4, !tbaa !9
  %573 = and i32 %572, 7
  store i32 %573, ptr %52, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %55) #5
  br label %574

574:                                              ; preds = %513
  %575 = load i32, ptr %54, align 4, !tbaa !9
  %576 = add i32 %575, 1
  store i32 %576, ptr %54, align 4, !tbaa !9
  br label %504, !llvm.loop !39

577:                                              ; preds = %508
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #5
  br label %578

578:                                              ; preds = %577
  %579 = load i32, ptr %50, align 4, !tbaa !9
  %580 = add i32 %579, 1
  store i32 %580, ptr %50, align 4, !tbaa !9
  br label %473, !llvm.loop !40

581:                                              ; preds = %477
  store i1 true, ptr %10, align 1
  store i32 1, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %49) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  br label %583

582:                                              ; preds = %509, %466, %451, %292
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  br label %584

583:                                              ; preds = %581, %268, %243
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS7_EEEERNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %24) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %585

584:                                              ; preds = %582, %241, %137
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS7_EEEERNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %24) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %587

585:                                              ; preds = %583, %62
  %586 = load i1, ptr %10, align 1
  ret i1 %586

587:                                              ; preds = %584
  %588 = load ptr, ptr %26, align 8
  %589 = load i32, ptr %27, align 4
  %590 = insertvalue { ptr, i32 } poison, ptr %588, 0
  %591 = insertvalue { ptr, i32 } %590, i32 %589, 1
  resume { ptr, i32 } %591
}

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !10, i64 64}
!14 = !{!"_ZTSN3JPH16HeightFieldShapeE", !15, i64 0, !21, i64 32, !21, i64 48, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !7, i64 84, !7, i64 85, !22, i64 86, !22, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !23, i64 120, !24, i64 144, !10, i64 168}
!15 = !{!"_ZTSN3JPH5ShapeE", !16, i64 8, !12, i64 16, !19, i64 24, !20, i64 25}
!16 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !17, i64 0}
!17 = !{!"_ZTSSt6atomicIjE", !18, i64 0}
!18 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!19 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!20 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!21 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = !{!"_ZTSN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEE", !12, i64 0, !12, i64 8, !6, i64 16}
!24 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !12, i64 0, !12, i64 8, !6, i64 16}
!25 = !{i64 2158619245}
!26 = !{i64 2158619676}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !8, i64 0}
!29 = !{!30, !6, i64 8}
!30 = !{!"_ZTSZN3JPH16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS6_EEEERNS_13TempAllocatorEE3$_0", !6, i64 0, !6, i64 8, !10, i64 16}
!31 = !{!30, !10, i64 16}
!32 = !{!7, !7, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!14, !10, i64 168}
!36 = !{i64 2158620376}
!37 = !{!22, !22, i64 0}
!38 = distinct !{!38, !34}
!39 = distinct !{!39, !34}
!40 = distinct !{!40, !34}


; 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.25" = type { %class.anon.26, i8, [7 x i8] }
%class.anon.26 = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.JPH::RefConst" = type { ptr }

@.str.2 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [66 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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH6SquareIjEET_S1_(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH17CountLeadingZerosEj(i32 noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS6_EEEERNS_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, i64 noundef %6, ptr noundef %7, ptr noundef nonnull align 8 dereferenceable(8) %8) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %10 = alloca %"class.JPH::ScopeExit.25", align 8
  %11 = alloca %class.anon.26, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.JPH::RefConst", align 8
  %14 = alloca i8, align 1
  %15 = icmp eq i32 %3, 0
  %16 = icmp eq i32 %4, 0
  %or.cond = or i1 %15, %16
  br i1 %or.cond, label %214, label %17

17:                                               ; preds = %9
  %18 = getelementptr inbounds i8, ptr %0, i64 64
  %19 = load i32, ptr %18, align 16, !tbaa !5
  %20 = icmp ugt i32 %19, %1
  %21 = icmp ugt i32 %19, %2
  %or.cond168 = and i1 %20, %21
  br i1 %or.cond168, label %25, label %22

22:                                               ; preds = %17
  %23 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.2, i32 noundef 1286)
  br i1 %23, label %24, label %25

24:                                               ; preds = %22
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !22
  br label %25

25:                                               ; preds = %17, %24, %22
  %26 = add i32 %3, %1
  %27 = load i32, ptr %18, align 16, !tbaa !5
  %28 = icmp ult i32 %26, %27
  %29 = add i32 %4, %2
  %30 = icmp ult i32 %29, %27
  %or.cond170 = and i1 %28, %30
  br i1 %or.cond170, label %34, label %31

31:                                               ; preds = %25
  %32 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.2, i32 noundef 1287)
  br i1 %32, label %33, label %34

33:                                               ; preds = %31
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !23
  br label %34

34:                                               ; preds = %25, %31, %33
  %.not = icmp eq ptr %7, null
  %35 = getelementptr inbounds i8, ptr %0, i64 120
  %.sink = select i1 %.not, ptr %35, ptr %7
  %36 = tail call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %.sink)
  %37 = trunc i64 %36 to i32
  %38 = load ptr, ptr %8, align 8, !tbaa !24
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = load ptr, ptr %39, align 8
  %41 = tail call noundef ptr %40(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef %37)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  store ptr %8, ptr %11, align 8, !tbaa !26
  %42 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %41, ptr %42, align 8, !tbaa !27
  %43 = getelementptr inbounds i8, ptr %11, i64 16
  store i32 %37, ptr %43, align 8, !tbaa !29
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS7_EEEERNS_13TempAllocatorEE3$_0EC2EOSF_"(ptr noundef nonnull align 8 dereferenceable(25) %10, ptr noundef nonnull align 8 dereferenceable(20) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  br i1 %.not, label %.preheader, label %49

.preheader:                                       ; preds = %34
  %.not196 = icmp eq i32 %37, 0
  br i1 %.not196, label %.critedge, label %iter.check

iter.check:                                       ; preds = %.preheader
  %wide.trip.count = and i64 %36, 4294967295
  %min.iters.check = icmp ult i64 %wide.trip.count, 8
  br i1 %min.iters.check, label %.lr.ph179.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check211 = icmp ult i64 %wide.trip.count, 16
  br i1 %min.iters.check211, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.mod.vf = and i64 %36, 15
  %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <16 x i8> [ <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %44 = getelementptr inbounds i8, ptr %41, i64 %index
  store <16 x i8> %vec.ind, ptr %44, align 1, !tbaa !30
  %index.next = add nuw i64 %index, 16
  %vec.ind.next = add <16 x i8> %vec.ind, <i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16>
  %45 = icmp eq i64 %index.next, %n.vec
  br i1 %45, label %middle.block, label %vector.body, !llvm.loop !31

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br i1 %cmp.n, label %.critedge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8
  br i1 %min.epilog.iters.check, label %.lr.ph179.preheader, label %vec.epilog.ph

.lr.ph179.preheader:                              ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec213, %vec.epilog.middle.block ]
  br label %.lr.ph179

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.mod.vf212 = and i64 %36, 7
  %n.vec213 = sub nsw i64 %wide.trip.count, %n.mod.vf212
  %46 = trunc i64 %vec.epilog.resume.val to i8
  %.splatinsert = insertelement <8 x i8> poison, i8 %46, i64 0
  %.splat = shufflevector <8 x i8> %.splatinsert, <8 x i8> poison, <8 x i32> zeroinitializer
  %induction = add <8 x i8> %.splat, <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7>
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index215 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next218, %vec.epilog.vector.body ]
  %vec.ind216 = phi <8 x i8> [ %induction, %vec.epilog.ph ], [ %vec.ind.next217, %vec.epilog.vector.body ]
  %47 = getelementptr inbounds i8, ptr %41, i64 %index215
  store <8 x i8> %vec.ind216, ptr %47, align 1, !tbaa !30
  %index.next218 = add nuw i64 %index215, 8
  %vec.ind.next217 = add <8 x i8> %vec.ind216, <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>
  %48 = icmp eq i64 %index.next218, %n.vec213
  br i1 %48, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !35

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n219 = icmp eq i64 %n.mod.vf212, 0
  br i1 %cmp.n219, label %.critedge, label %.lr.ph179.preheader

49:                                               ; preds = %34
  %50 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %51 = getelementptr inbounds i8, ptr %0, i64 120
  %52 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %53 = icmp ugt i64 %50, %52
  br i1 %53, label %54, label %58

54:                                               ; preds = %49
  %55 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  invoke void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %55)
          to label %58 unwind label %56

56:                                               ; preds = %54
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %213

58:                                               ; preds = %54, %49
  %59 = call noundef ptr @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %60 = call noundef ptr @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %.not158175 = icmp eq ptr %59, %60
  br i1 %.not158175, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %58, %90
  %.0140177 = phi ptr [ %91, %90 ], [ %41, %58 ]
  %.0146176 = phi ptr [ %92, %90 ], [ %59, %58 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %61 = call noundef ptr @_ZNK3JPH8RefConstINS_15PhysicsMaterialEEcvPKS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %.0146176)
  store ptr %61, ptr %12, align 8, !tbaa !26
  %62 = call noundef ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %63 = call noundef ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %64 = invoke noundef ptr @_ZSt4findIPN3JPH8RefConstINS0_15PhysicsMaterialEEEPKS2_ET_S7_S7_RKT0_(ptr noundef %62, ptr noundef %63, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %65 unwind label %74

65:                                               ; preds = %.lr.ph
  %66 = call noundef ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %.not159 = icmp eq ptr %64, %66
  br i1 %.not159, label %76, label %67

67:                                               ; preds = %65
  %68 = call noundef ptr @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %69 = ptrtoint ptr %64 to i64
  %70 = ptrtoint ptr %68 to i64
  %71 = sub i64 %69, %70
  %72 = lshr exact i64 %71, 3
  %73 = trunc i64 %72 to i8
  store i8 %73, ptr %.0140177, align 1, !tbaa !30
  br label %90

74:                                               ; preds = %.lr.ph
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %93

76:                                               ; preds = %65
  %77 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %78 = icmp ugt i64 %77, 255
  br i1 %78, label %94, label %79

79:                                               ; preds = %76
  %80 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %81 = trunc i64 %80 to i8
  store i8 %81, ptr %.0140177, align 1, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %82 = load ptr, ptr %12, align 8, !tbaa !26
  invoke void @_ZN3JPH8RefConstINS_15PhysicsMaterialEEC2EPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %82)
          to label %83 unwind label %85

83:                                               ; preds = %79
  invoke void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %84 unwind label %87

84:                                               ; preds = %83
  call void @_ZN3JPH8RefConstINS_15PhysicsMaterialEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %90

85:                                               ; preds = %79
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %89

87:                                               ; preds = %83
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH8RefConstINS_15PhysicsMaterialEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br label %89

89:                                               ; preds = %87, %85
  %.pn = phi { ptr, i32 } [ %88, %87 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %93

90:                                               ; preds = %67, %84
  %91 = getelementptr inbounds i8, ptr %.0140177, i64 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %92 = getelementptr inbounds i8, ptr %.0146176, i64 8
  %.not158 = icmp eq ptr %92, %60
  br i1 %.not158, label %.critedge, label %.lr.ph

93:                                               ; preds = %89, %74
  %.pn.pn = phi { ptr, i32 } [ %.pn, %89 ], [ %75, %74 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br label %213

94:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br label %.loopexit

.lr.ph179:                                        ; preds = %.lr.ph179.preheader, %.lr.ph179
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph179 ], [ %indvars.iv.ph, %.lr.ph179.preheader ]
  %95 = trunc i64 %indvars.iv to i8
  %96 = getelementptr inbounds i8, ptr %41, i64 %indvars.iv
  store i8 %95, ptr %96, align 1, !tbaa !30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph179, !llvm.loop !36

.critedge:                                        ; preds = %90, %.lr.ph179, %middle.block, %vec.epilog.middle.block, %58, %.preheader
  %97 = getelementptr inbounds i8, ptr %0, i64 120
  %98 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %97)
  %99 = icmp eq i64 %98, 1
  br i1 %99, label %.loopexit, label %100

100:                                              ; preds = %.critedge
  %101 = load i32, ptr %18, align 16, !tbaa !5
  %102 = add i32 %101, -1
  %103 = call noundef i64 @_ZNK3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %97)
  %104 = trunc i64 %103 to i32
  %105 = add i32 %104, -1
  %106 = call noundef i32 @_ZN3JPH17CountLeadingZerosEj(i32 noundef %105)
  %107 = sub i32 32, %106
  %108 = getelementptr inbounds i8, ptr %0, i64 168
  %109 = load i32, ptr %108, align 8, !tbaa !37
  %110 = icmp ult i32 %109, 9
  %111 = icmp ult i32 %107, 9
  %or.cond7 = and i1 %110, %111
  br i1 %or.cond7, label %118, label %112

112:                                              ; preds = %100
  %113 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.2, i32 noundef 1340)
          to label %114 unwind label %116

114:                                              ; preds = %112
  br i1 %113, label %115, label %118

115:                                              ; preds = %114
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !38
  br label %118

116:                                              ; preds = %112
  %117 = landingpad { ptr, i32 }
          cleanup
  br label %213

118:                                              ; preds = %100, %115, %114
  %119 = load i32, ptr %108, align 8, !tbaa !37
  %120 = icmp ugt i32 %107, %119
  br i1 %120, label %121, label %.lr.ph191.us.preheader

121:                                              ; preds = %118
  %122 = getelementptr inbounds i8, ptr %0, i64 144
  %123 = call noundef i32 @_ZN3JPH6SquareIjEET_S1_(i32 noundef %102)
  %124 = mul i32 %123, %107
  %125 = add i32 %124, 7
  %126 = lshr i32 %125, 3
  %127 = add nuw nsw i32 %126, 1
  %128 = zext nneg i32 %127 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %14) #5
  store i8 0, ptr %14, align 1, !tbaa !30
  invoke void @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE6resizeEmRKh(ptr noundef nonnull align 8 dereferenceable(24) %122, i64 noundef %128, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %129 unwind label %172

129:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #5
  %130 = load i32, ptr %108, align 8, !tbaa !37
  %131 = mul i32 %102, %102
  %132 = add i32 %131, -1
  %133 = call noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %122)
  %134 = mul i32 %132, %107
  %135 = call noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %122)
  %136 = ashr i32 %134, 3
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i8, ptr %135, i64 %137
  %139 = call noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %122)
  %.not166180 = icmp ult ptr %138, %139
  br i1 %.not166180, label %._crit_edge, label %.lr.ph185

.lr.ph185:                                        ; preds = %129
  %140 = mul i32 %130, %132
  %141 = ashr i32 %140, 3
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %133, i64 %142
  %notmask165 = shl nsw i32 -1, %107
  %notmask = shl nsw i32 -1, %130
  %144 = xor i32 %notmask, -1
  %145 = xor i32 %notmask165, -1
  br label %146

146:                                              ; preds = %.lr.ph185, %146
  %.0142184 = phi ptr [ %138, %.lr.ph185 ], [ %170, %146 ]
  %.0143.in183 = phi i32 [ %134, %.lr.ph185 ], [ %167, %146 ]
  %.0144182 = phi ptr [ %143, %.lr.ph185 ], [ %166, %146 ]
  %.0145.in181 = phi i32 [ %140, %.lr.ph185 ], [ %163, %146 ]
  %.0143 = and i32 %.0143.in183, 7
  %.0145 = and i32 %.0145.in181, 7
  %147 = load i16, ptr %.0144182, align 1
  %148 = zext i16 %147 to i32
  %149 = lshr i32 %148, %.0145
  %150 = and i32 %149, %144
  %151 = load i16, ptr %.0142184, align 1
  %152 = zext i16 %151 to i32
  %153 = getelementptr inbounds i8, ptr %.0142184, i64 1
  %154 = shl i32 %145, %.0143
  %155 = xor i32 %154, -1
  %156 = and i32 %152, %155
  %157 = shl nuw nsw i32 %150, %.0143
  %158 = or i32 %157, %156
  %159 = trunc i32 %158 to i8
  store i8 %159, ptr %.0142184, align 1, !tbaa !30
  %160 = lshr i32 %158, 8
  %161 = trunc i32 %160 to i8
  store i8 %161, ptr %153, align 1, !tbaa !30
  %162 = load i32, ptr %108, align 8, !tbaa !37
  %163 = sub nsw i32 %.0145, %162
  %164 = ashr i32 %163, 3
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i8, ptr %.0144182, i64 %165
  %167 = sub nsw i32 %.0143, %107
  %168 = ashr i32 %167, 3
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds i8, ptr %.0142184, i64 %169
  %171 = call noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %122)
  %.not166 = icmp ult ptr %170, %171
  br i1 %.not166, label %._crit_edge, label %146, !llvm.loop !39

172:                                              ; preds = %121
  %173 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #5
  br label %213

._crit_edge:                                      ; preds = %146, %129
  store i32 %107, ptr %108, align 8, !tbaa !37
  br label %.lr.ph191.us.preheader

.lr.ph191.us.preheader:                           ; preds = %._crit_edge, %118
  %174 = phi i32 [ %107, %._crit_edge ], [ %119, %118 ]
  %notmask167 = shl nsw i32 -1, %174
  %175 = getelementptr inbounds i8, ptr %0, i64 144
  %176 = xor i32 %notmask167, -1
  %wide.trip.count206 = zext i32 %4 to i64
  br label %.lr.ph191.us

.lr.ph191.us:                                     ; preds = %.lr.ph191.us.preheader, %._crit_edge192.us
  %177 = phi i32 [ %174, %.lr.ph191.us.preheader ], [ %207, %._crit_edge192.us ]
  %indvars.iv203 = phi i64 [ 0, %.lr.ph191.us.preheader ], [ %indvars.iv.next204, %._crit_edge192.us ]
  %178 = mul nsw i64 %indvars.iv203, %6
  %179 = getelementptr inbounds i8, ptr %5, i64 %178
  %180 = trunc nuw i64 %indvars.iv203 to i32
  %181 = add i32 %180, %2
  %182 = mul i32 %181, %102
  %183 = add i32 %182, %1
  %184 = mul i32 %177, %183
  %185 = call noundef ptr @_ZN3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %175)
  %186 = lshr i32 %184, 3
  %187 = zext nneg i32 %186 to i64
  %188 = getelementptr inbounds i8, ptr %185, i64 %187
  br label %189

189:                                              ; preds = %.lr.ph191.us, %189
  %.0127189.us = phi i32 [ 0, %.lr.ph191.us ], [ %212, %189 ]
  %.0128188.us = phi ptr [ %188, %.lr.ph191.us ], [ %211, %189 ]
  %.0129.in187.us = phi i32 [ %184, %.lr.ph191.us ], [ %208, %189 ]
  %.0130186.us = phi ptr [ %179, %.lr.ph191.us ], [ %206, %189 ]
  %.0129.us = and i32 %.0129.in187.us, 7
  %190 = load i16, ptr %.0128188.us, align 1
  %191 = zext i16 %190 to i32
  %192 = getelementptr inbounds i8, ptr %.0128188.us, i64 1
  %193 = shl i32 %176, %.0129.us
  %194 = xor i32 %193, -1
  %195 = and i32 %191, %194
  %196 = load i8, ptr %.0130186.us, align 1, !tbaa !30
  %197 = zext i8 %196 to i64
  %198 = getelementptr inbounds i8, ptr %41, i64 %197
  %199 = load i8, ptr %198, align 1, !tbaa !30
  %200 = zext i8 %199 to i32
  %201 = shl nuw nsw i32 %200, %.0129.us
  %202 = or i32 %201, %195
  %203 = trunc i32 %202 to i8
  store i8 %203, ptr %.0128188.us, align 1, !tbaa !30
  %204 = lshr i32 %202, 8
  %205 = trunc nuw i32 %204 to i8
  store i8 %205, ptr %192, align 1, !tbaa !30
  %206 = getelementptr inbounds i8, ptr %.0130186.us, i64 1
  %207 = load i32, ptr %108, align 8, !tbaa !37
  %208 = add i32 %207, %.0129.us
  %209 = lshr i32 %208, 3
  %210 = zext nneg i32 %209 to i64
  %211 = getelementptr inbounds i8, ptr %.0128188.us, i64 %210
  %212 = add nuw i32 %.0127189.us, 1
  %exitcond202.not = icmp eq i32 %212, %3
  br i1 %exitcond202.not, label %._crit_edge192.us, label %189, !llvm.loop !40

._crit_edge192.us:                                ; preds = %189
  %indvars.iv.next204 = add nuw nsw i64 %indvars.iv203, 1
  %exitcond207.not = icmp eq i64 %indvars.iv.next204, %wide.trip.count206
  br i1 %exitcond207.not, label %.loopexit, label %.lr.ph191.us, !llvm.loop !41

.loopexit:                                        ; preds = %._crit_edge192.us, %94, %.critedge
  %.3 = phi i1 [ false, %94 ], [ true, %.critedge ], [ true, %._crit_edge192.us ]
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS7_EEEERNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  br label %214

213:                                              ; preds = %116, %172, %93, %56
  %.pn162.pn = phi { ptr, i32 } [ %.pn.pn, %93 ], [ %57, %56 ], [ %173, %172 ], [ %117, %116 ]
  call void @"_ZN3JPH9ScopeExitIZNS_16HeightFieldShape12SetMaterialsEjjjjPKhlPKNS_5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS7_EEEERNS_13TempAllocatorEE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  resume { ptr, i32 } %.pn162.pn

214:                                              ; preds = %9, %.loopexit
  %.4 = phi i1 [ %.3, %.loopexit ], [ true, %9 ]
  ret i1 %.4
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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