; 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::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::Edge" = type <{ ptr, ptr, ptr, i32, [4 x i8] }>
%"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 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17ConvexHullBuilder18RemoveInvalidEdgesEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #4
  store i8 0, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  br label %18

18:                                               ; preds = %173, %3
  store i8 0, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  store ptr %21, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %22, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  %25 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !20
  store ptr %26, ptr %10, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %163, %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  store ptr %30, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %31, i32 0, i32 2
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  %34 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !20
  store ptr %35, ptr %12, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = icmp eq ptr %36, %37
  br i1 %38, label %39, label %84

39:                                               ; preds = %27
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = icmp eq ptr %42, %43
  br i1 %44, label %45, label %83

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = call noundef ptr @_ZN3JPH17ConvexHullBuilder4Edge15GetPreviousEdgeEv(ptr noundef nonnull align 8 dereferenceable(28) %46)
  store ptr %47, ptr %13, align 8, !tbaa !5
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %51, i32 0, i32 1
  store ptr %50, ptr %52, align 8, !tbaa !21
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %53, i32 0, i32 3
  %55 = load ptr, ptr %54, align 8, !tbaa !11
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = icmp eq ptr %55, %56
  br i1 %57, label %64, label %58

58:                                               ; preds = %45
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %59, i32 0, i32 3
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = icmp eq ptr %61, %62
  br i1 %63, label %64, label %68

64:                                               ; preds = %58, %45
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %66, i32 0, i32 3
  store ptr %65, ptr %67, align 8, !tbaa !11
  br label %68

68:                                               ; preds = %64, %58
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = icmp eq ptr %69, null
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef %69) #4
  br label %72

72:                                               ; preds = %71, %68
  %73 = load ptr, ptr %11, 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) #4
  br label %76

76:                                               ; preds = %75, %72
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = call noundef zeroext i1 @_ZNK3JPH17ConvexHullBuilder17RemoveTwoEdgeFaceEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef %77, ptr noundef nonnull align 8 dereferenceable(24) %78)
  br i1 %79, label %80, label %81

80:                                               ; preds = %76
  store i32 1, ptr %14, align 4
  br label %82

81:                                               ; preds = %76
  store i8 1, ptr %7, align 1, !tbaa !9
  store i8 1, ptr %8, align 1, !tbaa !9
  store i32 4, ptr %14, align 4
  br label %82

82:                                               ; preds = %81, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %160

83:                                               ; preds = %39
  br label %157

84:                                               ; preds = %27
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = icmp eq ptr %85, %86
  br i1 %87, label %88, label %156

88:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !17
  store ptr %91, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !21
  store ptr %94, ptr %16, align 8, !tbaa !5
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !11
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  %99 = icmp eq ptr %97, %98
  br i1 %99, label %100, label %104

100:                                              ; preds = %88
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %102, i32 0, i32 3
  store ptr %101, ptr %103, align 8, !tbaa !11
  br label %104

104:                                              ; preds = %100, %88
  %105 = load ptr, ptr %16, align 8, !tbaa !5
  %106 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !21
  %108 = load ptr, ptr %15, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %108, i32 0, i32 1
  store ptr %107, ptr %109, align 8, !tbaa !21
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = load ptr, ptr %15, align 8, !tbaa !5
  %112 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %111, i32 0, i32 2
  store ptr %110, ptr %112, align 8, !tbaa !17
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = icmp eq ptr %113, null
  br i1 %114, label %116, label %115

115:                                              ; preds = %104
  call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef %113) #4
  br label %116

116:                                              ; preds = %115, %104
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %117, i32 0, i32 3
  %119 = load ptr, ptr %118, align 8, !tbaa !11
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = icmp eq ptr %119, %120
  br i1 %121, label %122, label %126

122:                                              ; preds = %116
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %124, i32 0, i32 3
  store ptr %123, ptr %125, align 8, !tbaa !11
  br label %126

126:                                              ; preds = %122, %116
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !21
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %130, i32 0, i32 1
  store ptr %129, ptr %131, align 8, !tbaa !21
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Edge", ptr %133, i32 0, i32 2
  store ptr %132, ptr %134, align 8, !tbaa !17
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = icmp eq ptr %135, null
  br i1 %136, label %138, label %137

137:                                              ; preds = %126
  call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef %135) #4
  br label %138

138:                                              ; preds = %137, %126
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = call noundef zeroext i1 @_ZNK3JPH17ConvexHullBuilder17RemoveTwoEdgeFaceEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef %139, ptr noundef nonnull align 8 dereferenceable(24) %140)
  br i1 %141, label %149, label %142

142:                                              ; preds = %138
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  %144 = getelementptr inbounds %"class.JPH::ConvexHullBuilder", ptr %17, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !22
  %146 = call noundef ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %145)
  call void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69) %143, ptr noundef %146)
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3JPH17ConvexHullBuilder13sMarkAffectedEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef %147, ptr noundef nonnull align 8 dereferenceable(24) %148)
  br label %149

149:                                              ; preds = %142, %138
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = call noundef zeroext i1 @_ZNK3JPH17ConvexHullBuilder17RemoveTwoEdgeFaceEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef %150, ptr noundef nonnull align 8 dereferenceable(24) %151)
  br i1 %152, label %153, label %154

153:                                              ; preds = %149
  store i32 1, ptr %14, align 4
  br label %155

154:                                              ; preds = %149
  store i8 1, ptr %7, align 1, !tbaa !9
  store i8 1, ptr %8, align 1, !tbaa !9
  store i32 4, ptr %14, align 4
  br label %155

155:                                              ; preds = %154, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %160

156:                                              ; preds = %84
  br label %157

157:                                              ; preds = %156, %83
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %158, ptr %9, align 8, !tbaa !5
  %159 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %159, ptr %10, align 8, !tbaa !5
  store i32 0, ptr %14, align 4
  br label %160

160:                                              ; preds = %157, %155, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %161 = load i32, ptr %14, align 4
  switch i32 %161, label %170 [
    i32 0, label %162
    i32 4, label %169
  ]

162:                                              ; preds = %160
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %"class.JPH::ConvexHullBuilder::Face", ptr %165, i32 0, i32 3
  %167 = load ptr, ptr %166, align 8, !tbaa !11
  %168 = icmp ne ptr %164, %167
  br i1 %168, label %27, label %169, !llvm.loop !26

169:                                              ; preds = %163, %160
  store i32 0, ptr %14, align 4
  br label %170

170:                                              ; preds = %169, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %171 = load i32, ptr %14, align 4
  switch i32 %171, label %185 [
    i32 0, label %172
  ]

172:                                              ; preds = %170
  br label %173

173:                                              ; preds = %172
  %174 = load i8, ptr %8, align 1, !tbaa !9, !range !28, !noundef !29
  %175 = trunc i8 %174 to i1
  br i1 %175, label %18, label %176, !llvm.loop !30

176:                                              ; preds = %173
  %177 = load i8, ptr %7, align 1, !tbaa !9, !range !28, !noundef !29
  %178 = trunc i8 %177 to i1
  br i1 %178, label %179, label %184

179:                                              ; preds = %176
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %"class.JPH::ConvexHullBuilder", ptr %17, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !22
  %183 = call noundef ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %182)
  call void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69) %180, ptr noundef %183)
  br label %184

184:                                              ; preds = %179, %176
  store i32 0, ptr %14, align 4
  br label %185

185:                                              ; preds = %184, %170
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  %186 = load i32, ptr %14, align 4
  switch i32 %186, label %188 [
    i32 0, label %187
    i32 1, label %187
  ]

187:                                              ; preds = %185, %185
  ret void

188:                                              ; preds = %185
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH17ConvexHullBuilder17RemoveTwoEdgeFaceEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #2 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 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, !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 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"_ZTSN3JPH17ConvexHullBuilder4FaceE", !13, i64 0, !13, i64 16, !14, i64 32, !6, i64 56, !16, i64 64, !10, i64 68}
!13 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!14 = !{!"_ZTSN3JPH5ArrayIiNS_12STLAllocatorIiEEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!18, !6, i64 16}
!18 = !{!"_ZTSN3JPH17ConvexHullBuilder4EdgeE", !6, i64 0, !6, i64 8, !6, i64 16, !19, i64 24}
!19 = !{!"int", !7, i64 0}
!20 = !{!18, !6, i64 0}
!21 = !{!18, !6, i64 8}
!22 = !{!23, !6, i64 0}
!23 = !{!"_ZTSN3JPH17ConvexHullBuilderE", !6, i64 0, !24, i64 8, !25, i64 32}
!24 = !{!"_ZTSN3JPH5ArrayIPNS_17ConvexHullBuilder4FaceENS_12STLAllocatorIS3_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!25 = !{!"_ZTSN3JPH5ArrayINS_17ConvexHullBuilder8CoplanarENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = distinct !{!30, !27}


; 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 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 nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH17ConvexHullBuilder4Edge15GetPreviousEdgeEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #2 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 #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17ConvexHullBuilder18RemoveInvalidEdgesEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #1 align 2 {
  %4 = getelementptr inbounds i8, ptr %1, i64 56
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.backedge, %3
  %.0 = phi i1 [ false, %3 ], [ true, %.loopexit.backedge ]
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !15
  %8 = load ptr, ptr %7, align 8, !tbaa !18
  br label %9

9:                                                ; preds = %58, %.loopexit
  %.069 = phi ptr [ %8, %.loopexit ], [ %14, %58 ]
  %.067 = phi ptr [ %5, %.loopexit ], [ %11, %58 ]
  %10 = getelementptr inbounds i8, ptr %.067, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !19
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !15
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %15 = icmp eq ptr %.069, %1
  br i1 %15, label %16, label %31

16:                                               ; preds = %9
  %17 = getelementptr inbounds i8, ptr %.067, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !15
  %19 = icmp eq ptr %18, %11
  br i1 %19, label %20, label %58

20:                                               ; preds = %16
  %21 = tail call noundef ptr @_ZN3JPH17ConvexHullBuilder4Edge15GetPreviousEdgeEv(ptr noundef nonnull align 8 dereferenceable(28) %.067)
  %22 = getelementptr inbounds i8, ptr %11, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !19
  %24 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %23, ptr %24, align 8, !tbaa !19
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = icmp eq ptr %25, %.067
  %27 = icmp eq ptr %25, %11
  %or.cond = or i1 %26, %27
  br i1 %or.cond, label %28, label %29

28:                                               ; preds = %20
  store ptr %21, ptr %4, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %28, %20
  tail call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef nonnull %.067) #3
  tail call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef nonnull %11) #3
  %30 = tail call noundef zeroext i1 @_ZNK3JPH17ConvexHullBuilder17RemoveTwoEdgeFaceEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(24) %2)
  br i1 %30, label %select.unfold, label %.loopexit.backedge

.loopexit.backedge:                               ; preds = %29, %56
  br label %.loopexit, !llvm.loop !20

31:                                               ; preds = %9
  %32 = icmp eq ptr %.069, %14
  br i1 %32, label %33, label %58

33:                                               ; preds = %31
  %34 = getelementptr inbounds i8, ptr %.067, i64 8
  %35 = getelementptr inbounds i8, ptr %13, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !19
  %37 = getelementptr inbounds i8, ptr %.069, i64 56
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = icmp eq ptr %38, %36
  br i1 %39, label %40, label %41

40:                                               ; preds = %33
  store ptr %13, ptr %37, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %40, %33
  %42 = getelementptr inbounds i8, ptr %36, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  store ptr %43, ptr %35, align 8, !tbaa !19
  %44 = getelementptr inbounds i8, ptr %13, i64 16
  store ptr %.067, ptr %44, align 8, !tbaa !15
  tail call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef nonnull %36) #3
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = icmp eq ptr %45, %11
  br i1 %46, label %47, label %48

47:                                               ; preds = %41
  store ptr %.067, ptr %4, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %47, %41
  %49 = getelementptr inbounds i8, ptr %11, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  store ptr %50, ptr %34, align 8, !tbaa !19
  %51 = getelementptr inbounds i8, ptr %.067, i64 16
  store ptr %13, ptr %51, align 8, !tbaa !15
  tail call void @_ZN3JPH17ConvexHullBuilder4EdgedlEPv(ptr noundef nonnull %11) #3
  %52 = tail call noundef zeroext i1 @_ZNK3JPH17ConvexHullBuilder17RemoveTwoEdgeFaceEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %.069, ptr noundef nonnull align 8 dereferenceable(24) %2)
  br i1 %52, label %56, label %53

53:                                               ; preds = %48
  %54 = load ptr, ptr %0, align 8, !tbaa !22
  %55 = tail call noundef ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %54)
  tail call void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69) %.069, ptr noundef %55)
  tail call void @_ZN3JPH17ConvexHullBuilder13sMarkAffectedEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull %.069, ptr noundef nonnull align 8 dereferenceable(24) %2)
  br label %56

56:                                               ; preds = %53, %48
  %57 = tail call noundef zeroext i1 @_ZNK3JPH17ConvexHullBuilder17RemoveTwoEdgeFaceEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(24) %2)
  br i1 %57, label %select.unfold, label %.loopexit.backedge

58:                                               ; preds = %31, %16
  %.not = icmp eq ptr %11, %5
  br i1 %.not, label %59, label %9, !llvm.loop !26

59:                                               ; preds = %58
  br i1 %.0, label %60, label %select.unfold

60:                                               ; preds = %59
  %61 = load ptr, ptr %0, align 8, !tbaa !22
  %62 = tail call noundef ptr @_ZNK3JPH5ArrayINS_4Vec3ENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %61)
  tail call void @_ZN3JPH17ConvexHullBuilder4Face26CalculateNormalAndCentroidEPKNS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(69) %1, ptr noundef %62)
  br label %select.unfold

select.unfold:                                    ; preds = %56, %29, %59, %60
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH17ConvexHullBuilder17RemoveTwoEdgeFaceEPNS0_4FaceERNS_5ArrayIS2_NS_12STLAllocatorIS2_EEEE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 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 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 = { 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, !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 16}
!16 = !{!"_ZTSN3JPH17ConvexHullBuilder4EdgeE", !12, i64 0, !12, i64 8, !12, i64 16, !17, i64 24}
!17 = !{!"int", !8, i64 0}
!18 = !{!16, !12, i64 0}
!19 = !{!16, !12, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !12, i64 0}
!23 = !{!"_ZTSN3JPH17ConvexHullBuilderE", !12, i64 0, !24, i64 8, !25, i64 32}
!24 = !{!"_ZTSN3JPH5ArrayIPNS_17ConvexHullBuilder4FaceENS_12STLAllocatorIS3_EEEE", !11, i64 0, !11, i64 8, !12, i64 16}
!25 = !{!"_ZTSN3JPH5ArrayINS_17ConvexHullBuilder8CoplanarENS_12STLAllocatorIS2_EEEE", !11, i64 0, !11, i64 8, !12, i64 16}
!26 = distinct !{!26, !21}


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