; LLVM IR from jrouwe/JoltPhysics :: Samples/Tests/Test.ll (ZN4Test17CreateMeshTerrainEv)

; 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::Array" = type { i64, i64, ptr }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Triangle" = type { [3 x %"class.JPH::Float3"], i32, i32 }
%"class.JPH::BodyCreationSettings" = type { %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Vec3", i64, i16, %"class.JPH::CollisionGroup", i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, float, i32, i32, i8, float, %"class.JPH::MassProperties", %"class.JPH::RefConst.3", %"class.JPH::RefConst.4" }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.2 }
%union.anon.2 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst", i32, i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::MassProperties" = type { float, %"class.JPH::Mat44" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::RefConst.3" = type { ptr }
%"class.JPH::RefConst.4" = type { ptr }
%"class.JPH::Array.19" = type { i64, i64, ptr }
%class.Test = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, %"class.std::unordered_map" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

; 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

declare noundef ptr @_ZN3JPH13BodyInterface10CreateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(256)) #1

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

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

declare void @_ZN3JPH13BodyInterface7AddBodyERKNS_6BodyIDENS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH8TriangleC2ERKNS_6Float3ES3_S3_jj(ptr noundef nonnull align 4 dereferenceable(44), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef) unnamed_addr #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

declare void @_ZN3JPH17MeshShapeSettingsC1ERKNS_5ArrayINS_8TriangleENS_12STLAllocatorIS2_EEEENS1_INS_8RefConstINS_15PhysicsMaterialEEENS3_ISA_EEEE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH20BodyCreationSettingsC2EPKNS_13ShapeSettingsENS_4Vec3ENS_4QuatENS_11EMotionTypeEt(ptr noundef nonnull align 16 dereferenceable(256), ptr noundef, double, double, double, double, i8 noundef zeroext, i16 noundef zeroext) unnamed_addr #6 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 16 dereferenceable(122) ptr @_ZN4Test17CreateMeshTerrainEv(ptr noundef nonnull align 8 dereferenceable(112) %0) #6 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca float, align 4
  %4 = alloca i32, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca [51 x [51 x float]], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.JPH::Array", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca %"class.JPH::Float3", align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca %"class.JPH::Float3", align 4
  %23 = alloca %"class.JPH::Float3", align 4
  %24 = alloca %"class.JPH::Float3", align 4
  %25 = alloca %"class.JPH::Triangle", align 4
  %26 = alloca %"class.JPH::Triangle", align 4
  %27 = alloca ptr, align 8
  %28 = alloca %"class.JPH::BodyCreationSettings", align 16
  %29 = alloca %"class.JPH::Array.19", align 8
  %30 = alloca i1, align 1
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca %"class.JPH::Quat", align 16
  store ptr %0, ptr %2, align 8, !tbaa !5
  %33 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #11
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds ptr, ptr %34, i64 7
  %36 = load ptr, ptr %35, align 8
  %37 = call noundef float %36(ptr noundef nonnull align 8 dereferenceable(112) %33)
  store float %37, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #11
  store i32 50, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #11
  %38 = load float, ptr %3, align 4, !tbaa !11
  %39 = fmul float %38, 2.000000e+00
  store float %39, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #11
  %40 = load float, ptr %3, align 4, !tbaa !11
  %41 = fmul float %40, 3.000000e+00
  store float %41, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 10404, ptr %7) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #11
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %42

42:                                               ; preds = %73, %1
  %43 = load i32, ptr %8, align 4, !tbaa !13
  %44 = icmp sle i32 %43, 50
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #11
  br label %76

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #11
  store i32 0, ptr %10, align 4, !tbaa !13
  br label %47

47:                                               ; preds = %69, %46
  %48 = load i32, ptr %10, align 4, !tbaa !13
  %49 = icmp sle i32 %48, 50
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %47
  %52 = load float, ptr %6, align 4, !tbaa !11
  %53 = load i32, ptr %8, align 4, !tbaa !13
  %54 = sitofp i32 %53 to float
  %55 = fmul float %54, 8.000000e+00
  %56 = fdiv float %55, 5.000000e+01
  %57 = load i32, ptr %10, align 4, !tbaa !13
  %58 = sitofp i32 %57 to float
  %59 = fmul float %58, 8.000000e+00
  %60 = fdiv float %59, 5.000000e+01
  %61 = call noundef float @_Z12PerlinNoise3fffiii(float noundef %56, float noundef 0.000000e+00, float noundef %60, i32 noundef 256, i32 noundef 256, i32 noundef 256)
  %62 = fmul float %52, %61
  %63 = load i32, ptr %8, align 4, !tbaa !13
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [51 x [51 x float]], ptr %7, i64 0, i64 %64
  %66 = load i32, ptr %10, align 4, !tbaa !13
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [51 x float], ptr %65, i64 0, i64 %67
  store float %62, ptr %68, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %51
  %70 = load i32, ptr %10, align 4, !tbaa !13
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %10, align 4, !tbaa !13
  br label %47, !llvm.loop !15

72:                                               ; preds = %50
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %8, align 4, !tbaa !13
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %8, align 4, !tbaa !13
  br label %42, !llvm.loop !17

76:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #11
  call void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #11
  store i32 0, ptr %12, align 4, !tbaa !13
  br label %77

77:                                               ; preds = %188, %76
  %78 = load i32, ptr %12, align 4, !tbaa !13
  %79 = icmp slt i32 %78, 50
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #11
  br label %191

81:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #11
  store i32 0, ptr %13, align 4, !tbaa !13
  br label %82

82:                                               ; preds = %156, %81
  %83 = load i32, ptr %13, align 4, !tbaa !13
  %84 = icmp slt i32 %83, 50
  br i1 %84, label %86, label %85

85:                                               ; preds = %82
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #11
  br label %187

86:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #11
  %87 = load float, ptr %5, align 4, !tbaa !11
  %88 = fmul float 5.000000e+01, %87
  %89 = fdiv float %88, 2.000000e+00
  store float %89, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #11
  %90 = load float, ptr %5, align 4, !tbaa !11
  %91 = load i32, ptr %12, align 4, !tbaa !13
  %92 = sitofp i32 %91 to float
  %93 = load float, ptr %14, align 4, !tbaa !11
  %94 = fneg float %93
  %95 = call float @llvm.fmuladd.f32(float %90, float %92, float %94)
  store float %95, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #11
  %96 = load float, ptr %5, align 4, !tbaa !11
  %97 = load i32, ptr %13, align 4, !tbaa !13
  %98 = sitofp i32 %97 to float
  %99 = load float, ptr %14, align 4, !tbaa !11
  %100 = fneg float %99
  %101 = call float @llvm.fmuladd.f32(float %96, float %98, float %100)
  store float %101, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #11
  %102 = load float, ptr %15, align 4, !tbaa !11
  %103 = load float, ptr %5, align 4, !tbaa !11
  %104 = fadd float %102, %103
  store float %104, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #11
  %105 = load float, ptr %16, align 4, !tbaa !11
  %106 = load float, ptr %5, align 4, !tbaa !11
  %107 = fadd float %105, %106
  store float %107, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #11
  %108 = load float, ptr %15, align 4, !tbaa !11
  %109 = load i32, ptr %12, align 4, !tbaa !13
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [51 x [51 x float]], ptr %7, i64 0, i64 %110
  %112 = load i32, ptr %13, align 4, !tbaa !13
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [51 x float], ptr %111, i64 0, i64 %113
  %115 = load float, ptr %114, align 4, !tbaa !11
  %116 = load float, ptr %16, align 4, !tbaa !11
  invoke void @_ZN3JPH6Float3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %19, float noundef %108, float noundef %115, float noundef %116)
          to label %117 unwind label %159

117:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #11
  %118 = load float, ptr %17, align 4, !tbaa !11
  %119 = load i32, ptr %12, align 4, !tbaa !13
  %120 = add nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [51 x [51 x float]], ptr %7, i64 0, i64 %121
  %123 = load i32, ptr %13, align 4, !tbaa !13
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [51 x float], ptr %122, i64 0, i64 %124
  %126 = load float, ptr %125, align 4, !tbaa !11
  %127 = load float, ptr %16, align 4, !tbaa !11
  invoke void @_ZN3JPH6Float3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %22, float noundef %118, float noundef %126, float noundef %127)
          to label %128 unwind label %163

128:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #11
  %129 = load float, ptr %15, align 4, !tbaa !11
  %130 = load i32, ptr %12, align 4, !tbaa !13
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [51 x [51 x float]], ptr %7, i64 0, i64 %131
  %133 = load i32, ptr %13, align 4, !tbaa !13
  %134 = add nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [51 x float], ptr %132, i64 0, i64 %135
  %137 = load float, ptr %136, align 4, !tbaa !11
  %138 = load float, ptr %18, align 4, !tbaa !11
  invoke void @_ZN3JPH6Float3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %23, float noundef %129, float noundef %137, float noundef %138)
          to label %139 unwind label %167

139:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #11
  %140 = load float, ptr %17, align 4, !tbaa !11
  %141 = load i32, ptr %12, align 4, !tbaa !13
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [51 x [51 x float]], ptr %7, i64 0, i64 %143
  %145 = load i32, ptr %13, align 4, !tbaa !13
  %146 = add nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [51 x float], ptr %144, i64 0, i64 %147
  %149 = load float, ptr %148, align 4, !tbaa !11
  %150 = load float, ptr %18, align 4, !tbaa !11
  invoke void @_ZN3JPH6Float3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %24, float noundef %140, float noundef %149, float noundef %150)
          to label %151 unwind label %171

151:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 44, ptr %25) #11
  invoke void @_ZN3JPH8TriangleC2ERKNS_6Float3ES3_S3_jj(ptr noundef nonnull align 4 dereferenceable(44) %25, ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %24, i32 noundef 0, i32 noundef 0)
          to label %152 unwind label %175

152:                                              ; preds = %151
  invoke void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(44) %25)
          to label %153 unwind label %175

153:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 44, ptr %25) #11
  call void @llvm.lifetime.start.p0(i64 44, ptr %26) #11
  invoke void @_ZN3JPH8TriangleC2ERKNS_6Float3ES3_S3_jj(ptr noundef nonnull align 4 dereferenceable(44) %26, ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef nonnull align 4 dereferenceable(12) %22, i32 noundef 0, i32 noundef 0)
          to label %154 unwind label %179

154:                                              ; preds = %153
  invoke void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(44) %26)
          to label %155 unwind label %179

155:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 44, ptr %26) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #11
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %13, align 4, !tbaa !13
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %13, align 4, !tbaa !13
  br label %82, !llvm.loop !18

159:                                              ; preds = %86
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %20, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %21, align 4
  br label %186

163:                                              ; preds = %117
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %20, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %21, align 4
  br label %185

167:                                              ; preds = %128
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %20, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %21, align 4
  br label %184

171:                                              ; preds = %139
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %20, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %21, align 4
  br label %183

175:                                              ; preds = %152, %151
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %20, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 44, ptr %25) #11
  br label %183

179:                                              ; preds = %154, %153
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %20, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 44, ptr %26) #11
  br label %183

183:                                              ; preds = %179, %175, %171
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #11
  br label %184

184:                                              ; preds = %183, %167
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #11
  br label %185

185:                                              ; preds = %184, %163
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #11
  br label %186

186:                                              ; preds = %185, %159
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #11
  br label %254

187:                                              ; preds = %85
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %12, align 4, !tbaa !13
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %12, align 4, !tbaa !13
  br label %77, !llvm.loop !19

191:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #11
  %192 = getelementptr inbounds %class.Test, ptr %33, i32 0, i32 3
  %193 = load ptr, ptr %192, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 256, ptr %28) #11
  %194 = invoke noundef ptr @_ZN3JPH17MeshShapeSettingsnwEm(i64 noundef 152)
          to label %195 unwind label %232

195:                                              ; preds = %191
  store i1 true, ptr %30, align 1
  call void @llvm.memset.p0.i64(ptr align 8 %29, i8 0, i64 24, i1 false)
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #11
  invoke void @_ZN3JPH17MeshShapeSettingsC1ERKNS_5ArrayINS_8TriangleENS_12STLAllocatorIS2_EEEENS1_INS_8RefConstINS_15PhysicsMaterialEEENS3_ISA_EEEE(ptr noundef nonnull align 8 dereferenceable(152) %194, ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef %29)
          to label %196 unwind label %236

196:                                              ; preds = %195
  store i1 false, ptr %30, align 1
  %197 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %198 unwind label %236

198:                                              ; preds = %196
  %199 = getelementptr inbounds %"class.JPH::Vec3", ptr %31, i32 0, i32 0
  %200 = getelementptr inbounds %union.anon, ptr %199, i32 0, i32 0
  %201 = getelementptr inbounds { double, double }, ptr %200, i32 0, i32 0
  %202 = extractvalue { double, double } %197, 0
  store double %202, ptr %201, align 16
  %203 = getelementptr inbounds { double, double }, ptr %200, i32 0, i32 1
  %204 = extractvalue { double, double } %197, 1
  store double %204, ptr %203, align 8
  %205 = invoke { double, double } @_ZN3JPH4Quat9sIdentityEv()
          to label %206 unwind label %236

206:                                              ; preds = %198
  %207 = getelementptr inbounds %"class.JPH::Quat", ptr %32, i32 0, i32 0
  %208 = getelementptr inbounds %"class.JPH::Vec4", ptr %207, i32 0, i32 0
  %209 = getelementptr inbounds %union.anon.2, ptr %208, i32 0, i32 0
  %210 = getelementptr inbounds { double, double }, ptr %209, i32 0, i32 0
  %211 = extractvalue { double, double } %205, 0
  store double %211, ptr %210, align 16
  %212 = getelementptr inbounds { double, double }, ptr %209, i32 0, i32 1
  %213 = extractvalue { double, double } %205, 1
  store double %213, ptr %212, align 8
  %214 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %215 = load double, ptr %214, align 16
  %216 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %217 = load double, ptr %216, align 8
  %218 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 0
  %219 = load double, ptr %218, align 16
  %220 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 1
  %221 = load double, ptr %220, align 8
  invoke void @_ZN3JPH20BodyCreationSettingsC2EPKNS_13ShapeSettingsENS_4Vec3ENS_4QuatENS_11EMotionTypeEt(ptr noundef nonnull align 16 dereferenceable(256) %28, ptr noundef %194, double %215, double %217, double %219, double %221, i8 noundef zeroext 0, i16 noundef zeroext 0)
          to label %222 unwind label %236

222:                                              ; preds = %206
  %223 = invoke noundef ptr @_ZN3JPH13BodyInterface10CreateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(24) %193, ptr noundef nonnull align 16 dereferenceable(256) %28)
          to label %224 unwind label %240

224:                                              ; preds = %222
  call void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256) %28) #11
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #11
  call void @llvm.lifetime.end.p0(i64 256, ptr %28) #11
  store ptr %223, ptr %27, align 8, !tbaa !5
  %225 = getelementptr inbounds %class.Test, ptr %33, i32 0, i32 3
  %226 = load ptr, ptr %225, align 8, !tbaa !20
  %227 = load ptr, ptr %27, align 8, !tbaa !5
  %228 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %227)
          to label %229 unwind label %249

229:                                              ; preds = %224
  invoke void @_ZN3JPH13BodyInterface7AddBodyERKNS_6BodyIDENS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24) %226, ptr noundef nonnull align 4 dereferenceable(4) %228, i32 noundef 1)
          to label %230 unwind label %249

230:                                              ; preds = %229
  %231 = load ptr, ptr %27, align 8, !tbaa !5
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #11
  call void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #11
  call void @llvm.lifetime.end.p0(i64 10404, ptr %7) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #11
  ret ptr %231

232:                                              ; preds = %191
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %20, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %21, align 4
  br label %248

236:                                              ; preds = %206, %198, %196, %195
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %20, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %21, align 4
  br label %244

240:                                              ; preds = %222
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %20, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %21, align 4
  call void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256) %28) #11
  br label %244

244:                                              ; preds = %240, %236
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #11
  %245 = load i1, ptr %30, align 1
  br i1 %245, label %246, label %247

246:                                              ; preds = %244
  call void @_ZN3JPH17MeshShapeSettingsdlEPv(ptr noundef %194) #11
  br label %247

247:                                              ; preds = %246, %244
  br label %248

248:                                              ; preds = %247, %232
  call void @llvm.lifetime.end.p0(i64 256, ptr %28) #11
  br label %253

249:                                              ; preds = %229, %224
  %250 = landingpad { ptr, i32 }
          cleanup
  %251 = extractvalue { ptr, i32 } %250, 0
  store ptr %251, ptr %20, align 8
  %252 = extractvalue { ptr, i32 } %250, 1
  store i32 %252, ptr %21, align 4
  br label %253

253:                                              ; preds = %249, %248
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #11
  br label %254

254:                                              ; preds = %253, %186
  call void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #11
  call void @llvm.lifetime.end.p0(i64 10404, ptr %7) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #11
  br label %255

255:                                              ; preds = %254
  %256 = load ptr, ptr %20, align 8
  %257 = load i32, ptr %21, align 4
  %258 = insertvalue { ptr, i32 } poison, ptr %256, 0
  %259 = insertvalue { ptr, i32 } %258, i32 %257, 1
  resume { ptr, i32 } %259
}

declare noundef float @_Z12PerlinNoise3fffiii(float noundef, float noundef, float noundef, i32 noundef, i32 noundef, i32 noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #7

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH17MeshShapeSettingsnwEm(i64 noundef) #2 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH17MeshShapeSettingsdlEPv(ptr noundef) #10 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = { 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 #9 = { 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 #10 = { 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 #11 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = !{!21, !6, i64 24}
!21 = !{!"_ZTS4Test", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !22, i64 48, !23, i64 56}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !24, i64 0}
!24 = !{!"_ZTSSt10_HashtableIN3JPH6BodyIDESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEEESaISB_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSD_18_Mod_range_hashingENSD_20_Default_ranged_hashENSD_20_Prime_rehash_policyENSD_17_Hashtable_traitsILb1ELb0ELb1EEEE", !6, i64 0, !25, i64 8, !26, i64 16, !25, i64 24, !27, i64 32, !6, i64 48}
!25 = !{!"long", !7, i64 0}
!26 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!27 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !12, i64 0, !25, i64 8}


; 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::Array" = type { i64, i64, ptr }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Triangle" = type { [3 x %"class.JPH::Float3"], i32, i32 }
%"class.JPH::BodyCreationSettings" = type { %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Vec3", i64, i16, %"class.JPH::CollisionGroup", i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, float, i32, i32, i8, float, %"class.JPH::MassProperties", %"class.JPH::RefConst.3", %"class.JPH::RefConst.4" }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.2 }
%union.anon.2 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst", i32, i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::MassProperties" = type { float, %"class.JPH::Mat44" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::RefConst.3" = type { ptr }
%"class.JPH::RefConst.4" = type { ptr }
%"class.JPH::Array.19" = type { i64, i64, ptr }

; 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

declare noundef ptr @_ZN3JPH13BodyInterface10CreateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(256)) local_unnamed_addr #1

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

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

declare void @_ZN3JPH13BodyInterface7AddBodyERKNS_6BodyIDENS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH8TriangleC2ERKNS_6Float3ES3_S3_jj(ptr noundef nonnull align 4 dereferenceable(44), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef) unnamed_addr #4 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

declare void @_ZN3JPH17MeshShapeSettingsC1ERKNS_5ArrayINS_8TriangleENS_12STLAllocatorIS2_EEEENS1_INS_8RefConstINS_15PhysicsMaterialEEENS3_ISA_EEEE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH20BodyCreationSettingsC2EPKNS_13ShapeSettingsENS_4Vec3ENS_4QuatENS_11EMotionTypeEt(ptr noundef nonnull align 16 dereferenceable(256), ptr noundef, double, double, double, double, i8 noundef zeroext, i16 noundef zeroext) unnamed_addr #6 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 16 dereferenceable(122) ptr @_ZN4Test17CreateMeshTerrainEv(ptr noundef nonnull align 8 dereferenceable(112) %0) local_unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca [51 x [51 x float]], align 16
  %3 = alloca %"class.JPH::Array", align 8
  %4 = alloca %"class.JPH::Float3", align 4
  %5 = alloca %"class.JPH::Float3", align 4
  %6 = alloca %"class.JPH::Float3", align 4
  %7 = alloca %"class.JPH::Float3", align 4
  %8 = alloca %"class.JPH::Triangle", align 4
  %9 = alloca %"class.JPH::Triangle", align 4
  %10 = alloca %"class.JPH::BodyCreationSettings", align 16
  %11 = alloca %"class.JPH::Array.19", align 8
  %12 = load ptr, ptr %0, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 56
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef float %14(ptr noundef nonnull align 8 dereferenceable(112) %0)
  %16 = fmul float %15, 3.000000e+00
  call void @llvm.lifetime.start.p0(i64 10404, ptr nonnull %2) #11
  br label %.preheader72

.preheader72:                                     ; preds = %1, %25
  %indvars.iv78 = phi i64 [ 0, %1 ], [ %indvars.iv.next79, %25 ]
  %17 = trunc nuw nsw i64 %indvars.iv78 to i32
  %18 = uitofp nneg i32 %17 to float
  %19 = fmul float %18, 8.000000e+00
  %20 = fdiv float %19, 5.000000e+01
  br label %26

21:                                               ; preds = %25
  %22 = fmul float %15, 2.000000e+00
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #11
  call void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #11
  %23 = fmul float %22, 5.000000e+01
  %24 = fmul float %23, -5.000000e-01
  br label %.preheader

25:                                               ; preds = %26
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next79, 51
  br i1 %exitcond81.not, label %21, label %.preheader72, !llvm.loop !8

26:                                               ; preds = %.preheader72, %26
  %indvars.iv = phi i64 [ 0, %.preheader72 ], [ %indvars.iv.next, %26 ]
  %27 = trunc nuw nsw i64 %indvars.iv to i32
  %28 = uitofp nneg i32 %27 to float
  %29 = fmul float %28, 8.000000e+00
  %30 = fdiv float %29, 5.000000e+01
  %31 = tail call noundef float @_Z12PerlinNoise3fffiii(float noundef %20, float noundef 0.000000e+00, float noundef %30, i32 noundef 256, i32 noundef 256, i32 noundef 256)
  %32 = fmul float %16, %31
  %33 = getelementptr inbounds [51 x [51 x float]], ptr %2, i64 0, i64 %indvars.iv78, i64 %indvars.iv
  store float %32, ptr %33, align 4, !tbaa !10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 51
  br i1 %exitcond.not, label %25, label %26, !llvm.loop !13

.preheader:                                       ; preds = %21, %42
  %indvars.iv86 = phi i64 [ 0, %21 ], [ %indvars.iv.next87, %42 ]
  %34 = trunc nuw nsw i64 %indvars.iv86 to i32
  %35 = uitofp nneg i32 %34 to float
  %36 = call float @llvm.fmuladd.f32(float %22, float %35, float %24)
  %37 = fadd float %22, %36
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %.phi.trans.insert = getelementptr inbounds [51 x [51 x float]], ptr %2, i64 0, i64 %indvars.iv86, i64 0
  %.pre = load float, ptr %.phi.trans.insert, align 4, !tbaa !10
  br label %43

38:                                               ; preds = %42
  %39 = getelementptr inbounds i8, ptr %0, i64 24
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %10) #11
  %41 = invoke noundef ptr @_ZN3JPH17MeshShapeSettingsnwEm(i64 noundef 152)
          to label %62 unwind label %78

42:                                               ; preds = %56
  %exitcond89.not = icmp eq i64 %indvars.iv.next87, 50
  br i1 %exitcond89.not, label %38, label %.preheader, !llvm.loop !23

43:                                               ; preds = %.preheader, %56
  %44 = phi float [ %.pre, %.preheader ], [ %52, %56 ]
  %indvars.iv82 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next83, %56 ]
  %45 = trunc nuw nsw i64 %indvars.iv82 to i32
  %46 = uitofp nneg i32 %45 to float
  %47 = call float @llvm.fmuladd.f32(float %22, float %46, float %24)
  %48 = fadd float %22, %47
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #11
  call void @_ZN3JPH6Float3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef %36, float noundef %44, float noundef %47)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #11
  %49 = getelementptr inbounds [51 x [51 x float]], ptr %2, i64 0, i64 %indvars.iv.next87, i64 %indvars.iv82
  %50 = load float, ptr %49, align 4, !tbaa !10
  call void @_ZN3JPH6Float3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef %37, float noundef %50, float noundef %47)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #11
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %51 = getelementptr inbounds [51 x [51 x float]], ptr %2, i64 0, i64 %indvars.iv86, i64 %indvars.iv.next83
  %52 = load float, ptr %51, align 4, !tbaa !10
  call void @_ZN3JPH6Float3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef %36, float noundef %52, float noundef %48)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #11
  %53 = getelementptr inbounds [51 x [51 x float]], ptr %2, i64 0, i64 %indvars.iv.next87, i64 %indvars.iv.next83
  %54 = load float, ptr %53, align 4, !tbaa !10
  call void @_ZN3JPH6Float3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef %37, float noundef %54, float noundef %48)
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %8) #11
  call void @_ZN3JPH8TriangleC2ERKNS_6Float3ES3_S3_jj(ptr noundef nonnull align 4 dereferenceable(44) %8, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %7, i32 noundef 0, i32 noundef 0)
  invoke void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(44) %8)
          to label %55 unwind label %57

55:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %8) #11
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %9) #11
  call void @_ZN3JPH8TriangleC2ERKNS_6Float3ES3_S3_jj(ptr noundef nonnull align 4 dereferenceable(44) %9, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 0, i32 noundef 0)
  invoke void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(44) %9)
          to label %56 unwind label %59

56:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %9) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #11
  %exitcond85.not = icmp eq i64 %indvars.iv.next83, 50
  br i1 %exitcond85.not, label %42, label %43, !llvm.loop !24

57:                                               ; preds = %43
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %8) #11
  br label %61

59:                                               ; preds = %55
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %9) #11
  br label %61

61:                                               ; preds = %59, %57
  %.pn64 = phi { ptr, i32 } [ %60, %59 ], [ %58, %57 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #11
  br label %85

62:                                               ; preds = %38
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, i8 0, i64 24, i1 false)
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #11
  invoke void @_ZN3JPH17MeshShapeSettingsC1ERKNS_5ArrayINS_8TriangleENS_12STLAllocatorIS2_EEEENS1_INS_8RefConstINS_15PhysicsMaterialEEENS3_ISA_EEEE(ptr noundef nonnull align 8 dereferenceable(152) %41, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull %11)
          to label %63 unwind label %81

63:                                               ; preds = %62
  %64 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %65 unwind label %.thread69

65:                                               ; preds = %63
  %66 = invoke { double, double } @_ZN3JPH4Quat9sIdentityEv()
          to label %67 unwind label %.thread69

67:                                               ; preds = %65
  %68 = extractvalue { double, double } %64, 1
  %69 = extractvalue { double, double } %64, 0
  %70 = extractvalue { double, double } %66, 0
  %71 = extractvalue { double, double } %66, 1
  invoke void @_ZN3JPH20BodyCreationSettingsC2EPKNS_13ShapeSettingsENS_4Vec3ENS_4QuatENS_11EMotionTypeEt(ptr noundef nonnull align 16 dereferenceable(256) %10, ptr noundef nonnull %41, double %69, double %68, double %70, double %71, i8 noundef zeroext 0, i16 noundef zeroext 0)
          to label %72 unwind label %.thread69

72:                                               ; preds = %67
  %73 = invoke noundef ptr @_ZN3JPH13BodyInterface10CreateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 16 dereferenceable(256) %10)
          to label %74 unwind label %.thread

74:                                               ; preds = %72
  call void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256) %10) #11
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #11
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %10) #11
  %75 = load ptr, ptr %39, align 8, !tbaa !14
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %73)
  invoke void @_ZN3JPH13BodyInterface7AddBodyERKNS_6BodyIDENS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 4 dereferenceable(4) %76, i32 noundef 1)
          to label %77 unwind label %83

77:                                               ; preds = %74
  call void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #11
  call void @llvm.lifetime.end.p0(i64 10404, ptr nonnull %2) #11
  ret ptr %73

78:                                               ; preds = %38
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %82

.thread:                                          ; preds = %72
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH20BodyCreationSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(256) %10) #11
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #11
  br label %82

.thread69:                                        ; preds = %67, %65, %63
  %lpad.thr_comm = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #11
  br label %82

81:                                               ; preds = %62
  %lpad.thr_comm.split-lp = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH5ArrayINS_8RefConstINS_15PhysicsMaterialEEENS_12STLAllocatorIS3_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #11
  call void @_ZN3JPH17MeshShapeSettingsdlEPv(ptr noundef %41) #11
  br label %82

82:                                               ; preds = %.thread69, %.thread, %81, %78
  %.pn.pn = phi { ptr, i32 } [ %lpad.thr_comm.split-lp, %81 ], [ %79, %78 ], [ %80, %.thread ], [ %lpad.thr_comm, %.thread69 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %10) #11
  br label %85

83:                                               ; preds = %74
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %85

85:                                               ; preds = %82, %83, %61
  %.pn64.pn = phi { ptr, i32 } [ %.pn64, %61 ], [ %84, %83 ], [ %.pn.pn, %82 ]
  call void @_ZN3JPH5ArrayINS_8TriangleENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #11
  call void @llvm.lifetime.end.p0(i64 10404, ptr nonnull %2) #11
  resume { ptr, i32 } %.pn64.pn
}

declare noundef float @_Z12PerlinNoise3fffiii(float noundef, float noundef, float noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #7

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH17MeshShapeSettingsnwEm(i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH17MeshShapeSettingsdlEPv(ptr noundef) local_unnamed_addr #10 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 #9 = { 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 #10 = { 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 #11 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = distinct !{!13, !9}
!14 = !{!15, !16, i64 24}
!15 = !{!"_ZTS4Test", !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !17, i64 48, !18, i64 56}
!16 = !{!"any pointer", !12, i64 0}
!17 = !{!"bool", !12, i64 0}
!18 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !19, i64 0}
!19 = !{!"_ZTSSt10_HashtableIN3JPH6BodyIDESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEEESaISB_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSD_18_Mod_range_hashingENSD_20_Default_ranged_hashENSD_20_Prime_rehash_policyENSD_17_Hashtable_traitsILb1ELb0ELb1EEEE", !16, i64 0, !20, i64 8, !21, i64 16, !20, i64 24, !22, i64 32, !16, i64 48}
!20 = !{!"long", !12, i64 0}
!21 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !16, i64 0}
!22 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !11, i64 0, !20, i64 8}
!23 = distinct !{!23, !9}
!24 = distinct !{!24, !9}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass