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

; 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.geometry::types::triangle_t" = type { [3 x %class.Vector3] }
%class.Vector3 = type { [3 x float] }
%"struct.geometry::mesh::quickhullMesh_t" = type { %"class.geometry::mesh::TriangleGraphMesh", i32, [500 x %"struct.geometry::types::minkowskiDiffVertex_t"] }
%"class.geometry::mesh::TriangleGraphMesh" = type { i32, [500 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 }
%"struct.geometry::types::triangleMesh_t" = type { i32, i32, [1000 x %"struct.geometry::types::meshTriangle_t"], [500 x %class.Vector3] }
%"struct.geometry::types::meshTriangle_t" = type { [3 x i32], %class.Vector3 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8geometry4mesh28convertQuickHullToMeshConfigERKNS0_15quickhullMesh_tERK7Vector3RNS_5types14triangleMesh_tE(ptr noundef nonnull align 4 dereferenceable(34008) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(30008) %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.geometry::types::triangle_t", align 4
  %11 = alloca i32, align 4
  %12 = alloca %class.Vector3, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %13, i32 0, i32 1
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %"struct.geometry::types::triangleMesh_t", ptr %16, i32 0, i32 1
  store i32 %15, ptr %17, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !15
  br label %18

18:                                               ; preds = %38, %3
  %19 = load i32, ptr %7, align 4, !tbaa !15
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = icmp ult i32 %19, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %41

25:                                               ; preds = %18
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %26, i32 0, i32 2
  %28 = load i32, ptr %7, align 4, !tbaa !15
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %27, i64 0, i64 %29
  %31 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %30, i32 0, i32 2
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.geometry::types::triangleMesh_t", ptr %32, i32 0, i32 3
  %34 = load i32, ptr %7, align 4, !tbaa !15
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds [500 x %class.Vector3], ptr %33, i64 0, i64 %35
  %37 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 4 dereferenceable(12) %31)
  br label %38

38:                                               ; preds = %25
  %39 = load i32, ptr %7, align 4, !tbaa !15
  %40 = add i32 %39, 1
  store i32 %40, ptr %7, align 4, !tbaa !15
  br label %18, !llvm.loop !16

41:                                               ; preds = %24
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %42, i32 0, i32 0
  %44 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004) %43)
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.geometry::types::triangleMesh_t", ptr %45, i32 0, i32 0
  store i32 %44, ptr %46, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !15
  br label %47

47:                                               ; preds = %118, %41
  %48 = load i32, ptr %8, align 4, !tbaa !15
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %49, i32 0, i32 0
  %51 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004) %50)
  %52 = icmp ult i32 %48, %51
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 36, ptr %10) #5
  call void @_ZN8geometry5types10triangle_tC2Ev(ptr noundef nonnull align 4 dereferenceable(36) %10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !15
  br label %55

55:                                               ; preds = %97, %54
  %56 = load i32, ptr %11, align 4, !tbaa !15
  %57 = icmp ult i32 %56, 3
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %100

59:                                               ; preds = %55
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %62, i32 0, i32 0
  %64 = load i32, ptr %8, align 4, !tbaa !15
  %65 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %63, i32 noundef %64)
  %66 = getelementptr inbounds %"struct.geometry::types::leanNeighborTriangle_t", ptr %65, i32 0, i32 0
  %67 = load i32, ptr %11, align 4, !tbaa !15
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds [3 x i32], ptr %66, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !15
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %61, i64 0, i64 %71
  %73 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %72, i32 0, i32 2
  %74 = getelementptr inbounds %"struct.geometry::types::triangle_t", ptr %10, i32 0, i32 0
  %75 = load i32, ptr %11, align 4, !tbaa !15
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds [3 x %class.Vector3], ptr %74, i64 0, i64 %76
  %78 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %77, ptr noundef nonnull align 4 dereferenceable(12) %73)
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %79, i32 0, i32 0
  %81 = load i32, ptr %8, align 4, !tbaa !15
  %82 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %80, i32 noundef %81)
  %83 = getelementptr inbounds %"struct.geometry::types::leanNeighborTriangle_t", ptr %82, i32 0, i32 0
  %84 = load i32, ptr %11, align 4, !tbaa !15
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds [3 x i32], ptr %83, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !15
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.geometry::types::triangleMesh_t", ptr %88, i32 0, i32 2
  %90 = load i32, ptr %8, align 4, !tbaa !15
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds [1000 x %"struct.geometry::types::meshTriangle_t"], ptr %89, i64 0, i64 %91
  %93 = getelementptr inbounds %"struct.geometry::types::meshTriangle_t", ptr %92, i32 0, i32 0
  %94 = load i32, ptr %11, align 4, !tbaa !15
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds [3 x i32], ptr %93, i64 0, i64 %95
  store i32 %87, ptr %96, align 4, !tbaa !15
  br label %97

97:                                               ; preds = %59
  %98 = load i32, ptr %11, align 4, !tbaa !15
  %99 = add i32 %98, 1
  store i32 %99, ptr %11, align 4, !tbaa !15
  br label %55, !llvm.loop !19

100:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  %101 = getelementptr inbounds %"struct.geometry::types::triangle_t", ptr %10, i32 0, i32 0
  %102 = getelementptr inbounds [3 x %class.Vector3], ptr %101, i64 0, i64 0
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN8geometry10calcNormalEPK7Vector3RS1_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %12, ptr noundef %102, ptr noundef nonnull align 4 dereferenceable(12) %103)
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.geometry::types::triangleMesh_t", ptr %104, i32 0, i32 2
  %106 = load i32, ptr %8, align 4, !tbaa !15
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds [1000 x %"struct.geometry::types::meshTriangle_t"], ptr %105, i64 0, i64 %107
  %109 = getelementptr inbounds %"struct.geometry::types::meshTriangle_t", ptr %108, i32 0, i32 1
  %110 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %109, ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.geometry::types::triangleMesh_t", ptr %111, i32 0, i32 2
  %113 = load i32, ptr %8, align 4, !tbaa !15
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds [1000 x %"struct.geometry::types::meshTriangle_t"], ptr %112, i64 0, i64 %114
  %116 = getelementptr inbounds %"struct.geometry::types::meshTriangle_t", ptr %115, i32 0, i32 1
  %117 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector39NormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %116)
  call void @llvm.lifetime.end.p0(i64 36, ptr %10) #5
  br label %118

118:                                              ; preds = %100
  %119 = load i32, ptr %8, align 4, !tbaa !15
  %120 = add i32 %119, 1
  store i32 %120, ptr %8, align 4, !tbaa !15
  br label %47, !llvm.loop !20

121:                                              ; preds = %53
  ret void
}

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

; Function Attrs: mustprogress 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)) #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8geometry5types10triangle_tC2Ev(ptr noundef nonnull align 4 dereferenceable(36)) unnamed_addr #3 align 2

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

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

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

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 = { 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 #4 = { "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, !12, i64 12004}
!10 = !{!"_ZTSN8geometry4mesh15quickhullMesh_tE", !11, i64 0, !12, i64 12004, !7, i64 12008}
!11 = !{!"_ZTSN8geometry4mesh17TriangleGraphMeshILj500EEE", !12, i64 0, !7, i64 4}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 4}
!14 = !{!"_ZTSN8geometry5types14triangleMesh_tE", !12, i64 0, !12, i64 4, !7, i64 8, !7, i64 24008}
!15 = !{!12, !12, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!14, !12, i64 0}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}


; 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"

%"struct.geometry::types::triangle_t" = type { [3 x %class.Vector3] }
%class.Vector3 = type { [3 x float] }
%"struct.geometry::types::minkowskiDiffVertex_t" = type { i32, i32, %class.Vector3, %class.Vector3, %class.Vector3 }
%"struct.geometry::types::meshTriangle_t" = type { [3 x i32], %class.Vector3 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8geometry4mesh28convertQuickHullToMeshConfigERKNS0_15quickhullMesh_tERK7Vector3RNS_5types14triangleMesh_tE(ptr noundef nonnull align 4 dereferenceable(34008) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(30008) %2) local_unnamed_addr #0 {
  %4 = alloca %"struct.geometry::types::triangle_t", align 4
  %5 = alloca %class.Vector3, align 4
  %6 = getelementptr inbounds i8, ptr %0, i64 12004
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %7, ptr %8, align 4, !tbaa !11
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 12008
  %10 = getelementptr inbounds i8, ptr %2, i64 24008
  br label %17

._crit_edge:                                      ; preds = %17, %3
  %11 = tail call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004) %0)
  store i32 %11, ptr %2, align 4, !tbaa !13
  %12 = tail call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004) %0)
  %.not39 = icmp eq i32 %12, 0
  br i1 %.not39, label %._crit_edge38, label %.lr.ph37

.lr.ph37:                                         ; preds = %._crit_edge
  %13 = getelementptr inbounds i8, ptr %0, i64 12008
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = getelementptr inbounds i8, ptr %4, i64 12
  %16 = getelementptr inbounds i8, ptr %4, i64 24
  br label %24

17:                                               ; preds = %.lr.ph, %17
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %17 ]
  %18 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %9, i64 0, i64 %indvars.iv, i32 2
  %19 = getelementptr inbounds [500 x %class.Vector3], ptr %10, i64 0, i64 %indvars.iv
  %20 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = zext i32 %21 to i64
  %23 = icmp ult i64 %indvars.iv.next, %22
  br i1 %23, label %17, label %._crit_edge, !llvm.loop !14

._crit_edge38:                                    ; preds = %24, %._crit_edge
  ret void

24:                                               ; preds = %.lr.ph37, %24
  %indvars.iv44 = phi i64 [ 0, %.lr.ph37 ], [ %indvars.iv.next45, %24 ]
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %4) #5
  call void @_ZN8geometry5types10triangle_tC2Ev(ptr noundef nonnull align 4 dereferenceable(36) %4)
  %25 = getelementptr inbounds [1000 x %"struct.geometry::types::meshTriangle_t"], ptr %14, i64 0, i64 %indvars.iv44
  %26 = trunc nuw i64 %indvars.iv44 to i32
  %27 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %26)
  %28 = load i32, ptr %27, align 4, !tbaa !16
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %13, i64 0, i64 %29, i32 2
  %31 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %30)
  %32 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %26)
  %33 = load i32, ptr %32, align 4, !tbaa !16
  store i32 %33, ptr %25, align 4, !tbaa !16
  %34 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %26)
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !16
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %13, i64 0, i64 %37, i32 2
  %39 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %15, ptr noundef nonnull align 4 dereferenceable(12) %38)
  %40 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %26)
  %41 = getelementptr inbounds i8, ptr %40, i64 4
  %42 = load i32, ptr %41, align 4, !tbaa !16
  %43 = getelementptr inbounds i8, ptr %25, i64 4
  store i32 %42, ptr %43, align 4, !tbaa !16
  %44 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %26)
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load i32, ptr %45, align 4, !tbaa !16
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %13, i64 0, i64 %47, i32 2
  %49 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %48)
  %50 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %26)
  %51 = getelementptr inbounds i8, ptr %50, i64 8
  %52 = load i32, ptr %51, align 4, !tbaa !16
  %53 = getelementptr inbounds i8, ptr %25, i64 8
  store i32 %52, ptr %53, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  call void @_ZN8geometry10calcNormalEPK7Vector3RS1_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %5, ptr noundef nonnull %4, ptr noundef nonnull align 4 dereferenceable(12) %1)
  %54 = getelementptr inbounds [1000 x %"struct.geometry::types::meshTriangle_t"], ptr %14, i64 0, i64 %indvars.iv44, i32 1
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %54, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector39NormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %54)
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %4) #5
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %57 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004) %0)
  %58 = zext i32 %57 to i64
  %59 = icmp ult i64 %indvars.iv.next45, %58
  br i1 %59, label %24, label %._crit_edge38, !llvm.loop !17
}

; 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 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 #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8geometry5types10triangle_tC2Ev(ptr noundef nonnull align 4 dereferenceable(36)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004), i32 noundef) local_unnamed_addr #2 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 #4

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

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 = { 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 #4 = { "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, !8, i64 12004}
!6 = !{!"_ZTSN8geometry4mesh15quickhullMesh_tE", !7, i64 0, !8, i64 12004, !9, i64 12008}
!7 = !{!"_ZTSN8geometry4mesh17TriangleGraphMeshILj500EEE", !8, i64 0, !9, i64 4}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !8, i64 4}
!12 = !{!"_ZTSN8geometry5types14triangleMesh_tE", !8, i64 0, !8, i64 4, !9, i64 8, !9, i64 24008}
!13 = !{!12, !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!8, !8, i64 0}
!17 = distinct !{!17, !15}


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