; LLVM IR from jrouwe/JoltPhysics :: Jolt/Geometry/ConvexHullBuilder.ll (ZN3JPH17ConvexHullBuilder10MergeFacesEPNS0_4EdgeE)

; 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.JPH::AssertLastParam" = type { i8 }
%"class.JPH::ConvexHullBuilder::Edge" = type <{ ptr, ptr, ptr, i32, [4 x i8] }>
%"class.JPH::ConvexHullBuilder::Face" = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Array", ptr, float, i8, [11 x i8] }>
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::ConvexHullBuilder" = type { ptr, %"class.JPH::Array.2", %"class.JPH::Array.5" }
%"class.JPH::Array.2" = type { i64, i64, ptr }
%"class.JPH::Array.5" = type { i64, i64, ptr }

@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1

; 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: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #3

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

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

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

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

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

27:                                               ; preds = %2
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = icmp ne ptr %28, %29
  br i1 %30, label %34, label %31

31:                                               ; preds = %27
  %32 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.23, ptr noundef @.str.1, i32 noundef 883)
  br i1 %32, label %33, label %34

33:                                               ; preds = %31
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !14
  br label %34

34:                                               ; preds = %33, %31, %27
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !12
  store ptr %39, ptr %11, align 8, !tbaa !5
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %41, i32 0, i32 1
  store ptr %40, ptr %42, align 8, !tbaa !12
  br label %43

43:                                               ; preds = %56, %36
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %45, i32 0, i32 0
  store ptr %44, ptr %46, align 8, !tbaa !9
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !12
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = icmp eq ptr %49, %50
  br i1 %51, label %52, label %56

52:                                               ; preds = %43
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %54, i32 0, i32 1
  store ptr %53, ptr %55, align 8, !tbaa !12
  br label %60

56:                                               ; preds = %43
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %57, i32 0, i32 1
  %59 = load ptr, ptr %58, align 8, !tbaa !12
  store ptr %59, ptr %11, align 8, !tbaa !5
  br label %43, !llvm.loop !15

60:                                               ; preds = %52
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %61, i32 0, i32 3
  %63 = load ptr, ptr %62, align 8, !tbaa !17
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = icmp eq ptr %63, %64
  br i1 %65, label %66, label %72

66:                                               ; preds = %60
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !12
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %70, i32 0, i32 3
  store ptr %69, ptr %71, align 8, !tbaa !17
  br label %72

72:                                               ; preds = %66, %60
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = icmp eq ptr %73, null
  br i1 %74, label %76, label %75

75:                                               ; preds = %72
  call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef %73) #5
  br label %76

76:                                               ; preds = %75, %72
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = icmp eq ptr %77, null
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef %77) #5
  br label %80

80:                                               ; preds = %79, %76
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %81, i32 0, i32 3
  store ptr null, ptr %82, align 8, !tbaa !17
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %83, i32 0, i32 5
  store i8 1, ptr %84, align 4, !tbaa !24
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.JPH::ConvexHullBuilder", ptr %12, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !25
  %88 = call noundef ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %87)
  call void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69) %85, ptr noundef %88)
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %89, i32 0, i32 4
  %91 = load float, ptr %90, align 16, !tbaa !29
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %92, i32 0, i32 4
  %94 = load float, ptr %93, align 16, !tbaa !29
  %95 = fcmp ogt float %91, %94
  br i1 %95, label %96, label %109

96:                                               ; preds = %80
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %99, i32 0, i32 2
  %101 = call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %100)
  %102 = getelementptr inbounds i32, ptr %101, i64 -1
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %103, i32 0, i32 2
  %105 = call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %104)
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %106, i32 0, i32 2
  %108 = call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %107)
  call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE6insertIPiEEvPKiT_S8_(ptr noundef nonnull align 8 dereferenceable(24) %98, ptr noundef %102, ptr noundef %105, ptr noundef %108)
  br label %126

109:                                              ; preds = %80
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %112, i32 0, i32 2
  %114 = call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %113)
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %115, i32 0, i32 2
  %117 = call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %116)
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %118, i32 0, i32 2
  %120 = call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %119)
  call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE6insertIPiEEvPKiT_S8_(ptr noundef nonnull align 8 dereferenceable(24) %111, ptr noundef %114, ptr noundef %117, ptr noundef %120)
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %121, i32 0, i32 4
  %123 = load float, ptr %122, align 16, !tbaa !29
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %124, i32 0, i32 4
  store float %123, ptr %125, align 16, !tbaa !29
  br label %126

126:                                              ; preds = %109, %96
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %127, i32 0, i32 2
  call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %128)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 = { 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, !6, i64 0}
!10 = !{!"_ZTSN3JPH17ConvexHullBuilder4EdgeE", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !6, i64 16}
!14 = !{i64 2157050421}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !6, i64 56}
!18 = !{!"_ZTSN3JPH17ConvexHullBuilder4FaceE", !19, i64 0, !19, i64 16, !20, i64 32, !6, i64 56, !22, i64 64, !23, i64 68}
!19 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!20 = !{!"_ZTSN3JPH5ArrayIiNS_12STLAllocatorIiEEEE", !21, i64 0, !21, i64 8, !6, i64 16}
!21 = !{!"long", !7, i64 0}
!22 = !{!"float", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!18, !23, i64 68}
!25 = !{!26, !6, i64 0}
!26 = !{!"_ZTSN3JPH17ConvexHullBuilderE", !6, i64 0, !27, i64 8, !28, i64 32}
!27 = !{!"_ZTSN3JPH5ArrayIPNS_17ConvexHullBuilder4FaceENS_12STLAllocatorIS3_EEEE", !21, i64 0, !21, i64 8, !6, i64 16}
!28 = !{!"_ZTSN3JPH5ArrayINS_17ConvexHullBuilder8CoplanarENS_12STLAllocatorIS2_EEEE", !21, i64 0, !21, i64 8, !6, i64 16}
!29 = !{!18, !22, i64 64}


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

@.str.1 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH17ConvexHullBuilder4Edge15GetPreviousEdgeEv(ptr noundef nonnull align 8 dereferenceable(28)) 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 #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17ConvexHullBuilder10MergeFacesEPNS0_4EdgeE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(56) %0, ptr noundef nonnull %1) local_unnamed_addr #1 align 2 {
  %3 = load ptr, ptr %1, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !11
  %6 = tail call noundef ptr @_ZN3JPH17ConvexHullBuilder4Edge15GetPreviousEdgeEv(ptr noundef nonnull align 8 dereferenceable(28) %1)
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %.not = icmp eq ptr %3, %9
  br i1 %.not, label %10, label %13

10:                                               ; preds = %2
  %11 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.1, i32 noundef 883)
  br i1 %11, label %12, label %13

12:                                               ; preds = %10
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !13
  br label %13

13:                                               ; preds = %12, %10, %2
  %14 = getelementptr inbounds i8, ptr %8, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %15, ptr %16, align 8, !tbaa !11
  br label %17

17:                                               ; preds = %17, %13
  %.0 = phi ptr [ %15, %13 ], [ %19, %17 ]
  store ptr %3, ptr %.0, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %.0, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = icmp eq ptr %19, %8
  br i1 %20, label %21, label %17, !llvm.loop !14

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %.0, i64 8
  store ptr %5, ptr %22, align 8, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %3, i64 56
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = icmp eq ptr %24, %1
  br i1 %25, label %26, label %28

26:                                               ; preds = %21
  %27 = load ptr, ptr %16, align 8, !tbaa !11
  store ptr %27, ptr %23, align 8, !tbaa !16
  br label %28

28:                                               ; preds = %21, %26
  tail call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef nonnull %1) #4
  tail call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef nonnull %8) #4
  %29 = getelementptr inbounds i8, ptr %9, i64 56
  store ptr null, ptr %29, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %9, i64 68
  store i8 1, ptr %30, align 4, !tbaa !23
  %31 = load ptr, ptr %0, align 8, !tbaa !24
  %32 = tail call noundef ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  tail call void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69) %3, ptr noundef %32)
  %33 = getelementptr inbounds i8, ptr %3, i64 64
  %34 = load float, ptr %33, align 16, !tbaa !28
  %35 = getelementptr inbounds i8, ptr %9, i64 64
  %36 = load float, ptr %35, align 16, !tbaa !28
  %37 = fcmp ogt float %34, %36
  %38 = getelementptr inbounds i8, ptr %3, i64 32
  %39 = tail call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
  br i1 %37, label %40, label %45

40:                                               ; preds = %28
  %41 = getelementptr inbounds i8, ptr %39, i64 -4
  %42 = getelementptr inbounds i8, ptr %9, i64 32
  %43 = tail call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %42)
  %44 = tail call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %42)
  tail call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE6insertIPiEEvPKiT_S8_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull %41, ptr noundef %43, ptr noundef %44)
  br label %50

45:                                               ; preds = %28
  %46 = getelementptr inbounds i8, ptr %9, i64 32
  %47 = tail call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %46)
  %48 = tail call noundef ptr @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %46)
  tail call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE6insertIPiEEvPKiT_S8_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef %39, ptr noundef %47, ptr noundef %48)
  %49 = load float, ptr %35, align 16, !tbaa !28
  store float %49, ptr %33, align 16, !tbaa !28
  br label %50

50:                                               ; preds = %45, %40
  %51 = getelementptr inbounds i8, ptr %9, i64 32
  tail call void @_ZN3JPH5ArrayIiNS_12STLAllocatorIiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  ret void
}

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { 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 #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, !7, i64 0}
!6 = !{!"_ZTSN3JPH17ConvexHullBuilder4EdgeE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !7, i64 16}
!13 = !{i64 2157050421}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !7, i64 56}
!17 = !{!"_ZTSN3JPH17ConvexHullBuilder4FaceE", !18, i64 0, !18, i64 16, !19, i64 32, !7, i64 56, !21, i64 64, !22, i64 68}
!18 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!19 = !{!"_ZTSN3JPH5ArrayIiNS_12STLAllocatorIiEEEE", !20, i64 0, !20, i64 8, !7, i64 16}
!20 = !{!"long", !8, i64 0}
!21 = !{!"float", !8, i64 0}
!22 = !{!"bool", !8, i64 0}
!23 = !{!17, !22, i64 68}
!24 = !{!25, !7, i64 0}
!25 = !{!"_ZTSN3JPH17ConvexHullBuilderE", !7, i64 0, !26, i64 8, !27, i64 32}
!26 = !{!"_ZTSN3JPH5ArrayIPNS_17ConvexHullBuilder4FaceENS_12STLAllocatorIS3_EEEE", !20, i64 0, !20, i64 8, !7, i64 16}
!27 = !{!"_ZTSN3JPH5ArrayINS_17ConvexHullBuilder8CoplanarENS_12STLAllocatorIS2_EEEE", !20, i64 0, !20, i64 8, !7, i64 16}
!28 = !{!17, !21, i64 64}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass