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

%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 }

; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004)) #1 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) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector3miERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8geometry4mesh17findFarthestPointERKNS0_15quickhullMesh_tERK7Vector3PKbjPKNS_5types21minkowskiDiffVertex_tE(ptr noundef nonnull align 4 dereferenceable(34008) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca [3 x %class.Vector3], align 16
  %17 = alloca %class.Vector3, align 4
  %18 = alloca %class.Vector3, align 4
  %19 = alloca float, align 4
  %20 = alloca %class.Vector3, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 -1, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store float 0.000000e+00, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %113, %5
  %22 = load i32, ptr %13, align 4, !tbaa !9
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = icmp ult i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %116

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %109, %26
  %28 = load i32, ptr %15, align 4, !tbaa !9
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %29, i32 0, i32 0
  %31 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004) %30)
  %32 = icmp ult i32 %28, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %27
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %112

34:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 36, ptr %16) #4
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %37, i32 0, i32 0
  %39 = load i32, ptr %15, align 4, !tbaa !9
  %40 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %38, i32 noundef %39)
  %41 = getelementptr inbounds %"struct.geometry::types::leanNeighborTriangle_t", ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds [3 x i32], ptr %41, i64 0, i64 0
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %36, i64 0, i64 %44
  %46 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %45, i32 0, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %46)
  %47 = getelementptr inbounds %class.Vector3, ptr %16, i64 1
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %50, i32 0, i32 0
  %52 = load i32, ptr %15, align 4, !tbaa !9
  %53 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %51, i32 noundef %52)
  %54 = getelementptr inbounds %"struct.geometry::types::leanNeighborTriangle_t", ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds [3 x i32], ptr %54, i64 0, i64 1
  %56 = load i32, ptr %55, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %49, i64 0, i64 %57
  %59 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %58, i32 0, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %47, ptr noundef nonnull align 4 dereferenceable(12) %59)
  %60 = getelementptr inbounds %class.Vector3, ptr %16, i64 2
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %61, i32 0, i32 2
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.geometry::mesh::quickhullMesh_t", ptr %63, i32 0, i32 0
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %64, i32 noundef %65)
  %67 = getelementptr inbounds %"struct.geometry::types::leanNeighborTriangle_t", ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds [3 x i32], ptr %67, i64 0, i64 2
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %62, i64 0, i64 %70
  %72 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %71, i32 0, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %60, ptr noundef nonnull align 4 dereferenceable(12) %72)
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #4
  %73 = getelementptr inbounds [3 x %class.Vector3], ptr %16, i64 0, i64 0
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN8geometry10calcNormalEPK7Vector3RS1_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %17, ptr noundef %73, ptr noundef nonnull align 4 dereferenceable(12) %74)
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #4
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %75, i64 %77
  %79 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %78, i32 0, i32 2
  %80 = getelementptr inbounds [3 x %class.Vector3], ptr %16, i64 0, i64 0
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %18, ptr noundef nonnull align 4 dereferenceable(12) %79, ptr noundef nonnull align 4 dereferenceable(12) %80)
  %81 = call noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12) %18, ptr noundef nonnull align 4 dereferenceable(12) %17)
  %82 = fcmp ogt float %81, 0.000000e+00
  br i1 %82, label %83, label %91

83:                                               ; preds = %34
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %84, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !13, !range !15, !noundef !16
  %89 = trunc i8 %88 to i1
  %90 = xor i1 %89, true
  br label %91

91:                                               ; preds = %83, %34
  %92 = phi i1 [ false, %34 ], [ %90, %83 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #4
  br i1 %92, label %93, label %108

93:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #4
  %94 = getelementptr inbounds [3 x %class.Vector3], ptr %16, i64 0, i64 0
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !9
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %95, i64 %97
  %99 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %98, i32 0, i32 2
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %20, ptr noundef nonnull align 4 dereferenceable(12) %94, ptr noundef nonnull align 4 dereferenceable(12) %99)
  %100 = call noundef float @_ZNK7Vector39magnitudeEv(ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #4
  store float %100, ptr %19, align 4, !tbaa !11
  %101 = load float, ptr %19, align 4, !tbaa !11
  %102 = load float, ptr %12, align 4, !tbaa !11
  %103 = fcmp ogt float %101, %102
  br i1 %103, label %104, label %107

104:                                              ; preds = %93
  %105 = load float, ptr %19, align 4, !tbaa !11
  store float %105, ptr %12, align 4, !tbaa !11
  %106 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %106, ptr %11, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %104, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %108

108:                                              ; preds = %107, %91
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr %16) #4
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %15, align 4, !tbaa !9
  %111 = add i32 %110, 1
  store i32 %111, ptr %15, align 4, !tbaa !9
  br label %27, !llvm.loop !17

112:                                              ; preds = %33
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = add i32 %114, 1
  store i32 %115, ptr %13, align 4, !tbaa !9
  br label %21, !llvm.loop !19

116:                                              ; preds = %25
  %117 = load i32, ptr %11, align 4, !tbaa !9
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret i32 %117
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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::minkowskiDiffVertex_t" = type { i32, i32, %class.Vector3, %class.Vector3, %class.Vector3 }

; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004)) local_unnamed_addr #1 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 #1 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 #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector3miERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8geometry4mesh17findFarthestPointERKNS0_15quickhullMesh_tERK7Vector3PKbjPKNS_5types21minkowskiDiffVertex_tE(ptr noundef nonnull align 4 dereferenceable(34008) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr nocapture noundef readonly %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = alloca [3 x %class.Vector3], align 16
  %7 = alloca %class.Vector3, align 4
  %8 = alloca %class.Vector3, align 4
  %9 = alloca %class.Vector3, align 4
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %._crit_edge40, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 12008
  %11 = getelementptr inbounds i8, ptr %6, i64 12
  %12 = getelementptr inbounds i8, ptr %6, i64 24
  %wide.trip.count = zext i32 %3 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next, %._crit_edge ]
  %.039 = phi i32 [ -1, %.preheader.lr.ph ], [ %.1.lcssa, %._crit_edge ]
  %.02837 = phi float [ 0.000000e+00, %.preheader.lr.ph ], [ %.129.lcssa, %._crit_edge ]
  %13 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004) %0)
  %.not42 = icmp eq i32 %13, 0
  br i1 %.not42, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %14 = getelementptr inbounds %"struct.geometry::types::minkowskiDiffVertex_t", ptr %4, i64 %indvars.iv, i32 2
  %15 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv
  %16 = trunc nuw i64 %indvars.iv to i32
  br label %17

._crit_edge40:                                    ; preds = %._crit_edge, %5
  %.0.lcssa = phi i32 [ -1, %5 ], [ %.1.lcssa, %._crit_edge ]
  ret i32 %.0.lcssa

._crit_edge:                                      ; preds = %40, %.preheader
  %.129.lcssa = phi float [ %.02837, %.preheader ], [ %.331, %40 ]
  %.1.lcssa = phi i32 [ %.039, %.preheader ], [ %.3, %40 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge40, label %.preheader, !llvm.loop !5

17:                                               ; preds = %.lr.ph, %40
  %.135 = phi i32 [ %.039, %.lr.ph ], [ %.3, %40 ]
  %.02634 = phi i32 [ 0, %.lr.ph ], [ %41, %40 ]
  %.12933 = phi float [ %.02837, %.lr.ph ], [ %.331, %40 ]
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %6) #4
  %18 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %.02634)
  %19 = load i32, ptr %18, align 4, !tbaa !7
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %10, i64 0, i64 %20, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %21)
  %22 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %.02634)
  %23 = getelementptr inbounds i8, ptr %22, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !7
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %10, i64 0, i64 %25, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %26)
  %27 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNK8geometry4mesh17TriangleGraphMeshILj500EEixEj(ptr noundef nonnull align 4 dereferenceable(12004) %0, i32 noundef %.02634)
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = load i32, ptr %28, align 4, !tbaa !7
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [500 x %"struct.geometry::types::minkowskiDiffVertex_t"], ptr %10, i64 0, i64 %30, i32 2
  call void @_ZN7Vector3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %31)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #4
  call void @_ZN8geometry10calcNormalEPK7Vector3RS1_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %7, ptr noundef nonnull %6, ptr noundef nonnull align 4 dereferenceable(12) %1)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #4
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %6)
  %32 = call noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %7)
  %33 = fcmp ogt float %32, 0.000000e+00
  br i1 %33, label %34, label %.critedge

34:                                               ; preds = %17
  %35 = load i8, ptr %15, align 1, !tbaa !11, !range !13, !noundef !14
  %36 = trunc nuw i8 %35 to i1
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #4
  br i1 %36, label %40, label %37

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #4
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %9, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %14)
  %38 = call noundef float @_ZNK7Vector39magnitudeEv(ptr noundef nonnull align 4 dereferenceable(12) %9)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #4
  %39 = fcmp ogt float %38, %.12933
  %.230 = select i1 %39, float %38, float %.12933
  %.2 = select i1 %39, i32 %16, i32 %.135
  br label %40

.critedge:                                        ; preds = %17
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #4
  br label %40

40:                                               ; preds = %.critedge, %37, %34
  %.331 = phi float [ %.230, %37 ], [ %.12933, %34 ], [ %.12933, %.critedge ]
  %.3 = phi i32 [ %.2, %37 ], [ %.135, %34 ], [ %.135, %.critedge ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #4
  %41 = add nuw i32 %.02634, 1
  %42 = call noundef i32 @_ZNK8geometry4mesh17TriangleGraphMeshILj500EE4sizeEv(ptr noundef nonnull align 4 dereferenceable(12004) %0)
  %43 = icmp ult i32 %41, %42
  br i1 %43, label %17, label %._crit_edge, !llvm.loop !15
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !6}


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