; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/Shape (ConvexShape)

; 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::StaticArray.1" = type { i32, [12 x i8], [384 x %"struct.JPH::StaticArray<JPH::Vec3, 384>::Storage"] }
%"struct.JPH::StaticArray<JPH::Vec3, 384>::Storage" = type { [16 x i8] }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::Vec3" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }
%"class.JPH::ConvexShape::CSGetTrianglesContext" = type { %"class.JPH::ConvexShape::SupportBuffer", ptr, %"class.JPH::Mat44", i8, i64 }
%"class.JPH::ConvexShape::SupportBuffer" = type { [4160 x i8] }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }
%"class.JPH::Float3" = type { float, float, float }

@_ZN3JPH11ConvexShape20sUnitSphereTrianglesE = external dso_local global %"class.JPH::StaticArray.1", align 16
@.str.3 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [62 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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3JPH11ConvexShape16GetTrianglesNextERNS_5Shape19GetTrianglesContextEiPNS_6Float3EPPKNS_15PhysicsMaterialE(ptr noundef nonnull align 8 dereferenceable(44) %0, ptr noundef nonnull align 16 dereferenceable(4288) %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) unnamed_addr #4 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.JPH::AssertLastParam", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca %"class.JPH::Vec3", align 16
  %33 = alloca %"class.JPH::Vec3", align 16
  %34 = alloca %"class.JPH::Vec3", align 16
  %35 = alloca %"class.JPH::Vec3", align 16
  %36 = alloca %"class.JPH::Vec3", align 16
  %37 = alloca %"class.JPH::Vec3", align 16
  %38 = alloca i32, align 4
  %39 = alloca ptr, align 8
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %42 = load ptr, ptr %6, align 8
  br label %43

43:                                               ; preds = %5
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = icmp sge i32 %44, 32
  br i1 %45, label %49, label %46

46:                                               ; preds = %43
  %47 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.8, ptr noundef @.str.3, i32 noundef 342)
  br i1 %47, label %48, label %49

48:                                               ; preds = %46
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !11
  br label %49

49:                                               ; preds = %48, %46, %43
  br label %50

50:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %51, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = mul nsw i32 %52, 3
  store i32 %53, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %54 = call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(6160) @_ZN3JPH11ConvexShape20sUnitSphereTrianglesE)
  %55 = zext i32 %54 to i64
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %56, i32 0, i32 4
  %58 = load i64, ptr %57, align 8, !tbaa !12
  %59 = sub i64 %55, %58
  %60 = trunc i64 %59 to i32
  store i32 %60, ptr %15, align 4, !tbaa !9
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %62 = load i32, ptr %61, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  store i32 %62, ptr %13, align 4, !tbaa !9
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %63, i32 0, i32 3
  %65 = load i8, ptr %64, align 16, !tbaa !18, !range !19, !noundef !20
  %66 = trunc i8 %65 to i1
  br i1 %66, label %67, label %189

67:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %68 = call noundef ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4dataEv(ptr noundef nonnull align 16 dereferenceable(6160) @_ZN3JPH11ConvexShape20sUnitSphereTrianglesE)
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %69, i32 0, i32 4
  %71 = load i64, ptr %70, align 8, !tbaa !12
  %72 = getelementptr inbounds %"class.JPH::Vec3", ptr %68, i64 %71
  store ptr %72, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %"class.JPH::Vec3", ptr %73, i64 %75
  store ptr %76, ptr %17, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %185, %67
  %78 = load ptr, ptr %16, align 8, !tbaa !5
  %79 = load ptr, ptr %17, align 8, !tbaa !5
  %80 = icmp ult ptr %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %188

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %83, i32 0, i32 2
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %85, i32 0, i32 1
  %87 = load ptr, ptr %86, align 16, !tbaa !21
  %88 = load ptr, ptr %16, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.JPH::Vec3", ptr %88, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %89, i64 16, i1 false), !tbaa.struct !22
  %90 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %91 = load double, ptr %90, align 16
  %92 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %93 = load double, ptr %92, align 8
  %94 = load ptr, ptr %87, align 8, !tbaa !24
  %95 = getelementptr inbounds ptr, ptr %94, i64 2
  %96 = load ptr, ptr %95, align 8
  %97 = call { double, double } %96(ptr noundef nonnull align 8 dereferenceable(8) %87, double %91, double %93)
  %98 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %99 = getelementptr inbounds %union.anon.4, ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds { double, double }, ptr %99, i32 0, i32 0
  %101 = extractvalue { double, double } %97, 0
  store double %101, ptr %100, align 16
  %102 = getelementptr inbounds { double, double }, ptr %99, i32 0, i32 1
  %103 = extractvalue { double, double } %97, 1
  store double %103, ptr %102, align 8
  %104 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %105 = load double, ptr %104, align 16
  %106 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %107 = load double, ptr %106, align 8
  %108 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %84, double %105, double %107)
  %109 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %110 = getelementptr inbounds %union.anon.4, ptr %109, i32 0, i32 0
  %111 = getelementptr inbounds { double, double }, ptr %110, i32 0, i32 0
  %112 = extractvalue { double, double } %108, 0
  store double %112, ptr %111, align 16
  %113 = getelementptr inbounds { double, double }, ptr %110, i32 0, i32 1
  %114 = extractvalue { double, double } %108, 1
  store double %114, ptr %113, align 8
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %"class.JPH::Float3", ptr %115, i32 1
  store ptr %116, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %18, ptr noundef %115)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %117 = load ptr, ptr %12, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %117, i32 0, i32 2
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %119, i32 0, i32 1
  %121 = load ptr, ptr %120, align 16, !tbaa !21
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.JPH::Vec3", ptr %122, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %123, i64 16, i1 false), !tbaa.struct !22
  %124 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %125 = load double, ptr %124, align 16
  %126 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %127 = load double, ptr %126, align 8
  %128 = load ptr, ptr %121, align 8, !tbaa !24
  %129 = getelementptr inbounds ptr, ptr %128, i64 2
  %130 = load ptr, ptr %129, align 8
  %131 = call { double, double } %130(ptr noundef nonnull align 8 dereferenceable(8) %121, double %125, double %127)
  %132 = getelementptr inbounds %"class.JPH::Vec3", ptr %22, i32 0, i32 0
  %133 = getelementptr inbounds %union.anon.4, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds { double, double }, ptr %133, i32 0, i32 0
  %135 = extractvalue { double, double } %131, 0
  store double %135, ptr %134, align 16
  %136 = getelementptr inbounds { double, double }, ptr %133, i32 0, i32 1
  %137 = extractvalue { double, double } %131, 1
  store double %137, ptr %136, align 8
  %138 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %139 = load double, ptr %138, align 16
  %140 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %141 = load double, ptr %140, align 8
  %142 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %118, double %139, double %141)
  %143 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %144 = getelementptr inbounds %union.anon.4, ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds { double, double }, ptr %144, i32 0, i32 0
  %146 = extractvalue { double, double } %142, 0
  store double %146, ptr %145, align 16
  %147 = getelementptr inbounds { double, double }, ptr %144, i32 0, i32 1
  %148 = extractvalue { double, double } %142, 1
  store double %148, ptr %147, align 8
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %"class.JPH::Float3", ptr %149, i32 1
  store ptr %150, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %21, ptr noundef %149)
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %151, i32 0, i32 2
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  %154 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 16, !tbaa !21
  %156 = load ptr, ptr %16, align 8, !tbaa !5
  %157 = getelementptr inbounds %"class.JPH::Vec3", ptr %156, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %157, i64 16, i1 false), !tbaa.struct !22
  %158 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %159 = load double, ptr %158, align 16
  %160 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %161 = load double, ptr %160, align 8
  %162 = load ptr, ptr %155, align 8, !tbaa !24
  %163 = getelementptr inbounds ptr, ptr %162, i64 2
  %164 = load ptr, ptr %163, align 8
  %165 = call { double, double } %164(ptr noundef nonnull align 8 dereferenceable(8) %155, double %159, double %161)
  %166 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %167 = getelementptr inbounds %union.anon.4, ptr %166, i32 0, i32 0
  %168 = getelementptr inbounds { double, double }, ptr %167, i32 0, i32 0
  %169 = extractvalue { double, double } %165, 0
  store double %169, ptr %168, align 16
  %170 = getelementptr inbounds { double, double }, ptr %167, i32 0, i32 1
  %171 = extractvalue { double, double } %165, 1
  store double %171, ptr %170, align 8
  %172 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %173 = load double, ptr %172, align 16
  %174 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %175 = load double, ptr %174, align 8
  %176 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %152, double %173, double %175)
  %177 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %178 = getelementptr inbounds %union.anon.4, ptr %177, i32 0, i32 0
  %179 = getelementptr inbounds { double, double }, ptr %178, i32 0, i32 0
  %180 = extractvalue { double, double } %176, 0
  store double %180, ptr %179, align 16
  %181 = getelementptr inbounds { double, double }, ptr %178, i32 0, i32 1
  %182 = extractvalue { double, double } %176, 1
  store double %182, ptr %181, align 8
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = getelementptr inbounds %"class.JPH::Float3", ptr %183, i32 1
  store ptr %184, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %24, ptr noundef %183)
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  br label %185

185:                                              ; preds = %82
  %186 = load ptr, ptr %16, align 8, !tbaa !5
  %187 = getelementptr inbounds %"class.JPH::Vec3", ptr %186, i64 3
  store ptr %187, ptr %16, align 8, !tbaa !5
  br label %77, !llvm.loop !26

188:                                              ; preds = %81
  br label %311

189:                                              ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %190 = call noundef ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4dataEv(ptr noundef nonnull align 16 dereferenceable(6160) @_ZN3JPH11ConvexShape20sUnitSphereTrianglesE)
  %191 = load ptr, ptr %12, align 8, !tbaa !5
  %192 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %191, i32 0, i32 4
  %193 = load i64, ptr %192, align 8, !tbaa !12
  %194 = getelementptr inbounds %"class.JPH::Vec3", ptr %190, i64 %193
  store ptr %194, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %195 = load ptr, ptr %27, align 8, !tbaa !5
  %196 = load i32, ptr %13, align 4, !tbaa !9
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds %"class.JPH::Vec3", ptr %195, i64 %197
  store ptr %198, ptr %28, align 8, !tbaa !5
  br label %199

199:                                              ; preds = %307, %189
  %200 = load ptr, ptr %27, align 8, !tbaa !5
  %201 = load ptr, ptr %28, align 8, !tbaa !5
  %202 = icmp ult ptr %200, %201
  br i1 %202, label %204, label %203

203:                                              ; preds = %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %310

204:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #7
  %205 = load ptr, ptr %12, align 8, !tbaa !5
  %206 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %205, i32 0, i32 2
  %207 = load ptr, ptr %12, align 8, !tbaa !5
  %208 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %207, i32 0, i32 1
  %209 = load ptr, ptr %208, align 16, !tbaa !21
  %210 = load ptr, ptr %27, align 8, !tbaa !5
  %211 = getelementptr inbounds %"class.JPH::Vec3", ptr %210, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %31, ptr align 16 %211, i64 16, i1 false), !tbaa.struct !22
  %212 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %213 = load double, ptr %212, align 16
  %214 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %215 = load double, ptr %214, align 8
  %216 = load ptr, ptr %209, align 8, !tbaa !24
  %217 = getelementptr inbounds ptr, ptr %216, i64 2
  %218 = load ptr, ptr %217, align 8
  %219 = call { double, double } %218(ptr noundef nonnull align 8 dereferenceable(8) %209, double %213, double %215)
  %220 = getelementptr inbounds %"class.JPH::Vec3", ptr %30, i32 0, i32 0
  %221 = getelementptr inbounds %union.anon.4, ptr %220, i32 0, i32 0
  %222 = getelementptr inbounds { double, double }, ptr %221, i32 0, i32 0
  %223 = extractvalue { double, double } %219, 0
  store double %223, ptr %222, align 16
  %224 = getelementptr inbounds { double, double }, ptr %221, i32 0, i32 1
  %225 = extractvalue { double, double } %219, 1
  store double %225, ptr %224, align 8
  %226 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %227 = load double, ptr %226, align 16
  %228 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %229 = load double, ptr %228, align 8
  %230 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %206, double %227, double %229)
  %231 = getelementptr inbounds %"class.JPH::Vec3", ptr %29, i32 0, i32 0
  %232 = getelementptr inbounds %union.anon.4, ptr %231, i32 0, i32 0
  %233 = getelementptr inbounds { double, double }, ptr %232, i32 0, i32 0
  %234 = extractvalue { double, double } %230, 0
  store double %234, ptr %233, align 16
  %235 = getelementptr inbounds { double, double }, ptr %232, i32 0, i32 1
  %236 = extractvalue { double, double } %230, 1
  store double %236, ptr %235, align 8
  %237 = load ptr, ptr %9, align 8, !tbaa !5
  %238 = getelementptr inbounds %"class.JPH::Float3", ptr %237, i32 1
  store ptr %238, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %29, ptr noundef %237)
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #7
  %239 = load ptr, ptr %12, align 8, !tbaa !5
  %240 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %239, i32 0, i32 2
  %241 = load ptr, ptr %12, align 8, !tbaa !5
  %242 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %241, i32 0, i32 1
  %243 = load ptr, ptr %242, align 16, !tbaa !21
  %244 = load ptr, ptr %27, align 8, !tbaa !5
  %245 = getelementptr inbounds %"class.JPH::Vec3", ptr %244, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %34, ptr align 16 %245, i64 16, i1 false), !tbaa.struct !22
  %246 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 0
  %247 = load double, ptr %246, align 16
  %248 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 1
  %249 = load double, ptr %248, align 8
  %250 = load ptr, ptr %243, align 8, !tbaa !24
  %251 = getelementptr inbounds ptr, ptr %250, i64 2
  %252 = load ptr, ptr %251, align 8
  %253 = call { double, double } %252(ptr noundef nonnull align 8 dereferenceable(8) %243, double %247, double %249)
  %254 = getelementptr inbounds %"class.JPH::Vec3", ptr %33, i32 0, i32 0
  %255 = getelementptr inbounds %union.anon.4, ptr %254, i32 0, i32 0
  %256 = getelementptr inbounds { double, double }, ptr %255, i32 0, i32 0
  %257 = extractvalue { double, double } %253, 0
  store double %257, ptr %256, align 16
  %258 = getelementptr inbounds { double, double }, ptr %255, i32 0, i32 1
  %259 = extractvalue { double, double } %253, 1
  store double %259, ptr %258, align 8
  %260 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 0
  %261 = load double, ptr %260, align 16
  %262 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 1
  %263 = load double, ptr %262, align 8
  %264 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %240, double %261, double %263)
  %265 = getelementptr inbounds %"class.JPH::Vec3", ptr %32, i32 0, i32 0
  %266 = getelementptr inbounds %union.anon.4, ptr %265, i32 0, i32 0
  %267 = getelementptr inbounds { double, double }, ptr %266, i32 0, i32 0
  %268 = extractvalue { double, double } %264, 0
  store double %268, ptr %267, align 16
  %269 = getelementptr inbounds { double, double }, ptr %266, i32 0, i32 1
  %270 = extractvalue { double, double } %264, 1
  store double %270, ptr %269, align 8
  %271 = load ptr, ptr %9, align 8, !tbaa !5
  %272 = getelementptr inbounds %"class.JPH::Float3", ptr %271, i32 1
  store ptr %272, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %32, ptr noundef %271)
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #7
  %273 = load ptr, ptr %12, align 8, !tbaa !5
  %274 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %273, i32 0, i32 2
  %275 = load ptr, ptr %12, align 8, !tbaa !5
  %276 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %275, i32 0, i32 1
  %277 = load ptr, ptr %276, align 16, !tbaa !21
  %278 = load ptr, ptr %27, align 8, !tbaa !5
  %279 = getelementptr inbounds %"class.JPH::Vec3", ptr %278, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %37, ptr align 16 %279, i64 16, i1 false), !tbaa.struct !22
  %280 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 0
  %281 = load double, ptr %280, align 16
  %282 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 1
  %283 = load double, ptr %282, align 8
  %284 = load ptr, ptr %277, align 8, !tbaa !24
  %285 = getelementptr inbounds ptr, ptr %284, i64 2
  %286 = load ptr, ptr %285, align 8
  %287 = call { double, double } %286(ptr noundef nonnull align 8 dereferenceable(8) %277, double %281, double %283)
  %288 = getelementptr inbounds %"class.JPH::Vec3", ptr %36, i32 0, i32 0
  %289 = getelementptr inbounds %union.anon.4, ptr %288, i32 0, i32 0
  %290 = getelementptr inbounds { double, double }, ptr %289, i32 0, i32 0
  %291 = extractvalue { double, double } %287, 0
  store double %291, ptr %290, align 16
  %292 = getelementptr inbounds { double, double }, ptr %289, i32 0, i32 1
  %293 = extractvalue { double, double } %287, 1
  store double %293, ptr %292, align 8
  %294 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %295 = load double, ptr %294, align 16
  %296 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %297 = load double, ptr %296, align 8
  %298 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %274, double %295, double %297)
  %299 = getelementptr inbounds %"class.JPH::Vec3", ptr %35, i32 0, i32 0
  %300 = getelementptr inbounds %union.anon.4, ptr %299, i32 0, i32 0
  %301 = getelementptr inbounds { double, double }, ptr %300, i32 0, i32 0
  %302 = extractvalue { double, double } %298, 0
  store double %302, ptr %301, align 16
  %303 = getelementptr inbounds { double, double }, ptr %300, i32 0, i32 1
  %304 = extractvalue { double, double } %298, 1
  store double %304, ptr %303, align 8
  %305 = load ptr, ptr %9, align 8, !tbaa !5
  %306 = getelementptr inbounds %"class.JPH::Float3", ptr %305, i32 1
  store ptr %306, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %35, ptr noundef %305)
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #7
  br label %307

307:                                              ; preds = %204
  %308 = load ptr, ptr %27, align 8, !tbaa !5
  %309 = getelementptr inbounds %"class.JPH::Vec3", ptr %308, i64 3
  store ptr %309, ptr %27, align 8, !tbaa !5
  br label %199, !llvm.loop !28

310:                                              ; preds = %203
  br label %311

311:                                              ; preds = %310, %188
  %312 = load i32, ptr %13, align 4, !tbaa !9
  %313 = sext i32 %312 to i64
  %314 = load ptr, ptr %12, align 8, !tbaa !5
  %315 = getelementptr inbounds %"class.JPH::ConvexShape::CSGetTrianglesContext", ptr %314, i32 0, i32 4
  %316 = load i64, ptr %315, align 8, !tbaa !12
  %317 = add i64 %316, %313
  store i64 %317, ptr %315, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  %318 = load i32, ptr %13, align 4, !tbaa !9
  %319 = sdiv i32 %318, 3
  store i32 %319, ptr %38, align 4, !tbaa !9
  %320 = load ptr, ptr %10, align 8, !tbaa !5
  %321 = icmp ne ptr %320, null
  br i1 %321, label %322, label %341

322:                                              ; preds = %311
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %323 = call noundef ptr @_ZNK3JPH11ConvexShape11GetMaterialEv(ptr noundef nonnull align 8 dereferenceable(44) %42)
  store ptr %323, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  %324 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %324, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #7
  %325 = load ptr, ptr %10, align 8, !tbaa !5
  %326 = load i32, ptr %38, align 4, !tbaa !9
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds ptr, ptr %325, i64 %327
  store ptr %328, ptr %41, align 8, !tbaa !5
  br label %329

329:                                              ; preds = %337, %322
  %330 = load ptr, ptr %40, align 8, !tbaa !5
  %331 = load ptr, ptr %41, align 8, !tbaa !5
  %332 = icmp ult ptr %330, %331
  br i1 %332, label %334, label %333

333:                                              ; preds = %329
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  br label %340

334:                                              ; preds = %329
  %335 = load ptr, ptr %39, align 8, !tbaa !5
  %336 = load ptr, ptr %40, align 8, !tbaa !5
  store ptr %335, ptr %336, align 8, !tbaa !5
  br label %337

337:                                              ; preds = %334
  %338 = load ptr, ptr %40, align 8, !tbaa !5
  %339 = getelementptr inbounds ptr, ptr %338, i32 1
  store ptr %339, ptr %40, align 8, !tbaa !5
  br label %329, !llvm.loop !29

340:                                              ; preds = %333
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  br label %341

341:                                              ; preds = %340, %311
  %342 = load i32, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  ret i32 %342
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(6160)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4dataEv(ptr noundef nonnull align 16 dereferenceable(6160)) #6 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3JPH11ConvexShape11GetMaterialEv(ptr noundef nonnull align 8 dereferenceable(44)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = !{i64 2158392889}
!12 = !{!13, !17, i64 4248}
!13 = !{!"_ZTSN3JPH11ConvexShape21CSGetTrianglesContextE", !14, i64 0, !6, i64 4160, !15, i64 4176, !16, i64 4240, !17, i64 4248}
!14 = !{!"_ZTSN3JPH11ConvexShape13SupportBufferE", !7, i64 0}
!15 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!13, !16, i64 4240}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!13, !6, i64 4160}
!22 = !{i64 0, i64 16, !23}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !8, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = distinct !{!29, !27}


; 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::StaticArray.1" = type { i32, [12 x i8], [384 x %"struct.JPH::StaticArray<JPH::Vec3, 384>::Storage"] }
%"struct.JPH::StaticArray<JPH::Vec3, 384>::Storage" = type { [16 x i8] }
%"class.JPH::Vec3" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }

@_ZN3JPH11ConvexShape20sUnitSphereTrianglesE = external dso_local global %"class.JPH::StaticArray.1", align 16
@.str.3 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [62 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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -715827882, 715827883) i32 @_ZNK3JPH11ConvexShape16GetTrianglesNextERNS_5Shape19GetTrianglesContextEiPNS_6Float3EPPKNS_15PhysicsMaterialE(ptr noundef nonnull align 8 dereferenceable(44) %0, ptr noundef nonnull align 16 dereferenceable(4288) %1, i32 noundef %2, ptr noundef %3, ptr noundef writeonly %4) unnamed_addr #3 align 2 {
  %6 = ptrtoint ptr %4 to i64
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = icmp sgt i32 %2, 31
  br i1 %15, label %19, label %16

16:                                               ; preds = %5
  %17 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.3, i32 noundef 342)
  br i1 %17, label %18, label %19

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

19:                                               ; preds = %5, %16, %18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %20 = mul nsw i32 %2, 3
  store i32 %20, ptr %7, align 4, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %21 = tail call noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(6160) @_ZN3JPH11ConvexShape20sUnitSphereTrianglesE)
  %22 = getelementptr inbounds i8, ptr %1, i64 4248
  %23 = load i64, ptr %22, align 8, !tbaa !10
  %24 = trunc i64 %23 to i32
  %25 = sub i32 %21, %24
  store i32 %25, ptr %8, align 4, !tbaa !6
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %27 = load i32, ptr %26, align 4, !tbaa !6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %28 = getelementptr inbounds i8, ptr %1, i64 4240
  %29 = load i8, ptr %28, align 16, !tbaa !17, !range !18, !noundef !19
  %30 = trunc nuw i8 %29 to i1
  %31 = call noundef ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4dataEv(ptr noundef nonnull align 16 dereferenceable(6160) @_ZN3JPH11ConvexShape20sUnitSphereTrianglesE)
  %32 = load i64, ptr %22, align 8, !tbaa !10
  %33 = getelementptr inbounds %"class.JPH::Vec3", ptr %31, i64 %32
  %34 = sext i32 %27 to i64
  %35 = getelementptr inbounds %"class.JPH::Vec3", ptr %33, i64 %34
  %36 = icmp sgt i32 %27, 0
  br i1 %30, label %37, label %81

37:                                               ; preds = %19
  br i1 %36, label %.lr.ph86, label %.loopexit80

.lr.ph86:                                         ; preds = %37
  %38 = getelementptr inbounds i8, ptr %1, i64 4176
  %39 = getelementptr inbounds i8, ptr %1, i64 4160
  %40 = getelementptr inbounds i8, ptr %9, i64 8
  %41 = getelementptr inbounds i8, ptr %10, i64 8
  %42 = getelementptr inbounds i8, ptr %11, i64 8
  br label %43

43:                                               ; preds = %.lr.ph86, %43
  %.085 = phi ptr [ %3, %.lr.ph86 ], [ %78, %43 ]
  %.07784 = phi ptr [ %33, %.lr.ph86 ], [ %79, %43 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  %44 = load ptr, ptr %39, align 16, !tbaa !20
  %.sroa.031.0.copyload = load double, ptr %.07784, align 16
  %.sroa.232.0..sroa_idx = getelementptr inbounds i8, ptr %.07784, i64 8
  %.sroa.232.0.copyload = load double, ptr %.sroa.232.0..sroa_idx, align 8, !tbaa !21
  %45 = load ptr, ptr %44, align 8, !tbaa !22
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  %47 = load ptr, ptr %46, align 8
  %48 = call { double, double } %47(ptr noundef nonnull align 8 dereferenceable(8) %44, double %.sroa.031.0.copyload, double %.sroa.232.0.copyload)
  %49 = extractvalue { double, double } %48, 0
  %50 = extractvalue { double, double } %48, 1
  %51 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %38, double %49, double %50)
  %52 = extractvalue { double, double } %51, 0
  store double %52, ptr %9, align 16
  %53 = extractvalue { double, double } %51, 1
  store double %53, ptr %40, align 8
  %54 = getelementptr inbounds i8, ptr %.085, i64 12
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %9, ptr noundef %.085)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  %55 = load ptr, ptr %39, align 16, !tbaa !20
  %56 = getelementptr inbounds i8, ptr %.07784, i64 32
  %.sroa.027.0.copyload = load double, ptr %56, align 16
  %.sroa.228.0..sroa_idx = getelementptr inbounds i8, ptr %.07784, i64 40
  %.sroa.228.0.copyload = load double, ptr %.sroa.228.0..sroa_idx, align 8, !tbaa !21
  %57 = load ptr, ptr %55, align 8, !tbaa !22
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %59 = load ptr, ptr %58, align 8
  %60 = call { double, double } %59(ptr noundef nonnull align 8 dereferenceable(8) %55, double %.sroa.027.0.copyload, double %.sroa.228.0.copyload)
  %61 = extractvalue { double, double } %60, 0
  %62 = extractvalue { double, double } %60, 1
  %63 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %38, double %61, double %62)
  %64 = extractvalue { double, double } %63, 0
  store double %64, ptr %10, align 16
  %65 = extractvalue { double, double } %63, 1
  store double %65, ptr %41, align 8
  %66 = getelementptr inbounds i8, ptr %.085, i64 24
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %10, ptr noundef nonnull %54)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %67 = load ptr, ptr %39, align 16, !tbaa !20
  %68 = getelementptr inbounds i8, ptr %.07784, i64 16
  %.sroa.023.0.copyload = load double, ptr %68, align 16
  %.sroa.224.0..sroa_idx = getelementptr inbounds i8, ptr %.07784, i64 24
  %.sroa.224.0.copyload = load double, ptr %.sroa.224.0..sroa_idx, align 8, !tbaa !21
  %69 = load ptr, ptr %67, align 8, !tbaa !22
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %71 = load ptr, ptr %70, align 8
  %72 = call { double, double } %71(ptr noundef nonnull align 8 dereferenceable(8) %67, double %.sroa.023.0.copyload, double %.sroa.224.0.copyload)
  %73 = extractvalue { double, double } %72, 0
  %74 = extractvalue { double, double } %72, 1
  %75 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %38, double %73, double %74)
  %76 = extractvalue { double, double } %75, 0
  store double %76, ptr %11, align 16
  %77 = extractvalue { double, double } %75, 1
  store double %77, ptr %42, align 8
  %78 = getelementptr inbounds i8, ptr %.085, i64 36
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %11, ptr noundef nonnull %66)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  %79 = getelementptr inbounds i8, ptr %.07784, i64 48
  %80 = icmp ult ptr %79, %35
  br i1 %80, label %43, label %.loopexit80, !llvm.loop !24

81:                                               ; preds = %19
  br i1 %36, label %.lr.ph, label %.loopexit80

.lr.ph:                                           ; preds = %81
  %82 = getelementptr inbounds i8, ptr %1, i64 4176
  %83 = getelementptr inbounds i8, ptr %1, i64 4160
  %84 = getelementptr inbounds i8, ptr %12, i64 8
  %85 = getelementptr inbounds i8, ptr %13, i64 8
  %86 = getelementptr inbounds i8, ptr %14, i64 8
  br label %87

87:                                               ; preds = %.lr.ph, %87
  %.183 = phi ptr [ %3, %.lr.ph ], [ %122, %87 ]
  %.07882 = phi ptr [ %33, %.lr.ph ], [ %123, %87 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  %88 = load ptr, ptr %83, align 16, !tbaa !20
  %.sroa.012.0.copyload = load double, ptr %.07882, align 16
  %.sroa.213.0..sroa_idx = getelementptr inbounds i8, ptr %.07882, i64 8
  %.sroa.213.0.copyload = load double, ptr %.sroa.213.0..sroa_idx, align 8, !tbaa !21
  %89 = load ptr, ptr %88, align 8, !tbaa !22
  %90 = getelementptr inbounds i8, ptr %89, i64 16
  %91 = load ptr, ptr %90, align 8
  %92 = call { double, double } %91(ptr noundef nonnull align 8 dereferenceable(8) %88, double %.sroa.012.0.copyload, double %.sroa.213.0.copyload)
  %93 = extractvalue { double, double } %92, 0
  %94 = extractvalue { double, double } %92, 1
  %95 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %82, double %93, double %94)
  %96 = extractvalue { double, double } %95, 0
  store double %96, ptr %12, align 16
  %97 = extractvalue { double, double } %95, 1
  store double %97, ptr %84, align 8
  %98 = getelementptr inbounds i8, ptr %.183, i64 12
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %12, ptr noundef %.183)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  %99 = load ptr, ptr %83, align 16, !tbaa !20
  %100 = getelementptr inbounds i8, ptr %.07882, i64 16
  %.sroa.08.0.copyload = load double, ptr %100, align 16
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %.07882, i64 24
  %.sroa.29.0.copyload = load double, ptr %.sroa.29.0..sroa_idx, align 8, !tbaa !21
  %101 = load ptr, ptr %99, align 8, !tbaa !22
  %102 = getelementptr inbounds i8, ptr %101, i64 16
  %103 = load ptr, ptr %102, align 8
  %104 = call { double, double } %103(ptr noundef nonnull align 8 dereferenceable(8) %99, double %.sroa.08.0.copyload, double %.sroa.29.0.copyload)
  %105 = extractvalue { double, double } %104, 0
  %106 = extractvalue { double, double } %104, 1
  %107 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %82, double %105, double %106)
  %108 = extractvalue { double, double } %107, 0
  store double %108, ptr %13, align 16
  %109 = extractvalue { double, double } %107, 1
  store double %109, ptr %85, align 8
  %110 = getelementptr inbounds i8, ptr %.183, i64 24
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %13, ptr noundef nonnull %98)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %111 = load ptr, ptr %83, align 16, !tbaa !20
  %112 = getelementptr inbounds i8, ptr %.07882, i64 32
  %.sroa.0.0.copyload = load double, ptr %112, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %.07882, i64 40
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !21
  %113 = load ptr, ptr %111, align 8, !tbaa !22
  %114 = getelementptr inbounds i8, ptr %113, i64 16
  %115 = load ptr, ptr %114, align 8
  %116 = call { double, double } %115(ptr noundef nonnull align 8 dereferenceable(8) %111, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %117 = extractvalue { double, double } %116, 0
  %118 = extractvalue { double, double } %116, 1
  %119 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %82, double %117, double %118)
  %120 = extractvalue { double, double } %119, 0
  store double %120, ptr %14, align 16
  %121 = extractvalue { double, double } %119, 1
  store double %121, ptr %86, align 8
  %122 = getelementptr inbounds i8, ptr %.183, i64 36
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %14, ptr noundef nonnull %110)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  %123 = getelementptr inbounds i8, ptr %.07882, i64 48
  %124 = icmp ult ptr %123, %35
  br i1 %124, label %87, label %.loopexit80, !llvm.loop !26

.loopexit80:                                      ; preds = %87, %43, %81, %37
  %125 = load i64, ptr %22, align 8, !tbaa !10
  %126 = add i64 %125, %34
  store i64 %126, ptr %22, align 8, !tbaa !10
  %127 = sdiv i32 %27, 3
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %.loopexit, label %128

128:                                              ; preds = %.loopexit80
  %129 = call noundef ptr @_ZNK3JPH11ConvexShape11GetMaterialEv(ptr noundef nonnull align 8 dereferenceable(44) %0)
  %130 = sext i32 %127 to i64
  %131 = getelementptr inbounds ptr, ptr %4, i64 %130
  %132 = icmp sgt i32 %27, 2
  br i1 %132, label %.lr.ph88.preheader, label %.loopexit

.lr.ph88.preheader:                               ; preds = %128
  %133 = shl nuw nsw i64 %130, 3
  %134 = add i64 %133, %6
  %135 = add i64 %6, 8
  %umax = call i64 @llvm.umax.i64(i64 %134, i64 %135)
  %136 = xor i64 %6, -1
  %137 = add i64 %umax, %136
  %138 = lshr i64 %137, 3
  %139 = add nuw nsw i64 %138, 1
  %min.iters.check = icmp ult i64 %137, 24
  br i1 %min.iters.check, label %.lr.ph88.preheader93, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph88.preheader
  %n.vec = and i64 %139, 4611686018427387900
  %140 = shl i64 %n.vec, 3
  %ind.end = getelementptr i8, ptr %4, i64 %140
  %broadcast.splatinsert = insertelement <2 x ptr> poison, ptr %129, i64 0
  %broadcast.splat = shufflevector <2 x ptr> %broadcast.splatinsert, <2 x ptr> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = shl i64 %index, 3
  %next.gep = getelementptr i8, ptr %4, i64 %offset.idx
  %141 = getelementptr i8, ptr %next.gep, i64 16
  store <2 x ptr> %broadcast.splat, ptr %next.gep, align 8, !tbaa !27
  store <2 x ptr> %broadcast.splat, ptr %141, align 8, !tbaa !27
  %index.next = add nuw i64 %index, 4
  %142 = icmp eq i64 %index.next, %n.vec
  br i1 %142, label %middle.block, label %vector.body, !llvm.loop !28

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %139, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph88.preheader93

.lr.ph88.preheader93:                             ; preds = %middle.block, %.lr.ph88.preheader
  %.07687.ph = phi ptr [ %4, %.lr.ph88.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph88

.lr.ph88:                                         ; preds = %.lr.ph88.preheader93, %.lr.ph88
  %.07687 = phi ptr [ %143, %.lr.ph88 ], [ %.07687.ph, %.lr.ph88.preheader93 ]
  store ptr %129, ptr %.07687, align 8, !tbaa !27
  %143 = getelementptr inbounds i8, ptr %.07687, i64 8
  %144 = icmp ult ptr %143, %131
  br i1 %144, label %.lr.ph88, label %.loopexit, !llvm.loop !31

.loopexit:                                        ; preds = %.lr.ph88, %middle.block, %128, %.loopexit80
  ret i32 %127
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4sizeEv(ptr noundef nonnull align 16 dereferenceable(6160)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH11StaticArrayINS_4Vec3ELj384EE4dataEv(ptr noundef nonnull align 16 dereferenceable(6160)) local_unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #6

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 2158392889}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !16, i64 4248}
!11 = !{!"_ZTSN3JPH11ConvexShape21CSGetTrianglesContextE", !12, i64 0, !13, i64 4160, !14, i64 4176, !15, i64 4240, !16, i64 4248}
!12 = !{!"_ZTSN3JPH11ConvexShape13SupportBufferE", !8, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"_ZTSN3JPH5Mat44E", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!11, !15, i64 4240}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!11, !13, i64 4160}
!21 = !{!8, !8, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !9, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = !{!13, !13, i64 0}
!28 = distinct !{!28, !25, !29, !30}
!29 = !{!"llvm.loop.isvectorized", i32 1}
!30 = !{!"llvm.loop.unroll.runtime.disable"}
!31 = distinct !{!31, !25, !30, !29}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass