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

; 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.9 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi = external hidden unnamed_addr constant [43 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [35 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 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_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 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
define dso_local noundef i32 @_ZN7Riemann15DynamicAABBTree7BalanceEi(ptr noundef nonnull align 8 dereferenceable(44) %0, i32 noundef %1) #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %"class.Maths::TAABB3", align 4
  %18 = alloca %"class.Maths::TAABB3", align 4
  %19 = alloca %"class.Maths::TAABB3", align 4
  %20 = alloca %"class.Maths::TAABB3", align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca %"class.Maths::TAABB3", align 4
  %26 = alloca %"class.Maths::TAABB3", align 4
  %27 = alloca %"class.Maths::TAABB3", align 4
  %28 = alloca %"class.Maths::TAABB3", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %29 = load ptr, ptr %4, align 8
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = icmp ne i32 %30, -1
  br i1 %31, label %32, label %33

32:                                               ; preds = %2
  br label %35

33:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 810, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %36 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %37 = load i32, ptr %5, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %38) #6
  store ptr %39, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %40)
  br i1 %41, label %47, label %42

42:                                               ; preds = %35
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %43, i32 0, i32 4
  %45 = load i32, ptr %44, align 4, !tbaa !11
  %46 = icmp slt i32 %45, 2
  br i1 %46, label %47, label %49

47:                                               ; preds = %42, %35
  %48 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %48, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %499

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %50, i32 0, i32 2
  %52 = load i32, ptr %51, align 4, !tbaa !17
  store i32 %52, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %53, i32 0, i32 3
  %55 = load i32, ptr %54, align 8, !tbaa !18
  store i32 %55, ptr %9, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = icmp sle i32 0, %56
  br i1 %57, label %58, label %63

58:                                               ; preds = %49
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 4
  %61 = load i32, ptr %60, align 4, !tbaa !19
  %62 = icmp slt i32 %59, %61
  br label %63

63:                                               ; preds = %58, %49
  %64 = phi i1 [ false, %49 ], [ %62, %58 ]
  br i1 %64, label %65, label %66

65:                                               ; preds = %63
  br label %68

66:                                               ; preds = %63
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 820, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

67:                                               ; No predecessors!
  br label %68

68:                                               ; preds = %67, %65
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = icmp sle i32 0, %69
  br i1 %70, label %71, label %76

71:                                               ; preds = %68
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 4
  %74 = load i32, ptr %73, align 4, !tbaa !19
  %75 = icmp slt i32 %72, %74
  br label %76

76:                                               ; preds = %71, %68
  %77 = phi i1 [ false, %68 ], [ %75, %71 ]
  br i1 %77, label %78, label %79

78:                                               ; preds = %76
  br label %81

79:                                               ; preds = %76
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 821, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

80:                                               ; No predecessors!
  br label %81

81:                                               ; preds = %80, %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %82 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %83 = load i32, ptr %8, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %84) #6
  store ptr %85, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %86 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %86, i64 noundef %88) #6
  store ptr %89, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %90, i32 0, i32 4
  %92 = load i32, ptr %91, align 4, !tbaa !11
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %93, i32 0, i32 4
  %95 = load i32, ptr %94, align 4, !tbaa !11
  %96 = sub nsw i32 %92, %95
  store i32 %96, ptr %12, align 4, !tbaa !9
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = icmp sgt i32 %97, 1
  br i1 %98, label %99, label %296

99:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %100, i32 0, i32 2
  %102 = load i32, ptr %101, align 4, !tbaa !17
  store i32 %102, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %103, i32 0, i32 3
  %105 = load i32, ptr %104, align 8, !tbaa !18
  store i32 %105, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %106 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %106, i64 noundef %108) #6
  store ptr %109, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %110 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %111 = load i32, ptr %14, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %110, i64 noundef %112) #6
  store ptr %113, ptr %16, align 8, !tbaa !5
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = icmp sle i32 0, %114
  br i1 %115, label %116, label %121

116:                                              ; preds = %99
  %117 = load i32, ptr %13, align 4, !tbaa !9
  %118 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 4
  %119 = load i32, ptr %118, align 4, !tbaa !19
  %120 = icmp slt i32 %117, %119
  br label %121

121:                                              ; preds = %116, %99
  %122 = phi i1 [ false, %99 ], [ %120, %116 ]
  br i1 %122, label %123, label %124

123:                                              ; preds = %121
  br label %126

124:                                              ; preds = %121
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 835, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

125:                                              ; No predecessors!
  br label %126

126:                                              ; preds = %125, %123
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = icmp sle i32 0, %127
  br i1 %128, label %129, label %134

129:                                              ; preds = %126
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 4
  %132 = load i32, ptr %131, align 4, !tbaa !19
  %133 = icmp slt i32 %130, %132
  br label %134

134:                                              ; preds = %129, %126
  %135 = phi i1 [ false, %126 ], [ %133, %129 ]
  br i1 %135, label %136, label %137

136:                                              ; preds = %134
  br label %139

137:                                              ; preds = %134
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 836, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

138:                                              ; No predecessors!
  br label %139

139:                                              ; preds = %138, %136
  %140 = load i32, ptr %5, align 4, !tbaa !9
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %141, i32 0, i32 2
  store i32 %140, ptr %142, align 4, !tbaa !17
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %143, i32 0, i32 0
  %145 = load i32, ptr %144, align 8, !tbaa !25
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %146, i32 0, i32 0
  store i32 %145, ptr %147, align 8, !tbaa !25
  %148 = load i32, ptr %9, align 4, !tbaa !9
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %149, i32 0, i32 0
  store i32 %148, ptr %150, align 8, !tbaa !25
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 8, !tbaa !25
  %154 = icmp ne i32 %153, -1
  br i1 %154, label %155, label %199

155:                                              ; preds = %139
  %156 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %157, i32 0, i32 0
  %159 = load i32, ptr %158, align 8, !tbaa !25
  %160 = sext i32 %159 to i64
  %161 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %156, i64 noundef %160) #6
  %162 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %161, i32 0, i32 2
  %163 = load i32, ptr %162, align 4, !tbaa !17
  %164 = load i32, ptr %5, align 4, !tbaa !9
  %165 = icmp eq i32 %163, %164
  br i1 %165, label %166, label %175

166:                                              ; preds = %155
  %167 = load i32, ptr %9, align 4, !tbaa !9
  %168 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %169 = load ptr, ptr %11, align 8, !tbaa !5
  %170 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %169, i32 0, i32 0
  %171 = load i32, ptr %170, align 8, !tbaa !25
  %172 = sext i32 %171 to i64
  %173 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %168, i64 noundef %172) #6
  %174 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %173, i32 0, i32 2
  store i32 %167, ptr %174, align 4, !tbaa !17
  br label %198

175:                                              ; preds = %155
  %176 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %177 = load ptr, ptr %11, align 8, !tbaa !5
  %178 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %177, i32 0, i32 0
  %179 = load i32, ptr %178, align 8, !tbaa !25
  %180 = sext i32 %179 to i64
  %181 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %176, i64 noundef %180) #6
  %182 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %181, i32 0, i32 3
  %183 = load i32, ptr %182, align 8, !tbaa !18
  %184 = load i32, ptr %5, align 4, !tbaa !9
  %185 = icmp eq i32 %183, %184
  br i1 %185, label %186, label %187

186:                                              ; preds = %175
  br label %189

187:                                              ; preds = %175
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 852, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

188:                                              ; No predecessors!
  br label %189

189:                                              ; preds = %188, %186
  %190 = load i32, ptr %9, align 4, !tbaa !9
  %191 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %192 = load ptr, ptr %11, align 8, !tbaa !5
  %193 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %192, i32 0, i32 0
  %194 = load i32, ptr %193, align 8, !tbaa !25
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %191, i64 noundef %195) #6
  %197 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %196, i32 0, i32 3
  store i32 %190, ptr %197, align 8, !tbaa !18
  br label %198

198:                                              ; preds = %189, %166
  br label %202

199:                                              ; preds = %139
  %200 = load i32, ptr %9, align 4, !tbaa !9
  %201 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 0
  store i32 %200, ptr %201, align 8, !tbaa !26
  br label %202

202:                                              ; preds = %199, %198
  %203 = load ptr, ptr %15, align 8, !tbaa !5
  %204 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %203, i32 0, i32 4
  %205 = load i32, ptr %204, align 4, !tbaa !11
  %206 = load ptr, ptr %16, align 8, !tbaa !5
  %207 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %206, i32 0, i32 4
  %208 = load i32, ptr %207, align 4, !tbaa !11
  %209 = icmp sgt i32 %205, %208
  br i1 %209, label %210, label %252

210:                                              ; preds = %202
  %211 = load i32, ptr %13, align 4, !tbaa !9
  %212 = load ptr, ptr %11, align 8, !tbaa !5
  %213 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %212, i32 0, i32 3
  store i32 %211, ptr %213, align 8, !tbaa !18
  %214 = load i32, ptr %14, align 4, !tbaa !9
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %215, i32 0, i32 3
  store i32 %214, ptr %216, align 8, !tbaa !18
  %217 = load i32, ptr %5, align 4, !tbaa !9
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %218, i32 0, i32 0
  store i32 %217, ptr %219, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  %220 = load ptr, ptr %10, align 8, !tbaa !5
  %221 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %220, i32 0, i32 1
  %222 = load ptr, ptr %16, align 8, !tbaa !5
  %223 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %222, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(24) %221, ptr noundef nonnull align 4 dereferenceable(24) %223)
  %224 = load ptr, ptr %6, align 8, !tbaa !5
  %225 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %224, i32 0, i32 1
  %226 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %225, ptr noundef nonnull align 4 dereferenceable(24) %17)
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %227, i32 0, i32 1
  %229 = load ptr, ptr %15, align 8, !tbaa !5
  %230 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %229, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(24) %228, ptr noundef nonnull align 4 dereferenceable(24) %230)
  %231 = load ptr, ptr %11, align 8, !tbaa !5
  %232 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %231, i32 0, i32 1
  %233 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %232, ptr noundef nonnull align 4 dereferenceable(24) %18)
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  %234 = load ptr, ptr %10, align 8, !tbaa !5
  %235 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %234, i32 0, i32 4
  %236 = load ptr, ptr %16, align 8, !tbaa !5
  %237 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %236, i32 0, i32 4
  %238 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %235, ptr noundef nonnull align 4 dereferenceable(4) %237)
  %239 = load i32, ptr %238, align 4, !tbaa !9
  %240 = add nsw i32 1, %239
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  %242 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %241, i32 0, i32 4
  store i32 %240, ptr %242, align 4, !tbaa !11
  %243 = load ptr, ptr %6, align 8, !tbaa !5
  %244 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %243, i32 0, i32 4
  %245 = load ptr, ptr %15, align 8, !tbaa !5
  %246 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %245, i32 0, i32 4
  %247 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %244, ptr noundef nonnull align 4 dereferenceable(4) %246)
  %248 = load i32, ptr %247, align 4, !tbaa !9
  %249 = add nsw i32 1, %248
  %250 = load ptr, ptr %11, align 8, !tbaa !5
  %251 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %250, i32 0, i32 4
  store i32 %249, ptr %251, align 4, !tbaa !11
  br label %294

252:                                              ; preds = %202
  %253 = load i32, ptr %14, align 4, !tbaa !9
  %254 = load ptr, ptr %11, align 8, !tbaa !5
  %255 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %254, i32 0, i32 3
  store i32 %253, ptr %255, align 8, !tbaa !18
  %256 = load i32, ptr %13, align 4, !tbaa !9
  %257 = load ptr, ptr %6, align 8, !tbaa !5
  %258 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %257, i32 0, i32 3
  store i32 %256, ptr %258, align 8, !tbaa !18
  %259 = load i32, ptr %5, align 4, !tbaa !9
  %260 = load ptr, ptr %15, align 8, !tbaa !5
  %261 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %260, i32 0, i32 0
  store i32 %259, ptr %261, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  %262 = load ptr, ptr %10, align 8, !tbaa !5
  %263 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %262, i32 0, i32 1
  %264 = load ptr, ptr %15, align 8, !tbaa !5
  %265 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %264, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(24) %263, ptr noundef nonnull align 4 dereferenceable(24) %265)
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %266, i32 0, i32 1
  %268 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %267, ptr noundef nonnull align 4 dereferenceable(24) %19)
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  %269 = load ptr, ptr %6, align 8, !tbaa !5
  %270 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %269, i32 0, i32 1
  %271 = load ptr, ptr %16, align 8, !tbaa !5
  %272 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %271, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %20, ptr noundef nonnull align 4 dereferenceable(24) %270, ptr noundef nonnull align 4 dereferenceable(24) %272)
  %273 = load ptr, ptr %11, align 8, !tbaa !5
  %274 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %273, i32 0, i32 1
  %275 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %274, ptr noundef nonnull align 4 dereferenceable(24) %20)
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  %276 = load ptr, ptr %10, align 8, !tbaa !5
  %277 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %276, i32 0, i32 4
  %278 = load ptr, ptr %15, align 8, !tbaa !5
  %279 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %278, i32 0, i32 4
  %280 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %277, ptr noundef nonnull align 4 dereferenceable(4) %279)
  %281 = load i32, ptr %280, align 4, !tbaa !9
  %282 = add nsw i32 1, %281
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  %284 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %283, i32 0, i32 4
  store i32 %282, ptr %284, align 4, !tbaa !11
  %285 = load ptr, ptr %6, align 8, !tbaa !5
  %286 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %285, i32 0, i32 4
  %287 = load ptr, ptr %16, align 8, !tbaa !5
  %288 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %287, i32 0, i32 4
  %289 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %286, ptr noundef nonnull align 4 dereferenceable(4) %288)
  %290 = load i32, ptr %289, align 4, !tbaa !9
  %291 = add nsw i32 1, %290
  %292 = load ptr, ptr %11, align 8, !tbaa !5
  %293 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %292, i32 0, i32 4
  store i32 %291, ptr %293, align 4, !tbaa !11
  br label %294

294:                                              ; preds = %252, %210
  %295 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %295, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %498

296:                                              ; preds = %81
  %297 = load i32, ptr %12, align 4, !tbaa !9
  %298 = icmp slt i32 %297, -1
  br i1 %298, label %299, label %496

299:                                              ; preds = %296
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %300 = load ptr, ptr %10, align 8, !tbaa !5
  %301 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %300, i32 0, i32 2
  %302 = load i32, ptr %301, align 4, !tbaa !17
  store i32 %302, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %303 = load ptr, ptr %10, align 8, !tbaa !5
  %304 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %303, i32 0, i32 3
  %305 = load i32, ptr %304, align 8, !tbaa !18
  store i32 %305, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %306 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %307 = load i32, ptr %21, align 4, !tbaa !9
  %308 = sext i32 %307 to i64
  %309 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %306, i64 noundef %308) #6
  store ptr %309, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %310 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %311 = load i32, ptr %22, align 4, !tbaa !9
  %312 = sext i32 %311 to i64
  %313 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %310, i64 noundef %312) #6
  store ptr %313, ptr %24, align 8, !tbaa !5
  %314 = load i32, ptr %21, align 4, !tbaa !9
  %315 = icmp sle i32 0, %314
  br i1 %315, label %316, label %321

316:                                              ; preds = %299
  %317 = load i32, ptr %21, align 4, !tbaa !9
  %318 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 4
  %319 = load i32, ptr %318, align 4, !tbaa !19
  %320 = icmp slt i32 %317, %319
  br label %321

321:                                              ; preds = %316, %299
  %322 = phi i1 [ false, %299 ], [ %320, %316 ]
  br i1 %322, label %323, label %324

323:                                              ; preds = %321
  br label %326

324:                                              ; preds = %321
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 895, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

325:                                              ; No predecessors!
  br label %326

326:                                              ; preds = %325, %323
  %327 = load i32, ptr %22, align 4, !tbaa !9
  %328 = icmp sle i32 0, %327
  br i1 %328, label %329, label %334

329:                                              ; preds = %326
  %330 = load i32, ptr %22, align 4, !tbaa !9
  %331 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 4
  %332 = load i32, ptr %331, align 4, !tbaa !19
  %333 = icmp slt i32 %330, %332
  br label %334

334:                                              ; preds = %329, %326
  %335 = phi i1 [ false, %326 ], [ %333, %329 ]
  br i1 %335, label %336, label %337

336:                                              ; preds = %334
  br label %339

337:                                              ; preds = %334
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 896, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

338:                                              ; No predecessors!
  br label %339

339:                                              ; preds = %338, %336
  %340 = load i32, ptr %5, align 4, !tbaa !9
  %341 = load ptr, ptr %10, align 8, !tbaa !5
  %342 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %341, i32 0, i32 2
  store i32 %340, ptr %342, align 4, !tbaa !17
  %343 = load ptr, ptr %6, align 8, !tbaa !5
  %344 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %343, i32 0, i32 0
  %345 = load i32, ptr %344, align 8, !tbaa !25
  %346 = load ptr, ptr %10, align 8, !tbaa !5
  %347 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %346, i32 0, i32 0
  store i32 %345, ptr %347, align 8, !tbaa !25
  %348 = load i32, ptr %8, align 4, !tbaa !9
  %349 = load ptr, ptr %6, align 8, !tbaa !5
  %350 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %349, i32 0, i32 0
  store i32 %348, ptr %350, align 8, !tbaa !25
  %351 = load ptr, ptr %10, align 8, !tbaa !5
  %352 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %351, i32 0, i32 0
  %353 = load i32, ptr %352, align 8, !tbaa !25
  %354 = icmp ne i32 %353, -1
  br i1 %354, label %355, label %399

355:                                              ; preds = %339
  %356 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %357 = load ptr, ptr %10, align 8, !tbaa !5
  %358 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %357, i32 0, i32 0
  %359 = load i32, ptr %358, align 8, !tbaa !25
  %360 = sext i32 %359 to i64
  %361 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %356, i64 noundef %360) #6
  %362 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %361, i32 0, i32 2
  %363 = load i32, ptr %362, align 4, !tbaa !17
  %364 = load i32, ptr %5, align 4, !tbaa !9
  %365 = icmp eq i32 %363, %364
  br i1 %365, label %366, label %375

366:                                              ; preds = %355
  %367 = load i32, ptr %8, align 4, !tbaa !9
  %368 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %369 = load ptr, ptr %10, align 8, !tbaa !5
  %370 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %369, i32 0, i32 0
  %371 = load i32, ptr %370, align 8, !tbaa !25
  %372 = sext i32 %371 to i64
  %373 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %368, i64 noundef %372) #6
  %374 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %373, i32 0, i32 2
  store i32 %367, ptr %374, align 4, !tbaa !17
  br label %398

375:                                              ; preds = %355
  %376 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %377 = load ptr, ptr %10, align 8, !tbaa !5
  %378 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %377, i32 0, i32 0
  %379 = load i32, ptr %378, align 8, !tbaa !25
  %380 = sext i32 %379 to i64
  %381 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %376, i64 noundef %380) #6
  %382 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %381, i32 0, i32 3
  %383 = load i32, ptr %382, align 8, !tbaa !18
  %384 = load i32, ptr %5, align 4, !tbaa !9
  %385 = icmp eq i32 %383, %384
  br i1 %385, label %386, label %387

386:                                              ; preds = %375
  br label %389

387:                                              ; preds = %375
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 912, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

388:                                              ; No predecessors!
  br label %389

389:                                              ; preds = %388, %386
  %390 = load i32, ptr %8, align 4, !tbaa !9
  %391 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 2
  %392 = load ptr, ptr %10, align 8, !tbaa !5
  %393 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %392, i32 0, i32 0
  %394 = load i32, ptr %393, align 8, !tbaa !25
  %395 = sext i32 %394 to i64
  %396 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %391, i64 noundef %395) #6
  %397 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %396, i32 0, i32 3
  store i32 %390, ptr %397, align 8, !tbaa !18
  br label %398

398:                                              ; preds = %389, %366
  br label %402

399:                                              ; preds = %339
  %400 = load i32, ptr %8, align 4, !tbaa !9
  %401 = getelementptr inbounds %"class.Riemann::DynamicAABBTree", ptr %29, i32 0, i32 0
  store i32 %400, ptr %401, align 8, !tbaa !26
  br label %402

402:                                              ; preds = %399, %398
  %403 = load ptr, ptr %23, align 8, !tbaa !5
  %404 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %403, i32 0, i32 4
  %405 = load i32, ptr %404, align 4, !tbaa !11
  %406 = load ptr, ptr %24, align 8, !tbaa !5
  %407 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %406, i32 0, i32 4
  %408 = load i32, ptr %407, align 4, !tbaa !11
  %409 = icmp sgt i32 %405, %408
  br i1 %409, label %410, label %452

410:                                              ; preds = %402
  %411 = load i32, ptr %21, align 4, !tbaa !9
  %412 = load ptr, ptr %10, align 8, !tbaa !5
  %413 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %412, i32 0, i32 3
  store i32 %411, ptr %413, align 8, !tbaa !18
  %414 = load i32, ptr %22, align 4, !tbaa !9
  %415 = load ptr, ptr %6, align 8, !tbaa !5
  %416 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %415, i32 0, i32 2
  store i32 %414, ptr %416, align 4, !tbaa !17
  %417 = load i32, ptr %5, align 4, !tbaa !9
  %418 = load ptr, ptr %24, align 8, !tbaa !5
  %419 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %418, i32 0, i32 0
  store i32 %417, ptr %419, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #6
  %420 = load ptr, ptr %11, align 8, !tbaa !5
  %421 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %420, i32 0, i32 1
  %422 = load ptr, ptr %24, align 8, !tbaa !5
  %423 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %422, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(24) %421, ptr noundef nonnull align 4 dereferenceable(24) %423)
  %424 = load ptr, ptr %6, align 8, !tbaa !5
  %425 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %424, i32 0, i32 1
  %426 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %425, ptr noundef nonnull align 4 dereferenceable(24) %25)
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #6
  %427 = load ptr, ptr %6, align 8, !tbaa !5
  %428 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %427, i32 0, i32 1
  %429 = load ptr, ptr %23, align 8, !tbaa !5
  %430 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %429, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(24) %428, ptr noundef nonnull align 4 dereferenceable(24) %430)
  %431 = load ptr, ptr %10, align 8, !tbaa !5
  %432 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %431, i32 0, i32 1
  %433 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %432, ptr noundef nonnull align 4 dereferenceable(24) %26)
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #6
  %434 = load ptr, ptr %11, align 8, !tbaa !5
  %435 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %434, i32 0, i32 4
  %436 = load ptr, ptr %24, align 8, !tbaa !5
  %437 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %436, i32 0, i32 4
  %438 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %435, ptr noundef nonnull align 4 dereferenceable(4) %437)
  %439 = load i32, ptr %438, align 4, !tbaa !9
  %440 = add nsw i32 1, %439
  %441 = load ptr, ptr %6, align 8, !tbaa !5
  %442 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %441, i32 0, i32 4
  store i32 %440, ptr %442, align 4, !tbaa !11
  %443 = load ptr, ptr %6, align 8, !tbaa !5
  %444 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %443, i32 0, i32 4
  %445 = load ptr, ptr %23, align 8, !tbaa !5
  %446 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %445, i32 0, i32 4
  %447 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %444, ptr noundef nonnull align 4 dereferenceable(4) %446)
  %448 = load i32, ptr %447, align 4, !tbaa !9
  %449 = add nsw i32 1, %448
  %450 = load ptr, ptr %10, align 8, !tbaa !5
  %451 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %450, i32 0, i32 4
  store i32 %449, ptr %451, align 4, !tbaa !11
  br label %494

452:                                              ; preds = %402
  %453 = load i32, ptr %22, align 4, !tbaa !9
  %454 = load ptr, ptr %10, align 8, !tbaa !5
  %455 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %454, i32 0, i32 3
  store i32 %453, ptr %455, align 8, !tbaa !18
  %456 = load i32, ptr %21, align 4, !tbaa !9
  %457 = load ptr, ptr %6, align 8, !tbaa !5
  %458 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %457, i32 0, i32 2
  store i32 %456, ptr %458, align 4, !tbaa !17
  %459 = load i32, ptr %5, align 4, !tbaa !9
  %460 = load ptr, ptr %23, align 8, !tbaa !5
  %461 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %460, i32 0, i32 0
  store i32 %459, ptr %461, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #6
  %462 = load ptr, ptr %11, align 8, !tbaa !5
  %463 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %462, i32 0, i32 1
  %464 = load ptr, ptr %23, align 8, !tbaa !5
  %465 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %464, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %27, ptr noundef nonnull align 4 dereferenceable(24) %463, ptr noundef nonnull align 4 dereferenceable(24) %465)
  %466 = load ptr, ptr %6, align 8, !tbaa !5
  %467 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %466, i32 0, i32 1
  %468 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %467, ptr noundef nonnull align 4 dereferenceable(24) %27)
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #6
  %469 = load ptr, ptr %6, align 8, !tbaa !5
  %470 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %469, i32 0, i32 1
  %471 = load ptr, ptr %24, align 8, !tbaa !5
  %472 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %471, i32 0, i32 1
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(24) %470, ptr noundef nonnull align 4 dereferenceable(24) %472)
  %473 = load ptr, ptr %10, align 8, !tbaa !5
  %474 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %473, i32 0, i32 1
  %475 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %474, ptr noundef nonnull align 4 dereferenceable(24) %28)
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #6
  %476 = load ptr, ptr %11, align 8, !tbaa !5
  %477 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %476, i32 0, i32 4
  %478 = load ptr, ptr %23, align 8, !tbaa !5
  %479 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %478, i32 0, i32 4
  %480 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %477, ptr noundef nonnull align 4 dereferenceable(4) %479)
  %481 = load i32, ptr %480, align 4, !tbaa !9
  %482 = add nsw i32 1, %481
  %483 = load ptr, ptr %6, align 8, !tbaa !5
  %484 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %483, i32 0, i32 4
  store i32 %482, ptr %484, align 4, !tbaa !11
  %485 = load ptr, ptr %6, align 8, !tbaa !5
  %486 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %485, i32 0, i32 4
  %487 = load ptr, ptr %24, align 8, !tbaa !5
  %488 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %487, i32 0, i32 4
  %489 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %486, ptr noundef nonnull align 4 dereferenceable(4) %488)
  %490 = load i32, ptr %489, align 4, !tbaa !9
  %491 = add nsw i32 1, %490
  %492 = load ptr, ptr %10, align 8, !tbaa !5
  %493 = getelementptr inbounds %"struct.Riemann::DynamicAABBTree::Node", ptr %492, i32 0, i32 4
  store i32 %491, ptr %493, align 4, !tbaa !11
  br label %494

494:                                              ; preds = %452, %410
  %495 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %495, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %498

496:                                              ; preds = %296
  %497 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %497, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %498

498:                                              ; preds = %496, %494, %294
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %499

499:                                              ; preds = %498, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %500 = load i32, ptr %3, align 4
  ret i32 %500
}

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 = { noreturn nounwind }
attributes #6 = { nounwind }

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

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


; 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.9 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi = external hidden unnamed_addr constant [43 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [35 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 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_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 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
define dso_local noundef range(i32 0, -1) i32 @_ZN7Riemann15DynamicAABBTree7BalanceEi(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 = alloca %"class.Maths::TAABB3", align 4
  %10 = alloca %"class.Maths::TAABB3", align 4
  %.not = icmp eq i32 %1, -1
  br i1 %.not, label %11, label %12

11:                                               ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 810, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

12:                                               ; preds = %2
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = sext i32 %1 to i64
  %15 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %14) #6
  %16 = tail call noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree4Node6IsLeafEv(ptr noundef nonnull align 8 dereferenceable(49) %15)
  br i1 %16, label %174, label %17

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %15, i64 36
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 2
  br i1 %20, label %174, label %21

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %15, i64 28
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = getelementptr inbounds i8, ptr %15, i64 32
  %25 = load i32, ptr %24, align 8, !tbaa !16
  %26 = icmp sgt i32 %23, -1
  br i1 %26, label %27, label %.critedge

27:                                               ; preds = %21
  %28 = getelementptr inbounds i8, ptr %0, i64 36
  %29 = load i32, ptr %28, align 4, !tbaa !17
  %30 = icmp slt i32 %23, %29
  br i1 %30, label %31, label %.critedge

.critedge:                                        ; preds = %21, %27
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 820, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

31:                                               ; preds = %27
  %32 = icmp sgt i32 %25, -1
  %33 = icmp slt i32 %25, %29
  %or.cond = and i1 %32, %33
  br i1 %or.cond, label %34, label %.critedge2

.critedge2:                                       ; preds = %31
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 821, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

34:                                               ; preds = %31
  %35 = zext nneg i32 %23 to i64
  %36 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %35) #6
  %37 = zext nneg i32 %25 to i64
  %38 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %37) #6
  %39 = getelementptr inbounds i8, ptr %38, i64 36
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %36, i64 36
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sub nsw i32 %40, %42
  %44 = icmp sgt i32 %43, 1
  br i1 %44, label %45, label %107

45:                                               ; preds = %34
  %46 = getelementptr inbounds i8, ptr %38, i64 28
  %47 = load i32, ptr %46, align 4, !tbaa !15
  %48 = getelementptr inbounds i8, ptr %38, i64 32
  %49 = load i32, ptr %48, align 8, !tbaa !16
  %50 = sext i32 %47 to i64
  %51 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %50) #6
  %52 = sext i32 %49 to i64
  %53 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %52) #6
  %54 = icmp sgt i32 %47, -1
  br i1 %54, label %55, label %.critedge4

55:                                               ; preds = %45
  %56 = load i32, ptr %28, align 4, !tbaa !17
  %57 = icmp slt i32 %47, %56
  br i1 %57, label %58, label %.critedge4

.critedge4:                                       ; preds = %45, %55
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 835, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

58:                                               ; preds = %55
  %59 = icmp sgt i32 %49, -1
  %60 = icmp slt i32 %49, %56
  %or.cond171 = and i1 %59, %60
  br i1 %or.cond171, label %61, label %.critedge6

.critedge6:                                       ; preds = %58
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 836, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

61:                                               ; preds = %58
  store i32 %1, ptr %46, align 4, !tbaa !15
  %62 = load i32, ptr %15, align 8, !tbaa !23
  store i32 %62, ptr %38, align 8, !tbaa !23
  store i32 %25, ptr %15, align 8, !tbaa !23
  %63 = load i32, ptr %38, align 8, !tbaa !23
  %.not169 = icmp eq i32 %63, -1
  br i1 %.not169, label %85, label %64

64:                                               ; preds = %61
  %65 = sext i32 %63 to i64
  %66 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %65) #6
  %67 = getelementptr inbounds i8, ptr %66, i64 28
  %68 = load i32, ptr %67, align 4, !tbaa !15
  %69 = icmp eq i32 %68, %1
  %70 = load i32, ptr %38, align 8, !tbaa !23
  %71 = sext i32 %70 to i64
  %72 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %71) #6
  br i1 %69, label %73, label %75

73:                                               ; preds = %64
  %74 = getelementptr inbounds i8, ptr %72, i64 28
  store i32 %25, ptr %74, align 4, !tbaa !15
  br label %86

75:                                               ; preds = %64
  %76 = getelementptr inbounds i8, ptr %72, i64 32
  %77 = load i32, ptr %76, align 8, !tbaa !16
  %78 = icmp eq i32 %77, %1
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 852, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

80:                                               ; preds = %75
  %81 = load i32, ptr %38, align 8, !tbaa !23
  %82 = sext i32 %81 to i64
  %83 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %82) #6
  %84 = getelementptr inbounds i8, ptr %83, i64 32
  store i32 %25, ptr %84, align 8, !tbaa !16
  br label %86

85:                                               ; preds = %61
  store i32 %25, ptr %0, align 8, !tbaa !24
  br label %86

86:                                               ; preds = %73, %80, %85
  %87 = getelementptr inbounds i8, ptr %51, i64 36
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %53, i64 36
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp sgt i32 %88, %90
  %92 = getelementptr inbounds i8, ptr %36, i64 4
  %93 = getelementptr inbounds i8, ptr %15, i64 4
  %94 = getelementptr inbounds i8, ptr %38, i64 4
  br i1 %91, label %95, label %100

95:                                               ; preds = %86
  store i32 %47, ptr %48, align 8, !tbaa !16
  store i32 %49, ptr %24, align 8, !tbaa !16
  store i32 %1, ptr %53, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %96 = getelementptr inbounds i8, ptr %53, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(24) %92, ptr noundef nonnull align 4 dereferenceable(24) %96)
  %97 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %93, ptr noundef nonnull align 4 dereferenceable(24) %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  %98 = getelementptr inbounds i8, ptr %51, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(24) %93, ptr noundef nonnull align 4 dereferenceable(24) %98)
  %99 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %94, ptr noundef nonnull align 4 dereferenceable(24) %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %105

100:                                              ; preds = %86
  store i32 %49, ptr %48, align 8, !tbaa !16
  store i32 %47, ptr %24, align 8, !tbaa !16
  store i32 %1, ptr %51, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %101 = getelementptr inbounds i8, ptr %51, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(24) %92, ptr noundef nonnull align 4 dereferenceable(24) %101)
  %102 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %93, ptr noundef nonnull align 4 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %103 = getelementptr inbounds i8, ptr %53, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(24) %93, ptr noundef nonnull align 4 dereferenceable(24) %103)
  %104 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %94, ptr noundef nonnull align 4 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %105

105:                                              ; preds = %100, %95
  %.sink176 = phi ptr [ %87, %100 ], [ %89, %95 ]
  %.sink = phi ptr [ %89, %100 ], [ %87, %95 ]
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %.sink176)
  br label %.sink.split

107:                                              ; preds = %34
  %108 = icmp slt i32 %43, -1
  br i1 %108, label %109, label %174

109:                                              ; preds = %107
  %110 = getelementptr inbounds i8, ptr %36, i64 28
  %111 = load i32, ptr %110, align 4, !tbaa !15
  %112 = getelementptr inbounds i8, ptr %36, i64 32
  %113 = load i32, ptr %112, align 8, !tbaa !16
  %114 = sext i32 %111 to i64
  %115 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %114) #6
  %116 = sext i32 %113 to i64
  %117 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %116) #6
  %118 = icmp sgt i32 %111, -1
  br i1 %118, label %119, label %.critedge8

119:                                              ; preds = %109
  %120 = load i32, ptr %28, align 4, !tbaa !17
  %121 = icmp slt i32 %111, %120
  br i1 %121, label %122, label %.critedge8

.critedge8:                                       ; preds = %109, %119
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 895, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

122:                                              ; preds = %119
  %123 = icmp sgt i32 %113, -1
  %124 = icmp slt i32 %113, %120
  %or.cond172 = and i1 %123, %124
  br i1 %or.cond172, label %125, label %.critedge10

.critedge10:                                      ; preds = %122
  tail call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 896, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

125:                                              ; preds = %122
  store i32 %1, ptr %110, align 4, !tbaa !15
  %126 = load i32, ptr %15, align 8, !tbaa !23
  store i32 %126, ptr %36, align 8, !tbaa !23
  store i32 %23, ptr %15, align 8, !tbaa !23
  %127 = load i32, ptr %36, align 8, !tbaa !23
  %.not168 = icmp eq i32 %127, -1
  br i1 %.not168, label %149, label %128

128:                                              ; preds = %125
  %129 = sext i32 %127 to i64
  %130 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %129) #6
  %131 = getelementptr inbounds i8, ptr %130, i64 28
  %132 = load i32, ptr %131, align 4, !tbaa !15
  %133 = icmp eq i32 %132, %1
  %134 = load i32, ptr %36, align 8, !tbaa !23
  %135 = sext i32 %134 to i64
  %136 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %135) #6
  br i1 %133, label %137, label %139

137:                                              ; preds = %128
  %138 = getelementptr inbounds i8, ptr %136, i64 28
  store i32 %23, ptr %138, align 4, !tbaa !15
  br label %150

139:                                              ; preds = %128
  %140 = getelementptr inbounds i8, ptr %136, i64 32
  %141 = load i32, ptr %140, align 8, !tbaa !16
  %142 = icmp eq i32 %141, %1
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  tail call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 912, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann15DynamicAABBTree7BalanceEi) #5
  unreachable

144:                                              ; preds = %139
  %145 = load i32, ptr %36, align 8, !tbaa !23
  %146 = sext i32 %145 to i64
  %147 = tail call noundef nonnull align 8 dereferenceable(49) ptr @_ZNSt6vectorIN7Riemann15DynamicAABBTree4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %146) #6
  %148 = getelementptr inbounds i8, ptr %147, i64 32
  store i32 %23, ptr %148, align 8, !tbaa !16
  br label %150

149:                                              ; preds = %125
  store i32 %23, ptr %0, align 8, !tbaa !24
  br label %150

150:                                              ; preds = %137, %144, %149
  %151 = getelementptr inbounds i8, ptr %115, i64 36
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = getelementptr inbounds i8, ptr %117, i64 36
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = icmp sgt i32 %152, %154
  %156 = getelementptr inbounds i8, ptr %38, i64 4
  %157 = getelementptr inbounds i8, ptr %15, i64 4
  %158 = getelementptr inbounds i8, ptr %36, i64 4
  br i1 %155, label %159, label %164

159:                                              ; preds = %150
  store i32 %111, ptr %112, align 8, !tbaa !16
  store i32 %113, ptr %22, align 4, !tbaa !15
  store i32 %1, ptr %117, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %160 = getelementptr inbounds i8, ptr %117, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(24) %156, ptr noundef nonnull align 4 dereferenceable(24) %160)
  %161 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %157, ptr noundef nonnull align 4 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  %162 = getelementptr inbounds i8, ptr %115, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(24) %157, ptr noundef nonnull align 4 dereferenceable(24) %162)
  %163 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %158, ptr noundef nonnull align 4 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %169

164:                                              ; preds = %150
  store i32 %113, ptr %112, align 8, !tbaa !16
  store i32 %111, ptr %22, align 4, !tbaa !15
  store i32 %1, ptr %115, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  %165 = getelementptr inbounds i8, ptr %115, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(24) %156, ptr noundef nonnull align 4 dereferenceable(24) %165)
  %166 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %157, ptr noundef nonnull align 4 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  %167 = getelementptr inbounds i8, ptr %117, i64 4
  call void @_ZN5Maths6TAABB3IfEC2ERKS1_S3_(ptr noundef nonnull align 4 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(24) %157, ptr noundef nonnull align 4 dereferenceable(24) %167)
  %168 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %158, ptr noundef nonnull align 4 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  br label %169

169:                                              ; preds = %164, %159
  %.sink181 = phi ptr [ %151, %164 ], [ %153, %159 ]
  %.sink177 = phi ptr [ %153, %164 ], [ %151, %159 ]
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %.sink181)
  br label %.sink.split

.sink.split:                                      ; preds = %169, %105
  %.sink186 = phi ptr [ %106, %105 ], [ %170, %169 ]
  %.sink.sink = phi ptr [ %.sink, %105 ], [ %.sink177, %169 ]
  %.sink182 = phi ptr [ %39, %105 ], [ %41, %169 ]
  %.1.ph = phi i32 [ %25, %105 ], [ %23, %169 ]
  %171 = load i32, ptr %.sink186, align 4, !tbaa !25
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %18, align 4, !tbaa !5
  %173 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %.sink.sink)
  %storemerge170.in = load i32, ptr %173, align 4, !tbaa !25
  %storemerge170 = add nsw i32 %storemerge170.in, 1
  store i32 %storemerge170, ptr %.sink182, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %.sink.split, %107, %12, %17
  %.1 = phi i32 [ %1, %17 ], [ %1, %12 ], [ %1, %107 ], [ %.1.ph, %.sink.split ]
  ret i32 %.1
}

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 = { noreturn nounwind }
attributes #6 = { nounwind }

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

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


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