; LLVM IR from gazebosim/gz-physics :: tpe/lib/src/aabb_tree/AABB.ll (ZN4aabb4Tree14insertParticleEjRSt6vectorIdSaIdEEd)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"struct.std::pair.14" = type { i32, i32 }
%"struct.std::pair" = type <{ %"struct.std::__detail::_Node_iterator", i8, [7 x i8] }>
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"class.aabb::Tree" = type <{ i32, [4 x i8], %"class.std::vector.0", i32, i32, i32, i32, i8, [7 x i8], double, %"class.std::vector.5", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::unordered_map", i8, [7 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<aabb::Node, std::allocator<aabb::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<aabb::Node, std::allocator<aabb::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<aabb::Node, std::allocator<aabb::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<aabb::Node, std::allocator<aabb::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"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 }
%"struct.aabb::Node" = type { %"class.aabb::AABB", i32, i32, i32, i32, i32, i32 }
%"class.aabb::AABB" = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", double }

@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@_ZTISt16invalid_argument = external constant ptr
@.str.11 = external hidden unnamed_addr constant [42 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt16invalid_argumentD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4aabb4AABB18computeSurfaceAreaEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4aabb4AABB13computeCentreEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4aabb4Tree12allocateNodeEv(ptr noundef nonnull align 8 dereferenceable(233)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4aabb4Tree14insertParticleEjRSt6vectorIdSaIdEEd(ptr noundef nonnull align 8 dereferenceable(233) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3) #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::vector", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca %"struct.std::pair.14", align 4
  %18 = alloca %"struct.std::pair", 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 double %3, ptr %8, align 8, !tbaa !11
  %19 = load ptr, ptr %5, align 8
  %20 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 14
  %21 = call noundef i64 @_ZNKSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE5countERS5_(ptr noundef nonnull align 8 dereferenceable(56) %20, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %22 = icmp ne i64 %21, 0
  br i1 %22, label %23, label %30

23:                                               ; preds = %4
  %24 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef @.str.11)
          to label %25 unwind label %26

25:                                               ; preds = %23
  call void @__cxa_throw(ptr %24, ptr @_ZTISt16invalid_argument, ptr @_ZNSt16invalid_argumentD1Ev) #7
  unreachable

26:                                               ; preds = %23
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %9, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %10, align 4
  call void @__cxa_free_exception(ptr %24) #6
  br label %227

30:                                               ; preds = %4
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  %33 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 6
  %34 = load i32, ptr %33, align 4, !tbaa !13
  %35 = zext i32 %34 to i64
  %36 = icmp ne i64 %32, %35
  br i1 %36, label %37, label %44

37:                                               ; preds = %30
  %38 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef @.str.2)
          to label %39 unwind label %40

39:                                               ; preds = %37
  call void @__cxa_throw(ptr %38, ptr @_ZTISt16invalid_argument, ptr @_ZNSt16invalid_argumentD1Ev) #7
  unreachable

40:                                               ; preds = %37
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %9, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %10, align 4
  call void @__cxa_free_exception(ptr %38) #6
  br label %227

44:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %45 = call noundef i32 @_ZN4aabb4Tree12allocateNodeEv(ptr noundef nonnull align 8 dereferenceable(233) %19)
  store i32 %45, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  %46 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 6
  %47 = load i32, ptr %46, align 4, !tbaa !13
  %48 = zext i32 %47 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %48, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %49 unwind label %56

49:                                               ; preds = %44
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %117, %49
  %51 = load i32, ptr %14, align 4, !tbaa !9
  %52 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 6
  %53 = load i32, ptr %52, align 4, !tbaa !13
  %54 = icmp ult i32 %51, %53
  br i1 %54, label %60, label %55

55:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %120

56:                                               ; preds = %44
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %9, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %226

60:                                               ; preds = %50
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = zext i32 %62 to i64
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %63) #6
  %65 = load double, ptr %64, align 8, !tbaa !11
  %66 = load double, ptr %8, align 8, !tbaa !11
  %67 = fsub double %65, %66
  %68 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %70) #6
  %72 = getelementptr inbounds %"struct.aabb::Node", ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds %"class.aabb::AABB", ptr %72, i32 0, i32 0
  %74 = load i32, ptr %14, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %75) #6
  store double %67, ptr %76, align 8, !tbaa !11
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load i32, ptr %14, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef %79) #6
  %81 = load double, ptr %80, align 8, !tbaa !11
  %82 = load double, ptr %8, align 8, !tbaa !11
  %83 = fadd double %81, %82
  %84 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = zext i32 %85 to i64
  %87 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %86) #6
  %88 = getelementptr inbounds %"struct.aabb::Node", ptr %87, i32 0, i32 0
  %89 = getelementptr inbounds %"class.aabb::AABB", ptr %88, i32 0, i32 1
  %90 = load i32, ptr %14, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %91) #6
  store double %83, ptr %92, align 8, !tbaa !11
  %93 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = zext i32 %94 to i64
  %96 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %95) #6
  %97 = getelementptr inbounds %"struct.aabb::Node", ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds %"class.aabb::AABB", ptr %97, i32 0, i32 1
  %99 = load i32, ptr %14, align 4, !tbaa !9
  %100 = zext i32 %99 to i64
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %100) #6
  %102 = load double, ptr %101, align 8, !tbaa !11
  %103 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = zext i32 %104 to i64
  %106 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %103, i64 noundef %105) #6
  %107 = getelementptr inbounds %"struct.aabb::Node", ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds %"class.aabb::AABB", ptr %107, i32 0, i32 0
  %109 = load i32, ptr %14, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %110) #6
  %112 = load double, ptr %111, align 8, !tbaa !11
  %113 = fsub double %102, %112
  %114 = load i32, ptr %14, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %115) #6
  store double %113, ptr %116, align 8, !tbaa !11
  br label %117

117:                                              ; preds = %60
  %118 = load i32, ptr %14, align 4, !tbaa !9
  %119 = add i32 %118, 1
  store i32 %119, ptr %14, align 4, !tbaa !9
  br label %50, !llvm.loop !36

120:                                              ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %163, %120
  %122 = load i32, ptr %15, align 4, !tbaa !9
  %123 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 6
  %124 = load i32, ptr %123, align 4, !tbaa !13
  %125 = icmp ult i32 %122, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %166

127:                                              ; preds = %121
  %128 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 9
  %129 = load double, ptr %128, align 8, !tbaa !38
  %130 = load i32, ptr %15, align 4, !tbaa !9
  %131 = zext i32 %130 to i64
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %131) #6
  %133 = load double, ptr %132, align 8, !tbaa !11
  %134 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %135 = load i32, ptr %11, align 4, !tbaa !9
  %136 = zext i32 %135 to i64
  %137 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %134, i64 noundef %136) #6
  %138 = getelementptr inbounds %"struct.aabb::Node", ptr %137, i32 0, i32 0
  %139 = getelementptr inbounds %"class.aabb::AABB", ptr %138, i32 0, i32 0
  %140 = load i32, ptr %15, align 4, !tbaa !9
  %141 = zext i32 %140 to i64
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %139, i64 noundef %141) #6
  %143 = load double, ptr %142, align 8, !tbaa !11
  %144 = fneg double %129
  %145 = call double @llvm.fmuladd.f64(double %144, double %133, double %143)
  store double %145, ptr %142, align 8, !tbaa !11
  %146 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 9
  %147 = load double, ptr %146, align 8, !tbaa !38
  %148 = load i32, ptr %15, align 4, !tbaa !9
  %149 = zext i32 %148 to i64
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %149) #6
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %153 = load i32, ptr %11, align 4, !tbaa !9
  %154 = zext i32 %153 to i64
  %155 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %152, i64 noundef %154) #6
  %156 = getelementptr inbounds %"struct.aabb::Node", ptr %155, i32 0, i32 0
  %157 = getelementptr inbounds %"class.aabb::AABB", ptr %156, i32 0, i32 1
  %158 = load i32, ptr %15, align 4, !tbaa !9
  %159 = zext i32 %158 to i64
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %157, i64 noundef %159) #6
  %161 = load double, ptr %160, align 8, !tbaa !11
  %162 = call double @llvm.fmuladd.f64(double %147, double %151, double %161)
  store double %162, ptr %160, align 8, !tbaa !11
  br label %163

163:                                              ; preds = %127
  %164 = load i32, ptr %15, align 4, !tbaa !9
  %165 = add i32 %164, 1
  store i32 %165, ptr %15, align 4, !tbaa !9
  br label %121, !llvm.loop !39

166:                                              ; preds = %126
  %167 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %168 = load i32, ptr %11, align 4, !tbaa !9
  %169 = zext i32 %168 to i64
  %170 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %167, i64 noundef %169) #6
  %171 = getelementptr inbounds %"struct.aabb::Node", ptr %170, i32 0, i32 0
  %172 = call noundef double @_ZNK4aabb4AABB18computeSurfaceAreaEv(ptr noundef nonnull align 8 dereferenceable(80) %171)
  %173 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %174 = load i32, ptr %11, align 4, !tbaa !9
  %175 = zext i32 %174 to i64
  %176 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %173, i64 noundef %175) #6
  %177 = getelementptr inbounds %"struct.aabb::Node", ptr %176, i32 0, i32 0
  %178 = getelementptr inbounds %"class.aabb::AABB", ptr %177, i32 0, i32 3
  store double %172, ptr %178, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #6
  %179 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %180 = load i32, ptr %11, align 4, !tbaa !9
  %181 = zext i32 %180 to i64
  %182 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %179, i64 noundef %181) #6
  %183 = getelementptr inbounds %"struct.aabb::Node", ptr %182, i32 0, i32 0
  invoke void @_ZN4aabb4AABB13computeCentreEv(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %16, ptr noundef nonnull align 8 dereferenceable(80) %183)
          to label %184 unwind label %213

184:                                              ; preds = %166
  %185 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %186 = load i32, ptr %11, align 4, !tbaa !9
  %187 = zext i32 %186 to i64
  %188 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %185, i64 noundef %187) #6
  %189 = getelementptr inbounds %"struct.aabb::Node", ptr %188, i32 0, i32 0
  %190 = getelementptr inbounds %"class.aabb::AABB", ptr %189, i32 0, i32 2
  %191 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIdSaIdEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %190, ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  %192 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %193 = load i32, ptr %11, align 4, !tbaa !9
  %194 = zext i32 %193 to i64
  %195 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %192, i64 noundef %194) #6
  %196 = getelementptr inbounds %"struct.aabb::Node", ptr %195, i32 0, i32 5
  store i32 0, ptr %196, align 8, !tbaa !43
  %197 = load i32, ptr %11, align 4, !tbaa !9
  invoke void @_ZN4aabb4Tree10insertLeafEj(ptr noundef nonnull align 8 dereferenceable(233) %19, i32 noundef %197)
          to label %198 unwind label %217

198:                                              ; preds = %184
  %199 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 14
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  invoke void @_ZNSt4pairIKjjEC2IRjS3_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %200 unwind label %221

200:                                              ; preds = %198
  %201 = invoke { ptr, i8 } @_ZNSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE6insertEOS6_(ptr noundef nonnull align 8 dereferenceable(56) %199, ptr noundef nonnull align 4 dereferenceable(8) %17)
          to label %202 unwind label %221

202:                                              ; preds = %200
  %203 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %204 = extractvalue { ptr, i8 } %201, 0
  store ptr %204, ptr %203, align 8
  %205 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %206 = extractvalue { ptr, i8 } %201, 1
  store i8 %206, ptr %205, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %207 = load i32, ptr %6, align 4, !tbaa !9
  %208 = getelementptr inbounds %"class.aabb::Tree", ptr %19, i32 0, i32 2
  %209 = load i32, ptr %11, align 4, !tbaa !9
  %210 = zext i32 %209 to i64
  %211 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %208, i64 noundef %210) #6
  %212 = getelementptr inbounds %"struct.aabb::Node", ptr %211, i32 0, i32 6
  store i32 %207, ptr %212, align 4, !tbaa !44
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  ret void

213:                                              ; preds = %166
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %9, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  br label %225

217:                                              ; preds = %184
  %218 = landingpad { ptr, i32 }
          cleanup
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %9, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %10, align 4
  br label %225

221:                                              ; preds = %200, %198
  %222 = landingpad { ptr, i32 }
          cleanup
  %223 = extractvalue { ptr, i32 } %222, 0
  store ptr %223, ptr %9, align 8
  %224 = extractvalue { ptr, i32 } %222, 1
  store i32 %224, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %225

225:                                              ; preds = %221, %217, %213
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  br label %226

226:                                              ; preds = %225, %56
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %227

227:                                              ; preds = %226, %40, %26
  %228 = load ptr, ptr %9, align 8
  %229 = load i32, ptr %10, align 4
  %230 = insertvalue { ptr, i32 } poison, ptr %228, 0
  %231 = insertvalue { ptr, i32 } %230, i32 %229, 1
  resume { ptr, i32 } %231
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIKjjEC2IRjS3_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

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

attributes #0 = { 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 #1 = { "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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { noreturn }

!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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 44}
!14 = !{!"_ZTSN4aabb4TreeE", !10, i64 0, !15, i64 8, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !19, i64 48, !12, i64 56, !20, i64 64, !26, i64 104, !26, i64 128, !26, i64 152, !30, i64 176, !19, i64 232}
!15 = !{!"_ZTSSt6vectorIN4aabb4NodeESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIN4aabb4NodeESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN4aabb4NodeESaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN4aabb4NodeESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSSt6vectorIbSaIbEE", !21, i64 0}
!21 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !22, i64 0}
!22 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !24, i64 0, !24, i64 16, !6, i64 32}
!24 = !{!"_ZTSSt13_Bit_iterator", !25, i64 0}
!25 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !10, i64 8}
!26 = !{!"_ZTSSt6vectorIdSaIdEE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!"_ZTSSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE", !31, i64 0}
!31 = !{!"_ZTSSt10_HashtableIjSt4pairIKjjESaIS2_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !32, i64 8, !33, i64 16, !32, i64 24, !34, i64 32, !6, i64 48}
!32 = !{!"long", !7, i64 0}
!33 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!34 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !35, i64 0, !32, i64 8}
!35 = !{!"float", !7, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!14, !12, i64 56}
!39 = distinct !{!39, !37}
!40 = !{!41, !12, i64 72}
!41 = !{!"_ZTSN4aabb4NodeE", !42, i64 0, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100}
!42 = !{!"_ZTSN4aabb4AABBE", !26, i64 0, !26, i64 24, !26, i64 48, !12, i64 72}
!43 = !{!41, !10, i64 96}
!44 = !{!41, !10, i64 100}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"struct.std::pair.14" = type { i32, i32 }

@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@_ZTISt16invalid_argument = external constant ptr
@.str.11 = external hidden unnamed_addr constant [42 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt16invalid_argumentD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4aabb4AABB13computeCentreEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4aabb4Tree14insertParticleEjRSt6vectorIdSaIdEEd(ptr noundef nonnull align 8 dereferenceable(233) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, double noundef %3) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"struct.std::pair.14", align 4
  store i32 %1, ptr %5, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 176
  %12 = call noundef i64 @_ZNKSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE5countERS5_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %18, label %13

13:                                               ; preds = %4
  %14 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull @.str.11)
          to label %15 unwind label %16

15:                                               ; preds = %13
  call void @__cxa_throw(ptr nonnull %14, ptr nonnull @_ZTISt16invalid_argument, ptr nonnull @_ZNSt16invalid_argumentD1Ev) #7
  unreachable

16:                                               ; preds = %13
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %14) #6
  br label %114

18:                                               ; preds = %4
  %19 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %20 = getelementptr inbounds i8, ptr %0, i64 44
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %.not27 = icmp eq i64 %19, %22
  br i1 %.not27, label %28, label %23

23:                                               ; preds = %18
  %24 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt16invalid_argumentC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull @.str.2)
          to label %25 unwind label %26

25:                                               ; preds = %23
  call void @__cxa_throw(ptr nonnull %24, ptr nonnull @_ZTISt16invalid_argument, ptr nonnull @_ZNSt16invalid_argumentD1Ev) #7
  unreachable

26:                                               ; preds = %23
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %24) #6
  br label %114

28:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %29 = call noundef i32 @_ZN4aabb4Tree12allocateNodeEv(ptr noundef nonnull align 8 dereferenceable(233) %0)
  store i32 %29, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %30 = load i32, ptr %20, align 4, !tbaa !9
  %31 = zext i32 %30 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %31, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %32 unwind label %40

32:                                               ; preds = %28
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  %33 = load i32, ptr %20, align 4, !tbaa !9
  %.not35 = icmp eq i32 %33, 0
  br i1 %.not35, label %.preheader.._crit_edge_crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %32
  %34 = getelementptr inbounds i8, ptr %0, i64 8
  %35 = zext i32 %29 to i64
  br label %42

.preheader:                                       ; preds = %42
  %36 = icmp eq i32 %63, 0
  br i1 %36, label %.preheader.._crit_edge_crit_edge, label %.lr.ph34

.preheader.._crit_edge_crit_edge:                 ; preds = %32, %.preheader
  %.pre = zext i32 %29 to i64
  br label %._crit_edge

.lr.ph34:                                         ; preds = %.preheader
  %37 = getelementptr inbounds i8, ptr %0, i64 56
  %38 = getelementptr inbounds i8, ptr %0, i64 8
  %39 = zext i32 %29 to i64
  br label %72

40:                                               ; preds = %28
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  br label %113

42:                                               ; preds = %.lr.ph, %42
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %42 ]
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #6
  %44 = load double, ptr %43, align 8, !tbaa !34
  %45 = fsub double %44, %3
  %46 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35) #6
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %indvars.iv) #6
  store double %45, ptr %47, align 8, !tbaa !34
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #6
  %49 = load double, ptr %48, align 8, !tbaa !34
  %50 = fadd double %49, %3
  %51 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35) #6
  %52 = getelementptr inbounds i8, ptr %51, i64 24
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %indvars.iv) #6
  store double %50, ptr %53, align 8, !tbaa !34
  %54 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35) #6
  %55 = getelementptr inbounds i8, ptr %54, i64 24
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %indvars.iv) #6
  %57 = load double, ptr %56, align 8, !tbaa !34
  %58 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35) #6
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %indvars.iv) #6
  %60 = load double, ptr %59, align 8, !tbaa !34
  %61 = fsub double %57, %60
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #6
  store double %61, ptr %62, align 8, !tbaa !34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %63 = load i32, ptr %20, align 4, !tbaa !9
  %64 = zext i32 %63 to i64
  %65 = icmp ult i64 %indvars.iv.next, %64
  br i1 %65, label %42, label %.preheader, !llvm.loop !35

._crit_edge:                                      ; preds = %72, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %39, %72 ]
  %66 = getelementptr inbounds i8, ptr %0, i64 8
  %67 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.pre-phi) #6
  %68 = call noundef double @_ZNK4aabb4AABB18computeSurfaceAreaEv(ptr noundef nonnull align 8 dereferenceable(80) %67)
  %69 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.pre-phi) #6
  %70 = getelementptr inbounds i8, ptr %69, i64 72
  store double %68, ptr %70, align 8, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  %71 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.pre-phi) #6
  invoke void @_ZN4aabb4AABB13computeCentreEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %9, ptr noundef nonnull align 8 dereferenceable(80) %71)
          to label %92 unwind label %106

72:                                               ; preds = %.lr.ph34, %72
  %indvars.iv38 = phi i64 [ 0, %.lr.ph34 ], [ %indvars.iv.next39, %72 ]
  %73 = load double, ptr %37, align 8, !tbaa !40
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv38) #6
  %75 = load double, ptr %74, align 8, !tbaa !34
  %76 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #6
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %indvars.iv38) #6
  %78 = load double, ptr %77, align 8, !tbaa !34
  %79 = fneg double %73
  %80 = call double @llvm.fmuladd.f64(double %79, double %75, double %78)
  store double %80, ptr %77, align 8, !tbaa !34
  %81 = load double, ptr %37, align 8, !tbaa !40
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv38) #6
  %83 = load double, ptr %82, align 8, !tbaa !34
  %84 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %39) #6
  %85 = getelementptr inbounds i8, ptr %84, i64 24
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %indvars.iv38) #6
  %87 = load double, ptr %86, align 8, !tbaa !34
  %88 = call double @llvm.fmuladd.f64(double %81, double %83, double %87)
  store double %88, ptr %86, align 8, !tbaa !34
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %89 = load i32, ptr %20, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = icmp ult i64 %indvars.iv.next39, %90
  br i1 %91, label %72, label %._crit_edge, !llvm.loop !41

92:                                               ; preds = %._crit_edge
  %93 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.pre-phi) #6
  %94 = getelementptr inbounds i8, ptr %93, i64 48
  %95 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIdSaIdEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %94, ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  %96 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %.pre-phi) #6
  %97 = getelementptr inbounds i8, ptr %96, i64 96
  store i32 0, ptr %97, align 8, !tbaa !42
  invoke void @_ZN4aabb4Tree10insertLeafEj(ptr noundef nonnull align 8 dereferenceable(233) %0, i32 noundef %29)
          to label %98 unwind label %108

98:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @_ZNSt4pairIKjjEC2IRjS3_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %99 = invoke { ptr, i8 } @_ZNSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE6insertEOS6_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %100 unwind label %110

100:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = zext i32 %102 to i64
  %104 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZNSt6vectorIN4aabb4NodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %103) #6
  %105 = getelementptr inbounds i8, ptr %104, i64 100
  store i32 %101, ptr %105, align 4, !tbaa !43
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  ret void

106:                                              ; preds = %._crit_edge
  %107 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  br label %112

108:                                              ; preds = %92
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %112

110:                                              ; preds = %98
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %112

112:                                              ; preds = %110, %108, %106
  %.pn = phi { ptr, i32 } [ %111, %110 ], [ %109, %108 ], [ %107, %106 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %113

113:                                              ; preds = %112, %40
  %.pn.pn = phi { ptr, i32 } [ %.pn, %112 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %114

114:                                              ; preds = %113, %26, %16
  %.pn30 = phi { ptr, i32 } [ %17, %16 ], [ %27, %26 ], [ %.pn.pn, %113 ]
  resume { ptr, i32 } %.pn30
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIKjjEC2IRjS3_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

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

attributes #0 = { 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 #1 = { "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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { noreturn }

!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 44}
!10 = !{!"_ZTSN4aabb4TreeE", !6, i64 0, !11, i64 8, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !16, i64 48, !17, i64 56, !18, i64 64, !24, i64 104, !24, i64 128, !24, i64 152, !28, i64 176, !16, i64 232}
!11 = !{!"_ZTSSt6vectorIN4aabb4NodeESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIN4aabb4NodeESaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN4aabb4NodeESaIS1_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN4aabb4NodeESaIS1_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{!"_ZTSSt6vectorIbSaIbEE", !19, i64 0}
!19 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !20, i64 0}
!20 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !22, i64 0, !22, i64 16, !15, i64 32}
!22 = !{!"_ZTSSt13_Bit_iterator", !23, i64 0}
!23 = !{!"_ZTSSt18_Bit_iterator_base", !15, i64 0, !6, i64 8}
!24 = !{!"_ZTSSt6vectorIdSaIdEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!28 = !{!"_ZTSSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE", !29, i64 0}
!29 = !{!"_ZTSSt10_HashtableIjSt4pairIKjjESaIS2_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !15, i64 0, !30, i64 8, !31, i64 16, !30, i64 24, !32, i64 32, !15, i64 48}
!30 = !{!"long", !7, i64 0}
!31 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !15, i64 0}
!32 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !33, i64 0, !30, i64 8}
!33 = !{!"float", !7, i64 0}
!34 = !{!17, !17, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!38, !17, i64 72}
!38 = !{!"_ZTSN4aabb4NodeE", !39, i64 0, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100}
!39 = !{!"_ZTSN4aabb4AABBE", !24, i64 0, !24, i64 24, !24, i64 48, !17, i64 72}
!40 = !{!10, !17, i64 56}
!41 = distinct !{!41, !36}
!42 = !{!38, !6, i64 96}
!43 = !{!38, !6, i64 100}


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