; LLVM IR from atlantis13579/Riemann :: Src/Collision (AABBTreeOffline)

; 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.Riemann::AABBTreeNodeOffline" = type { %"class.Maths::TAABB3", ptr, ptr, i32, i32 }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann19AABBTreeNodeOffline23BuildHierarchyRecursiveERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(41) %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(41) %6)
  %7 = call noundef zeroext i1 @_ZNK7Riemann19AABBTreeNodeOffline10IsLeafNodeEv(ptr noundef nonnull align 8 dereferenceable(48) %5)
  br i1 %7, label %15, label %8

8:                                                ; preds = %2
  %9 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %5, i32 0, i32 1
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN7Riemann19AABBTreeNodeOffline23BuildHierarchyRecursiveERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 8 dereferenceable(41) %11)
  %12 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %5, i32 0, i32 2
  %13 = load ptr, ptr %12, align 8, !tbaa !15
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN7Riemann19AABBTreeNodeOffline23BuildHierarchyRecursiveERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(41) %14)
  br label %15

15:                                               ; preds = %8, %2
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(41)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann19AABBTreeNodeOffline10IsLeafNodeEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

attributes #0 = { 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 #1 = { 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" }

!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 24}
!10 = !{!"_ZTSN7Riemann19AABBTreeNodeOfflineE", !11, i64 0, !6, i64 24, !6, i64 32, !14, i64 40, !14, i64 44}
!11 = !{!"_ZTSN5Maths6TAABB3IfEE", !12, i64 0, !12, i64 12}
!12 = !{!"_ZTSN5Maths8TVector3IfEE", !13, i64 0, !13, i64 4, !13, i64 8}
!13 = !{!"float", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!10, !6, i64 32}


; 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: mustprogress uwtable
define dso_local void @_ZN7Riemann19AABBTreeNodeOffline23BuildHierarchyRecursiveERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(41) %1) local_unnamed_addr #0 align 2 {
  tail call void @_ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(41) %1)
  %3 = tail call noundef zeroext i1 @_ZNK7Riemann19AABBTreeNodeOffline10IsLeafNodeEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  br i1 %3, label %tailrecurse._crit_edge, label %tailrecurse

tailrecurse:                                      ; preds = %2, %tailrecurse
  %.tr5 = phi ptr [ %7, %tailrecurse ], [ %0, %2 ]
  %4 = getelementptr inbounds i8, ptr %.tr5, i64 24
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  tail call void @_ZN7Riemann19AABBTreeNodeOffline23BuildHierarchyRecursiveERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(41) %1)
  %6 = getelementptr inbounds i8, ptr %.tr5, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !14
  tail call void @_ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(41) %1)
  %8 = tail call noundef zeroext i1 @_ZNK7Riemann19AABBTreeNodeOffline10IsLeafNodeEv(ptr noundef nonnull align 8 dereferenceable(48) %7)
  br i1 %8, label %tailrecurse._crit_edge, label %tailrecurse

tailrecurse._crit_edge:                           ; preds = %tailrecurse, %2
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(41)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann19AABBTreeNodeOffline10IsLeafNodeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { 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" }

!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 24}
!6 = !{!"_ZTSN7Riemann19AABBTreeNodeOfflineE", !7, i64 0, !12, i64 24, !12, i64 32, !13, i64 40, !13, i64 44}
!7 = !{!"_ZTSN5Maths6TAABB3IfEE", !8, i64 0, !8, i64 12}
!8 = !{!"_ZTSN5Maths8TVector3IfEE", !9, i64 0, !9, i64 4, !9, i64 8}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"int", !10, i64 0}
!14 = !{!6, !12, i64 32}


; Effective O3 passes: GlobalOptPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass