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

; 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::ConvexHullBuilder2D" = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.JPH::ConvexHullBuilder2D::Edge" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Array", ptr, ptr, i32, float }
%"class.JPH::Array" = type { i64, i64, ptr }

; 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: mustprogress uwtable
define dso_local void @_ZNK3JPH19ConvexHullBuilder2D17AssignPointToEdgeEiRKNS_5ArrayIPNS0_4EdgeENS_12STLAllocatorIS3_EEEE(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca float, align 4
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %19 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D", ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %22)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 %23, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store float 0.000000e+00, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %24, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = call noundef ptr @_ZNK3JPH5ArrayIPNS_19ConvexHullBuilder2D4EdgeENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %25)
  store ptr %26, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = call noundef ptr @_ZNK3JPH5ArrayIPNS_19ConvexHullBuilder2D4EdgeENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
  store ptr %28, ptr %12, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %75, %3
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = icmp ne ptr %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %78

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  store ptr %36, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %37 = load ptr, ptr %13, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %39, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %40, i64 16, i1 false), !tbaa.struct !13
  %41 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %42 = load double, ptr %41, align 16
  %43 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %44 = load double, ptr %43, align 8
  %45 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %42, double %44)
  %46 = getelementptr inbounds %"class.JPH::Vec3", ptr %15, 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
  %52 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %53 = load double, ptr %52, align 16
  %54 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %55 = load double, ptr %54, align 8
  %56 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %38, double %53, double %55)
  store float %56, ptr %14, align 4, !tbaa !15
  %57 = load float, ptr %14, align 4, !tbaa !15
  %58 = fcmp ogt float %57, 0.000000e+00
  br i1 %58, label %59, label %74

59:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %60 = load float, ptr %14, align 4, !tbaa !15
  %61 = load float, ptr %14, align 4, !tbaa !15
  %62 = fmul float %60, %61
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %63, i32 0, i32 0
  %65 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %64)
  %66 = fdiv float %62, %65
  store float %66, ptr %17, align 4, !tbaa !15
  %67 = load float, ptr %17, align 4, !tbaa !15
  %68 = load float, ptr %9, align 4, !tbaa !15
  %69 = fcmp ogt float %67, %68
  br i1 %69, label %70, label %73

70:                                               ; preds = %59
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %71, ptr %8, align 8, !tbaa !5
  %72 = load float, ptr %17, align 4, !tbaa !15
  store float %72, ptr %9, align 4, !tbaa !15
  br label %73

73:                                               ; preds = %70, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %74

74:                                               ; preds = %73, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds ptr, ptr %76, i32 1
  store ptr %77, ptr %11, align 8, !tbaa !5
  br label %29

78:                                               ; preds = %33
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %105

81:                                               ; preds = %78
  %82 = load float, ptr %9, align 4, !tbaa !15
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %83, i32 0, i32 6
  %85 = load float, ptr %84, align 4, !tbaa !17
  %86 = fcmp ogt float %82, %85
  br i1 %86, label %87, label %93

87:                                               ; preds = %81
  %88 = load float, ptr %9, align 4, !tbaa !15
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %89, i32 0, i32 6
  store float %88, ptr %90, align 4, !tbaa !17
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %91, i32 0, i32 2
  call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %104

93:                                               ; preds = %81
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %94, i32 0, i32 2
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %96, i32 0, i32 2
  %98 = call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %97)
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %"class.JPH::ConvexHullBuilder2D::Edge", ptr %99, i32 0, i32 2
  %101 = call noundef i64 @_ZNK3JPH5ArrayIiNS_12STLAllocatorIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %100)
  %102 = getelementptr inbounds i32, ptr %98, i64 %101
  %103 = getelementptr inbounds i32, ptr %102, i64 -1
  call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE6insertEPKiRS4_(ptr noundef nonnull align 8 dereferenceable(24) %95, ptr noundef %103, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %104

104:                                              ; preds = %93, %87
  br label %105

105:                                              ; preds = %104, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH5ArrayIPNS_19ConvexHullBuilder2D4EdgeENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH5ArrayIPNS_19ConvexHullBuilder2D4EdgeENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayIiNS_12STLAllocatorIiEEE4sizeEv(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 = { 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 = { 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 = { 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 #6 = { 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 #7 = { 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, !6, i64 0}
!12 = !{!"_ZTSN3JPH19ConvexHullBuilder2DE", !6, i64 0, !6, i64 8, !10, i64 16}
!13 = !{i64 0, i64 16, !14}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!18, !16, i64 76}
!18 = !{!"_ZTSN3JPH19ConvexHullBuilder2D4EdgeE", !19, i64 0, !19, i64 16, !20, i64 32, !6, i64 56, !6, i64 64, !10, i64 72, !16, i64 76}
!19 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!20 = !{!"_ZTSN3JPH5ArrayIiNS_12STLAllocatorIiEEEE", !21, i64 0, !21, i64 8, !6, i64 16}
!21 = !{!"long", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH19ConvexHullBuilder2D17AssignPointToEdgeEiRKNS_5ArrayIPNS0_4EdgeENS_12STLAllocatorIS3_EEEE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(20) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #3 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca %"class.JPH::Vec3", align 16
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %6 = load ptr, ptr %0, align 8, !tbaa !9
  %7 = sext i32 %1 to i64
  %8 = tail call noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %7)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %8, i64 16, i1 false), !tbaa.struct !12
  %9 = tail call noundef ptr @_ZNK3JPH5ArrayIPNS_19ConvexHullBuilder2D4EdgeENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %10 = tail call noundef ptr @_ZNK3JPH5ArrayIPNS_19ConvexHullBuilder2D4EdgeENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %.not36 = icmp eq ptr %9, %10
  br i1 %.not36, label %._crit_edge.thread, label %.lr.ph

._crit_edge:                                      ; preds = %23
  %.not35 = icmp eq ptr %.2, null
  br i1 %.not35, label %._crit_edge.thread, label %25

.lr.ph:                                           ; preds = %3, %23
  %.039 = phi ptr [ %.2, %23 ], [ null, %3 ]
  %.02938 = phi float [ %.231, %23 ], [ 0.000000e+00, %3 ]
  %.03237 = phi ptr [ %24, %23 ], [ %9, %3 ]
  %11 = load ptr, ptr %.03237, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %.sroa.0.0.copyload = load double, ptr %12, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 24
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !13
  %13 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %5, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %14 = extractvalue { double, double } %13, 0
  %15 = extractvalue { double, double } %13, 1
  %16 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %11, double %14, double %15)
  %17 = fcmp ogt float %16, 0.000000e+00
  br i1 %17, label %18, label %23

18:                                               ; preds = %.lr.ph
  %19 = fmul float %16, %16
  %20 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %11)
  %21 = fdiv float %19, %20
  %22 = fcmp ogt float %21, %.02938
  %.130 = select i1 %22, float %21, float %.02938
  %.1 = select i1 %22, ptr %11, ptr %.039
  br label %23

23:                                               ; preds = %18, %.lr.ph
  %.231 = phi float [ %.130, %18 ], [ %.02938, %.lr.ph ]
  %.2 = phi ptr [ %.1, %18 ], [ %.039, %.lr.ph ]
  %24 = getelementptr inbounds i8, ptr %.03237, i64 8
  %.not = icmp eq ptr %24, %10
  br i1 %.not, label %._crit_edge, label %.lr.ph

25:                                               ; preds = %._crit_edge
  %26 = getelementptr inbounds i8, ptr %.2, i64 76
  %27 = load float, ptr %26, align 4, !tbaa !15
  %28 = fcmp ogt float %.231, %27
  br i1 %28, label %29, label %31

29:                                               ; preds = %25
  store float %.231, ptr %26, align 4, !tbaa !15
  %30 = getelementptr inbounds i8, ptr %.2, i64 32
  call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %._crit_edge.thread

31:                                               ; preds = %25
  %32 = getelementptr inbounds i8, ptr %.2, i64 32
  %33 = call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %32)
  %34 = call noundef i64 @_ZNK3JPH5ArrayIiNS_12STLAllocatorIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32)
  %35 = getelementptr inbounds i32, ptr %33, i64 %34
  %36 = getelementptr inbounds i8, ptr %35, i64 -4
  call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE6insertEPKiRS4_(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull %36, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %3, %29, %31, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH5ArrayIPNS_19ConvexHullBuilder2D4EdgeENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH5ArrayIPNS_19ConvexHullBuilder2D4EdgeENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 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 #6 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayIiNS_12STLAllocatorIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 = { 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 = { 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 #6 = { 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 #7 = { 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 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN3JPH19ConvexHullBuilder2DE", !11, i64 0, !11, i64 8, !6, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{i64 0, i64 16, !13}
!13 = !{!7, !7, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !20, i64 76}
!16 = !{!"_ZTSN3JPH19ConvexHullBuilder2D4EdgeE", !17, i64 0, !17, i64 16, !18, i64 32, !11, i64 56, !11, i64 64, !6, i64 72, !20, i64 76}
!17 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!18 = !{!"_ZTSN3JPH5ArrayIiNS_12STLAllocatorIiEEEE", !19, i64 0, !19, i64 8, !11, i64 16}
!19 = !{!"long", !7, i64 0}
!20 = !{!"float", !7, i64 0}


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