; 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.Riemann::ListSet<int>::ValueEnumerable::Iterator" = type { ptr, i32, i32, ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"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 = type { ptr, ptr, ptr, ptr, ptr }
%"class.Riemann::ListSet<int>::ValueEnumerable" = type <{ ptr, i32, [4 x i8] }>
%"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 }
%"struct.Riemann::SparseOctree::Cell" = type { i32, i32, %"class.Maths::TVector3.28", [8 x i32] }
%"class.Maths::TVector3.28" = type { i32, i32, i32 }

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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52), i32 noundef) #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, i32 } @_ZNK7Riemann7ListSetIiLi8EEixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable5beginEv(ptr dead_on_unwind noalias writable sret(%"class.Riemann::ListSet<int>::ValueEnumerable::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(12)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable3endEv(ptr dead_on_unwind noalias writable sret(%"class.Riemann::ListSet<int>::ValueEnumerable::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(12)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK7Riemann12SparseOctree11RaycastCellERKN5Maths8TVector3IfEES5_St8functionIFfiS5_S5_EEPf(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef %3, ptr noundef %4) #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca float, align 4
  %18 = alloca %"class.std::vector.29", align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %"class.std::function.34", align 8
  %22 = alloca %class.anon, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca %"class.Riemann::ListSet<int>::ValueEnumerable", align 8
  %26 = alloca { ptr, i32 }, align 8
  %27 = alloca %"class.Riemann::ListSet<int>::ValueEnumerable::Iterator", align 8
  %28 = alloca %"class.Riemann::ListSet<int>::ValueEnumerable::Iterator", align 8
  %29 = alloca i32, align 4
  %30 = alloca float, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %34 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store float 0x47EFFFFFE0000000, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 -1, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %35 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %34, i32 0, i32 3
  store ptr %35, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %36) #6
  %38 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %37, ptr %38, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %39) #6
  %41 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  br label %42

42:                                               ; preds = %59, %5
  %43 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br i1 %43, label %45, label %44

44:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %61

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  %47 = load i32, ptr %46, align 4, !tbaa !11
  store i32 %47, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %48 = load i32, ptr %16, align 4, !tbaa !11
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = call noundef float @_ZNKSt8functionIFfiRKN5Maths8TVector3IfEES4_EEclEiS4_S4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %48, ptr noundef nonnull align 4 dereferenceable(12) %49, ptr noundef nonnull align 4 dereferenceable(12) %50)
  store float %51, ptr %17, align 4, !tbaa !9
  %52 = load float, ptr %17, align 4, !tbaa !9
  %53 = load float, ptr %11, align 4, !tbaa !9
  %54 = fcmp olt float %52, %53
  br i1 %54, label %55, label %58

55:                                               ; preds = %45
  %56 = load float, ptr %17, align 4, !tbaa !9
  store float %56, ptr %11, align 4, !tbaa !9
  %57 = load i32, ptr %16, align 4, !tbaa !11
  store i32 %57, ptr %12, align 4, !tbaa !11
  br label %58

58:                                               ; preds = %55, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %59

59:                                               ; preds = %58
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br label %42

61:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 64)
          to label %62 unwind label %93

62:                                               ; preds = %61
  %63 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %34, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 40, ptr %22) #6
  %64 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 0
  store ptr %34, ptr %64, align 8, !tbaa !13
  %65 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 1
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %66, ptr %65, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 2
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %68, ptr %67, align 8, !tbaa !5
  %69 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 3
  store ptr %11, ptr %69, align 8, !tbaa !5
  %70 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 4
  store ptr %18, ptr %70, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree11RaycastCellERKN5Maths8TVector3IfEESB_S_IFfiSB_SB_EEPfE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(40) %22)
          to label %71 unwind label %97

71:                                               ; preds = %62
  invoke void @_ZNK7Riemann11SparseGrid3IiE12AllIterationESt8functionIFvRKiEE(ptr noundef nonnull align 8 dereferenceable(48) %63, ptr noundef %21)
          to label %72 unwind label %101

72:                                               ; preds = %71
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #6
  br label %73

73:                                               ; preds = %198, %72
  %74 = call noundef i64 @_ZNKSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %75 = icmp ugt i64 %74, 0
  br i1 %75, label %76, label %200

76:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  store ptr %78, ptr %23, align 8, !tbaa !5
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  %79 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %34, i32 0, i32 2
  %80 = load ptr, ptr %23, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 4, !tbaa !15
  %83 = invoke { ptr, i32 } @_ZNK7Riemann7ListSetIiLi8EEixEi(ptr noundef nonnull align 8 dereferenceable(72) %79, i32 noundef %82)
          to label %84 unwind label %106

84:                                               ; preds = %76
  store { ptr, i32 } %83, ptr %26, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %26, i64 12, i1 false)
  store ptr %25, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #6
  %85 = load ptr, ptr %24, align 8, !tbaa !5
  invoke void @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable5beginEv(ptr dead_on_unwind writable sret(%"class.Riemann::ListSet<int>::ValueEnumerable::Iterator") align 8 %27, ptr noundef nonnull align 8 dereferenceable(12) %85)
          to label %86 unwind label %110

86:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #6
  %87 = load ptr, ptr %24, align 8, !tbaa !5
  invoke void @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable3endEv(ptr dead_on_unwind writable sret(%"class.Riemann::ListSet<int>::ValueEnumerable::Iterator") align 8 %28, ptr noundef nonnull align 8 dereferenceable(12) %87)
          to label %88 unwind label %114

88:                                               ; preds = %86
  br label %89

89:                                               ; preds = %144, %88
  %90 = invoke noundef zeroext i1 @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(24) %28)
          to label %91 unwind label %114

91:                                               ; preds = %89
  br i1 %90, label %118, label %92

92:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %149

93:                                               ; preds = %61
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %19, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %20, align 4
  br label %204

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

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

105:                                              ; preds = %101, %97
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #6
  br label %204

106:                                              ; preds = %76
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %19, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %20, align 4
  br label %148

110:                                              ; preds = %84
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %19, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %20, align 4
  br label %147

114:                                              ; preds = %142, %89, %86
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %19, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %20, align 4
  br label %146

118:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %119 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %120 unwind label %133

120:                                              ; preds = %118
  %121 = load i32, ptr %119, align 4, !tbaa !11
  store i32 %121, ptr %29, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %122 = load i32, ptr %29, align 4, !tbaa !11
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = invoke noundef float @_ZNKSt8functionIFfiRKN5Maths8TVector3IfEES4_EEclEiS4_S4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %122, ptr noundef nonnull align 4 dereferenceable(12) %123, ptr noundef nonnull align 4 dereferenceable(12) %124)
          to label %126 unwind label %137

126:                                              ; preds = %120
  store float %125, ptr %30, align 4, !tbaa !9
  %127 = load float, ptr %30, align 4, !tbaa !9
  %128 = load float, ptr %11, align 4, !tbaa !9
  %129 = fcmp olt float %127, %128
  br i1 %129, label %130, label %141

130:                                              ; preds = %126
  %131 = load float, ptr %30, align 4, !tbaa !9
  store float %131, ptr %11, align 4, !tbaa !9
  %132 = load i32, ptr %29, align 4, !tbaa !11
  store i32 %132, ptr %12, align 4, !tbaa !11
  br label %141

133:                                              ; preds = %118
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %19, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %20, align 4
  br label %145

137:                                              ; preds = %120
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %19, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  br label %145

141:                                              ; preds = %130, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %142

142:                                              ; preds = %141
  %143 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %144 unwind label %114

144:                                              ; preds = %142
  br label %89

145:                                              ; preds = %137, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %146

146:                                              ; preds = %145, %114
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #6
  br label %147

147:                                              ; preds = %146, %110
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  br label %148

148:                                              ; preds = %147, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %199

149:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  store i32 0, ptr %31, align 4, !tbaa !11
  br label %150

150:                                              ; preds = %194, %149
  %151 = load i32, ptr %31, align 4, !tbaa !11
  %152 = icmp slt i32 %151, 8
  br i1 %152, label %154, label %153

153:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %198

154:                                              ; preds = %150
  %155 = load ptr, ptr %23, align 8, !tbaa !5
  %156 = load i32, ptr %31, align 4, !tbaa !11
  %157 = invoke noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %155, i32 noundef %156)
          to label %158 unwind label %179

158:                                              ; preds = %154
  br i1 %157, label %159, label %193

159:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %160 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %34, i32 0, i32 0
  %161 = load ptr, ptr %23, align 8, !tbaa !5
  %162 = load i32, ptr %31, align 4, !tbaa !11
  %163 = invoke noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %161, i32 noundef %162)
          to label %164 unwind label %183

164:                                              ; preds = %159
  %165 = sext i32 %163 to i64
  %166 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %160, i64 noundef %165) #6
  store ptr %166, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %167 = load ptr, ptr %32, align 8, !tbaa !5
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = load ptr, ptr %8, align 8, !tbaa !5
  %170 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %34, ptr noundef nonnull align 4 dereferenceable(52) %167, ptr noundef nonnull align 4 dereferenceable(12) %168, ptr noundef nonnull align 4 dereferenceable(12) %169)
          to label %171 unwind label %187

171:                                              ; preds = %164
  %172 = fpext float %170 to double
  store double %172, ptr %33, align 8, !tbaa !18
  %173 = load double, ptr %33, align 8, !tbaa !18
  %174 = load float, ptr %11, align 4, !tbaa !9
  %175 = fpext float %174 to double
  %176 = fcmp olt double %173, %175
  br i1 %176, label %177, label %191

177:                                              ; preds = %171
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %178 unwind label %187

178:                                              ; preds = %177
  br label %191

179:                                              ; preds = %154
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %19, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %20, align 4
  br label %197

183:                                              ; preds = %159
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %19, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %20, align 4
  br label %192

187:                                              ; preds = %177, %164
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %19, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  br label %192

191:                                              ; preds = %178, %171
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %193

192:                                              ; preds = %187, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %197

193:                                              ; preds = %191, %158
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %31, align 4, !tbaa !11
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %31, align 4, !tbaa !11
  br label %150, !llvm.loop !20

197:                                              ; preds = %192, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %199

198:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %73, !llvm.loop !22

199:                                              ; preds = %197, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %204

200:                                              ; preds = %73
  %201 = load float, ptr %11, align 4, !tbaa !9
  %202 = load ptr, ptr %10, align 8, !tbaa !5
  store float %201, ptr %202, align 4, !tbaa !9
  %203 = load i32, ptr %12, align 4, !tbaa !11
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  ret i32 %203

204:                                              ; preds = %199, %105, %93
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %205

205:                                              ; preds = %204
  %206 = load ptr, ptr %19, align 8
  %207 = load i32, ptr %20, align 4
  %208 = insertvalue { ptr, i32 } poison, ptr %206, 0
  %209 = insertvalue { ptr, i32 } %208, i32 %207, 1
  resume { ptr, i32 } %209
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNKSt8functionIFfiRKN5Maths8TVector3IfEES4_EEclEiS4_S4_(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #5 align 2

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSZNK7Riemann12SparseOctree11RaycastCellERKN5Maths8TVector3IfEES5_St8functionIFfiS5_S5_EEPfE3$_0", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!15 = !{!16, !12, i64 0}
!16 = !{!"_ZTSN7Riemann12SparseOctree4CellE", !12, i64 0, !12, i64 4, !17, i64 8, !7, i64 20}
!17 = !{!"_ZTSN5Maths8TVector3IiEE", !12, i64 0, !12, i64 4, !12, i64 8}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; 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.Riemann::ListSet<int>::ValueEnumerable::Iterator" = type { ptr, i32, i32, ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"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 = type { ptr, ptr, ptr, ptr, ptr }
%"class.Riemann::ListSet<int>::ValueEnumerable" = type <{ ptr, i32, [4 x i8] }>

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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52), i32 noundef) local_unnamed_addr #1 align 2

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, i32 } @_ZNK7Riemann7ListSetIiLi8EEixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable5beginEv(ptr dead_on_unwind noalias writable sret(%"class.Riemann::ListSet<int>::ValueEnumerable::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable3endEv(ptr dead_on_unwind noalias writable sret(%"class.Riemann::ListSet<int>::ValueEnumerable::Iterator") align 8, ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; 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 uwtable
define dso_local noundef i32 @_ZNK7Riemann12SparseOctree11RaycastCellERKN5Maths8TVector3IfEES5_St8functionIFfiS5_S5_EEPf(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca float, align 4
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"class.std::vector.29", align 8
  %10 = alloca %"class.std::function.34", align 8
  %11 = alloca %class.anon, align 8
  %12 = alloca %"class.Riemann::ListSet<int>::ValueEnumerable", align 8
  %13 = alloca %"class.Riemann::ListSet<int>::ValueEnumerable::Iterator", align 8
  %14 = alloca %"class.Riemann::ListSet<int>::ValueEnumerable::Iterator", align 8
  %15 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store float 0x47EFFFFFE0000000, ptr %6, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 144
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %17 = tail call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %16) #5
  store ptr %17, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %18 = tail call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %16) #5
  store ptr %18, ptr %8, align 8
  %19 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %26, %5
  %.0.lcssa = phi i32 [ -1, %5 ], [ %.1, %26 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 64)
          to label %29 unwind label %48

.lr.ph:                                           ; preds = %5, %26
  %.059 = phi i32 [ %.1, %26 ], [ -1, %5 ]
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = call noundef float @_ZNKSt8functionIFfiRKN5Maths8TVector3IfEES4_EEclEiS4_S4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %21, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
  %23 = load float, ptr %6, align 4, !tbaa !5
  %24 = fcmp olt float %22, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %.lr.ph
  store float %22, ptr %6, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %25, %.lr.ph
  %.1 = phi i32 [ %21, %25 ], [ %.059, %.lr.ph ]
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %28 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %28, label %.lr.ph, label %._crit_edge

29:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #5
  store ptr %0, ptr %11, align 8, !tbaa !11
  %30 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %1, ptr %30, align 8, !tbaa !14
  %31 = getelementptr inbounds i8, ptr %11, i64 16
  store ptr %2, ptr %31, align 8, !tbaa !14
  %32 = getelementptr inbounds i8, ptr %11, i64 24
  store ptr %6, ptr %32, align 8, !tbaa !14
  %33 = getelementptr inbounds i8, ptr %11, i64 32
  store ptr %9, ptr %33, align 8, !tbaa !14
  invoke void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree11RaycastCellERKN5Maths8TVector3IfEESB_S_IFfiSB_SB_EEPfE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(40) %11)
          to label %34 unwind label %50

34:                                               ; preds = %29
  %35 = getelementptr inbounds i8, ptr %0, i64 24
  invoke void @_ZNK7Riemann11SparseGrid3IiE12AllIterationESt8functionIFvRKiEE(ptr noundef nonnull align 8 dereferenceable(48) %35, ptr noundef nonnull %10)
          to label %36 unwind label %52

36:                                               ; preds = %34
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #5
  %37 = call noundef i64 @_ZNKSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %.not65 = icmp eq i64 %37, 0
  br i1 %.not65, label %._crit_edge69, label %.lr.ph68

.lr.ph68:                                         ; preds = %36
  %38 = getelementptr inbounds i8, ptr %0, i64 72
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  br label %39

39:                                               ; preds = %.lr.ph68, %.loopexit
  %.266 = phi i32 [ %.0.lcssa, %.lr.ph68 ], [ %.3.lcssa, %.loopexit ]
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %42 = load i32, ptr %41, align 4, !tbaa !15
  %43 = invoke { ptr, i32 } @_ZNK7Riemann7ListSetIiLi8EEixEi(ptr noundef nonnull align 8 dereferenceable(72) %38, i32 noundef %42)
          to label %44 unwind label %55

44:                                               ; preds = %39
  %.fca.0.extract = extractvalue { ptr, i32 } %43, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %43, 1
  store ptr %.fca.0.extract, ptr %12, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #5
  invoke void @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable5beginEv(ptr dead_on_unwind nonnull writable sret(%"class.Riemann::ListSet<int>::ValueEnumerable::Iterator") align 8 %13, ptr noundef nonnull align 8 dereferenceable(12) %12)
          to label %45 unwind label %57

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #5
  invoke void @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable3endEv(ptr dead_on_unwind nonnull writable sret(%"class.Riemann::ListSet<int>::ValueEnumerable::Iterator") align 8 %14, ptr noundef nonnull align 8 dereferenceable(12) %12)
          to label %.preheader unwind label %59

.preheader:                                       ; preds = %45
  %46 = call noundef zeroext i1 @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %14)
  br i1 %46, label %.lr.ph61, label %._crit_edge62

._crit_edge62:                                    ; preds = %70, %.preheader
  %.3.lcssa = phi i32 [ %.266, %.preheader ], [ %.4, %70 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  %47 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 0)
  br i1 %47, label %75, label %87

48:                                               ; preds = %._crit_edge
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %173

50:                                               ; preds = %29
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %54

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

54:                                               ; preds = %52, %50
  %.pn = phi { ptr, i32 } [ %53, %52 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #5
  br label %173

55:                                               ; preds = %39
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %173

57:                                               ; preds = %44
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %74

59:                                               ; preds = %45
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %73

.lr.ph61:                                         ; preds = %.preheader, %70
  %.360 = phi i32 [ %.4, %70 ], [ %.266, %.preheader ]
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratordeEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = invoke noundef float @_ZNKSt8functionIFfiRKN5Maths8TVector3IfEES4_EEclEiS4_S4_(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %62, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %64 unwind label %68

64:                                               ; preds = %.lr.ph61
  %65 = load float, ptr %6, align 4, !tbaa !5
  %66 = fcmp olt float %63, %65
  br i1 %66, label %67, label %70

67:                                               ; preds = %64
  store float %63, ptr %6, align 4, !tbaa !5
  br label %70

68:                                               ; preds = %.lr.ph61
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %73

70:                                               ; preds = %67, %64
  %.4 = phi i32 [ %62, %67 ], [ %.360, %64 ]
  %71 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratorppEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %72 = call noundef zeroext i1 @_ZNK7Riemann7ListSetIiLi8EE15ValueEnumerable8IteratorneERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %14)
  br i1 %72, label %.lr.ph61, label %._crit_edge62

73:                                               ; preds = %68, %59
  %.pn47 = phi { ptr, i32 } [ %69, %68 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #5
  br label %74

74:                                               ; preds = %73, %57
  %.pn47.pn = phi { ptr, i32 } [ %.pn47, %73 ], [ %58, %57 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br label %173

75:                                               ; preds = %._crit_edge62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %76 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 0)
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %77) #5
  store ptr %78, ptr %15, align 8, !tbaa !14
  %79 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %78, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %80 unwind label %84

80:                                               ; preds = %75
  %81 = load float, ptr %6, align 4, !tbaa !5
  %82 = fcmp olt float %79, %81
  br i1 %82, label %83, label %86

83:                                               ; preds = %80
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %86 unwind label %84

84:                                               ; preds = %169, %161, %157, %149, %145, %137, %133, %125, %121, %113, %109, %101, %97, %89, %83, %75
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %173

86:                                               ; preds = %83, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %87

87:                                               ; preds = %._crit_edge62, %86
  %88 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 1)
  br i1 %88, label %89, label %99

89:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %90 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 1)
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %91) #5
  store ptr %92, ptr %15, align 8, !tbaa !14
  %93 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %92, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %94 unwind label %84

94:                                               ; preds = %89
  %95 = load float, ptr %6, align 4, !tbaa !5
  %96 = fcmp olt float %93, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %94
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %98 unwind label %84

98:                                               ; preds = %97, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %99

99:                                               ; preds = %98, %87
  %100 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 2)
  br i1 %100, label %101, label %111

101:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %102 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 2)
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %103) #5
  store ptr %104, ptr %15, align 8, !tbaa !14
  %105 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %104, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %106 unwind label %84

106:                                              ; preds = %101
  %107 = load float, ptr %6, align 4, !tbaa !5
  %108 = fcmp olt float %105, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %110 unwind label %84

110:                                              ; preds = %109, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %111

111:                                              ; preds = %110, %99
  %112 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 3)
  br i1 %112, label %113, label %123

113:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %114 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 3)
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %115) #5
  store ptr %116, ptr %15, align 8, !tbaa !14
  %117 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %116, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %118 unwind label %84

118:                                              ; preds = %113
  %119 = load float, ptr %6, align 4, !tbaa !5
  %120 = fcmp olt float %117, %119
  br i1 %120, label %121, label %122

121:                                              ; preds = %118
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %122 unwind label %84

122:                                              ; preds = %121, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %123

123:                                              ; preds = %122, %111
  %124 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 4)
  br i1 %124, label %125, label %135

125:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %126 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 4)
  %127 = sext i32 %126 to i64
  %128 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %127) #5
  store ptr %128, ptr %15, align 8, !tbaa !14
  %129 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %128, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %130 unwind label %84

130:                                              ; preds = %125
  %131 = load float, ptr %6, align 4, !tbaa !5
  %132 = fcmp olt float %129, %131
  br i1 %132, label %133, label %134

133:                                              ; preds = %130
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %134 unwind label %84

134:                                              ; preds = %133, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %135

135:                                              ; preds = %134, %123
  %136 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 5)
  br i1 %136, label %137, label %147

137:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %138 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 5)
  %139 = sext i32 %138 to i64
  %140 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %139) #5
  store ptr %140, ptr %15, align 8, !tbaa !14
  %141 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %140, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %142 unwind label %84

142:                                              ; preds = %137
  %143 = load float, ptr %6, align 4, !tbaa !5
  %144 = fcmp olt float %141, %143
  br i1 %144, label %145, label %146

145:                                              ; preds = %142
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %146 unwind label %84

146:                                              ; preds = %145, %142
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %147

147:                                              ; preds = %146, %135
  %148 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 6)
  br i1 %148, label %149, label %159

149:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %150 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 6)
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %151) #5
  store ptr %152, ptr %15, align 8, !tbaa !14
  %153 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %152, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %154 unwind label %84

154:                                              ; preds = %149
  %155 = load float, ptr %6, align 4, !tbaa !5
  %156 = fcmp olt float %153, %155
  br i1 %156, label %157, label %158

157:                                              ; preds = %154
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %158 unwind label %84

158:                                              ; preds = %157, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %159

159:                                              ; preds = %158, %147
  %160 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree4Cell8HasChildEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 7)
  br i1 %160, label %161, label %.loopexit

161:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %162 = call noundef i32 @_ZNK7Riemann12SparseOctree4Cell10GetChildIDEi(ptr noundef nonnull align 4 dereferenceable(52) %41, i32 noundef 7)
  %163 = sext i32 %162 to i64
  %164 = call noundef nonnull align 4 dereferenceable(52) ptr @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %163) #5
  store ptr %164, ptr %15, align 8, !tbaa !14
  %165 = invoke noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %164, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %166 unwind label %84

166:                                              ; preds = %161
  %167 = load float, ptr %6, align 4, !tbaa !5
  %168 = fcmp olt float %165, %167
  br i1 %168, label %169, label %170

169:                                              ; preds = %166
  invoke void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %170 unwind label %84

170:                                              ; preds = %169, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %.loopexit

.loopexit:                                        ; preds = %170, %159
  %171 = call noundef i64 @_ZNKSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %.not = icmp eq i64 %171, 0
  br i1 %.not, label %._crit_edge69, label %39, !llvm.loop !18

._crit_edge69:                                    ; preds = %.loopexit, %36
  %.2.lcssa = phi i32 [ %.0.lcssa, %36 ], [ %.3.lcssa, %.loopexit ]
  %172 = load float, ptr %6, align 4, !tbaa !5
  store float %172, ptr %4, align 4, !tbaa !5
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  ret i32 %.2.lcssa

173:                                              ; preds = %84, %74, %55, %54, %48
  %.pn47.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn, %54 ], [ %49, %48 ], [ %85, %84 ], [ %.pn47.pn, %74 ], [ %56, %55 ]
  call void @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  resume { ptr, i32 } %.pn47.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNKSt8functionIFfiRKN5Maths8TVector3IfEES4_EEclEiS4_S4_(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 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 @_ZNSt6vectorIPKN7Riemann12SparseOctree4CellESaIS4_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvRKiEEC2IZNK7Riemann12SparseOctree11RaycastCellERKN5Maths8TVector3IfEESB_S_IFfiSB_SB_EEPfE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #4 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 noundef float @_ZNK7Riemann12SparseOctree11RaycastCellERKNS0_4CellERKN5Maths8TVector3IfEES8_(ptr noundef nonnull align 8 dereferenceable(268), ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 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 = !{!"float", !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, !13, i64 0}
!12 = !{!"_ZTSZNK7Riemann12SparseOctree11RaycastCellERKN5Maths8TVector3IfEES5_St8functionIFfiS5_S5_EEPfE3$_0", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTSN7Riemann12SparseOctree4CellE", !10, i64 0, !10, i64 4, !17, i64 8, !7, i64 20}
!17 = !{!"_ZTSN5Maths8TVector3IiEE", !10, i64 0, !10, i64 4, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass