; LLVM IR from jrouwe/JoltPhysics :: Jolt/TriangleSplitter (TriangleSplitterMean)

; 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::TriangleSplitter" = type { ptr, ptr, ptr, %"class.JPH::Array", %"class.JPH::Array.0" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.0" = type { i64, i64, ptr }
%"struct.JPH::TriangleSplitter::Range" = type { i32, i32 }

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH20TriangleSplitterMean5SplitERKNS_16TriangleSplitter5RangeERS2_S5_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3) unnamed_addr #1 align 2 {
  %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 ptr, align 8
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca ptr, align 8
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca ptr, align 8
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %24 = getelementptr inbounds %"class.JPH::TriangleSplitter", ptr %23, i32 0, i32 4
  %25 = call noundef ptr @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 4, !tbaa !9
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %25, i64 %29
  store ptr %30, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %31 = getelementptr inbounds %"class.JPH::TriangleSplitter", ptr %23, i32 0, i32 4
  %32 = call noundef ptr @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.JPH::TriangleSplitter::Range", ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !12
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds i32, ptr %32, i64 %36
  store ptr %37, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #9
  %38 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %39 = getelementptr inbounds %"class.JPH::Vec3", ptr %11, i32 0, i32 0
  %40 = getelementptr inbounds %union.anon, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds { double, double }, ptr %40, i32 0, i32 0
  %42 = extractvalue { double, double } %38, 0
  store double %42, ptr %41, align 16
  %43 = getelementptr inbounds { double, double }, ptr %40, i32 0, i32 1
  %44 = extractvalue { double, double } %38, 1
  store double %44, ptr %43, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %45, ptr %12, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %69, %4
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = icmp ult ptr %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %72

51:                                               ; preds = %46
  %52 = getelementptr inbounds %"class.JPH::TriangleSplitter", ptr %23, i32 0, i32 3
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = load i32, ptr %53, align 4, !tbaa !13
  %55 = zext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %55)
  %57 = call { double, double } @_ZN3JPH4Vec317sLoadFloat3UnsafeERKNS_6Float3E(ptr noundef nonnull align 4 dereferenceable(12) %56)
  %58 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %59 = getelementptr inbounds %union.anon, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 0
  %61 = extractvalue { double, double } %57, 0
  store double %61, ptr %60, align 16
  %62 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 1
  %63 = extractvalue { double, double } %57, 1
  store double %63, ptr %62, align 8
  %64 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %65 = load double, ptr %64, align 16
  %66 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %67 = load double, ptr %66, align 8
  %68 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %11, double %65, double %67)
  br label %69

69:                                               ; preds = %51
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds i32, ptr %70, i32 1
  store ptr %71, ptr %12, align 8, !tbaa !5
  br label %46, !llvm.loop !14

72:                                               ; preds = %50
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %73)
  %75 = uitofp i32 %74 to float
  %76 = fdiv float 1.000000e+00, %75
  %77 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3mLEf(ptr noundef nonnull align 16 dereferenceable(16) %11, float noundef %76)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #9
  %78 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %79 = getelementptr inbounds %"class.JPH::Vec3", ptr %14, i32 0, i32 0
  %80 = getelementptr inbounds %union.anon, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds { double, double }, ptr %80, i32 0, i32 0
  %82 = extractvalue { double, double } %78, 0
  store double %82, ptr %81, align 16
  %83 = getelementptr inbounds { double, double }, ptr %80, i32 0, i32 1
  %84 = extractvalue { double, double } %78, 1
  store double %84, ptr %83, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %85, ptr %15, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %131, %72
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = icmp ult ptr %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %134

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #9
  %92 = getelementptr inbounds %"class.JPH::TriangleSplitter", ptr %23, i32 0, i32 3
  %93 = load ptr, ptr %15, align 8, !tbaa !5
  %94 = load i32, ptr %93, align 4, !tbaa !13
  %95 = zext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %92, i64 noundef %95)
  %97 = call { double, double } @_ZN3JPH4Vec317sLoadFloat3UnsafeERKNS_6Float3E(ptr noundef nonnull align 4 dereferenceable(12) %96)
  %98 = getelementptr inbounds %"class.JPH::Vec3", ptr %17, i32 0, i32 0
  %99 = getelementptr inbounds %union.anon, ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds { double, double }, ptr %99, i32 0, i32 0
  %101 = extractvalue { double, double } %97, 0
  store double %101, ptr %100, align 16
  %102 = getelementptr inbounds { double, double }, ptr %99, i32 0, i32 1
  %103 = extractvalue { double, double } %97, 1
  store double %103, ptr %102, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !16
  %104 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %105 = load double, ptr %104, align 16
  %106 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %107 = load double, ptr %106, align 8
  %108 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %17, double %105, double %107)
  %109 = getelementptr inbounds %"class.JPH::Vec3", ptr %16, i32 0, i32 0
  %110 = getelementptr inbounds %union.anon, ptr %109, i32 0, i32 0
  %111 = getelementptr inbounds { double, double }, ptr %110, i32 0, i32 0
  %112 = extractvalue { double, double } %108, 0
  store double %112, ptr %111, align 16
  %113 = getelementptr inbounds { double, double }, ptr %110, i32 0, i32 1
  %114 = extractvalue { double, double } %108, 1
  store double %114, ptr %113, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %16, i64 16, i1 false), !tbaa.struct !16
  %115 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %116 = load double, ptr %115, align 16
  %117 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %118 = load double, ptr %117, align 8
  %119 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %16, double %116, double %118)
  %120 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %121 = getelementptr inbounds %union.anon, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds { double, double }, ptr %121, i32 0, i32 0
  %123 = extractvalue { double, double } %119, 0
  store double %123, ptr %122, align 16
  %124 = getelementptr inbounds { double, double }, ptr %121, i32 0, i32 1
  %125 = extractvalue { double, double } %119, 1
  store double %125, ptr %124, align 8
  %126 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %127 = load double, ptr %126, align 16
  %128 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %129 = load double, ptr %128, align 8
  %130 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %14, double %127, double %129)
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #9
  br label %131

131:                                              ; preds = %91
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = getelementptr inbounds i32, ptr %132, i32 1
  store ptr %133, ptr %15, align 8, !tbaa !5
  br label %86, !llvm.loop !18

134:                                              ; preds = %90
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %135)
  %137 = uitofp i32 %136 to float
  %138 = fdiv float 1.000000e+00, %137
  %139 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3mLEf(ptr noundef nonnull align 16 dereferenceable(16) %14, float noundef %138)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  %140 = call noundef i32 @_ZNK3JPH4Vec324GetHighestComponentIndexEv(ptr noundef nonnull align 16 dereferenceable(16) %14)
  store i32 %140, ptr %21, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  %141 = load i32, ptr %21, align 4, !tbaa !13
  %142 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %11, i32 noundef %141)
  store float %142, ptr %22, align 4, !tbaa !19
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = load i32, ptr %21, align 4, !tbaa !13
  %145 = load float, ptr %22, align 4, !tbaa !19
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = call noundef zeroext i1 @_ZN3JPH16TriangleSplitter13SplitInternalERKNS0_5RangeEjfRS1_S4_(ptr noundef nonnull align 8 dereferenceable(72) %23, ptr noundef nonnull align 4 dereferenceable(8) %143, i32 noundef %144, float noundef %145, ptr noundef nonnull align 4 dereferenceable(8) %146, ptr noundef nonnull align 4 dereferenceable(8) %147)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  ret i1 %148
}

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec317sLoadFloat3UnsafeERKNS_6Float3E(ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

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

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

; 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) #6

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH4Vec324GetHighestComponentIndexEv(ptr noundef nonnull align 16 dereferenceable(16)) #7 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16), i32 noundef) #7 align 2

declare noundef zeroext i1 @_ZN3JPH16TriangleSplitter13SplitInternalERKNS0_5RangeEjfRS1_S4_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, float noundef, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #8

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { alwaysinline 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 #8 = { "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 #9 = { 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, !11, i64 0}
!10 = !{!"_ZTSN3JPH16TriangleSplitter5RangeE", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!11, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i64 0, i64 16, !17}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !15}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !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 uwtable
define dso_local noundef zeroext i1 @_ZN3JPH20TriangleSplitterMean5SplitERKNS_16TriangleSplitter5RangeERS2_S5_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3) unnamed_addr #1 align 2 {
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = tail call noundef ptr @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = zext i32 %11 to i64
  %13 = getelementptr inbounds i32, ptr %10, i64 %12
  %14 = tail call noundef ptr @_ZN3JPH5ArrayIjNS_12STLAllocatorIjEEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %15 = getelementptr inbounds i8, ptr %1, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !10
  %17 = zext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr %14, i64 %17
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %19 = tail call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %20 = extractvalue { double, double } %19, 0
  store double %20, ptr %5, align 16
  %21 = getelementptr inbounds i8, ptr %5, i64 8
  %22 = extractvalue { double, double } %19, 1
  store double %22, ptr %21, align 8
  %23 = icmp ult ptr %13, %18
  br i1 %23, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %4
  %24 = getelementptr inbounds i8, ptr %0, i64 24
  br label %36

._crit_edge:                                      ; preds = %36, %4
  %25 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %1)
  %26 = uitofp i32 %25 to float
  %27 = fdiv float 1.000000e+00, %26
  %28 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3mLEf(ptr noundef nonnull align 16 dereferenceable(16) %5, float noundef %27)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  %29 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %30 = extractvalue { double, double } %29, 0
  store double %30, ptr %6, align 16
  %31 = getelementptr inbounds i8, ptr %6, i64 8
  %32 = extractvalue { double, double } %29, 1
  store double %32, ptr %31, align 8
  br i1 %23, label %.lr.ph31, label %._crit_edge32

.lr.ph31:                                         ; preds = %._crit_edge
  %33 = getelementptr inbounds i8, ptr %0, i64 24
  %34 = getelementptr inbounds i8, ptr %8, i64 8
  %35 = getelementptr inbounds i8, ptr %7, i64 8
  br label %53

36:                                               ; preds = %.lr.ph, %36
  %.028 = phi ptr [ %13, %.lr.ph ], [ %44, %36 ]
  %37 = load i32, ptr %.028, align 4, !tbaa !11
  %38 = zext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %38)
  %40 = call { double, double } @_ZN3JPH4Vec317sLoadFloat3UnsafeERKNS_6Float3E(ptr noundef nonnull align 4 dereferenceable(12) %39)
  %41 = extractvalue { double, double } %40, 0
  %42 = extractvalue { double, double } %40, 1
  %43 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %5, double %41, double %42)
  %44 = getelementptr inbounds i8, ptr %.028, i64 4
  %45 = icmp ult ptr %44, %18
  br i1 %45, label %36, label %._crit_edge, !llvm.loop !12

._crit_edge32:                                    ; preds = %53, %._crit_edge
  %46 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %1)
  %47 = uitofp i32 %46 to float
  %48 = fdiv float 1.000000e+00, %47
  %49 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3mLEf(ptr noundef nonnull align 16 dereferenceable(16) %6, float noundef %48)
  %50 = call noundef i32 @_ZNK3JPH4Vec324GetHighestComponentIndexEv(ptr noundef nonnull align 16 dereferenceable(16) %6)
  %51 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %5, i32 noundef %50)
  %52 = call noundef zeroext i1 @_ZN3JPH16TriangleSplitter13SplitInternalERKNS0_5RangeEjfRS1_S4_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, i32 noundef %50, float noundef %51, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  ret i1 %52

53:                                               ; preds = %.lr.ph31, %53
  %.02629 = phi ptr [ %13, %.lr.ph31 ], [ %67, %53 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  %54 = load i32, ptr %.02629, align 4, !tbaa !11
  %55 = zext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3JPH5ArrayINS_6Float3ENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %55)
  %57 = call { double, double } @_ZN3JPH4Vec317sLoadFloat3UnsafeERKNS_6Float3E(ptr noundef nonnull align 4 dereferenceable(12) %56)
  %58 = extractvalue { double, double } %57, 0
  store double %58, ptr %8, align 16
  %59 = extractvalue { double, double } %57, 1
  store double %59, ptr %34, align 8
  %.sroa.04.0.copyload = load double, ptr %5, align 16
  %.sroa.25.0.copyload = load double, ptr %21, align 8, !tbaa !14
  %60 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %.sroa.04.0.copyload, double %.sroa.25.0.copyload)
  %61 = extractvalue { double, double } %60, 0
  store double %61, ptr %7, align 16
  %62 = extractvalue { double, double } %60, 1
  store double %62, ptr %35, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  %63 = call { double, double } @_ZNK3JPH4Vec3mlES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %61, double %62)
  %64 = extractvalue { double, double } %63, 0
  %65 = extractvalue { double, double } %63, 1
  %66 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN3JPH4Vec3pLES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %64, double %65)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #8
  %67 = getelementptr inbounds i8, ptr %.02629, i64 4
  %68 = icmp ult ptr %67, %18
  br i1 %68, label %53, label %._crit_edge32, !llvm.loop !15
}

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec317sLoadFloat3UnsafeERKNS_6Float3E(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

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

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

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

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

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

declare noundef zeroext i1 @_ZN3JPH16TriangleSplitter13SplitInternalERKNS0_5RangeEjfRS1_S4_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, float noundef, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 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 = { "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 #8 = { 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 = !{!"_ZTSN3JPH16TriangleSplitter5RangeE", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!8, !8, i64 0}
!15 = distinct !{!15, !13}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass