; 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.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.Maths::TVector3.28" = type { i32, i32, i32 }
%"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.40 = type { ptr, ptr }
%class.anon.41 = 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 }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }

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 uwtable
define dso_local void @_ZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEE(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(24) %2) #1 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.40, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::function.34", align 8
  %20 = alloca %class.anon.41, 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 %53

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

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %"class.Maths::TAABB3", ptr %27, i32 0, i32 0
  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) %28)
          to label %29 unwind label %57

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.Maths::TAABB3", ptr %30, i32 0, i32 1
  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) %31)
          to label %32 unwind label %61

32:                                               ; preds = %29
  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 %33 unwind label %65

33:                                               ; preds = %32
  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 %34 unwind label %69

34:                                               ; preds = %33
  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 %35 unwind label %69

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

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

48:                                               ; preds = %38
  %49 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %21, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %50 = getelementptr inbounds %class.anon.40, ptr %17, i32 0, i32 0
  store ptr %0, ptr %50, align 8, !tbaa !5
  %51 = getelementptr inbounds %class.anon.40, ptr %17, i32 0, i32 1
  store ptr %21, ptr %51, align 8, !tbaa !15
  call void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEEE3$_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) %49, ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef %16)
          to label %52 unwind label %78

52:                                               ; preds = %48
  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 %83

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

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

61:                                               ; preds = %29
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %9, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %10, align 4
  br label %87

65:                                               ; preds = %32
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %9, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %10, align 4
  br label %73

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

73:                                               ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  br label %86

74:                                               ; preds = %35
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %9, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %10, align 4
  br label %86

78:                                               ; preds = %48
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %9, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, 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 %86

82:                                               ; preds = %38
  store i32 0, ptr %18, align 4
  br label %83

83:                                               ; preds = %82, %52
  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
  %84 = load i32, ptr %18, align 4
  switch i32 %84, label %106 [
    i32 0, label %85
  ]

85:                                               ; preds = %83
  br label %89

86:                                               ; preds = %78, %74, %73
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  br label %87

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

88:                                               ; preds = %87, %57
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #5
  br label %108

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

95:                                               ; preds = %89
  invoke void @_ZNK7Riemann11SparseGrid3IiE12AllIterationESt8functionIFvRKiEE(ptr noundef nonnull align 8 dereferenceable(48) %90, ptr noundef %19)
          to label %96 unwind label %101

96:                                               ; preds = %95
  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 %106

97:                                               ; preds = %89
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %9, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %10, align 4
  br label %105

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

105:                                              ; preds = %101, %97
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  br label %108

106:                                              ; preds = %96, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %107 = load i1, ptr %7, align 1
  br i1 %107, label %110, label %109

108:                                              ; preds = %105, %88, %53
  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 %111

109:                                              ; preds = %106
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %110

110:                                              ; preds = %109, %106
  ret void

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEEE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"_ZTSZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEEE3$_0", !6, i64 0, !6, i64 8}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEEE3$_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.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.Maths::TVector3.28" = type { i32, i32, i32 }
%"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.40 = type { ptr, ptr }
%class.anon.41 = 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 uwtable
define dso_local void @_ZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEE(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(24) %2) local_unnamed_addr #1 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.40, align 8
  %11 = alloca %"class.std::function.34", align 8
  %12 = alloca %class.anon.41, 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 %48

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 %34

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

19:                                               ; 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 %20 unwind label %38

20:                                               ; preds = %19
  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 %21 unwind label %40

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

31:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  store ptr %0, ptr %10, align 8, !tbaa !12
  %32 = getelementptr inbounds i8, ptr %10, i64 8
  store ptr %1, ptr %32, align 8, !tbaa !14
  call void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEEE3$_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 %33 unwind label %43

33:                                               ; preds = %31
  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

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

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

38:                                               ; preds = %19
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

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

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

43:                                               ; preds = %31
  %44 = 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 %45

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

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

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

.critedge:                                        ; preds = %21
  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 %48

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

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

.critedge25:                                      ; preds = %51
  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

52:                                               ; preds = %48
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %56

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEEE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"_ZTSZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEEE3$_0", !13, i64 0, !13, i64 8}
!16 = !{!17, !13, i64 0}
!17 = !{!"_ZTSZNK7Riemann12SparseOctree20InitializeQueryQueueERKN5Maths6TAABB3IfEEE3$_1", !13, i64 0, !13, i64 8, !13, i64 16}


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