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

%"class.Maths::TVector3.28" = type { i32, i32, i32 }
%"class.std::vector.29" = type { %"struct.std::_Vector_base.30" }
%"struct.std::_Vector_base.30" = type { %"struct.std::_Vector_base<const Riemann::SparseOctree::Cell *, std::allocator<const Riemann::SparseOctree::Cell *>>::_Vector_impl" }
%"struct.std::_Vector_base<const Riemann::SparseOctree::Cell *, std::allocator<const Riemann::SparseOctree::Cell *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const Riemann::SparseOctree::Cell *, std::allocator<const Riemann::SparseOctree::Cell *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const Riemann::SparseOctree::Cell *, std::allocator<const Riemann::SparseOctree::Cell *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function.34" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.38 = type { ptr, ptr }
%class.anon.39 = type { ptr, ptr, ptr }
%"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 }
%"class.Maths::TVector3" = type { float, float, float }

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.29") align 8 %0, ptr noundef nonnull align 8 dereferenceable(268) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.Maths::TVector3.28", align 4
  %12 = alloca %"class.Maths::TVector3.28", align 4
  %13 = alloca %"class.Maths::TVector3.28", align 4
  %14 = alloca %"class.Maths::TVector3.28", align 4
  %15 = alloca %"class.Maths::TVector3.28", align 4
  %16 = alloca %"class.std::function.34", align 8
  %17 = alloca %class.anon.38, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::function.34", align 8
  %20 = alloca %class.anon.39, align 8
  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
  %21 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 10, ptr %8, align 4, !tbaa !9
  %22 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %21, i32 0, i32 1
  %23 = invoke noundef i32 @_ZNK7Riemann11SparseGrid3IiE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(48) %22)
          to label %24 unwind label %51

24:                                               ; preds = %3
  %25 = icmp sgt i32 %23, 10
  br i1 %25, label %26, label %87

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNK7Riemann12SparseOctree12PointToIndexEiRKN5Maths8TVector3IfEE(ptr dead_on_unwind writable sret(%"class.Maths::TVector3.28") align 4 %11, ptr noundef nonnull align 8 dereferenceable(268) %21, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(12) %27)
          to label %28 unwind label %55

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNK7Riemann12SparseOctree12PointToIndexEiRKN5Maths8TVector3IfEE(ptr dead_on_unwind writable sret(%"class.Maths::TVector3.28") align 4 %12, ptr noundef nonnull align 8 dereferenceable(268) %21, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(12) %29)
          to label %30 unwind label %59

30:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  invoke void @_ZNK5Maths8TVector3IiEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3.28") align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %31 unwind label %63

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #5
  invoke void @_ZN5Maths8TVector3IiEC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %15, i32 noundef 1, i32 noundef 1, i32 noundef 1)
          to label %32 unwind label %67

32:                                               ; preds = %31
  invoke void @_ZNK5Maths8TVector3IiEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3.28") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %33 unwind label %67

33:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  %34 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %21, i32 0, i32 1
  %35 = invoke noundef i32 @_ZNK7Riemann11SparseGrid3IiE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(48) %34)
          to label %36 unwind label %72

36:                                               ; preds = %33
  %37 = getelementptr inbounds %"class.Maths::TVector3.28", ptr %13, i32 0, i32 0
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = getelementptr inbounds %"class.Maths::TVector3.28", ptr %13, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !13
  %41 = mul nsw i32 %38, %40
  %42 = getelementptr inbounds %"class.Maths::TVector3.28", ptr %13, i32 0, i32 2
  %43 = load i32, ptr %42, align 4, !tbaa !14
  %44 = mul nsw i32 %41, %43
  %45 = icmp sgt i32 %35, %44
  br i1 %45, label %46, label %80

46:                                               ; preds = %36
  %47 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %21, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %48 = getelementptr inbounds %class.anon.38, ptr %17, i32 0, i32 0
  store ptr %0, ptr %48, align 8, !tbaa !5
  %49 = getelementptr inbounds %class.anon.38, ptr %17, i32 0, i32 1
  store ptr %21, ptr %49, align 8, !tbaa !15
  call void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(16) %17) #5
  invoke void @_ZNK7Riemann11SparseGrid3IiE14RangeIterationERKN5Maths8TVector3IiEES6_St8functionIFvRKiEE(ptr noundef nonnull align 8 dereferenceable(48) %47, ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef %16)
          to label %50 unwind label %76

50:                                               ; preds = %46
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  store i1 true, ptr %7, align 1
  store i32 1, ptr %18, align 4
  br label %81

51:                                               ; preds = %3
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %9, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %10, align 4
  br label %106

55:                                               ; preds = %26
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  br label %86

59:                                               ; preds = %28
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %9, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %10, align 4
  br label %85

63:                                               ; preds = %30
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %9, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %10, align 4
  br label %71

67:                                               ; preds = %32, %31
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #5
  br label %71

71:                                               ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  br label %84

72:                                               ; preds = %33
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %9, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %10, align 4
  br label %84

76:                                               ; preds = %46
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %9, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %10, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  br label %84

80:                                               ; preds = %36
  store i32 0, ptr %18, align 4
  br label %81

81:                                               ; preds = %80, %50
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #5
  %82 = load i32, ptr %18, align 4
  switch i32 %82, label %104 [
    i32 0, label %83
  ]

83:                                               ; preds = %81
  br label %87

84:                                               ; preds = %76, %72, %71
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  br label %85

85:                                               ; preds = %84, %59
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  br label %86

86:                                               ; preds = %85, %55
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #5
  br label %106

87:                                               ; preds = %83, %24
  %88 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %21, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  %89 = getelementptr inbounds %class.anon.39, ptr %20, i32 0, i32 0
  store ptr %21, ptr %89, align 8, !tbaa !17
  %90 = getelementptr inbounds %class.anon.39, ptr %20, i32 0, i32 1
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %91, ptr %90, align 8, !tbaa !5
  %92 = getelementptr inbounds %class.anon.39, ptr %20, i32 0, i32 2
  store ptr %0, ptr %92, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %93 unwind label %95

93:                                               ; preds = %87
  invoke void @_ZNK7Riemann11SparseGrid3IiE12AllIterationESt8functionIFvRKiEE(ptr noundef nonnull align 8 dereferenceable(48) %88, ptr noundef %19)
          to label %94 unwind label %99

94:                                               ; preds = %93
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  store i1 true, ptr %7, align 1
  store i32 1, ptr %18, align 4
  br label %104

95:                                               ; preds = %87
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %9, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %10, align 4
  br label %103

99:                                               ; preds = %93
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %9, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %10, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #5
  br label %103

103:                                              ; preds = %99, %95
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  br label %106

104:                                              ; preds = %94, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %105 = load i1, ptr %7, align 1
  br i1 %105, label %108, label %107

106:                                              ; preds = %103, %86, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %109

107:                                              ; preds = %104
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %108

108:                                              ; preds = %107, %104
  ret void

109:                                              ; preds = %106
  %110 = load ptr, ptr %9, align 8
  %111 = load i32, ptr %10, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN5Maths8TVector3IiEE", !10, i64 0, !10, i64 4, !10, i64 8}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_0", !6, i64 0, !6, i64 8}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_1", !6, i64 0, !6, i64 8, !6, i64 16}


; 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.Maths::TVector3.28" = type { i32, i32, i32 }
%"class.std::vector.29" = type { %"struct.std::_Vector_base.30" }
%"struct.std::_Vector_base.30" = type { %"struct.std::_Vector_base<const Riemann::SparseOctree::Cell *, std::allocator<const Riemann::SparseOctree::Cell *>>::_Vector_impl" }
%"struct.std::_Vector_base<const Riemann::SparseOctree::Cell *, std::allocator<const Riemann::SparseOctree::Cell *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const Riemann::SparseOctree::Cell *, std::allocator<const Riemann::SparseOctree::Cell *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const Riemann::SparseOctree::Cell *, std::allocator<const Riemann::SparseOctree::Cell *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function.34" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.38 = type { ptr, ptr }
%class.anon.39 = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEE(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector.29") align 8 %0, ptr noundef nonnull align 8 dereferenceable(268) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.Maths::TVector3.28", align 4
  %5 = alloca %"class.Maths::TVector3.28", align 4
  %6 = alloca %"class.Maths::TVector3.28", align 4
  %7 = alloca %"class.Maths::TVector3.28", align 4
  %8 = alloca %"class.Maths::TVector3.28", align 4
  %9 = alloca %"class.std::function.34", align 8
  %10 = alloca %class.anon.38, align 8
  %11 = alloca %"class.std::function.34", align 8
  %12 = alloca %class.anon.39, align 8
  tail call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = tail call noundef i32 @_ZNK7Riemann11SparseGrid3IiE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(48) %13)
  %15 = icmp sgt i32 %14, 10
  br i1 %15, label %16, label %47

16:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  invoke void @_ZNK7Riemann12SparseOctree12PointToIndexEiRKN5Maths8TVector3IfEE(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3.28") align 4 %4, ptr noundef nonnull align 8 dereferenceable(268) %1, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %17 unwind label %33

17:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  invoke 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) %2)
          to label %18 unwind label %35

18:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #5
  invoke void @_ZNK5Maths8TVector3IiEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3.28") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %19 unwind label %37

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  call void @_ZN5Maths8TVector3IiEC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %8, i32 noundef 1, i32 noundef 1, i32 noundef 1)
  invoke void @_ZNK5Maths8TVector3IiEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3.28") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %20 unwind label %39

20:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  %21 = call noundef i32 @_ZNK7Riemann11SparseGrid3IiE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(48) %13)
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %6, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !10
  %25 = mul nsw i32 %24, %22
  %26 = getelementptr inbounds i8, ptr %6, i64 8
  %27 = load i32, ptr %26, align 4, !tbaa !11
  %28 = mul nsw i32 %25, %27
  %29 = icmp sgt i32 %21, %28
  br i1 %29, label %30, label %.critedge

30:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  store ptr %0, ptr %10, align 8, !tbaa !12
  %31 = getelementptr inbounds i8, ptr %10, i64 8
  store ptr %1, ptr %31, align 8, !tbaa !14
  call void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  invoke void @_ZNK7Riemann11SparseGrid3IiE14RangeIterationERKN5Maths8TVector3IiEES6_St8functionIFvRKiEE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull %9)
          to label %32 unwind label %42

32:                                               ; preds = %30
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  br label %.critedge27

33:                                               ; preds = %16
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %46

35:                                               ; preds = %17
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %45

37:                                               ; preds = %18
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %41

39:                                               ; preds = %19
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  br label %41

41:                                               ; preds = %39, %37
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  br label %44

42:                                               ; preds = %30
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %44

44:                                               ; preds = %42, %41
  %.pn17 = phi { ptr, i32 } [ %43, %42 ], [ %.pn, %41 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #5
  br label %45

45:                                               ; preds = %44, %35
  %.pn17.pn = phi { ptr, i32 } [ %.pn17, %44 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  br label %46

46:                                               ; preds = %45, %33
  %.pn17.pn.pn = phi { ptr, i32 } [ %.pn17.pn, %45 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  br label %56

.critedge:                                        ; preds = %20
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  br label %47

47:                                               ; preds = %.critedge, %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  store ptr %1, ptr %12, align 8, !tbaa !16
  %48 = getelementptr inbounds i8, ptr %12, i64 8
  store ptr %2, ptr %48, align 8, !tbaa !12
  %49 = getelementptr inbounds i8, ptr %12, i64 16
  store ptr %0, ptr %49, align 8, !tbaa !12
  invoke void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %50 unwind label %51

50:                                               ; preds = %47
  invoke void @_ZNK7Riemann11SparseGrid3IiE12AllIterationESt8functionIFvRKiEE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull %11)
          to label %.critedge25 unwind label %53

.critedge25:                                      ; preds = %50
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  br label %.critedge27

51:                                               ; preds = %47
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %55

53:                                               ; preds = %50
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  br label %55

55:                                               ; preds = %53, %51
  %.pn21 = phi { ptr, i32 } [ %54, %53 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  br label %56

56:                                               ; preds = %55, %46
  %.pn21.pn = phi { ptr, i32 } [ %.pn21, %55 ], [ %.pn17.pn.pn, %46 ]
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  resume { ptr, i32 } %.pn21.pn

.critedge27:                                      ; preds = %32, %.critedge25
  ret void
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 = !{!"_ZTSN5Maths8TVector3IiEE", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!6, !7, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!15, !13, i64 8}
!15 = !{!"_ZTSZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_0", !13, i64 0, !13, i64 8}
!16 = !{!17, !13, i64 0}
!17 = !{!"_ZTSZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths8TVector3IfEEE3$_1", !13, i64 0, !13, i64 8, !13, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass