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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"class.Riemann::ListSet<int>::ListProxy" = 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 }

@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [44 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE = external hidden unnamed_addr constant [67 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE(ptr noundef nonnull align 8 dereferenceable(268) %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(24) %2, ptr noundef %3) #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %10 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.Riemann::ListSet<int>::ListProxy", align 8
  %14 = alloca { ptr, i32 }, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %15 = load ptr, ptr %5, align 8
  %16 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 1
  %17 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %3, i32 0, i32 2
  %18 = call noundef zeroext i1 @_ZNK7Riemann11SparseGrid3IiE3HasERKN5Maths8TVector3IiEE(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull align 4 dereferenceable(12) %17)
  %19 = zext i1 %18 to i32
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %4
  br label %24

22:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 347, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE) #7
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  %25 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 0
  %26 = call noundef i64 @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  %27 = trunc i64 %26 to i32
  %28 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %3, i32 0, i32 0
  store i32 %27, ptr %28, align 4, !tbaa !11
  %29 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 0
  call void @_ZNSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 4 dereferenceable(52) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %30 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 4
  %31 = call ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56) %30, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %32 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %9, i32 0, i32 0
  %33 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %32, i32 0, i32 0
  store ptr %31, ptr %33, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %34 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 4
  %35 = call ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %34) #8
  %36 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %10, i32 0, i32 0
  %37 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %36, i32 0, i32 0
  store ptr %35, ptr %37, align 8
  %38 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKiiELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  br i1 %38, label %39, label %40

39:                                               ; preds = %24
  br label %42

40:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 352, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE) #7
  unreachable

41:                                               ; No predecessors!
  br label %42

42:                                               ; preds = %41, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  %43 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %3, i32 0, i32 0
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 4
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %45, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i32 %44, ptr %46, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %47 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 1
  %48 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %3, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !9
  %49 = call noundef ptr @_ZN7Riemann11SparseGrid3IiE3GetERKN5Maths8TVector3IiEEbRKi(ptr noundef nonnull align 8 dereferenceable(48) %47, ptr noundef nonnull align 4 dereferenceable(12) %48, i1 noundef zeroext true, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  store ptr %49, ptr %11, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %3, i32 0, i32 0
  %51 = load i32, ptr %50, align 4, !tbaa !11
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %51, ptr %52, align 4, !tbaa !9
  %53 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %3, i32 0, i32 0
  %54 = load i32, ptr %53, align 4, !tbaa !11
  %55 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 2
  %56 = call noundef i32 @_ZNK7Riemann7ListSetIiLi8EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72) %55)
  %57 = icmp sge i32 %54, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %42
  br label %61

59:                                               ; preds = %42
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 358, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE) #7
  unreachable

60:                                               ; No predecessors!
  br label %61

61:                                               ; preds = %60, %58
  %62 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 2
  %63 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %3, i32 0, i32 0
  %64 = load i32, ptr %63, align 4, !tbaa !11
  %65 = add nsw i32 %64, 1
  call void @_ZN7Riemann7ListSetIiLi8EE6resizeEi(ptr noundef nonnull align 8 dereferenceable(72) %62, i32 noundef %65)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #8
  %66 = getelementptr inbounds %"class.Riemann::SparseOctree", ptr %15, i32 0, i32 2
  %67 = getelementptr inbounds %"struct.Riemann::SparseOctree::Cell", ptr %3, i32 0, i32 0
  %68 = load i32, ptr %67, align 4, !tbaa !11
  %69 = call { ptr, i32 } @_ZN7Riemann7ListSetIiLi8EEixEi(ptr noundef nonnull align 8 dereferenceable(72) %66, i32 noundef %68)
  store { ptr, i32 } %69, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %14, i64 12, i1 false)
  call void @_ZN7Riemann7ListSetIiLi8EE9ListProxy9push_backERKi(ptr noundef nonnull align 8 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %15, ptr noundef nonnull align 4 dereferenceable(52) %3, ptr noundef nonnull align 4 dereferenceable(24) %70)
  br i1 %71, label %72, label %73

72:                                               ; preds = %61
  br label %75

73:                                               ; preds = %61
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 362, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE) #7
  unreachable

74:                                               ; No predecessors!
  br label %75

75:                                               ; preds = %74, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, i32 } @_ZN7Riemann7ListSetIiLi8EEixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #3 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) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Riemann7ListSetIiLi8EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72)) #6 align 2

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"class.Riemann::ListSet<int>::ListProxy" = type <{ ptr, i32, [4 x i8] }>

@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [44 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE = external hidden unnamed_addr constant [67 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE(ptr noundef nonnull align 8 dereferenceable(268) %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(24) %2, ptr noundef %3) local_unnamed_addr #2 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %7 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.Riemann::ListSet<int>::ListProxy", align 8
  store i32 %1, ptr %5, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  %12 = tail call noundef zeroext i1 @_ZNK7Riemann11SparseGrid3IiE3HasERKN5Maths8TVector3IiEE(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  br i1 %12, label %13, label %14

13:                                               ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 347, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE) #6
  unreachable

14:                                               ; preds = %4
  %15 = tail call noundef i64 @_ZNKSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %3, align 4, !tbaa !9
  tail call void @_ZNSt6vectorIN7Riemann12SparseOctree4CellESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(52) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %17 = getelementptr inbounds i8, ptr %0, i64 192
  %18 = call ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store ptr %18, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %19 = call ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %17) #7
  store ptr %19, ptr %7, align 8
  %20 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKiiELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br i1 %20, label %22, label %21

21:                                               ; preds = %14
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 352, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE) #6
  unreachable

22:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i32 %23, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  %25 = call noundef ptr @_ZN7Riemann11SparseGrid3IiE3GetERKN5Maths8TVector3IiEEbRKi(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 4 dereferenceable(12) %11, i1 noundef zeroext true, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %26 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %26, ptr %25, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 72
  %28 = call noundef i32 @_ZNK7Riemann7ListSetIiLi8EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72) %27)
  %.not = icmp slt i32 %26, %28
  br i1 %.not, label %29, label %30

29:                                               ; preds = %22
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 358, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE) #6
  unreachable

30:                                               ; preds = %22
  %31 = load i32, ptr %3, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  call void @_ZN7Riemann7ListSetIiLi8EE6resizeEi(ptr noundef nonnull align 8 dereferenceable(72) %27, i32 noundef %32)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  %33 = load i32, ptr %3, align 4, !tbaa !9
  %34 = call { ptr, i32 } @_ZN7Riemann7ListSetIiLi8EEixEi(ptr noundef nonnull align 8 dereferenceable(72) %27, i32 noundef %33)
  %.fca.0.extract = extractvalue { ptr, i32 } %34, 0
  %.fca.1.extract = extractvalue { ptr, i32 } %34, 1
  store ptr %.fca.0.extract, ptr %9, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZN7Riemann7ListSetIiLi8EE9ListProxy9push_backERKi(ptr noundef nonnull align 8 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  %35 = call noundef zeroext i1 @_ZNK7Riemann12SparseOctree5IsFitERKNS0_4CellERKN5Maths6TAABB3IfEE(ptr noundef nonnull align 8 dereferenceable(268) %0, ptr noundef nonnull align 4 dereferenceable(52) %3, ptr noundef nonnull align 4 dereferenceable(24) %2)
  br i1 %35, label %37, label %36

36:                                               ; preds = %30
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 362, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann12SparseOctree13InsertNewRootEiRKN5Maths6TAABB3IfEENS0_4CellE) #6
  unreachable

37:                                               ; preds = %30
  ret void
}

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Riemann7ListSetIiLi8EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #5 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { noreturn nounwind }
attributes #7 = { nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass