; LLVM IR from jrouwe/JoltPhysics :: Jolt/AABBTree (AABBTreeBuilder)

; 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::TriangleSplitter::Range" = type { i32, i32 }
%"class.JPH::AABBTreeBuilder" = type { ptr, i32, %"class.JPH::Array", %"class.JPH::Array.3" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.3" = type { i64, i64, ptr }
%"struct.JPH::AABBTreeBuilderStats" = type { %"struct.JPH::TriangleSplitter::Stats", float, i32, i32, i32, i32, i32, i32, i32, float, [4 x i8] }
%"struct.JPH::TriangleSplitter::Stats" = type <{ ptr, i32, [4 x i8] }>

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node11GetMinDepthERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node11GetMaxDepthERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node12GetNodeCountERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node16GetLeafNodeCountERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH15AABBTreeBuilder4Node23GetTriangleCountPerNodeERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEERfRjS9_(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH15AABBTreeBuilder4Node16CalculateSAHCostERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEEff(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24), float noundef, float noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN3JPH15AABBTreeBuilder5BuildERNS_20AABBTreeBuilderStatsE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(52) %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.JPH::TriangleSplitter::Range", align 4
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %11 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 0
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = call i64 @_ZNK3JPH16TriangleSplitter15GetInitialRangeEv(ptr noundef nonnull align 8 dereferenceable(72) %12)
  store i64 %13, ptr %5, align 4
  %14 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 2
  %15 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  %16 = mul i32 2, %15
  %17 = zext i32 %16 to i64
  call void @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %17)
  %18 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 3
  %19 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %5)
  %20 = zext i32 %19 to i64
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %21 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 2
  %22 = call noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64) %10, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %23 = zext i32 %22 to i64
  %24 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %23)
  store ptr %24, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 2
  call void @_ZNK3JPH15AABBTreeBuilder4Node23GetTriangleCountPerNodeERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEERfRjS9_(ptr noundef nonnull align 16 dereferenceable(48) %25, ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %27 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %28, align 8, !tbaa !15
  %32 = getelementptr inbounds ptr, ptr %31, i64 2
  %33 = load ptr, ptr %32, align 8
  call void %33(ptr noundef nonnull align 8 dereferenceable(72) %28, ptr noundef nonnull align 8 dereferenceable(12) %30)
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 2
  %36 = call noundef float @_ZNK3JPH15AABBTreeBuilder4Node16CalculateSAHCostERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEEff(ptr noundef nonnull align 16 dereferenceable(48) %34, ptr noundef nonnull align 8 dereferenceable(24) %35, float noundef 1.000000e+00, float noundef 1.000000e+00)
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %37, i32 0, i32 1
  store float %36, ptr %38, align 8, !tbaa !17
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 2
  %41 = call noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node11GetMinDepthERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %39, ptr noundef nonnull align 8 dereferenceable(24) %40)
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %42, i32 0, i32 2
  store i32 %41, ptr %43, align 4, !tbaa !21
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 2
  %46 = call noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node11GetMaxDepthERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %44, ptr noundef nonnull align 8 dereferenceable(24) %45)
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %47, i32 0, i32 3
  store i32 %46, ptr %48, align 8, !tbaa !22
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 2
  %51 = call noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node12GetNodeCountERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %49, ptr noundef nonnull align 8 dereferenceable(24) %50)
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %52, i32 0, i32 4
  store i32 %51, ptr %53, align 4, !tbaa !23
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 2
  %56 = call noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node16GetLeafNodeCountERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %54, ptr noundef nonnull align 8 dereferenceable(24) %55)
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %57, i32 0, i32 5
  store i32 %56, ptr %58, align 8, !tbaa !24
  %59 = getelementptr inbounds %"class.JPH::AABBTreeBuilder", ptr %10, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !25
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %61, i32 0, i32 6
  store i32 %60, ptr %62, align 4, !tbaa !26
  %63 = load i32, ptr %8, align 4, !tbaa !27
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %64, i32 0, i32 7
  store i32 %63, ptr %65, align 8, !tbaa !28
  %66 = load i32, ptr %9, align 4, !tbaa !27
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %67, i32 0, i32 8
  store i32 %66, ptr %68, align 4, !tbaa !29
  %69 = load float, ptr %7, align 4, !tbaa !30
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.JPH::AABBTreeBuilderStats", ptr %70, i32 0, i32 9
  store float %69, ptr %71, align 8, !tbaa !31
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret ptr %72
}

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK3JPH16TriangleSplitter15GetInitialRangeEv(ptr noundef nonnull align 8 dereferenceable(72)) #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(8)) #1 align 2

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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, !6, i64 0}
!10 = !{!"_ZTSN3JPH15AABBTreeBuilderE", !6, i64 0, !11, i64 8, !12, i64 16, !14, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEE", !13, i64 0, !13, i64 8, !6, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEE", !13, i64 0, !13, i64 8, !6, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !20, i64 16}
!18 = !{!"_ZTSN3JPH20AABBTreeBuilderStatsE", !19, i64 0, !20, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !20, i64 48}
!19 = !{!"_ZTSN3JPH16TriangleSplitter5StatsE", !6, i64 0, !11, i64 8}
!20 = !{!"float", !7, i64 0}
!21 = !{!18, !11, i64 20}
!22 = !{!18, !11, i64 24}
!23 = !{!18, !11, i64 28}
!24 = !{!18, !11, i64 32}
!25 = !{!10, !11, i64 8}
!26 = !{!18, !11, i64 36}
!27 = !{!11, !11, i64 0}
!28 = !{!18, !11, i64 40}
!29 = !{!18, !11, i64 44}
!30 = !{!20, !20, i64 0}
!31 = !{!18, !20, i64 48}


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

%"struct.JPH::TriangleSplitter::Range" = type { i32, i32 }

; 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
declare dso_local noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node11GetMinDepthERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node11GetMaxDepthERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node12GetNodeCountERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node16GetLeafNodeCountERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH15AABBTreeBuilder4Node16CalculateSAHCostERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEEff(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24), float noundef, float noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN3JPH15AABBTreeBuilder5BuildERNS_20AABBTreeBuilderStatsE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(52) %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"struct.JPH::TriangleSplitter::Range", align 8
  %4 = alloca float, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %8 = tail call i64 @_ZNK3JPH16TriangleSplitter15GetInitialRangeEv(ptr noundef nonnull align 8 dereferenceable(72) %7)
  store i64 %8, ptr %3, align 8
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %11 = shl i32 %10, 1
  %12 = zext i32 %11 to i64
  call void @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %12)
  %13 = getelementptr inbounds i8, ptr %0, i64 40
  %14 = call noundef i32 @_ZNK3JPH16TriangleSplitter5Range5CountEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %15 = zext i32 %14 to i64
  call void @_ZN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %15)
  %16 = call noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %17 = zext i32 %16 to i64
  %18 = call noundef nonnull align 16 dereferenceable(48) ptr @_ZN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %17)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  call void @_ZNK3JPH15AABBTreeBuilder4Node23GetTriangleCountPerNodeERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEERfRjS9_(ptr noundef nonnull align 16 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %19 = load ptr, ptr %0, align 8, !tbaa !5
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %22 = load ptr, ptr %21, align 8
  call void %22(ptr noundef nonnull align 8 dereferenceable(72) %19, ptr noundef nonnull align 8 dereferenceable(12) %1)
  %23 = call noundef float @_ZNK3JPH15AABBTreeBuilder4Node16CalculateSAHCostERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEEff(ptr noundef nonnull align 16 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(24) %9, float noundef 1.000000e+00, float noundef 1.000000e+00)
  %24 = getelementptr inbounds i8, ptr %1, i64 16
  store float %23, ptr %24, align 8, !tbaa !16
  %25 = call noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node11GetMinDepthERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %26 = getelementptr inbounds i8, ptr %1, i64 20
  store i32 %25, ptr %26, align 4, !tbaa !20
  %27 = call noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node11GetMaxDepthERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %28 = getelementptr inbounds i8, ptr %1, i64 24
  store i32 %27, ptr %28, align 8, !tbaa !21
  %29 = call noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node12GetNodeCountERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %30 = getelementptr inbounds i8, ptr %1, i64 28
  store i32 %29, ptr %30, align 4, !tbaa !22
  %31 = call noundef i32 @_ZNK3JPH15AABBTreeBuilder4Node16GetLeafNodeCountERKNS_5ArrayIS1_NS_12STLAllocatorIS1_EEEE(ptr noundef nonnull align 16 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(24) %9)
  %32 = getelementptr inbounds i8, ptr %1, i64 32
  store i32 %31, ptr %32, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %0, i64 8
  %34 = load i32, ptr %33, align 8, !tbaa !24
  %35 = getelementptr inbounds i8, ptr %1, i64 36
  store i32 %34, ptr %35, align 4, !tbaa !25
  %36 = load i32, ptr %5, align 4, !tbaa !26
  %37 = getelementptr inbounds i8, ptr %1, i64 40
  store i32 %36, ptr %37, align 8, !tbaa !27
  %38 = load i32, ptr %6, align 4, !tbaa !26
  %39 = getelementptr inbounds i8, ptr %1, i64 44
  store i32 %38, ptr %39, align 4, !tbaa !28
  %40 = load float, ptr %4, align 4, !tbaa !29
  %41 = getelementptr inbounds i8, ptr %1, i64 48
  store float %40, ptr %41, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret ptr %18
}

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNK3JPH16TriangleSplitter15GetInitialRangeEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH15AABBTreeBuilder13BuildInternalERKNS_16TriangleSplitter5RangeE(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1 align 2

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = !{!"_ZTSN3JPH15AABBTreeBuilderE", !7, i64 0, !10, i64 8, !11, i64 16, !13, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN3JPH5ArrayINS_15AABBTreeBuilder4NodeENS_12STLAllocatorIS2_EEEE", !12, i64 0, !12, i64 8, !7, i64 16}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_ZTSN3JPH5ArrayINS_15IndexedTriangleENS_12STLAllocatorIS1_EEEE", !12, i64 0, !12, i64 8, !7, i64 16}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !9, i64 0}
!16 = !{!17, !19, i64 16}
!17 = !{!"_ZTSN3JPH20AABBTreeBuilderStatsE", !18, i64 0, !19, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !19, i64 48}
!18 = !{!"_ZTSN3JPH16TriangleSplitter5StatsE", !7, i64 0, !10, i64 8}
!19 = !{!"float", !8, i64 0}
!20 = !{!17, !10, i64 20}
!21 = !{!17, !10, i64 24}
!22 = !{!17, !10, i64 28}
!23 = !{!17, !10, i64 32}
!24 = !{!6, !10, i64 8}
!25 = !{!17, !10, i64 36}
!26 = !{!10, !10, i64 0}
!27 = !{!17, !10, i64 40}
!28 = !{!17, !10, i64 44}
!29 = !{!19, !19, i64 0}
!30 = !{!17, !19, i64 48}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass