; 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::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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17ConvexHullBuilder27MergeCoplanarOrConcaveFacesEPNS0_4FaceEfRNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %1, float noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #5 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca float, align 4
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  store i8 0, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %25, i32 0, i32 3
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  store ptr %27, ptr %10, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %109, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  store ptr %31, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %32, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  %35 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !22
  store ptr %36, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %39, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %40, i64 16, i1 false), !tbaa.struct !23
  %41 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %42 = load double, ptr %41, align 16
  %43 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %44 = load double, ptr %43, align 8
  %45 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %38, double %42, double %44)
  %46 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %47 = getelementptr inbounds %union.anon, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds { double, double }, ptr %47, i32 0, i32 0
  %49 = extractvalue { double, double } %45, 0
  store double %49, ptr %48, align 16
  %50 = getelementptr inbounds { double, double }, ptr %47, i32 0, i32 1
  %51 = extractvalue { double, double } %45, 1
  store double %51, ptr %50, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %52, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %13, i64 16, i1 false), !tbaa.struct !23
  %54 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %55 = load double, ptr %54, align 16
  %56 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %57 = load double, ptr %56, align 8
  %58 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %53, double %55, double %57)
  store float %58, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %59 = load float, ptr %15, align 4, !tbaa !9
  %60 = call noundef float @_ZSt3absf(float noundef %59)
  %61 = load float, ptr %15, align 4, !tbaa !9
  %62 = fmul float %60, %61
  store float %62, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %63, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %13, i64 16, i1 false), !tbaa.struct !23
  %65 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %66 = load double, ptr %65, align 16
  %67 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %68 = load double, ptr %67, align 8
  %69 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %64, double %66, double %68)
  %70 = fneg float %69
  store float %70, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %71 = load float, ptr %18, align 4, !tbaa !9
  %72 = call noundef float @_ZSt3absf(float noundef %71)
  %73 = load float, ptr %18, align 4, !tbaa !9
  %74 = fmul float %72, %73
  store float %74, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %75, i32 0, i32 0
  %77 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %76)
  store float %77, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %78, i32 0, i32 0
  %80 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %79)
  store float %80, ptr %22, align 4, !tbaa !9
  %81 = load float, ptr %17, align 4, !tbaa !9
  %82 = load float, ptr %7, align 4, !tbaa !9
  %83 = fneg float %82
  %84 = load float, ptr %21, align 4, !tbaa !9
  %85 = fmul float %83, %84
  %86 = fcmp ogt float %81, %85
  br i1 %86, label %94, label %87

87:                                               ; preds = %28
  %88 = load float, ptr %20, align 4, !tbaa !9
  %89 = load float, ptr %7, align 4, !tbaa !9
  %90 = fneg float %89
  %91 = load float, ptr %22, align 4, !tbaa !9
  %92 = fmul float %90, %91
  %93 = fcmp ogt float %88, %92
  br i1 %93, label %94, label %107

94:                                               ; preds = %87, %28
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %97, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %98, i64 16, i1 false), !tbaa.struct !23
  %99 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %100 = load double, ptr %99, align 16
  %101 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %102 = load double, ptr %101, align 8
  %103 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %96, double %100, double %102)
  %104 = fcmp ogt float %103, 0.000000e+00
  br i1 %104, label %105, label %107

105:                                              ; preds = %94
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN3JPH17ConvexHullBuilder10MergeFacesEPNS0_4EdgeE(ptr noundef nonnull align 8 dereferenceable(56) %24, ptr noundef %106)
  store i8 1, ptr %9, align 1, !tbaa !11
  br label %107

107:                                              ; preds = %105, %94, %87
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %108, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %109

109:                                              ; preds = %107
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %111, i32 0, i32 3
  %113 = load ptr, ptr %112, align 8, !tbaa !13
  %114 = icmp ne ptr %110, %113
  br i1 %114, label %28, label %115, !llvm.loop !25

115:                                              ; preds = %109
  %116 = load i8, ptr %9, align 1, !tbaa !11, !range !27, !noundef !28
  %117 = trunc i8 %116 to i1
  br i1 %117, label %118, label %121

118:                                              ; preds = %115
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3JPH17ConvexHullBuilder18RemoveInvalidEdgesEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %24, ptr noundef %119, ptr noundef nonnull align 8 dereferenceable(24) %120)
  br label %121

121:                                              ; preds = %118, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH17ConvexHullBuilder10MergeFacesEPNS0_4EdgeE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH17ConvexHullBuilder18RemoveInvalidEdgesEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 56}
!14 = !{!"_ZTSN3JPH17ConvexHullBuilder4FaceE", !15, i64 0, !15, i64 16, !16, i64 32, !6, i64 56, !10, i64 64, !12, i64 68}
!15 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!16 = !{!"_ZTSN3JPH5ArrayIiNS_12STLAllocatorIiEEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !6, i64 8}
!19 = !{!"_ZTSN3JPH17ConvexHullBuilder4EdgeE", !6, i64 0, !6, i64 8, !6, i64 16, !20, i64 24}
!20 = !{!"int", !7, i64 0}
!21 = !{!19, !6, i64 16}
!22 = !{!19, !6, i64 0}
!23 = !{i64 0, i64 16, !24}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{i8 0, i8 2}
!28 = !{}


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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17ConvexHullBuilder27MergeCoplanarOrConcaveFacesEPNS0_4FaceEfRNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %1, float noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #3 align 2 {
  %5 = getelementptr inbounds i8, ptr %1, i64 56
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.213.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 24
  %8 = fneg float %2
  br label %.outer

.outer:                                           ; preds = %.thread, %4
  %.035.ph = phi ptr [ %11, %.thread ], [ %6, %4 ]
  %.0.ph = phi i1 [ true, %.thread ], [ false, %4 ]
  br label %9

9:                                                ; preds = %.outer, %36
  %.035 = phi ptr [ %11, %36 ], [ %.035.ph, %.outer ]
  %10 = getelementptr inbounds i8, ptr %.035, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %.035, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !18
  %14 = load ptr, ptr %13, align 8, !tbaa !19
  %15 = getelementptr inbounds i8, ptr %14, i64 16
  %.sroa.012.0.copyload = load double, ptr %7, align 16
  %.sroa.213.0.copyload = load double, ptr %.sroa.213.0..sroa_idx, align 8, !tbaa !20
  %16 = tail call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %15, double %.sroa.012.0.copyload, double %.sroa.213.0.copyload)
  %17 = extractvalue { double, double } %16, 0
  %18 = extractvalue { double, double } %16, 1
  %19 = tail call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %1, double %17, double %18)
  %20 = tail call noundef float @_ZSt3absf(float noundef %19)
  %21 = fmul float %19, %20
  %22 = tail call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %14, double %17, double %18)
  %23 = fneg float %22
  %24 = tail call noundef float @_ZSt3absf(float noundef %23)
  %25 = tail call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %1)
  %26 = tail call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %14)
  %27 = fmul float %25, %8
  %28 = fcmp ogt float %21, %27
  br i1 %28, label %33, label %29

29:                                               ; preds = %9
  %30 = fmul float %24, %23
  %31 = fmul float %26, %8
  %32 = fcmp ogt float %30, %31
  br i1 %32, label %33, label %36

33:                                               ; preds = %29, %9
  %.sroa.0.0.copyload = load double, ptr %14, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !20
  %34 = tail call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %1, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %35 = fcmp ogt float %34, 0.000000e+00
  br i1 %35, label %.thread, label %36

36:                                               ; preds = %33, %29
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %11, %37
  br i1 %.not, label %39, label %9, !llvm.loop !21

.thread:                                          ; preds = %33
  tail call void @_ZN3JPH17ConvexHullBuilder10MergeFacesEPNS0_4EdgeE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %.035)
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %.not38 = icmp eq ptr %11, %38
  br i1 %.not38, label %.thread40, label %.outer, !llvm.loop !21

39:                                               ; preds = %36
  br i1 %.0.ph, label %.thread40, label %40

.thread40:                                        ; preds = %.thread, %39
  tail call void @_ZN3JPH17ConvexHullBuilder18RemoveInvalidEdgesEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(24) %3)
  br label %40

40:                                               ; preds = %.thread40, %39
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH17ConvexHullBuilder10MergeFacesEPNS0_4EdgeE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH17ConvexHullBuilder18RemoveInvalidEdgesEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { alwaysinline 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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" }

!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, !12, i64 8}
!16 = !{!"_ZTSN3JPH17ConvexHullBuilder4EdgeE", !12, i64 0, !12, i64 8, !12, i64 16, !17, i64 24}
!17 = !{!"int", !8, i64 0}
!18 = !{!16, !12, i64 16}
!19 = !{!16, !12, i64 0}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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