; LLVM IR from atlantis13579/Riemann :: Src/Collision/DynamicAABBTree.ll (ZN7Riemann15DynamicAABBTree10InsertLeafEi)

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

%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }
%"class.Riemann::DynamicAABBTree" = type <{ i32, [4 x i8], %"class.std::vector", i32, i32, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::DynamicAABBTree::Node, std::allocator<Riemann::DynamicAABBTree::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Riemann::DynamicAABBTree::Node" = type <{ %union.anon, %"class.Maths::TAABB3", i32, i32, i32, ptr, i8, [7 x i8] }>
%union.anon = type { i32 }

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree10InsertLeafEi = external hidden unnamed_addr constant [47 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(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.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49)) #2 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann15DynamicAABBTree10InsertLeafEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.Maths::TAABB3", align 4
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca %"class.Maths::TAABB3", align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca [2 x i32], align 4
  %13 = alloca [2 x float], align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.Maths::TAABB3", align 4
  %18 = alloca %"class.Maths::TAABB3", align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"class.Maths::TAABB3", align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"class.Maths::TAABB3", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %28 = load ptr, ptr %3, align 8
  %29 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !11
  %31 = icmp eq i32 %30, -1
  br i1 %31, label %32, label %41

32:                                               ; preds = %2
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 0
  store i32 %33, ptr %34, align 8, !tbaa !11
  %35 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %36 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %38) #5
  %40 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %39, i32 0, i32 0
  store i32 -1, ptr %40, align 8, !tbaa !17
  br label %363

41:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  %42 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %43 = load i32, ptr %4, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %44) #5
  %46 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %45, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %46)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %47 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !11
  store i32 %48, ptr %6, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %165, %41
  %50 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %52) #5
  %54 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %53)
  %55 = zext i1 %54 to i32
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %166

57:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %58 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %60) #5
  %62 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %61, i32 0, i32 1
  %63 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %62)
  store float %63, ptr %7, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  %64 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %65 = load i32, ptr %6, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %66) #5
  %68 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %67, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(24) %68, ptr noundef nonnull align 4 dereferenceable(24) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %69 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %8)
  store float %69, ptr %9, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %70 = load float, ptr %9, align 4, !tbaa !18
  %71 = fmul float 2.000000e+00, %70
  store float %71, ptr %10, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %72 = load float, ptr %9, align 4, !tbaa !18
  %73 = load float, ptr %7, align 4, !tbaa !18
  %74 = fsub float %72, %73
  %75 = fmul float 2.000000e+00, %74
  store float %75, ptr %11, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %76 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %77 = load i32, ptr %6, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %78) #5
  %80 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %79, i32 0, i32 2
  %81 = load i32, ptr %80, align 4, !tbaa !20
  store i32 %81, ptr %12, align 4, !tbaa !9
  %82 = getelementptr inbounds i32, ptr %12, i64 1
  %83 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %85) #5
  %87 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %86, i32 0, i32 3
  %88 = load i32, ptr %87, align 8, !tbaa !25
  store i32 %88, ptr %82, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %135, %57
  %90 = load i32, ptr %14, align 4, !tbaa !9
  %91 = icmp slt i32 %90, 2
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %138

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [2 x i32], ptr %12, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !9
  store i32 %97, ptr %16, align 4, !tbaa !9
  %98 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %99 = load i32, ptr %16, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %100) #5
  %102 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %101)
  br i1 %102, label %103, label %112

103:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #5
  %104 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %105 = load i32, ptr %16, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106) #5
  %108 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %107, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %108)
  %109 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %17)
  %110 = load float, ptr %11, align 4, !tbaa !18
  %111 = fadd float %109, %110
  store float %111, ptr %15, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  br label %130

112:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #5
  %113 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %114 = load i32, ptr %16, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %113, i64 noundef %115) #5
  %117 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %116, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %117)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %118 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %119 = load i32, ptr %16, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %118, i64 noundef %120) #5
  %122 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %121, i32 0, i32 1
  %123 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %122)
  store float %123, ptr %19, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %124 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %18)
  store float %124, ptr %20, align 4, !tbaa !18
  %125 = load float, ptr %20, align 4, !tbaa !18
  %126 = load float, ptr %19, align 4, !tbaa !18
  %127 = fsub float %125, %126
  %128 = load float, ptr %11, align 4, !tbaa !18
  %129 = fadd float %127, %128
  store float %129, ptr %15, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #5
  br label %130

130:                                              ; preds = %112, %103
  %131 = load float, ptr %15, align 4, !tbaa !18
  %132 = load i32, ptr %14, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [2 x float], ptr %13, i64 0, i64 %133
  store float %131, ptr %134, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %135

135:                                              ; preds = %130
  %136 = load i32, ptr %14, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %14, align 4, !tbaa !9
  br label %89, !llvm.loop !26

138:                                              ; preds = %92
  %139 = load float, ptr %10, align 4, !tbaa !18
  %140 = getelementptr inbounds [2 x float], ptr %13, i64 0, i64 0
  %141 = load float, ptr %140, align 4, !tbaa !18
  %142 = fcmp olt float %139, %141
  br i1 %142, label %143, label %149

143:                                              ; preds = %138
  %144 = load float, ptr %10, align 4, !tbaa !18
  %145 = getelementptr inbounds [2 x float], ptr %13, i64 0, i64 1
  %146 = load float, ptr %145, align 4, !tbaa !18
  %147 = fcmp olt float %144, %146
  br i1 %147, label %148, label %149

148:                                              ; preds = %143
  store i32 3, ptr %21, align 4
  br label %163

149:                                              ; preds = %143, %138
  %150 = getelementptr inbounds [2 x float], ptr %13, i64 0, i64 0
  %151 = load float, ptr %150, align 4, !tbaa !18
  %152 = getelementptr inbounds [2 x float], ptr %13, i64 0, i64 1
  %153 = load float, ptr %152, align 4, !tbaa !18
  %154 = fcmp olt float %151, %153
  br i1 %154, label %155, label %158

155:                                              ; preds = %149
  %156 = getelementptr inbounds [2 x i32], ptr %12, i64 0, i64 0
  %157 = load i32, ptr %156, align 4, !tbaa !9
  br label %161

158:                                              ; preds = %149
  %159 = getelementptr inbounds [2 x i32], ptr %12, i64 0, i64 1
  %160 = load i32, ptr %159, align 4, !tbaa !9
  br label %161

161:                                              ; preds = %158, %155
  %162 = phi i32 [ %157, %155 ], [ %160, %158 ]
  store i32 %162, ptr %6, align 4, !tbaa !9
  store i32 0, ptr %21, align 4
  br label %163

163:                                              ; preds = %161, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %164 = load i32, ptr %21, align 4
  switch i32 %164, label %364 [
    i32 0, label %165
    i32 3, label %166
  ]

165:                                              ; preds = %163
  br label %49, !llvm.loop !28

166:                                              ; preds = %163, %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %167 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %168 = load i32, ptr %6, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %167, i64 noundef %169) #5
  %171 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %170, i32 0, i32 0
  %172 = load i32, ptr %171, align 8, !tbaa !17
  store i32 %172, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %173 = call noundef i32 @_ZN7Riemann15DynamicAABBTree9AllocNodeEv(ptr noundef nonnull align 8 dereferenceable(44) %28)
  store i32 %173, ptr %23, align 4, !tbaa !9
  %174 = load i32, ptr %22, align 4, !tbaa !9
  %175 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %176 = load i32, ptr %23, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %175, i64 noundef %177) #5
  %179 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %178, i32 0, i32 0
  store i32 %174, ptr %179, align 8, !tbaa !17
  %180 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %181 = load i32, ptr %23, align 4, !tbaa !9
  %182 = sext i32 %181 to i64
  %183 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %180, i64 noundef %182) #5
  %184 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %183, i32 0, i32 5
  store ptr null, ptr %184, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #5
  %185 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %186 = load i32, ptr %6, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %185, i64 noundef %187) #5
  %189 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %188, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %24, ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %189)
  %190 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %191 = load i32, ptr %23, align 4, !tbaa !9
  %192 = sext i32 %191 to i64
  %193 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %190, i64 noundef %192) #5
  %194 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %193, i32 0, i32 1
  %195 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %194, ptr noundef nonnull align 4 dereferenceable(24) %24)
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  %196 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %197 = load i32, ptr %6, align 4, !tbaa !9
  %198 = sext i32 %197 to i64
  %199 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %196, i64 noundef %198) #5
  %200 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %199, i32 0, i32 4
  %201 = load i32, ptr %200, align 4, !tbaa !30
  %202 = add nsw i32 %201, 1
  %203 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %204 = load i32, ptr %23, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %203, i64 noundef %205) #5
  %207 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %206, i32 0, i32 4
  store i32 %202, ptr %207, align 4, !tbaa !30
  %208 = load i32, ptr %22, align 4, !tbaa !9
  %209 = icmp ne i32 %208, -1
  br i1 %209, label %210, label %258

210:                                              ; preds = %166
  %211 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %212 = load i32, ptr %22, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %211, i64 noundef %213) #5
  %215 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %214, i32 0, i32 2
  %216 = load i32, ptr %215, align 4, !tbaa !20
  %217 = load i32, ptr %6, align 4, !tbaa !9
  %218 = icmp eq i32 %216, %217
  br i1 %218, label %219, label %226

219:                                              ; preds = %210
  %220 = load i32, ptr %23, align 4, !tbaa !9
  %221 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %222 = load i32, ptr %22, align 4, !tbaa !9
  %223 = sext i32 %222 to i64
  %224 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %221, i64 noundef %223) #5
  %225 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %224, i32 0, i32 2
  store i32 %220, ptr %225, align 4, !tbaa !20
  br label %233

226:                                              ; preds = %210
  %227 = load i32, ptr %23, align 4, !tbaa !9
  %228 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %229 = load i32, ptr %22, align 4, !tbaa !9
  %230 = sext i32 %229 to i64
  %231 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %228, i64 noundef %230) #5
  %232 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %231, i32 0, i32 3
  store i32 %227, ptr %232, align 8, !tbaa !25
  br label %233

233:                                              ; preds = %226, %219
  %234 = load i32, ptr %6, align 4, !tbaa !9
  %235 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %236 = load i32, ptr %23, align 4, !tbaa !9
  %237 = sext i32 %236 to i64
  %238 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %235, i64 noundef %237) #5
  %239 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %238, i32 0, i32 2
  store i32 %234, ptr %239, align 4, !tbaa !20
  %240 = load i32, ptr %4, align 4, !tbaa !9
  %241 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %242 = load i32, ptr %23, align 4, !tbaa !9
  %243 = sext i32 %242 to i64
  %244 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %241, i64 noundef %243) #5
  %245 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %244, i32 0, i32 3
  store i32 %240, ptr %245, align 8, !tbaa !25
  %246 = load i32, ptr %23, align 4, !tbaa !9
  %247 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %248 = load i32, ptr %6, align 4, !tbaa !9
  %249 = sext i32 %248 to i64
  %250 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %247, i64 noundef %249) #5
  %251 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %250, i32 0, i32 0
  store i32 %246, ptr %251, align 8, !tbaa !17
  %252 = load i32, ptr %23, align 4, !tbaa !9
  %253 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %254 = load i32, ptr %4, align 4, !tbaa !9
  %255 = sext i32 %254 to i64
  %256 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %253, i64 noundef %255) #5
  %257 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %256, i32 0, i32 0
  store i32 %252, ptr %257, align 8, !tbaa !17
  br label %285

258:                                              ; preds = %166
  %259 = load i32, ptr %6, align 4, !tbaa !9
  %260 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %261 = load i32, ptr %23, align 4, !tbaa !9
  %262 = sext i32 %261 to i64
  %263 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %260, i64 noundef %262) #5
  %264 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %263, i32 0, i32 2
  store i32 %259, ptr %264, align 4, !tbaa !20
  %265 = load i32, ptr %4, align 4, !tbaa !9
  %266 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %267 = load i32, ptr %23, align 4, !tbaa !9
  %268 = sext i32 %267 to i64
  %269 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %266, i64 noundef %268) #5
  %270 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %269, i32 0, i32 3
  store i32 %265, ptr %270, align 8, !tbaa !25
  %271 = load i32, ptr %23, align 4, !tbaa !9
  %272 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %273 = load i32, ptr %6, align 4, !tbaa !9
  %274 = sext i32 %273 to i64
  %275 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %272, i64 noundef %274) #5
  %276 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %275, i32 0, i32 0
  store i32 %271, ptr %276, align 8, !tbaa !17
  %277 = load i32, ptr %23, align 4, !tbaa !9
  %278 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %279 = load i32, ptr %4, align 4, !tbaa !9
  %280 = sext i32 %279 to i64
  %281 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %278, i64 noundef %280) #5
  %282 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %281, i32 0, i32 0
  store i32 %277, ptr %282, align 8, !tbaa !17
  %283 = load i32, ptr %23, align 4, !tbaa !9
  %284 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 0
  store i32 %283, ptr %284, align 8, !tbaa !11
  br label %285

285:                                              ; preds = %258, %233
  %286 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %287 = load i32, ptr %4, align 4, !tbaa !9
  %288 = sext i32 %287 to i64
  %289 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %286, i64 noundef %288) #5
  %290 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %289, i32 0, i32 0
  %291 = load i32, ptr %290, align 8, !tbaa !17
  store i32 %291, ptr %6, align 4, !tbaa !9
  br label %292

292:                                              ; preds = %321, %285
  %293 = load i32, ptr %6, align 4, !tbaa !9
  %294 = icmp ne i32 %293, -1
  br i1 %294, label %295, label %362

295:                                              ; preds = %292
  %296 = load i32, ptr %6, align 4, !tbaa !9
  %297 = call noundef i32 @_ZN7Riemann15DynamicAABBTree7BalanceEi(ptr noundef nonnull align 8 dereferenceable(44) %28, i32 noundef %296)
  store i32 %297, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %298 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %299 = load i32, ptr %6, align 4, !tbaa !9
  %300 = sext i32 %299 to i64
  %301 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %298, i64 noundef %300) #5
  %302 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %301, i32 0, i32 2
  %303 = load i32, ptr %302, align 4, !tbaa !20
  store i32 %303, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %304 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %305 = load i32, ptr %6, align 4, !tbaa !9
  %306 = sext i32 %305 to i64
  %307 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %304, i64 noundef %306) #5
  %308 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %307, i32 0, i32 3
  %309 = load i32, ptr %308, align 8, !tbaa !25
  store i32 %309, ptr %26, align 4, !tbaa !9
  %310 = load i32, ptr %25, align 4, !tbaa !9
  %311 = icmp ne i32 %310, -1
  br i1 %311, label %312, label %313

312:                                              ; preds = %295
  br label %315

313:                                              ; preds = %295
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 751, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree10InsertLeafEi) #6
  unreachable

314:                                              ; No predecessors!
  br label %315

315:                                              ; preds = %314, %312
  %316 = load i32, ptr %26, align 4, !tbaa !9
  %317 = icmp ne i32 %316, -1
  br i1 %317, label %318, label %319

318:                                              ; preds = %315
  br label %321

319:                                              ; preds = %315
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 752, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree10InsertLeafEi) #6
  unreachable

320:                                              ; No predecessors!
  br label %321

321:                                              ; preds = %320, %318
  %322 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %323 = load i32, ptr %25, align 4, !tbaa !9
  %324 = sext i32 %323 to i64
  %325 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %322, i64 noundef %324) #5
  %326 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %325, i32 0, i32 4
  %327 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %328 = load i32, ptr %26, align 4, !tbaa !9
  %329 = sext i32 %328 to i64
  %330 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %327, i64 noundef %329) #5
  %331 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %330, i32 0, i32 4
  %332 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %326, ptr noundef nonnull align 4 dereferenceable(4) %331)
  %333 = load i32, ptr %332, align 4, !tbaa !9
  %334 = add nsw i32 1, %333
  %335 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %336 = load i32, ptr %6, align 4, !tbaa !9
  %337 = sext i32 %336 to i64
  %338 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %335, i64 noundef %337) #5
  %339 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %338, i32 0, i32 4
  store i32 %334, ptr %339, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #5
  %340 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %341 = load i32, ptr %25, align 4, !tbaa !9
  %342 = sext i32 %341 to i64
  %343 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %340, i64 noundef %342) #5
  %344 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %343, i32 0, i32 1
  %345 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %346 = load i32, ptr %26, align 4, !tbaa !9
  %347 = sext i32 %346 to i64
  %348 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %345, i64 noundef %347) #5
  %349 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %348, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %27, ptr noundef nonnull align 4 dereferenceable(24) %344, ptr noundef nonnull align 4 dereferenceable(24) %349)
  %350 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %351 = load i32, ptr %6, align 4, !tbaa !9
  %352 = sext i32 %351 to i64
  %353 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %350, i64 noundef %352) #5
  %354 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %353, i32 0, i32 1
  %355 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %354, ptr noundef nonnull align 4 dereferenceable(24) %27)
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #5
  %356 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %28, i32 0, i32 2
  %357 = load i32, ptr %6, align 4, !tbaa !9
  %358 = sext i32 %357 to i64
  %359 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %356, i64 noundef %358) #5
  %360 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %359, i32 0, i32 0
  %361 = load i32, ptr %360, align 8, !tbaa !17
  store i32 %361, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %292, !llvm.loop !31

362:                                              ; preds = %292
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  br label %363

363:                                              ; preds = %362, %32
  ret void

364:                                              ; preds = %163
  unreachable
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7Riemann15DynamicAABBTree7BalanceEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) #4 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 }
attributes #6 = { noreturn 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 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !10, i64 0, !13, i64 8, !10, i64 32, !10, i64 36, !10, i64 40}
!13 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = !{!21, !10, i64 28}
!21 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !7, i64 0, !22, i64 4, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !24, i64 48}
!22 = !{!"_ZTSN5Maths6TAABB3IfEE", !23, i64 0, !23, i64 12}
!23 = !{!"_ZTSN5Maths8TVector3IfEE", !19, i64 0, !19, i64 4, !19, i64 8}
!24 = !{!"bool", !7, i64 0}
!25 = !{!21, !10, i64 32}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = !{!21, !6, i64 40}
!30 = !{!21, !10, i64 36}
!31 = distinct !{!31, !27}


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

%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree10InsertLeafEi = external hidden unnamed_addr constant [47 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(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.start.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann15DynamicAABBTree10InsertLeafEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1) local_unnamed_addr #4 align 2 {
  %3 = alloca %"class.Maths::TAABB3", align 4
  %4 = alloca %"class.Maths::TAABB3", align 4
  %5 = alloca %"class.Maths::TAABB3", align 4
  %6 = alloca %"class.Maths::TAABB3", align 4
  %7 = alloca %"class.Maths::TAABB3", align 4
  %8 = alloca %"class.Maths::TAABB3", align 4
  %9 = load i32, ptr %0, align 8, !tbaa !5
  %10 = icmp eq i32 %9, -1
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = sext i32 %1 to i64
  br i1 %10, label %13, label %15

13:                                               ; preds = %2
  store i32 %1, ptr %0, align 8, !tbaa !5
  %14 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %12) #5
  store i32 -1, ptr %14, align 8, !tbaa !15
  br label %154

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %16 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %12) #5
  %17 = getelementptr inbounds i8, ptr %16, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(24) %17)
  %18 = load i32, ptr %0, align 8, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %19) #5
  %21 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %20)
  br i1 %21, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %15, %72
  %22 = phi i64 [ %75, %72 ], [ %19, %15 ]
  %.090 = phi i32 [ %74, %72 ], [ %18, %15 ]
  %23 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %22) #5
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  %25 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %24)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %26 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %22) #5
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(24) %27, ptr noundef nonnull align 4 dereferenceable(24) %3)
  %28 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %4)
  %29 = fsub float %28, %25
  %30 = fmul float %29, 2.000000e+00
  %31 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %22) #5
  %32 = getelementptr inbounds i8, ptr %31, i64 28
  %33 = load i32, ptr %32, align 4, !tbaa !16
  %34 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %22) #5
  %35 = getelementptr inbounds i8, ptr %34, i64 32
  %36 = load i32, ptr %35, align 8, !tbaa !22
  %37 = sext i32 %33 to i64
  %38 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %37) #5
  %39 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %38)
  br i1 %39, label %40, label %44

.thread:                                          ; preds = %68
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  %.pre = sext i32 %.090 to i64
  br label %.loopexit

40:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %41 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %37) #5
  %42 = getelementptr inbounds i8, ptr %41, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(24) %42)
  %43 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %52

44:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %45 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %37) #5
  %46 = getelementptr inbounds i8, ptr %45, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(24) %46)
  %47 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %37) #5
  %48 = getelementptr inbounds i8, ptr %47, i64 4
  %49 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %48)
  %50 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %6)
  %51 = fsub float %50, %49
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %52

52:                                               ; preds = %44, %40
  %.pn = phi float [ %43, %40 ], [ %51, %44 ]
  %.073 = fadd float %30, %.pn
  %53 = sext i32 %36 to i64
  %54 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %53) #5
  %55 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %54)
  br i1 %55, label %64, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %57 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %53) #5
  %58 = getelementptr inbounds i8, ptr %57, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(24) %58)
  %59 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %53) #5
  %60 = getelementptr inbounds i8, ptr %59, i64 4
  %61 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %60)
  %62 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %6)
  %63 = fsub float %62, %61
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %68

64:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %65 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %53) #5
  %66 = getelementptr inbounds i8, ptr %65, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(24) %66)
  %67 = call noundef float @_ZNK5Maths6TAABB3IfE9GetVolumeEv(ptr noundef nonnull align 4 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %68

68:                                               ; preds = %64, %56
  %.pn.1 = phi float [ %67, %64 ], [ %63, %56 ]
  %.073.1 = fadd float %30, %.pn.1
  %69 = fmul float %28, 2.000000e+00
  %70 = fcmp olt float %69, %.073
  %71 = fcmp olt float %69, %.073.1
  %or.cond = and i1 %70, %71
  br i1 %or.cond, label %.thread, label %72

72:                                               ; preds = %68
  %73 = fcmp olt float %.073, %.073.1
  %74 = select i1 %73, i32 %33, i32 %36
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %75) #5
  %77 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %76)
  br i1 %77, label %.loopexit, label %.lr.ph

.loopexit:                                        ; preds = %72, %15, %.thread
  %.pre-phi = phi i64 [ %19, %15 ], [ %.pre, %.thread ], [ %75, %72 ]
  %.088 = phi i32 [ %18, %15 ], [ %.090, %.thread ], [ %74, %72 ]
  %78 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.pre-phi) #5
  %79 = load i32, ptr %78, align 8, !tbaa !15
  %80 = call noundef i32 @_ZN7Riemann15DynamicAABBTree9AllocNodeEv(ptr noundef nonnull align 8 dereferenceable(44) %0)
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %81) #5
  store i32 %79, ptr %82, align 8, !tbaa !15
  %83 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %81) #5
  %84 = getelementptr inbounds i8, ptr %83, i64 40
  store ptr null, ptr %84, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %85 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.pre-phi) #5
  %86 = getelementptr inbounds i8, ptr %85, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(24) %86)
  %87 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %81) #5
  %88 = getelementptr inbounds i8, ptr %87, i64 4
  %89 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %88, ptr noundef nonnull align 4 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  %90 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.pre-phi) #5
  %91 = getelementptr inbounds i8, ptr %90, i64 36
  %92 = load i32, ptr %91, align 4, !tbaa !24
  %93 = add nsw i32 %92, 1
  %94 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %81) #5
  %95 = getelementptr inbounds i8, ptr %94, i64 36
  store i32 %93, ptr %95, align 4, !tbaa !24
  %.not = icmp eq i32 %79, -1
  br i1 %.not, label %114, label %96

96:                                               ; preds = %.loopexit
  %97 = sext i32 %79 to i64
  %98 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %97) #5
  %99 = getelementptr inbounds i8, ptr %98, i64 28
  %100 = load i32, ptr %99, align 4, !tbaa !16
  %101 = icmp eq i32 %100, %.088
  %102 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %97) #5
  br i1 %101, label %103, label %105

103:                                              ; preds = %96
  %104 = getelementptr inbounds i8, ptr %102, i64 28
  store i32 %80, ptr %104, align 4, !tbaa !16
  br label %107

105:                                              ; preds = %96
  %106 = getelementptr inbounds i8, ptr %102, i64 32
  store i32 %80, ptr %106, align 8, !tbaa !22
  br label %107

107:                                              ; preds = %105, %103
  %108 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %81) #5
  %109 = getelementptr inbounds i8, ptr %108, i64 28
  store i32 %.088, ptr %109, align 4, !tbaa !16
  %110 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %81) #5
  %111 = getelementptr inbounds i8, ptr %110, i64 32
  store i32 %1, ptr %111, align 8, !tbaa !22
  %112 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.pre-phi) #5
  store i32 %80, ptr %112, align 8, !tbaa !15
  %113 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %12) #5
  br label %121

114:                                              ; preds = %.loopexit
  %115 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %81) #5
  %116 = getelementptr inbounds i8, ptr %115, i64 28
  store i32 %.088, ptr %116, align 4, !tbaa !16
  %117 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %81) #5
  %118 = getelementptr inbounds i8, ptr %117, i64 32
  store i32 %1, ptr %118, align 8, !tbaa !22
  %119 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.pre-phi) #5
  store i32 %80, ptr %119, align 8, !tbaa !15
  %120 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %12) #5
  store i32 %80, ptr %120, align 8, !tbaa !15
  br label %121

121:                                              ; preds = %114, %107
  %.sink = phi ptr [ %0, %114 ], [ %113, %107 ]
  store i32 %80, ptr %.sink, align 8, !tbaa !15
  %122 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %12) #5
  %.391 = load i32, ptr %122, align 8, !tbaa !15
  %.not7992 = icmp eq i32 %.391, -1
  br i1 %.not7992, label %._crit_edge, label %.lr.ph94

.lr.ph94:                                         ; preds = %121, %134
  %.393 = phi i32 [ %.3, %134 ], [ %.391, %121 ]
  %123 = call noundef i32 @_ZN7Riemann15DynamicAABBTree7BalanceEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %.393)
  %124 = sext i32 %123 to i64
  %125 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %124) #5
  %126 = getelementptr inbounds i8, ptr %125, i64 28
  %127 = load i32, ptr %126, align 4, !tbaa !16
  %128 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %124) #5
  %129 = getelementptr inbounds i8, ptr %128, i64 32
  %130 = load i32, ptr %129, align 8, !tbaa !22
  %.not80 = icmp eq i32 %127, -1
  br i1 %.not80, label %131, label %132

131:                                              ; preds = %.lr.ph94
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 751, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree10InsertLeafEi) #6
  unreachable

132:                                              ; preds = %.lr.ph94
  %.not81 = icmp eq i32 %130, -1
  br i1 %.not81, label %133, label %134

133:                                              ; preds = %132
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 752, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree10InsertLeafEi) #6
  unreachable

134:                                              ; preds = %132
  %135 = sext i32 %127 to i64
  %136 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %135) #5
  %137 = getelementptr inbounds i8, ptr %136, i64 36
  %138 = sext i32 %130 to i64
  %139 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %138) #5
  %140 = getelementptr inbounds i8, ptr %139, i64 36
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %137, ptr noundef nonnull align 4 dereferenceable(4) %140)
  %142 = load i32, ptr %141, align 4, !tbaa !25
  %143 = add nsw i32 %142, 1
  %144 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %124) #5
  %145 = getelementptr inbounds i8, ptr %144, i64 36
  store i32 %143, ptr %145, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %146 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %135) #5
  %147 = getelementptr inbounds i8, ptr %146, i64 4
  %148 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %138) #5
  %149 = getelementptr inbounds i8, ptr %148, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(24) %147, ptr noundef nonnull align 4 dereferenceable(24) %149)
  %150 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %124) #5
  %151 = getelementptr inbounds i8, ptr %150, i64 4
  %152 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %151, ptr noundef nonnull align 4 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  %153 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %124) #5
  %.3 = load i32, ptr %153, align 8, !tbaa !15
  %.not79 = icmp eq i32 %.3, -1
  br i1 %.not79, label %._crit_edge, label %.lr.ph94, !llvm.loop !26

._crit_edge:                                      ; preds = %134, %121
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  br label %154

154:                                              ; preds = %._crit_edge, %13
  ret void
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7Riemann15DynamicAABBTree7BalanceEi(ptr noundef nonnull align 8 dereferenceable(44), i32 noundef) local_unnamed_addr #4 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 }
attributes #6 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN7Riemann15DynamicAABBTreeE", !7, i64 0, !10, i64 8, !7, i64 32, !7, i64 36, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN7Riemann15DynamicAABBTree4NodeESaIS2_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!8, !8, i64 0}
!16 = !{!17, !7, i64 28}
!17 = !{!"_ZTSN7Riemann15DynamicAABBTree4NodeE", !8, i64 0, !18, i64 4, !7, i64 28, !7, i64 32, !7, i64 36, !14, i64 40, !21, i64 48}
!18 = !{!"_ZTSN5Maths6TAABB3IfEE", !19, i64 0, !19, i64 12}
!19 = !{!"_ZTSN5Maths8TVector3IfEE", !20, i64 0, !20, i64 4, !20, i64 8}
!20 = !{!"float", !8, i64 0}
!21 = !{!"bool", !8, i64 0}
!22 = !{!17, !7, i64 32}
!23 = !{!17, !14, i64 40}
!24 = !{!17, !7, i64 36}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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