; LLVM IR from atlantis13579/Riemann :: Src/Geometry (SparseOctree)

; 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.Riemann::SparseOctree::Cell" = type { i32, i32, %"class.Maths::TVector3.28", [8 x i32] }
%"class.Maths::TVector3.28" = type { i32, i32, i32 }
%"class.Maths::TVector3" = type { float, float, float }
%"class.Riemann::SparseOctree" = type <{ %"class.std::vector", %"class.Riemann::SparseGrid3", %"class.Riemann::ListSet", %"class.std::set", %"class.std::unordered_map", %"class.Maths::TVector3", float, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Riemann::SparseOctree::Cell, std::allocator<Riemann::SparseOctree::Cell>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::SparseOctree::Cell, std::allocator<Riemann::SparseOctree::Cell>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::SparseOctree::Cell, std::allocator<Riemann::SparseOctree::Cell>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::SparseOctree::Cell, std::allocator<Riemann::SparseOctree::Cell>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Riemann::SparseGrid3" = type { %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<Maths::TVector3<int>, std::pair<const Maths::TVector3<int>, int>, std::_Select1st<std::pair<const Maths::TVector3<int>, int>>, std::less<Maths::TVector3<int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<Maths::TVector3<int>, std::pair<const Maths::TVector3<int>, int>, std::_Select1st<std::pair<const Maths::TVector3<int>, int>>, std::less<Maths::TVector3<int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.Riemann::ListSet" = type { %"class.std::vector.3", %"class.std::vector.8", %"class.std::vector.13" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<Riemann::ListSet<int>::Header, std::allocator<Riemann::ListSet<int>::Header>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::ListSet<int>::Header, std::allocator<Riemann::ListSet<int>::Header>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::ListSet<int>::Header, std::allocator<Riemann::ListSet<int>::Header>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::ListSet<int>::Header, std::allocator<Riemann::ListSet<int>::Header>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<Riemann::ListSet<int>::Block, std::allocator<Riemann::ListSet<int>::Block>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::ListSet<int>::Block, std::allocator<Riemann::ListSet<int>::Block>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::ListSet<int>::Block, std::allocator<Riemann::ListSet<int>::Block>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::ListSet<int>::Block, std::allocator<Riemann::ListSet<int>::Block>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.18" }
%"class.std::_Rb_tree.18" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }

; 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 void @_ZNK7Riemann12SparseOctree25FindCurrentContainingCellERKN5Maths6TAABB3IfEE(ptr dead_on_unwind noalias writable sret(%"struct.Riemann::SparseOctree::Cell") align 4 %0, ptr noundef nonnull align 8 dereferenceable(268) %1, ptr noundef nonnull align 4 dereferenceable(24) %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.Maths::TVector3", align 4
  %8 = alloca %"class.Maths::TVector3.28", align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.Riemann::SparseOctree::Cell", align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.Maths::TVector3.28", align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.Maths::TVector3.28", align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"class.Maths::TVector3.28", align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK5Maths6TAABB3IfE9GetCenterEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %7, ptr noundef nonnull align 4 dereferenceable(24) %21)
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #5
  call void @_ZNK7Riemann12SparseOctree12PointToIndexEiRKN5Maths8TVector3IfEE(ptr dead_on_unwind writable sret(%"class.Maths::TVector3.28") align 4 %8, ptr noundef nonnull align 8 dereferenceable(268) %20, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %22 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %20, i32 0, i32 1
  %23 = call noundef ptr @_ZNK7Riemann11SparseGrid3IiE4FindERKN5Maths8TVector3IiEE(ptr noundef nonnull align 8 dereferenceable(48) %22, ptr noundef nonnull align 4 dereferenceable(12) %8)
  store ptr %23, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %32

26:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 52, ptr %10) #5
  call void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52) %10, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(12) %8)
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %20, ptr noundef nonnull align 4 dereferenceable(52) %10, ptr noundef nonnull align 4 dereferenceable(24) %27)
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  call void @_ZN7Riemann12SparseOctree4CellC2EOS1_(ptr noundef nonnull align 4 dereferenceable(52) %0, ptr noundef nonnull align 4 dereferenceable(52) %10)
  store i32 1, ptr %11, align 4
  br label %31

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  call void @_ZN5Maths8TVector3IiE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3.28") align 4 %12)
  call void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52) %0, i32 noundef -1, ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  store i32 1, ptr %11, align 4
  br label %31

31:                                               ; preds = %30, %29
  call void @llvm.lifetime.end.p0(i64 52, ptr %10) #5
  br label %77

32:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %33 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %20, i32 0, i32 0
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %36) #5
  store ptr %37, ptr %13, align 8, !tbaa !5
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %20, ptr noundef nonnull align 4 dereferenceable(52) %38, ptr noundef nonnull align 4 dereferenceable(24) %39)
  %41 = zext i1 %40 to i32
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  call void @_ZN5Maths8TVector3IiE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3.28") align 4 %14)
  call void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52) %0, i32 noundef -1, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  store i32 1, ptr %11, align 4
  br label %76

44:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %45, ptr %15, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %73, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = call noundef i32 @_ZNK7Riemann12SparseOctree13GetChildIndexERKNS0_4CellERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %20, ptr noundef nonnull align 4 dereferenceable(52) %47, ptr noundef nonnull align 4 dereferenceable(12) %7)
  store i32 %48, ptr %16, align 4, !tbaa !9
  %49 = load ptr, ptr %15, align 8, !tbaa !5
  %50 = load i32, ptr %16, align 4, !tbaa !9
  %51 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %49, i32 noundef %50)
  br i1 %51, label %52, label %69

52:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  %54 = load i32, ptr %16, align 4, !tbaa !9
  %55 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %53, i32 noundef %54)
  store i32 %55, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %56 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %20, i32 0, i32 0
  %57 = load i32, ptr %17, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #5
  store ptr %59, ptr %18, align 8, !tbaa !5
  %60 = load ptr, ptr %18, align 8, !tbaa !5
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %20, ptr noundef nonnull align 4 dereferenceable(52) %60, ptr noundef nonnull align 4 dereferenceable(24) %61)
  br i1 %62, label %63, label %65

63:                                               ; preds = %52
  %64 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %64, ptr %15, align 8, !tbaa !5
  store i32 3, ptr %11, align 4
  br label %66

65:                                               ; preds = %52
  store i32 0, ptr %11, align 4
  br label %66

66:                                               ; preds = %65, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  %67 = load i32, ptr %11, align 4
  switch i32 %67, label %71 [
    i32 0, label %68
  ]

68:                                               ; preds = %66
  br label %69

69:                                               ; preds = %68, %46
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  call void @_ZN7Riemann12SparseOctree4CellC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(52) %0, ptr noundef nonnull align 4 dereferenceable(52) %70)
  store i32 1, ptr %11, align 4
  br label %71

71:                                               ; preds = %69, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %72 = load i32, ptr %11, align 4
  switch i32 %72, label %75 [
    i32 3, label %73
  ]

73:                                               ; preds = %71
  br i1 true, label %46, label %74, !llvm.loop !11

74:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #5
  call void @_ZN5Maths8TVector3IiE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3.28") align 4 %19)
  call void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52) %0, i32 noundef -1, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #5
  store i32 1, ptr %11, align 4
  br label %75

75:                                               ; preds = %74, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %76

76:                                               ; preds = %75, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %77

77:                                               ; preds = %76, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268), ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7Riemann12SparseOctree4CellC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(52)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7Riemann12SparseOctree13GetChildIndexERKNS0_4CellERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(268), ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths6TAABB3IfE9GetCenterEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52), i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Riemann12SparseOctree12PointToIndexEiRKN5Maths8TVector3IfEE(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3.28") align 4, ptr noundef nonnull align 8 dereferenceable(268), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7Riemann11SparseGrid3IiE4FindERKN5Maths8TVector3IiEE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7Riemann12SparseOctree4CellC2EOS1_(ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(52)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IiE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3.28") align 4) #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 = { 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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.Riemann::SparseOctree::Cell" = type { i32, i32, %"class.Maths::TVector3.28", [8 x i32] }
%"class.Maths::TVector3.28" = type { i32, i32, i32 }
%"class.Maths::TVector3" = type { float, float, 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 void @_ZNK7Riemann12SparseOctree25FindCurrentContainingCellERKN5Maths6TAABB3IfEE(ptr dead_on_unwind noalias writable sret(%"struct.Riemann::SparseOctree::Cell") align 4 %0, ptr noundef nonnull align 8 dereferenceable(268) %1, ptr noundef nonnull align 4 dereferenceable(24) %2) local_unnamed_addr #1 align 2 {
  %4 = alloca %"class.Maths::TVector3", align 4
  %5 = alloca %"class.Maths::TVector3.28", align 4
  %6 = alloca %"struct.Riemann::SparseOctree::Cell", align 4
  %7 = alloca %"class.Maths::TVector3.28", align 4
  %8 = alloca %"class.Maths::TVector3.28", align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  call void @_ZNK5Maths6TAABB3IfE9GetCenterEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %4, ptr noundef nonnull align 4 dereferenceable(24) %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  call void @_ZNK7Riemann12SparseOctree12PointToIndexEiRKN5Maths8TVector3IfEE(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3.28") align 4 %5, ptr noundef nonnull align 8 dereferenceable(268) %1, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(12) %4)
  %9 = getelementptr inbounds i8, ptr %1, i64 24
  %10 = call noundef ptr @_ZNK7Riemann11SparseGrid3IiE4FindERKN5Maths8TVector3IiEE(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %17

12:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %6) #5
  call void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52) %6, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %13 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %1, ptr noundef nonnull align 4 dereferenceable(52) %6, ptr noundef nonnull align 4 dereferenceable(24) %2)
  br i1 %13, label %14, label %15

14:                                               ; preds = %12
  call void @_ZN7Riemann12SparseOctree4CellC2EOS1_(ptr noundef nonnull align 4 dereferenceable(52) %0, ptr noundef nonnull align 4 dereferenceable(52) %6)
  br label %16

15:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #5
  call void @_ZN5Maths8TVector3IiE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3.28") align 4 %7)
  call void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52) %0, i32 noundef -1, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  br label %16

16:                                               ; preds = %15, %14
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %6) #5
  br label %30

17:                                               ; preds = %3
  %18 = load i32, ptr %10, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %19) #5
  %21 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %1, ptr noundef nonnull align 4 dereferenceable(52) %20, ptr noundef nonnull align 4 dereferenceable(24) %2)
  br i1 %21, label %.preheader, label %22

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  call void @_ZN5Maths8TVector3IiE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3.28") align 4 %8)
  call void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52) %0, i32 noundef -1, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  br label %30

.preheader:                                       ; preds = %17, %25
  %.020 = phi ptr [ %28, %25 ], [ %20, %17 ]
  %23 = call noundef i32 @_ZNK7Riemann12SparseOctree13GetChildIndexERKNS0_4CellERKN5Maths8TVector3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %1, ptr noundef nonnull align 4 dereferenceable(52) %.020, ptr noundef nonnull align 4 dereferenceable(12) %4)
  %24 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %.020, i32 noundef %23)
  br i1 %24, label %25, label %.thread

25:                                               ; preds = %.preheader
  %26 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %.020, i32 noundef %23)
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %27) #5
  %29 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %1, ptr noundef nonnull align 4 dereferenceable(52) %28, ptr noundef nonnull align 4 dereferenceable(24) %2)
  br i1 %29, label %.preheader, label %.thread, !llvm.loop !9

.thread:                                          ; preds = %.preheader, %25
  call void @_ZN7Riemann12SparseOctree4CellC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(52) %0, ptr noundef nonnull align 4 dereferenceable(52) %.020)
  br label %30

30:                                               ; preds = %.thread, %22, %16
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268), ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7Riemann12SparseOctree4CellC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(52)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths6TAABB3IfE9GetCenterEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Riemann12SparseOctree12PointToIndexEiRKN5Maths8TVector3IfEE(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3.28") align 4, ptr noundef nonnull align 8 dereferenceable(268), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann12SparseOctree4CellC2EiRKN5Maths8TVector3IiEE(ptr noundef nonnull align 4 dereferenceable(52), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7Riemann12SparseOctree4CellC2EOS1_(ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(52)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IiE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3.28") align 4) 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 = { 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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