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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::Vec3" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }
%"class.JPH::ConvexHullShape::CHSGetTrianglesContext" = type { %"class.JPH::Mat44", i8, i64 }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.7 }
%union.anon.7 = type { <4 x float> }
%"class.JPH::ConvexHullShape" = type <{ %"class.JPH::ConvexShape.base", [4 x i8], %"class.JPH::Vec3", %"class.JPH::Mat44", %"class.JPH::AABox", %"class.JPH::Array.8", %"class.JPH::Array.11", %"class.JPH::Array.14", %"class.JPH::Array.17", float, float, float, [4 x i8] }>
%"class.JPH::ConvexShape.base" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::RefConst", float }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.5", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.5" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Array.8" = type { i64, i64, ptr }
%"class.JPH::Array.11" = type { i64, i64, ptr }
%"class.JPH::Array.14" = type { i64, i64, ptr }
%"class.JPH::Array.17" = type { i64, i64, ptr }
%"struct.JPH::ConvexHullShape::Face" = type { i16, i16 }
%"struct.JPH::ConvexHullShape::Point" = type { %"class.JPH::Vec3", i32, [3 x i32] }
%"class.JPH::Float3" = type { float, float, float }

@.str.4 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.17 = 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3JPH15ConvexHullShape16GetTrianglesNextERNS_5Shape19GetTrianglesContextEiPNS_6Float3EPPKNS_15PhysicsMaterialE(ptr noundef nonnull align 16 dereferenceable(272) %0, ptr noundef nonnull align 16 dereferenceable(4288) %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) unnamed_addr #5 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 ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %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 ptr, align 8
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca %"class.JPH::Vec3", align 16
  %28 = alloca %"class.JPH::Vec3", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca ptr, align 8
  %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 ptr, align 8
  %36 = alloca ptr, align 8
  %37 = 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
  %38 = load ptr, ptr %6, align 8
  br label %39

39:                                               ; preds = %5
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = icmp sge i32 %40, 32
  br i1 %41, label %45, label %42

42:                                               ; preds = %39
  %43 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.17, ptr noundef @.str.4, i32 noundef 1186)
  br i1 %43, label %44, label %45

44:                                               ; preds = %42
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !11
  br label %45

45:                                               ; preds = %44, %42, %39
  br label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %47, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %285, %46
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %49, i32 0, i32 2
  %51 = load i64, ptr %50, align 8, !tbaa !12
  %52 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 6
  %53 = call noundef i64 @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %52)
  %54 = icmp ult i64 %51, %53
  br i1 %54, label %55, label %290

55:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %56 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 6
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %57, i32 0, i32 2
  %59 = load i64, ptr %58, align 8, !tbaa !12
  %60 = call noundef nonnull align 2 dereferenceable(4) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %59)
  store ptr %60, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %61 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 8
  %62 = call noundef ptr @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %61)
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Face", ptr %63, i32 0, i32 0
  %65 = load i16, ptr %64, align 2, !tbaa !17
  %66 = zext i16 %65 to i32
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i8, ptr %62, i64 %67
  store ptr %68, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Face", ptr %70, i32 0, i32 1
  %72 = load i16, ptr %71, align 2, !tbaa !20
  %73 = zext i16 %72 to i32
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %69, i64 %74
  store ptr %75, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Face", ptr %76, i32 0, i32 1
  %78 = load i16, ptr %77, align 2, !tbaa !20
  %79 = zext i16 %78 to i32
  %80 = sub nsw i32 %79, 2
  store i32 %80, ptr %17, align 4, !tbaa !9
  %81 = load i32, ptr %17, align 4, !tbaa !9
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = sub nsw i32 %82, %81
  store i32 %83, ptr %8, align 4, !tbaa !9
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = icmp slt i32 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %55
  store i32 4, ptr %18, align 4
  br label %282

87:                                               ; preds = %55
  %88 = load i32, ptr %17, align 4, !tbaa !9
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = add nsw i32 %89, %88
  store i32 %90, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 5
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %94, i64 0
  %96 = load i8, ptr %95, align 1, !tbaa !21
  %97 = zext i8 %96 to i64
  %98 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %97)
  %99 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Point", ptr %98, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %99, i64 16, i1 false), !tbaa.struct !22
  %100 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %101 = load double, ptr %100, align 16
  %102 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %103 = load double, ptr %102, align 8
  %104 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %92, double %101, double %103)
  %105 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %106 = getelementptr inbounds %union.anon.6, ptr %105, i32 0, i32 0
  %107 = getelementptr inbounds { double, double }, ptr %106, i32 0, i32 0
  %108 = extractvalue { double, double } %104, 0
  store double %108, ptr %107, align 16
  %109 = getelementptr inbounds { double, double }, ptr %106, i32 0, i32 1
  %110 = extractvalue { double, double } %104, 1
  store double %110, ptr %109, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 5
  %114 = load ptr, ptr %15, align 8, !tbaa !5
  %115 = getelementptr inbounds i8, ptr %114, i64 1
  %116 = load i8, ptr %115, align 1, !tbaa !21
  %117 = zext i8 %116 to i64
  %118 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %113, i64 noundef %117)
  %119 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Point", ptr %118, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 %119, i64 16, i1 false), !tbaa.struct !22
  %120 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %121 = load double, ptr %120, align 16
  %122 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %123 = load double, ptr %122, align 8
  %124 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %112, double %121, double %123)
  %125 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %126 = getelementptr inbounds %union.anon.6, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds { double, double }, ptr %126, i32 0, i32 0
  %128 = extractvalue { double, double } %124, 0
  store double %128, ptr %127, align 16
  %129 = getelementptr inbounds { double, double }, ptr %126, i32 0, i32 1
  %130 = extractvalue { double, double } %124, 1
  store double %130, ptr %129, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #6
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 5
  %134 = load ptr, ptr %15, align 8, !tbaa !5
  %135 = getelementptr inbounds i8, ptr %134, i64 2
  %136 = load i8, ptr %135, align 1, !tbaa !21
  %137 = zext i8 %136 to i64
  %138 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %133, i64 noundef %137)
  %139 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Point", ptr %138, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %139, i64 16, i1 false), !tbaa.struct !22
  %140 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %141 = load double, ptr %140, align 16
  %142 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %143 = load double, ptr %142, align 8
  %144 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %132, double %141, double %143)
  %145 = getelementptr inbounds %"class.JPH::Vec3", ptr %23, i32 0, i32 0
  %146 = getelementptr inbounds %union.anon.6, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds { double, double }, ptr %146, i32 0, i32 0
  %148 = extractvalue { double, double } %144, 0
  store double %148, ptr %147, align 16
  %149 = getelementptr inbounds { double, double }, ptr %146, i32 0, i32 1
  %150 = extractvalue { double, double } %144, 1
  store double %150, ptr %149, align 8
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = getelementptr inbounds %"class.JPH::Float3", ptr %151, i32 1
  store ptr %152, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %19, ptr noundef %151)
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  %154 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %153, i32 0, i32 1
  %155 = load i8, ptr %154, align 16, !tbaa !23, !range !24, !noundef !25
  %156 = trunc i8 %155 to i1
  br i1 %156, label %157, label %219

157:                                              ; preds = %87
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = getelementptr inbounds %"class.JPH::Float3", ptr %158, i32 1
  store ptr %159, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %23, ptr noundef %158)
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %"class.JPH::Float3", ptr %160, i32 1
  store ptr %161, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %21, ptr noundef %160)
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  %163 = getelementptr inbounds i8, ptr %162, i64 3
  store ptr %163, ptr %25, align 8, !tbaa !5
  br label %164

164:                                              ; preds = %215, %157
  %165 = load ptr, ptr %25, align 8, !tbaa !5
  %166 = load ptr, ptr %16, align 8, !tbaa !5
  %167 = icmp ult ptr %165, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  store i32 7, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %218

169:                                              ; preds = %164
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = getelementptr inbounds %"class.JPH::Float3", ptr %170, i32 1
  store ptr %171, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %19, ptr noundef %170)
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #6
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  %173 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %172, i32 0, i32 0
  %174 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 5
  %175 = load ptr, ptr %25, align 8, !tbaa !5
  %176 = load i8, ptr %175, align 1, !tbaa !21
  %177 = zext i8 %176 to i64
  %178 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %174, i64 noundef %177)
  %179 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Point", ptr %178, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 16 %179, i64 16, i1 false), !tbaa.struct !22
  %180 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %181 = load double, ptr %180, align 16
  %182 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %183 = load double, ptr %182, align 8
  %184 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %173, double %181, double %183)
  %185 = getelementptr inbounds %"class.JPH::Vec3", ptr %26, i32 0, i32 0
  %186 = getelementptr inbounds %union.anon.6, ptr %185, i32 0, i32 0
  %187 = getelementptr inbounds { double, double }, ptr %186, i32 0, i32 0
  %188 = extractvalue { double, double } %184, 0
  store double %188, ptr %187, align 16
  %189 = getelementptr inbounds { double, double }, ptr %186, i32 0, i32 1
  %190 = extractvalue { double, double } %184, 1
  store double %190, ptr %189, align 8
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds %"class.JPH::Float3", ptr %191, i32 1
  store ptr %192, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %26, ptr noundef %191)
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  %193 = load ptr, ptr %12, align 8, !tbaa !5
  %194 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %193, i32 0, i32 0
  %195 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 5
  %196 = load ptr, ptr %25, align 8, !tbaa !5
  %197 = getelementptr inbounds i8, ptr %196, i64 -1
  %198 = load i8, ptr %197, align 1, !tbaa !21
  %199 = zext i8 %198 to i64
  %200 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %195, i64 noundef %199)
  %201 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Point", ptr %200, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %29, ptr align 16 %201, i64 16, i1 false), !tbaa.struct !22
  %202 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %203 = load double, ptr %202, align 16
  %204 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %205 = load double, ptr %204, align 8
  %206 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %194, double %203, double %205)
  %207 = getelementptr inbounds %"class.JPH::Vec3", ptr %28, i32 0, i32 0
  %208 = getelementptr inbounds %union.anon.6, ptr %207, i32 0, i32 0
  %209 = getelementptr inbounds { double, double }, ptr %208, i32 0, i32 0
  %210 = extractvalue { double, double } %206, 0
  store double %210, ptr %209, align 16
  %211 = getelementptr inbounds { double, double }, ptr %208, i32 0, i32 1
  %212 = extractvalue { double, double } %206, 1
  store double %212, ptr %211, align 8
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = getelementptr inbounds %"class.JPH::Float3", ptr %213, i32 1
  store ptr %214, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %28, ptr noundef %213)
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br label %215

215:                                              ; preds = %169
  %216 = load ptr, ptr %25, align 8, !tbaa !5
  %217 = getelementptr inbounds i8, ptr %216, i32 1
  store ptr %217, ptr %25, align 8, !tbaa !5
  br label %164, !llvm.loop !26

218:                                              ; preds = %168
  br label %281

219:                                              ; preds = %87
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = getelementptr inbounds %"class.JPH::Float3", ptr %220, i32 1
  store ptr %221, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %21, ptr noundef %220)
  %222 = load ptr, ptr %9, align 8, !tbaa !5
  %223 = getelementptr inbounds %"class.JPH::Float3", ptr %222, i32 1
  store ptr %223, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %23, ptr noundef %222)
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %224 = load ptr, ptr %15, align 8, !tbaa !5
  %225 = getelementptr inbounds i8, ptr %224, i64 3
  store ptr %225, ptr %30, align 8, !tbaa !5
  br label %226

226:                                              ; preds = %277, %219
  %227 = load ptr, ptr %30, align 8, !tbaa !5
  %228 = load ptr, ptr %16, align 8, !tbaa !5
  %229 = icmp ult ptr %227, %228
  br i1 %229, label %231, label %230

230:                                              ; preds = %226
  store i32 10, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %280

231:                                              ; preds = %226
  %232 = load ptr, ptr %9, align 8, !tbaa !5
  %233 = getelementptr inbounds %"class.JPH::Float3", ptr %232, i32 1
  store ptr %233, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %19, ptr noundef %232)
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #6
  %234 = load ptr, ptr %12, align 8, !tbaa !5
  %235 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %234, i32 0, i32 0
  %236 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 5
  %237 = load ptr, ptr %30, align 8, !tbaa !5
  %238 = getelementptr inbounds i8, ptr %237, i64 -1
  %239 = load i8, ptr %238, align 1, !tbaa !21
  %240 = zext i8 %239 to i64
  %241 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %236, i64 noundef %240)
  %242 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Point", ptr %241, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %32, ptr align 16 %242, i64 16, i1 false), !tbaa.struct !22
  %243 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 0
  %244 = load double, ptr %243, align 16
  %245 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 1
  %246 = load double, ptr %245, align 8
  %247 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %235, double %244, double %246)
  %248 = getelementptr inbounds %"class.JPH::Vec3", ptr %31, i32 0, i32 0
  %249 = getelementptr inbounds %union.anon.6, ptr %248, i32 0, i32 0
  %250 = getelementptr inbounds { double, double }, ptr %249, i32 0, i32 0
  %251 = extractvalue { double, double } %247, 0
  store double %251, ptr %250, align 16
  %252 = getelementptr inbounds { double, double }, ptr %249, i32 0, i32 1
  %253 = extractvalue { double, double } %247, 1
  store double %253, ptr %252, align 8
  %254 = load ptr, ptr %9, align 8, !tbaa !5
  %255 = getelementptr inbounds %"class.JPH::Float3", ptr %254, i32 1
  store ptr %255, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %31, ptr noundef %254)
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #6
  %256 = load ptr, ptr %12, align 8, !tbaa !5
  %257 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %256, i32 0, i32 0
  %258 = getelementptr inbounds %"class.JPH::ConvexHullShape", ptr %38, i32 0, i32 5
  %259 = load ptr, ptr %30, align 8, !tbaa !5
  %260 = load i8, ptr %259, align 1, !tbaa !21
  %261 = zext i8 %260 to i64
  %262 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %258, i64 noundef %261)
  %263 = getelementptr inbounds %"struct.JPH::ConvexHullShape::Point", ptr %262, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %34, ptr align 16 %263, i64 16, i1 false), !tbaa.struct !22
  %264 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 0
  %265 = load double, ptr %264, align 16
  %266 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 1
  %267 = load double, ptr %266, align 8
  %268 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %257, double %265, double %267)
  %269 = getelementptr inbounds %"class.JPH::Vec3", ptr %33, i32 0, i32 0
  %270 = getelementptr inbounds %union.anon.6, ptr %269, i32 0, i32 0
  %271 = getelementptr inbounds { double, double }, ptr %270, i32 0, i32 0
  %272 = extractvalue { double, double } %268, 0
  store double %272, ptr %271, align 16
  %273 = getelementptr inbounds { double, double }, ptr %270, i32 0, i32 1
  %274 = extractvalue { double, double } %268, 1
  store double %274, ptr %273, align 8
  %275 = load ptr, ptr %9, align 8, !tbaa !5
  %276 = getelementptr inbounds %"class.JPH::Float3", ptr %275, i32 1
  store ptr %276, ptr %9, align 8, !tbaa !5
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %33, ptr noundef %275)
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #6
  br label %277

277:                                              ; preds = %231
  %278 = load ptr, ptr %30, align 8, !tbaa !5
  %279 = getelementptr inbounds i8, ptr %278, i32 1
  store ptr %279, ptr %30, align 8, !tbaa !5
  br label %226, !llvm.loop !28

280:                                              ; preds = %230
  br label %281

281:                                              ; preds = %280, %218
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  store i32 0, ptr %18, align 4
  br label %282

282:                                              ; preds = %281, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %283 = load i32, ptr %18, align 4
  switch i32 %283, label %314 [
    i32 0, label %284
    i32 4, label %290
  ]

284:                                              ; preds = %282
  br label %285

285:                                              ; preds = %284
  %286 = load ptr, ptr %12, align 8, !tbaa !5
  %287 = getelementptr inbounds %"class.JPH::ConvexHullShape::CHSGetTrianglesContext", ptr %286, i32 0, i32 2
  %288 = load i64, ptr %287, align 8, !tbaa !12
  %289 = add i64 %288, 1
  store i64 %289, ptr %287, align 8, !tbaa !12
  br label %48, !llvm.loop !29

290:                                              ; preds = %282, %48
  %291 = load ptr, ptr %10, align 8, !tbaa !5
  %292 = icmp ne ptr %291, null
  br i1 %292, label %293, label %312

293:                                              ; preds = %290
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %294 = call noundef ptr @_ZNK3JPH11ConvexShape11GetMaterialEv(ptr noundef nonnull align 8 dereferenceable(44) %38)
  store ptr %294, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #6
  %295 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %295, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %296 = load ptr, ptr %10, align 8, !tbaa !5
  %297 = load i32, ptr %13, align 4, !tbaa !9
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds ptr, ptr %296, i64 %298
  store ptr %299, ptr %37, align 8, !tbaa !5
  br label %300

300:                                              ; preds = %308, %293
  %301 = load ptr, ptr %36, align 8, !tbaa !5
  %302 = load ptr, ptr %37, align 8, !tbaa !5
  %303 = icmp ult ptr %301, %302
  br i1 %303, label %305, label %304

304:                                              ; preds = %300
  store i32 13, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  br label %311

305:                                              ; preds = %300
  %306 = load ptr, ptr %35, align 8, !tbaa !5
  %307 = load ptr, ptr %36, align 8, !tbaa !5
  store ptr %306, ptr %307, align 8, !tbaa !5
  br label %308

308:                                              ; preds = %305
  %309 = load ptr, ptr %36, align 8, !tbaa !5
  %310 = getelementptr inbounds ptr, ptr %309, i32 1
  store ptr %310, ptr %36, align 8, !tbaa !5
  br label %300, !llvm.loop !30

311:                                              ; preds = %304
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  br label %312

312:                                              ; preds = %311, %290
  %313 = load i32, ptr %13, align 4, !tbaa !9
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  ret i32 %313

314:                                              ; preds = %282
  unreachable
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { 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 2158011981}
!12 = !{!13, !16, i64 72}
!13 = !{!"_ZTSN3JPH15ConvexHullShape22CHSGetTrianglesContextE", !14, i64 0, !15, i64 64, !16, i64 72}
!14 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTSN3JPH15ConvexHullShape4FaceE", !19, i64 0, !19, i64 2}
!19 = !{!"short", !7, i64 0}
!20 = !{!18, !19, i64 2}
!21 = !{!7, !7, i64 0}
!22 = !{i64 0, i64 16, !21}
!23 = !{!13, !15, i64 64}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = distinct !{!29, !27}
!30 = distinct !{!30, !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::Vec3" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }

@.str.4 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.17 = 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK3JPH15ConvexHullShape16GetTrianglesNextERNS_5Shape19GetTrianglesContextEiPNS_6Float3EPPKNS_15PhysicsMaterialE(ptr noundef nonnull align 16 dereferenceable(272) %0, ptr noundef nonnull align 16 dereferenceable(4288) %1, i32 noundef %2, ptr noundef %3, ptr noundef writeonly %4) unnamed_addr #4 align 2 {
  %6 = ptrtoint ptr %4 to i64
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %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 = icmp sgt i32 %2, 31
  br i1 %14, label %18, label %15

15:                                               ; preds = %5
  %16 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.4, i32 noundef 1186)
  br i1 %16, label %17, label %18

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

18:                                               ; preds = %5, %15, %17
  %19 = getelementptr inbounds i8, ptr %1, i64 72
  %20 = getelementptr inbounds i8, ptr %0, i64 184
  %21 = load i64, ptr %19, align 8, !tbaa !6
  %22 = tail call noundef i64 @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %23 = icmp ult i64 %21, %22
  br i1 %23, label %.lr.ph102, label %._crit_edge

.lr.ph102:                                        ; preds = %18
  %24 = getelementptr inbounds i8, ptr %0, i64 232
  %25 = getelementptr inbounds i8, ptr %0, i64 160
  %26 = getelementptr inbounds i8, ptr %7, i64 8
  %27 = getelementptr inbounds i8, ptr %8, i64 8
  %28 = getelementptr inbounds i8, ptr %9, i64 8
  %29 = getelementptr inbounds i8, ptr %1, i64 64
  %30 = getelementptr inbounds i8, ptr %12, i64 8
  %31 = getelementptr inbounds i8, ptr %13, i64 8
  %32 = getelementptr inbounds i8, ptr %10, i64 8
  %33 = getelementptr inbounds i8, ptr %11, i64 8
  br label %34

34:                                               ; preds = %.lr.ph102, %.loopexit87
  %.0101 = phi i32 [ %2, %.lr.ph102 ], [ %47, %.loopexit87 ]
  %.072100 = phi ptr [ %3, %.lr.ph102 ], [ %.3, %.loopexit87 ]
  %.07399 = phi i32 [ 0, %.lr.ph102 ], [ %50, %.loopexit87 ]
  %35 = load i64, ptr %19, align 8, !tbaa !6
  %36 = call noundef nonnull align 2 dereferenceable(4) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %35)
  %37 = call noundef ptr @_ZNK3JPH5ArrayIhNS_12STLAllocatorIhEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
  %38 = load i16, ptr %36, align 2, !tbaa !13
  %39 = zext i16 %38 to i64
  %40 = getelementptr inbounds i8, ptr %37, i64 %39
  %41 = getelementptr inbounds i8, ptr %36, i64 2
  %42 = load i16, ptr %41, align 2, !tbaa !16
  %43 = zext i16 %42 to i32
  %44 = zext i16 %42 to i64
  %45 = getelementptr inbounds i8, ptr %40, i64 %44
  %46 = add nsw i32 %43, -2
  %47 = sub nsw i32 %.0101, %46
  %48 = icmp slt i32 %47, 0
  br i1 %48, label %._crit_edge, label %49

49:                                               ; preds = %34
  %50 = add nsw i32 %46, %.07399
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %51 = load i8, ptr %40, align 1, !tbaa !17
  %52 = zext i8 %51 to i64
  %53 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %52)
  %.sroa.023.0.copyload = load double, ptr %53, align 16
  %.sroa.224.0..sroa_idx = getelementptr inbounds i8, ptr %53, i64 8
  %.sroa.224.0.copyload = load double, ptr %.sroa.224.0..sroa_idx, align 8, !tbaa !17
  %54 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %1, double %.sroa.023.0.copyload, double %.sroa.224.0.copyload)
  %55 = extractvalue { double, double } %54, 0
  store double %55, ptr %7, align 16
  %56 = extractvalue { double, double } %54, 1
  store double %56, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %57 = getelementptr inbounds i8, ptr %40, i64 1
  %58 = load i8, ptr %57, align 1, !tbaa !17
  %59 = zext i8 %58 to i64
  %60 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %59)
  %.sroa.021.0.copyload = load double, ptr %60, align 16
  %.sroa.222.0..sroa_idx = getelementptr inbounds i8, ptr %60, i64 8
  %.sroa.222.0.copyload = load double, ptr %.sroa.222.0..sroa_idx, align 8, !tbaa !17
  %61 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %1, double %.sroa.021.0.copyload, double %.sroa.222.0.copyload)
  %62 = extractvalue { double, double } %61, 0
  store double %62, ptr %8, align 16
  %63 = extractvalue { double, double } %61, 1
  store double %63, ptr %27, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %64 = getelementptr inbounds i8, ptr %40, i64 2
  %65 = load i8, ptr %64, align 1, !tbaa !17
  %66 = zext i8 %65 to i64
  %67 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %66)
  %.sroa.019.0.copyload = load double, ptr %67, align 16
  %.sroa.220.0..sroa_idx = getelementptr inbounds i8, ptr %67, i64 8
  %.sroa.220.0.copyload = load double, ptr %.sroa.220.0..sroa_idx, align 8, !tbaa !17
  %68 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %1, double %.sroa.019.0.copyload, double %.sroa.220.0.copyload)
  %69 = extractvalue { double, double } %68, 0
  store double %69, ptr %9, align 16
  %70 = extractvalue { double, double } %68, 1
  store double %70, ptr %28, align 8
  %71 = getelementptr inbounds i8, ptr %.072100, i64 12
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef %.072100)
  %72 = load i8, ptr %29, align 16, !tbaa !18, !range !19, !noundef !20
  %73 = trunc nuw i8 %72 to i1
  %74 = getelementptr inbounds i8, ptr %.072100, i64 24
  %.193 = getelementptr inbounds i8, ptr %.072100, i64 36
  %75 = icmp ugt i16 %42, 3
  br i1 %73, label %76, label %95

76:                                               ; preds = %49
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %9, ptr noundef nonnull %71)
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %8, ptr noundef nonnull %74)
  br i1 %75, label %.lr.ph97.preheader, label %.loopexit87

.lr.ph97.preheader:                               ; preds = %76
  %77 = getelementptr inbounds i8, ptr %40, i64 3
  br label %.lr.ph97

.lr.ph97:                                         ; preds = %.lr.ph97.preheader, %.lr.ph97
  %.196 = phi ptr [ %.1, %.lr.ph97 ], [ %.193, %.lr.ph97.preheader ]
  %.072.pn8095 = phi ptr [ %.196, %.lr.ph97 ], [ %.072100, %.lr.ph97.preheader ]
  %.07794 = phi ptr [ %93, %.lr.ph97 ], [ %77, %.lr.ph97.preheader ]
  %78 = getelementptr inbounds i8, ptr %.072.pn8095, i64 48
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull %.196)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  %79 = load i8, ptr %.07794, align 1, !tbaa !17
  %80 = zext i8 %79 to i64
  %81 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %80)
  %.sroa.013.0.copyload = load double, ptr %81, align 16
  %.sroa.214.0..sroa_idx = getelementptr inbounds i8, ptr %81, i64 8
  %.sroa.214.0.copyload = load double, ptr %.sroa.214.0..sroa_idx, align 8, !tbaa !17
  %82 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %1, double %.sroa.013.0.copyload, double %.sroa.214.0.copyload)
  %83 = extractvalue { double, double } %82, 0
  store double %83, ptr %10, align 16
  %84 = extractvalue { double, double } %82, 1
  store double %84, ptr %32, align 8
  %85 = getelementptr inbounds i8, ptr %.072.pn8095, i64 60
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %10, ptr noundef nonnull %78)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  %86 = getelementptr inbounds i8, ptr %.07794, i64 -1
  %87 = load i8, ptr %86, align 1, !tbaa !17
  %88 = zext i8 %87 to i64
  %89 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %88)
  %.sroa.011.0.copyload = load double, ptr %89, align 16
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %89, i64 8
  %.sroa.212.0.copyload = load double, ptr %.sroa.212.0..sroa_idx, align 8, !tbaa !17
  %90 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %1, double %.sroa.011.0.copyload, double %.sroa.212.0.copyload)
  %91 = extractvalue { double, double } %90, 0
  store double %91, ptr %11, align 16
  %92 = extractvalue { double, double } %90, 1
  store double %92, ptr %33, align 8
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %11, ptr noundef nonnull %85)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  %93 = getelementptr inbounds i8, ptr %.07794, i64 1
  %.1 = getelementptr inbounds i8, ptr %.196, i64 36
  %94 = icmp ult ptr %93, %45
  br i1 %94, label %.lr.ph97, label %.loopexit87, !llvm.loop !21

95:                                               ; preds = %49
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %8, ptr noundef nonnull %71)
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %9, ptr noundef nonnull %74)
  br i1 %75, label %.lr.ph.preheader, label %.loopexit87

.lr.ph.preheader:                                 ; preds = %95
  %96 = getelementptr inbounds i8, ptr %40, i64 3
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.292 = phi ptr [ %.2, %.lr.ph ], [ %.193, %.lr.ph.preheader ]
  %.072.pn91 = phi ptr [ %.292, %.lr.ph ], [ %.072100, %.lr.ph.preheader ]
  %.07890 = phi ptr [ %112, %.lr.ph ], [ %96, %.lr.ph.preheader ]
  %97 = getelementptr inbounds i8, ptr %.072.pn91, i64 48
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull %.292)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  %98 = getelementptr inbounds i8, ptr %.07890, i64 -1
  %99 = load i8, ptr %98, align 1, !tbaa !17
  %100 = zext i8 %99 to i64
  %101 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %100)
  %.sroa.05.0.copyload = load double, ptr %101, align 16
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %101, i64 8
  %.sroa.26.0.copyload = load double, ptr %.sroa.26.0..sroa_idx, align 8, !tbaa !17
  %102 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %1, double %.sroa.05.0.copyload, double %.sroa.26.0.copyload)
  %103 = extractvalue { double, double } %102, 0
  store double %103, ptr %12, align 16
  %104 = extractvalue { double, double } %102, 1
  store double %104, ptr %30, align 8
  %105 = getelementptr inbounds i8, ptr %.072.pn91, i64 60
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %12, ptr noundef nonnull %97)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  %106 = load i8, ptr %.07890, align 1, !tbaa !17
  %107 = zext i8 %106 to i64
  %108 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH5ArrayINS_15ConvexHullShape5PointENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %107)
  %.sroa.0.0.copyload = load double, ptr %108, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %108, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !17
  %109 = call { double, double } @_ZNK3JPH5Mat44mlENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %1, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %110 = extractvalue { double, double } %109, 0
  store double %110, ptr %13, align 16
  %111 = extractvalue { double, double } %109, 1
  store double %111, ptr %31, align 8
  call void @_ZNK3JPH4Vec311StoreFloat3EPNS_6Float3E(ptr noundef nonnull align 16 dereferenceable(16) %13, ptr noundef nonnull %105)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  %112 = getelementptr inbounds i8, ptr %.07890, i64 1
  %.2 = getelementptr inbounds i8, ptr %.292, i64 36
  %113 = icmp ult ptr %112, %45
  br i1 %113, label %.lr.ph, label %.loopexit87, !llvm.loop !23

.loopexit87:                                      ; preds = %.lr.ph, %.lr.ph97, %95, %76
  %.3 = phi ptr [ %.193, %76 ], [ %.193, %95 ], [ %.1, %.lr.ph97 ], [ %.2, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %114 = load i64, ptr %19, align 8, !tbaa !6
  %115 = add i64 %114, 1
  store i64 %115, ptr %19, align 8, !tbaa !6
  %116 = call noundef i64 @_ZNK3JPH5ArrayINS_15ConvexHullShape4FaceENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %117 = icmp ult i64 %115, %116
  br i1 %117, label %34, label %._crit_edge, !llvm.loop !24

._crit_edge:                                      ; preds = %.loopexit87, %34, %18
  %.073.lcssa = phi i32 [ 0, %18 ], [ %.07399, %34 ], [ %50, %.loopexit87 ]
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %.loopexit, label %118

118:                                              ; preds = %._crit_edge
  %119 = call noundef ptr @_ZNK3JPH11ConvexShape11GetMaterialEv(ptr noundef nonnull align 8 dereferenceable(44) %0)
  %120 = sext i32 %.073.lcssa to i64
  %121 = getelementptr inbounds ptr, ptr %4, i64 %120
  %122 = icmp sgt i32 %.073.lcssa, 0
  br i1 %122, label %.lr.ph108.preheader, label %.loopexit

.lr.ph108.preheader:                              ; preds = %118
  %123 = shl nuw nsw i64 %120, 3
  %124 = add i64 %123, %6
  %125 = add i64 %6, 8
  %umax = call i64 @llvm.umax.i64(i64 %124, i64 %125)
  %126 = xor i64 %6, -1
  %127 = add i64 %umax, %126
  %128 = lshr i64 %127, 3
  %129 = add nuw nsw i64 %128, 1
  %min.iters.check = icmp ult i64 %127, 24
  br i1 %min.iters.check, label %.lr.ph108.preheader113, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph108.preheader
  %n.vec = and i64 %129, 4611686018427387900
  %130 = shl i64 %n.vec, 3
  %ind.end = getelementptr i8, ptr %4, i64 %130
  %broadcast.splatinsert = insertelement <2 x ptr> poison, ptr %119, 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
  %131 = getelementptr i8, ptr %next.gep, i64 16
  store <2 x ptr> %broadcast.splat, ptr %next.gep, align 8, !tbaa !25
  store <2 x ptr> %broadcast.splat, ptr %131, align 8, !tbaa !25
  %index.next = add nuw i64 %index, 4
  %132 = icmp eq i64 %index.next, %n.vec
  br i1 %132, label %middle.block, label %vector.body, !llvm.loop !27

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %129, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph108.preheader113

.lr.ph108.preheader113:                           ; preds = %middle.block, %.lr.ph108.preheader
  %.071106.ph = phi ptr [ %4, %.lr.ph108.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph108

.lr.ph108:                                        ; preds = %.lr.ph108.preheader113, %.lr.ph108
  %.071106 = phi ptr [ %133, %.lr.ph108 ], [ %.071106.ph, %.lr.ph108.preheader113 ]
  store ptr %119, ptr %.071106, align 8, !tbaa !25
  %133 = getelementptr inbounds i8, ptr %.071106, i64 8
  %134 = icmp ult ptr %133, %121
  br i1 %134, label %.lr.ph108, label %.loopexit, !llvm.loop !30

.loopexit:                                        ; preds = %.lr.ph108, %middle.block, %118, %._crit_edge
  ret i32 %.073.lcssa
}

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 2158011981}
!6 = !{!7, !12, i64 72}
!7 = !{!"_ZTSN3JPH15ConvexHullShape22CHSGetTrianglesContextE", !8, i64 0, !11, i64 64, !12, i64 72}
!8 = !{!"_ZTSN3JPH5Mat44E", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"long", !9, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN3JPH15ConvexHullShape4FaceE", !15, i64 0, !15, i64 2}
!15 = !{!"short", !9, i64 0}
!16 = !{!14, !15, i64 2}
!17 = !{!9, !9, i64 0}
!18 = !{!7, !11, i64 64}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = !{!26, !26, i64 0}
!26 = !{!"any pointer", !9, i64 0}
!27 = distinct !{!27, !22, !28, !29}
!28 = !{!"llvm.loop.isvectorized", i32 1}
!29 = !{!"llvm.loop.unroll.runtime.disable"}
!30 = distinct !{!30, !22, !29, !28}


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