; LLVM IR from Slingshot-Physics/slingshot-community :: common/geometry/src (epa)

; 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.Vector3 = type { [3 x float] }
%"struct.geometry::types::triangle_t" = type { [3 x %class.Vector3] }
%"struct.geometry::types::pointBaryCoord_t" = type { %class.Vector3, %class.Vector4 }
%class.Vector4 = type { [4 x float] }
%"struct.geometry::types::epa::epaMesh_t" = type { %"class.geometry::mesh::TriangleGraphMesh", [384 x %"struct.geometry::types::minkowskiDiffVertex_t"], i32 }
%"class.geometry::mesh::TriangleGraphMesh" = type { i32, [128 x %"struct.geometry::types::leanNeighborTriangle_t"] }
%"struct.geometry::types::leanNeighborTriangle_t" = type { [3 x i32], [3 x i32] }
%"struct.geometry::types::minkowskiDiffVertex_t" = type { i32, i32, %class.Vector3, %class.Vector3, %class.Vector3 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8geometry3epa21findClosestTriangleIdERKNS_5types3epa9epaMesh_tERK7Vector3RNS1_16pointBaryCoord_tERS6_(ptr noundef nonnull align 4 dereferenceable(19976) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(28) %2, ptr noundef nonnull align 4 dereferenceable(12) %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %class.Vector3, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.geometry::types::triangle_t", align 4
  %14 = alloca %"struct.geometry::types::pointBaryCoord_t", align 4
  %15 = alloca %class.Vector3, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 -1, ptr %9, align 4, !tbaa !9
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = getelementptr inbounds %"struct.geometry::types::pointBaryCoord_t", ptr %16, i32 0, i32 0
  call void @_ZN7Vector310InitializeEfff(ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef 0x47EFFFFFE0000000, float noundef 0x47EFFFFFE0000000, float noundef 0x47EFFFFFE0000000)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #5
  call void @_ZN7Vector3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.geometry::types::epa::epaMesh_t", ptr %18, i32 0, i32 0
  store ptr %19, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %85, %4
  %21 = load i32, ptr %12, align 4, !tbaa !9
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj128EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(3076) %22)
  %24 = icmp ult i32 %21, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %88

26:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 36, ptr %13) #5
  %27 = getelementptr inbounds %"struct.geometry::types::triangle_t", ptr %13, i32 0, i32 0
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.geometry::types::epa::epaMesh_t", ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj128EEixEj(ptr noundef nonnull align 4 dereferenceable(3076) %30, i32 noundef %31)
  %33 = getelementptr inbounds %"struct.geometry::types::leanNeighborTriangle_t", ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds [3 x i32], ptr %33, i64 0, i64 0
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [384 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %29, i64 0, i64 %36
  %38 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %37, i32 0, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %27, ptr noundef nonnull align 4 dereferenceable(12) %38)
  %39 = getelementptr inbounds %class.Vector3, ptr %27, i64 1
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.geometry::types::epa::epaMesh_t", ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = load i32, ptr %12, align 4, !tbaa !9
  %44 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj128EEixEj(ptr noundef nonnull align 4 dereferenceable(3076) %42, i32 noundef %43)
  %45 = getelementptr inbounds %"struct.geometry::types::leanNeighborTriangle_t", ptr %44, i32 0, i32 0
  %46 = getelementptr inbounds [3 x i32], ptr %45, i64 0, i64 1
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [384 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %41, i64 0, i64 %48
  %50 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %49, i32 0, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %50)
  %51 = getelementptr inbounds %class.Vector3, ptr %27, i64 2
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.geometry::types::epa::epaMesh_t", ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj128EEixEj(ptr noundef nonnull align 4 dereferenceable(3076) %54, i32 noundef %55)
  %57 = getelementptr inbounds %"struct.geometry::types::leanNeighborTriangle_t", ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds [3 x i32], ptr %57, i64 0, i64 2
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [384 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %53, i64 0, i64 %60
  %62 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %61, i32 0, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %51, ptr noundef nonnull align 4 dereferenceable(12) %62)
  call void @llvm.lifetime.start.p0(i64 28, ptr %14) #5
  %63 = getelementptr inbounds %"struct.geometry::types::triangle_t", ptr %13, i32 0, i32 0
  %64 = getelementptr inbounds [3 x %class.Vector3], ptr %63, i64 0, i64 0
  %65 = getelementptr inbounds %"struct.geometry::types::triangle_t", ptr %13, i32 0, i32 0
  %66 = getelementptr inbounds [3 x %class.Vector3], ptr %65, i64 0, i64 1
  %67 = getelementptr inbounds %"struct.geometry::types::triangle_t", ptr %13, i32 0, i32 0
  %68 = getelementptr inbounds [3 x %class.Vector3], ptr %67, i64 0, i64 2
  call void @_ZN8geometry8triangle19closestPointToPointERK7Vector3S3_S3_S3_(ptr dead_on_unwind writable sret(%"struct.geometry::types::pointBaryCoord_t") align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %64, ptr noundef nonnull align 4 dereferenceable(12) %66, ptr noundef nonnull align 4 dereferenceable(12) %68, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %69 = getelementptr inbounds %"struct.geometry::types::pointBaryCoord_t", ptr %14, i32 0, i32 0
  %70 = call noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12) %69)
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.geometry::types::pointBaryCoord_t", ptr %71, i32 0, i32 0
  %73 = call noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12) %72)
  %74 = fcmp ole float %70, %73
  br i1 %74, label %75, label %84

75:                                               ; preds = %26
  %76 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %76, ptr %9, align 4, !tbaa !9
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(28) ptr @_ZN8geometry5types16pointBaryCoord_taSERKS1_(ptr noundef nonnull align 4 dereferenceable(28) %77, ptr noundef nonnull align 4 dereferenceable(28) %14)
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #5
  %79 = getelementptr inbounds %"struct.geometry::types::triangle_t", ptr %13, i32 0, i32 0
  %80 = getelementptr inbounds [3 x %class.Vector3], ptr %79, i64 0, i64 0
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN8geometry10calcNormalEPK7Vector3RS1_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %15, ptr noundef %80, ptr noundef nonnull align 4 dereferenceable(12) %81)
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %82, ptr noundef nonnull align 4 dereferenceable(12) %15)
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #5
  br label %84

84:                                               ; preds = %75, %26
  call void @llvm.lifetime.end.p0(i64 28, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #5
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = add i32 %86, 1
  store i32 %87, ptr %12, align 4, !tbaa !9
  br label %20, !llvm.loop !11

88:                                               ; preds = %25
  %89 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret i32 %89
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj128EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(3076)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj128EEixEj(ptr noundef nonnull align 4 dereferenceable(3076), i32 noundef) #2 align 2

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

declare void @_ZN8geometry8triangle19closestPointToPointERK7Vector3S3_S3_S3_(ptr dead_on_unwind writable sret(%"struct.geometry::types::pointBaryCoord_t") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3

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

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

declare void @_ZN8geometry10calcNormalEPK7Vector3RS1_(ptr dead_on_unwind writable sret(%class.Vector3) align 4, ptr noundef, ptr noundef nonnull align 4 dereferenceable(12)) #3

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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.Vector3 = type { [3 x float] }
%"struct.geometry::types::triangle_t" = type { [3 x %class.Vector3] }
%"struct.geometry::types::pointBaryCoord_t" = type { %class.Vector3, %class.Vector4 }
%class.Vector4 = type { [4 x float] }
%"struct.geometry::types::minkowskiDiffVertex_t" = type { i32, i32, %class.Vector3, %class.Vector3, %class.Vector3 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8geometry3epa21findClosestTriangleIdERKNS_5types3epa9epaMesh_tERK7Vector3RNS1_16pointBaryCoord_tERS6_(ptr noundef nonnull align 4 dereferenceable(19976) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(28) %2, ptr noundef nonnull align 4 dereferenceable(12) %3) local_unnamed_addr #0 {
  %5 = alloca %class.Vector3, align 4
  %6 = alloca %"struct.geometry::types::triangle_t", align 4
  %7 = alloca %"struct.geometry::types::pointBaryCoord_t", align 4
  %8 = alloca %class.Vector3, align 4
  tail call void @_ZN7Vector310InitializeEfff(ptr noundef nonnull align 4 dereferenceable(12) %2, float noundef 0x47EFFFFFE0000000, float noundef 0x47EFFFFFE0000000, float noundef 0x47EFFFFFE0000000)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  call void @_ZN7Vector3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %9 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj128EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(3076) %0)
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 3076
  %11 = getelementptr inbounds i8, ptr %6, i64 12
  %12 = getelementptr inbounds i8, ptr %6, i64 24
  br label %13

._crit_edge:                                      ; preds = %34, %4
  %.019.lcssa = phi i32 [ -1, %4 ], [ %.1, %34 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  ret i32 %.019.lcssa

13:                                               ; preds = %.lr.ph, %34
  %.021 = phi i32 [ 0, %.lr.ph ], [ %35, %34 ]
  %.01920 = phi i32 [ -1, %.lr.ph ], [ %.1, %34 ]
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %6) #5
  %14 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj128EEixEj(ptr noundef nonnull align 4 dereferenceable(3076) %0, i32 noundef %.021)
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [384 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %10, i64 0, i64 %16, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %17)
  %18 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj128EEixEj(ptr noundef nonnull align 4 dereferenceable(3076) %0, i32 noundef %.021)
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [384 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %10, i64 0, i64 %21, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %22)
  %23 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj128EEixEj(ptr noundef nonnull align 4 dereferenceable(3076) %0, i32 noundef %.021)
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [384 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %10, i64 0, i64 %26, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %27)
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %7) #5
  call void @_ZN8geometry8triangle19closestPointToPointERK7Vector3S3_S3_S3_(ptr dead_on_unwind nonnull writable sret(%"struct.geometry::types::pointBaryCoord_t") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %28 = call noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12) %7)
  %29 = call noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12) %2)
  %30 = fcmp ugt float %28, %29
  br i1 %30, label %34, label %31

31:                                               ; preds = %13
  %32 = call noundef nonnull align 4 dereferenceable(28) ptr @_ZN8geometry5types16pointBaryCoord_taSERKS1_(ptr noundef nonnull align 4 dereferenceable(28) %2, ptr noundef nonnull align 4 dereferenceable(28) %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  call void @_ZN8geometry10calcNormalEPK7Vector3RS1_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %8, ptr noundef nonnull %6, ptr noundef nonnull align 4 dereferenceable(12) %1)
  %33 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  br label %34

34:                                               ; preds = %31, %13
  %.1 = phi i32 [ %.021, %31 ], [ %.01920, %13 ]
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #5
  %35 = add nuw i32 %.021, 1
  %36 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj128EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(3076) %0)
  %37 = icmp ult i32 %35, %36
  br i1 %37, label %13, label %._crit_edge, !llvm.loop !9
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj128EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(3076)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj128EEixEj(ptr noundef nonnull align 4 dereferenceable(3076), i32 noundef) local_unnamed_addr #2 align 2

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

declare void @_ZN8geometry8triangle19closestPointToPointERK7Vector3S3_S3_S3_(ptr dead_on_unwind writable sret(%"struct.geometry::types::pointBaryCoord_t") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7Vector316magnitudeSquaredEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

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

declare void @_ZN8geometry10calcNormalEPK7Vector3RS1_(ptr dead_on_unwind writable sret(%class.Vector3) align 4, ptr noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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