; LLVM IR from jrouwe/JoltPhysics :: Jolt/Geometry (ConvexHullBuilder)

; 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::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::UVec4" = type { %union.anon.0 }
%union.anon.0 = type { <2 x i64> }
%"class.JPH::Vec4" = type { %union.anon.1 }
%union.anon.1 = type { <4 x float> }
%"class.JPH::ConvexHullBuilder::Face" = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Array", ptr, float, i8, [11 x i8] }>
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::ConvexHullBuilder::Edge" = type <{ ptr, ptr, ptr, i32, [4 x i8] }>

; 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: mustprogress uwtable
define dso_local void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca i32, align 4
  %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 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::UVec4", align 16
  %20 = alloca %"class.JPH::Vec4", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec4", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca %"class.JPH::Vec3", align 16
  %28 = alloca %"class.JPH::Vec3", align 16
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca %"class.JPH::UVec4", align 16
  %32 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %33 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %34 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %33, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  store ptr %35, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %37, i32 0, i32 3
  %39 = load i32, ptr %38, align 8, !tbaa !16
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %"class.JPH::Vec3", ptr %36, i64 %40
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 %41, i64 16, i1 false), !tbaa.struct !19
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  store ptr %44, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %46, i32 0, i32 3
  %48 = load i32, ptr %47, align 8, !tbaa !16
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds %"class.JPH::Vec3", ptr %45, i64 %49
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 %50, i64 16, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %7, i64 16, i1 false), !tbaa.struct !19
  %51 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %52 = load double, ptr %51, align 16
  %53 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %54 = load double, ptr %53, align 8
  %55 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %52, double %54)
  %56 = getelementptr inbounds %"class.JPH::Vec3", ptr %8, i32 0, i32 0
  %57 = getelementptr inbounds %union.anon, ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds { double, double }, ptr %57, i32 0, i32 0
  %59 = extractvalue { double, double } %55, 0
  store double %59, ptr %58, align 16
  %60 = getelementptr inbounds { double, double }, ptr %57, i32 0, i32 1
  %61 = extractvalue { double, double } %55, 1
  store double %61, ptr %60, align 8
  %62 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %33, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %62, ptr align 16 %8, i64 16, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 2, ptr %10, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  %63 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %64 = getelementptr inbounds %"class.JPH::Vec3", ptr %11, i32 0, i32 0
  %65 = getelementptr inbounds %union.anon, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 0
  %67 = extractvalue { double, double } %63, 0
  store double %67, ptr %66, align 16
  %68 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 1
  %69 = extractvalue { double, double } %63, 1
  store double %69, ptr %68, align 8
  %70 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %33, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %70, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %71, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !21
  store ptr %73, ptr %5, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %211, %2
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %33, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = icmp ne ptr %75, %77
  br i1 %78, label %79, label %215

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %81, i32 0, i32 3
  %83 = load i32, ptr %82, align 8, !tbaa !16
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds %"class.JPH::Vec3", ptr %80, i64 %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %85, i64 16, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %6, i64 16, i1 false), !tbaa.struct !19
  %86 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %87 = load double, ptr %86, align 16
  %88 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %89 = load double, ptr %88, align 8
  %90 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %87, double %89)
  %91 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %92 = getelementptr inbounds %union.anon, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 0
  %94 = extractvalue { double, double } %90, 0
  store double %94, ptr %93, align 16
  %95 = getelementptr inbounds { double, double }, ptr %92, i32 0, i32 1
  %96 = extractvalue { double, double } %90, 1
  store double %96, ptr %95, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %7, i64 16, i1 false), !tbaa.struct !19
  %97 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %98 = load double, ptr %97, align 16
  %99 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %100 = load double, ptr %99, align 8
  %101 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %98, double %100)
  %102 = getelementptr inbounds %"class.JPH::Vec3", ptr %15, i32 0, i32 0
  %103 = getelementptr inbounds %union.anon, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds { double, double }, ptr %103, i32 0, i32 0
  %105 = extractvalue { double, double } %101, 0
  store double %105, ptr %104, align 16
  %106 = getelementptr inbounds { double, double }, ptr %103, i32 0, i32 1
  %107 = extractvalue { double, double } %101, 1
  store double %107, ptr %106, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %12, i64 16, i1 false), !tbaa.struct !19
  %108 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %109 = load double, ptr %108, align 16
  %110 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %111 = load double, ptr %110, align 8
  %112 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %109, double %111)
  %113 = getelementptr inbounds %"class.JPH::Vec3", ptr %17, i32 0, i32 0
  %114 = getelementptr inbounds %union.anon, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds { double, double }, ptr %114, i32 0, i32 0
  %116 = extractvalue { double, double } %112, 0
  store double %116, ptr %115, align 16
  %117 = getelementptr inbounds { double, double }, ptr %114, i32 0, i32 1
  %118 = extractvalue { double, double } %112, 1
  store double %118, ptr %117, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 %15, i64 16, i1 false), !tbaa.struct !19
  %119 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %120 = load double, ptr %119, align 16
  %121 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %122 = load double, ptr %121, align 8
  %123 = call { double, double } @_ZNK3JPH4Vec35DotV4ES0_(ptr noundef nonnull align 16 dereferenceable(16) %15, double %120, double %122)
  %124 = getelementptr inbounds %"class.JPH::Vec4", ptr %20, i32 0, i32 0
  %125 = getelementptr inbounds %union.anon.1, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds { double, double }, ptr %125, i32 0, i32 0
  %127 = extractvalue { double, double } %123, 0
  store double %127, ptr %126, align 16
  %128 = getelementptr inbounds { double, double }, ptr %125, i32 0, i32 1
  %129 = extractvalue { double, double } %123, 1
  store double %129, ptr %128, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %17, i64 16, i1 false), !tbaa.struct !19
  %130 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %131 = load double, ptr %130, align 16
  %132 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %133 = load double, ptr %132, align 8
  %134 = call { double, double } @_ZNK3JPH4Vec35DotV4ES0_(ptr noundef nonnull align 16 dereferenceable(16) %17, double %131, double %133)
  %135 = getelementptr inbounds %"class.JPH::Vec4", ptr %22, i32 0, i32 0
  %136 = getelementptr inbounds %union.anon.1, ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds { double, double }, ptr %136, i32 0, i32 0
  %138 = extractvalue { double, double } %134, 0
  store double %138, ptr %137, align 16
  %139 = getelementptr inbounds { double, double }, ptr %136, i32 0, i32 1
  %140 = extractvalue { double, double } %134, 1
  store double %140, ptr %139, align 8
  %141 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %142 = load double, ptr %141, align 16
  %143 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %144 = load double, ptr %143, align 8
  %145 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %146 = load double, ptr %145, align 16
  %147 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %148 = load double, ptr %147, align 8
  %149 = call { i64, i64 } @_ZN3JPH4Vec45sLessES0_S0_(double %142, double %144, double %146, double %148)
  %150 = getelementptr inbounds %"class.JPH::UVec4", ptr %19, i32 0, i32 0
  %151 = getelementptr inbounds %union.anon.0, ptr %150, i32 0, i32 0
  %152 = getelementptr inbounds { i64, i64 }, ptr %151, i32 0, i32 0
  %153 = extractvalue { i64, i64 } %149, 0
  store i64 %153, ptr %152, align 16
  %154 = getelementptr inbounds { i64, i64 }, ptr %151, i32 0, i32 1
  %155 = extractvalue { i64, i64 } %149, 1
  store i64 %155, ptr %154, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %15, i64 16, i1 false), !tbaa.struct !19
  %156 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %157 = load double, ptr %156, align 16
  %158 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %159 = load double, ptr %158, align 8
  %160 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %13, double %157, double %159)
  %161 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %162 = getelementptr inbounds %union.anon, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds { double, double }, ptr %162, i32 0, i32 0
  %164 = extractvalue { double, double } %160, 0
  store double %164, ptr %163, align 16
  %165 = getelementptr inbounds { double, double }, ptr %162, i32 0, i32 1
  %166 = extractvalue { double, double } %160, 1
  store double %166, ptr %165, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 16 %13, i64 16, i1 false), !tbaa.struct !19
  %167 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %168 = load double, ptr %167, align 16
  %169 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %170 = load double, ptr %169, align 8
  %171 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %17, double %168, double %170)
  %172 = getelementptr inbounds %"class.JPH::Vec3", ptr %26, i32 0, i32 0
  %173 = getelementptr inbounds %union.anon, ptr %172, i32 0, i32 0
  %174 = getelementptr inbounds { double, double }, ptr %173, i32 0, i32 0
  %175 = extractvalue { double, double } %171, 0
  store double %175, ptr %174, align 16
  %176 = getelementptr inbounds { double, double }, ptr %173, i32 0, i32 1
  %177 = extractvalue { double, double } %171, 1
  store double %177, ptr %176, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %29, ptr align 16 %26, i64 16, i1 false), !tbaa.struct !19
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %30, ptr align 16 %24, i64 16, i1 false), !tbaa.struct !19
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %31, ptr align 16 %19, i64 16, i1 false), !tbaa.struct !19
  %178 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %179 = load double, ptr %178, align 16
  %180 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %181 = load double, ptr %180, align 8
  %182 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %183 = load double, ptr %182, align 16
  %184 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %185 = load double, ptr %184, align 8
  %186 = getelementptr inbounds { i64, i64 }, ptr %31, i32 0, i32 0
  %187 = load i64, ptr %186, align 16
  %188 = getelementptr inbounds { i64, i64 }, ptr %31, i32 0, i32 1
  %189 = load i64, ptr %188, align 8
  %190 = call { double, double } @_ZN3JPH4Vec37sSelectES0_S0_NS_5UVec4E(double %179, double %181, double %183, double %185, i64 %187, i64 %189)
  %191 = getelementptr inbounds %"class.JPH::Vec3", ptr %28, i32 0, i32 0
  %192 = getelementptr inbounds %union.anon, ptr %191, i32 0, i32 0
  %193 = getelementptr inbounds { double, double }, ptr %192, i32 0, i32 0
  %194 = extractvalue { double, double } %190, 0
  store double %194, ptr %193, align 16
  %195 = getelementptr inbounds { double, double }, ptr %192, i32 0, i32 1
  %196 = extractvalue { double, double } %190, 1
  store double %196, ptr %195, align 8
  %197 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %33, i32 0, i32 0
  %198 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %199 = load double, ptr %198, align 16
  %200 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %201 = load double, ptr %200, align 8
  %202 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %197, double %199, double %201)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %32, ptr align 16 %12, i64 16, i1 false), !tbaa.struct !19
  %203 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %33, i32 0, i32 1
  %204 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 0
  %205 = load double, ptr %204, align 16
  %206 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 1
  %207 = load double, ptr %206, align 8
  %208 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %203, double %205, double %207)
  %209 = load i32, ptr %10, align 4, !tbaa !22
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %10, align 4, !tbaa !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 %12, i64 16, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %211

211:                                              ; preds = %79
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  %213 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %212, i32 0, i32 1
  %214 = load ptr, ptr %213, align 8, !tbaa !21
  store ptr %214, ptr %5, align 8, !tbaa !5
  br label %74, !llvm.loop !23

215:                                              ; preds = %74
  %216 = load i32, ptr %10, align 4, !tbaa !22
  %217 = sitofp i32 %216 to float
  %218 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %33, i32 0, i32 1
  %219 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3dVEf(ptr noundef nonnull align 16 dereferenceable(16) %218, float noundef %217)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

; 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 } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #3 align 2

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !6, i64 56}
!10 = !{!"_ZTSN3JPH17ConvexHullBuilder4FaceE", !11, i64 0, !11, i64 16, !12, i64 32, !6, i64 56, !14, i64 64, !15, i64 68}
!11 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!12 = !{!"_ZTSN3JPH5ArrayIiNS_12STLAllocatorIiEEEE", !13, i64 0, !13, i64 8, !6, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!17, !18, i64 24}
!17 = !{!"_ZTSN3JPH17ConvexHullBuilder4EdgeE", !6, i64 0, !6, i64 8, !6, i64 16, !18, i64 24}
!18 = !{!"int", !7, i64 0}
!19 = !{i64 0, i64 16, !20}
!20 = !{!7, !7, i64 0}
!21 = !{!17, !6, i64 8}
!22 = !{!18, !18, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; 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 }
%union.anon = type { <4 x float> }

; 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: mustprogress uwtable
define dso_local void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"class.JPH::Vec3", align 16
  %4 = alloca %"class.JPH::Vec3", align 16
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %11 = getelementptr inbounds i8, ptr %10, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !15
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds %"class.JPH::Vec3", ptr %1, i64 %13
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 16 dereferenceable(16) %14, i64 16, i1 false), !tbaa.struct !18
  %15 = getelementptr inbounds i8, ptr %10, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  %17 = getelementptr inbounds i8, ptr %16, i64 24
  %18 = load i32, ptr %17, align 8, !tbaa !15
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds %"class.JPH::Vec3", ptr %1, i64 %19
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) %20, i64 16, i1 false), !tbaa.struct !18
  %.sroa.035.0.copyload = load double, ptr %4, align 16
  %.sroa.236.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.236.0.copyload = load double, ptr %.sroa.236.0..sroa_idx, align 8, !tbaa !19
  %21 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %3, double %.sroa.035.0.copyload, double %.sroa.236.0.copyload)
  %22 = extractvalue { double, double } %21, 0
  %23 = extractvalue { double, double } %21, 1
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  store double %22, ptr %24, align 16
  %.sroa.438.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 24
  store double %23, ptr %.sroa.438.0..sroa_idx, align 8, !tbaa !19
  %25 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %26 = extractvalue { double, double } %25, 0
  %27 = extractvalue { double, double } %25, 1
  store double %26, ptr %0, align 16
  %.sroa.433.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 8
  store double %27, ptr %.sroa.433.0..sroa_idx, align 8, !tbaa !19
  %.0.in50 = getelementptr inbounds i8, ptr %16, i64 8
  %.051 = load ptr, ptr %.0.in50, align 8, !tbaa !20
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %.not52 = icmp eq ptr %.051, %28
  br i1 %.not52, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %.sroa.231.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %29 = getelementptr inbounds i8, ptr %6, i64 8
  %30 = getelementptr inbounds i8, ptr %7, i64 8
  %.sroa.227.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %31 = getelementptr inbounds i8, ptr %8, i64 8
  br label %32

32:                                               ; preds = %.lr.ph, %32
  %.054 = phi ptr [ %.051, %.lr.ph ], [ %.0, %32 ]
  %.04953 = phi i32 [ 2, %.lr.ph ], [ %66, %32 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  %33 = getelementptr inbounds i8, ptr %.054, i64 24
  %34 = load i32, ptr %33, align 8, !tbaa !15
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds %"class.JPH::Vec3", ptr %1, i64 %35
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %36, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %.sroa.030.0.copyload = load double, ptr %3, align 16
  %.sroa.231.0.copyload = load double, ptr %.sroa.231.0..sroa_idx, align 8, !tbaa !19
  %37 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %4, double %.sroa.030.0.copyload, double %.sroa.231.0.copyload)
  %38 = extractvalue { double, double } %37, 0
  store double %38, ptr %6, align 16
  %39 = extractvalue { double, double } %37, 1
  store double %39, ptr %29, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %.sroa.028.0.copyload = load double, ptr %4, align 16
  %.sroa.229.0.copyload = load double, ptr %.sroa.236.0..sroa_idx, align 8, !tbaa !19
  %40 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %5, double %.sroa.028.0.copyload, double %.sroa.229.0.copyload)
  %41 = extractvalue { double, double } %40, 0
  store double %41, ptr %7, align 16
  %42 = extractvalue { double, double } %40, 1
  store double %42, ptr %30, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %.sroa.026.0.copyload = load double, ptr %5, align 16
  %.sroa.227.0.copyload = load double, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !19
  %43 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %3, double %.sroa.026.0.copyload, double %.sroa.227.0.copyload)
  %44 = extractvalue { double, double } %43, 0
  store double %44, ptr %8, align 16
  %45 = extractvalue { double, double } %43, 1
  store double %45, ptr %31, align 8
  %.sroa.020.0.copyload = load double, ptr %7, align 16
  %.sroa.221.0.copyload = load double, ptr %30, align 8, !tbaa !19
  %46 = call { double, double } @_ZNK3JPH4Vec35DotV4ES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %.sroa.020.0.copyload, double %.sroa.221.0.copyload)
  %47 = extractvalue { double, double } %46, 0
  %48 = extractvalue { double, double } %46, 1
  %.sroa.016.0.copyload = load double, ptr %8, align 16
  %.sroa.217.0.copyload = load double, ptr %31, align 8, !tbaa !19
  %49 = call { double, double } @_ZNK3JPH4Vec35DotV4ES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %.sroa.016.0.copyload, double %.sroa.217.0.copyload)
  %50 = extractvalue { double, double } %49, 0
  %51 = extractvalue { double, double } %49, 1
  %52 = call { i64, i64 } @_ZN3JPH4Vec45sLessES0_S0_(double %47, double %48, double %50, double %51)
  %53 = extractvalue { i64, i64 } %52, 0
  %54 = extractvalue { i64, i64 } %52, 1
  %.sroa.012.0.copyload = load double, ptr %7, align 16
  %.sroa.213.0.copyload = load double, ptr %30, align 8, !tbaa !19
  %55 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.012.0.copyload, double %.sroa.213.0.copyload)
  %56 = extractvalue { double, double } %55, 0
  %57 = extractvalue { double, double } %55, 1
  %.sroa.09.0.copyload = load double, ptr %6, align 16
  %.sroa.210.0.copyload = load double, ptr %29, align 8, !tbaa !19
  %58 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %.sroa.09.0.copyload, double %.sroa.210.0.copyload)
  %59 = extractvalue { double, double } %58, 0
  %60 = extractvalue { double, double } %58, 1
  %61 = call { double, double } @_ZN3JPH4Vec37sSelectES0_S0_NS_5UVec4E(double %59, double %60, double %56, double %57, i64 %53, i64 %54)
  %62 = extractvalue { double, double } %61, 0
  %63 = extractvalue { double, double } %61, 1
  %64 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %0, double %62, double %63)
  %.sroa.0.0.copyload = load double, ptr %5, align 16
  %.sroa.2.0.copyload = load double, ptr %.sroa.227.0..sroa_idx, align 8, !tbaa !19
  %65 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %24, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %66 = add nuw nsw i32 %.04953, 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) %5, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  %.0.in = getelementptr inbounds i8, ptr %.054, i64 8
  %.0 = load ptr, ptr %.0.in, align 8, !tbaa !20
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %.not = icmp eq ptr %.0, %67
  br i1 %.not, label %._crit_edge.loopexit, label %32, !llvm.loop !21

._crit_edge.loopexit:                             ; preds = %32
  %68 = uitofp nneg i32 %66 to float
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %2
  %.049.lcssa = phi float [ 2.000000e+00, %2 ], [ %68, %._crit_edge.loopexit ]
  %69 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3dVEf(ptr noundef nonnull align 16 dereferenceable(16) %24, float noundef %.049.lcssa)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  ret void
}

; Function Attrs: mustprogress 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 } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass