; LLVM IR from atlantis13579/Riemann :: Src/Collision (AABBTreeOffline)

; 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::TVector3" = type { float, float, float }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"struct.Riemann::AABBTreeBuildData" = type <{ i32, i32, ptr, ptr, ptr, ptr, i8, [7 x i8] }>
%"class.Riemann::AABBTreeNodeOffline" = type { %"class.Maths::TAABB3", ptr, ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(41) %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.Maths::TVector3", align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca %"class.Maths::TVector3", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.Maths::TVector3", align 4
  %16 = alloca %"class.Maths::TVector3", align 4
  %17 = alloca %"class.Maths::TAABB3", align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.Maths::TVector3", align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"class.Maths::TVector3", align 4
  %23 = alloca %"class.Maths::TVector3", align 4
  %24 = alloca %"class.Maths::TVector3", align 4
  %25 = alloca %"class.Maths::TVector3", align 4
  %26 = alloca %"class.Maths::TVector3", align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %29 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %30, i32 0, i32 4
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 3
  %34 = load i32, ptr %33, align 8, !tbaa !13
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %32, i64 %35
  store ptr %36, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %37 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 4
  %38 = load i32, ptr %37, align 4, !tbaa !18
  store i32 %38, ptr %6, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #6
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds i32, ptr %42, i64 0
  %44 = load i32, ptr %43, align 4, !tbaa !19
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %"class.Maths::TVector3", ptr %41, i64 %45
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %46)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %47, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !21
  store ptr %49, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #6
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds i32, ptr %51, i64 0
  %53 = load i32, ptr %52, align 4, !tbaa !19
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %"class.Maths::TAABB3", ptr %50, i64 %54
  %56 = getelementptr inbounds %"class.Maths::TAABB3", ptr %55, i32 0, i32 0
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %56)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #6
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds i32, ptr %58, i64 0
  %60 = load i32, ptr %59, align 4, !tbaa !19
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds %"class.Maths::TAABB3", ptr %57, i64 %61
  %63 = getelementptr inbounds %"class.Maths::TAABB3", ptr %62, i32 0, i32 1
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %63)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !19
  br label %64

64:                                               ; preds = %95, %2
  %65 = load i32, ptr %11, align 4, !tbaa !19
  %66 = load i32, ptr %6, align 4, !tbaa !19
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %98

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = load i32, ptr %11, align 4, !tbaa !19
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %70, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !19
  store i32 %74, ptr %12, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = load i32, ptr %12, align 4, !tbaa !19
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %"class.Maths::TAABB3", ptr %75, i64 %77
  %79 = getelementptr inbounds %"class.Maths::TAABB3", ptr %78, i32 0, i32 0
  store ptr %79, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = load i32, ptr %12, align 4, !tbaa !19
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %"class.Maths::TAABB3", ptr %80, i64 %82
  %84 = getelementptr inbounds %"class.Maths::TAABB3", ptr %83, i32 0, i32 1
  store ptr %84, ptr %14, align 8, !tbaa !5
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %85, i32 0, i32 3
  %87 = load ptr, ptr %86, align 8, !tbaa !20
  %88 = load i32, ptr %12, align 4, !tbaa !19
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %"class.Maths::TVector3", ptr %87, i64 %89
  call void @_ZN5Maths8TVector3IfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %90)
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #6
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZNK5Maths8TVector3IfE3MinERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %15, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %91)
  %92 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %15)
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #6
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZNK5Maths8TVector3IfE3MaxERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %93)
  %94 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %95

95:                                               ; preds = %69
  %96 = load i32, ptr %11, align 4, !tbaa !19
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %11, align 4, !tbaa !19
  br label %64, !llvm.loop !22

98:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  call void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %99 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 0
  %100 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %99, ptr noundef nonnull align 4 dereferenceable(24) %17)
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  %101 = load i32, ptr %6, align 4, !tbaa !19
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !24
  %105 = icmp sle i32 %101, %104
  br i1 %105, label %106, label %107

106:                                              ; preds = %98
  store i32 1, ptr %18, align 4
  br label %221

107:                                              ; preds = %98
  %108 = load i32, ptr %6, align 4, !tbaa !19
  %109 = sitofp i32 %108 to float
  %110 = fdiv float 1.000000e+00, %109
  call void @_ZN5Maths8TVector3IfEmLEf(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef %110)
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #6
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !19
  br label %111

111:                                              ; preds = %129, %107
  %112 = load i32, ptr %20, align 4, !tbaa !19
  %113 = load i32, ptr %6, align 4, !tbaa !19
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %132

116:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = load i32, ptr %20, align 4, !tbaa !19
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %117, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !19
  store i32 %121, ptr %21, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #6
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %122, i32 0, i32 3
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  %125 = load i32, ptr %21, align 4, !tbaa !19
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds %"class.Maths::TVector3", ptr %124, i64 %126
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %127)
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #6
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %25, ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #6
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %26, ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @_ZNK5Maths8TVector3IfEmlERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %24, ptr noundef nonnull align 4 dereferenceable(12) %25, ptr noundef nonnull align 4 dereferenceable(12) %26)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %23, ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %24)
  %128 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %23)
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %129

129:                                              ; preds = %116
  %130 = load i32, ptr %20, align 4, !tbaa !19
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %20, align 4, !tbaa !19
  br label %111, !llvm.loop !25

132:                                              ; preds = %115
  %133 = load i32, ptr %6, align 4, !tbaa !19
  %134 = sub nsw i32 %133, 1
  %135 = sitofp i32 %134 to float
  %136 = fdiv float 1.000000e+00, %135
  call void @_ZN5Maths8TVector3IfEmLEf(ptr noundef nonnull align 4 dereferenceable(12) %19, float noundef %136)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %137 = call noundef i32 @_ZNK5Maths8TVector3IfE11LargestAxisEv(ptr noundef nonnull align 4 dereferenceable(12) %19)
  store i32 %137, ptr %27, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 0, ptr %28, align 4, !tbaa !19
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %138, i32 0, i32 6
  %140 = load i8, ptr %139, align 8, !tbaa !26
  %141 = icmp eq i8 %140, 0
  br i1 %141, label %142, label %149

142:                                              ; preds = %132
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 4
  %146 = load i32, ptr %145, align 4, !tbaa !18
  %147 = load i32, ptr %27, align 4, !tbaa !19
  %148 = call noundef i32 @_ZN7Riemann19AABBTreeNodeOffline16SplitAxisBySpaceERKNS_17AABBTreeBuildDataEPiii(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef nonnull align 8 dereferenceable(41) %143, ptr noundef %144, i32 noundef %146, i32 noundef %147)
  store i32 %148, ptr %28, align 4, !tbaa !19
  br label %163

149:                                              ; preds = %132
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %150, i32 0, i32 6
  %152 = load i8, ptr %151, align 8, !tbaa !26
  %153 = icmp eq i8 %152, 1
  br i1 %153, label %154, label %161

154:                                              ; preds = %149
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 4
  %158 = load i32, ptr %157, align 4, !tbaa !18
  %159 = load i32, ptr %27, align 4, !tbaa !19
  %160 = call noundef i32 @_ZN7Riemann19AABBTreeNodeOffline24SplitAxisByNumGeometriesERKNS_17AABBTreeBuildDataEPiii(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef nonnull align 8 dereferenceable(41) %155, ptr noundef %156, i32 noundef %158, i32 noundef %159)
  store i32 %160, ptr %28, align 4, !tbaa !19
  br label %162

161:                                              ; preds = %149
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 119, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE) #7
  unreachable

162:                                              ; preds = %154
  br label %163

163:                                              ; preds = %162, %142
  %164 = load i32, ptr %28, align 4, !tbaa !19
  %165 = icmp eq i32 %164, 0
  br i1 %165, label %170, label %166

166:                                              ; preds = %163
  %167 = load i32, ptr %28, align 4, !tbaa !19
  %168 = load i32, ptr %6, align 4, !tbaa !19
  %169 = icmp eq i32 %167, %168
  br i1 %169, label %170, label %181

170:                                              ; preds = %166, %163
  %171 = load i32, ptr %6, align 4, !tbaa !19
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 8, !tbaa !24
  %175 = icmp sgt i32 %171, %174
  br i1 %175, label %176, label %179

176:                                              ; preds = %170
  %177 = load i32, ptr %6, align 4, !tbaa !19
  %178 = ashr i32 %177, 1
  store i32 %178, ptr %28, align 4, !tbaa !19
  br label %180

179:                                              ; preds = %170
  store i32 1, ptr %18, align 4
  br label %220

180:                                              ; preds = %176
  br label %181

181:                                              ; preds = %180, %166
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.Riemann::AABBTreeBuildData", ptr %182, i32 0, i32 5
  %184 = load ptr, ptr %183, align 8, !tbaa !27
  %185 = call noundef ptr @_ZN7Riemann15AABBTreeOffline10AllocNodesEv(ptr noundef nonnull align 8 dereferenceable(40) %184)
  %186 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 1
  store ptr %185, ptr %186, align 8, !tbaa !28
  %187 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 1
  %188 = load ptr, ptr %187, align 8, !tbaa !28
  %189 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %188, i64 1
  %190 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 2
  store ptr %189, ptr %190, align 8, !tbaa !29
  %191 = call noundef zeroext i1 @_ZNK7Riemann19AABBTreeNodeOffline10IsLeafNodeEv(ptr noundef nonnull align 8 dereferenceable(48) %29)
  %192 = xor i1 %191, true
  br i1 %192, label %193, label %194

193:                                              ; preds = %181
  br label %196

194:                                              ; preds = %181
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 137, ptr noundef @__PRETTY_FUNCTION__._ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE) #7
  unreachable

195:                                              ; No predecessors!
  br label %196

196:                                              ; preds = %195, %193
  %197 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 3
  %198 = load i32, ptr %197, align 8, !tbaa !13
  %199 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 1
  %200 = load ptr, ptr %199, align 8, !tbaa !28
  %201 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %200, i32 0, i32 3
  store i32 %198, ptr %201, align 8, !tbaa !13
  %202 = load i32, ptr %28, align 4, !tbaa !19
  %203 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 1
  %204 = load ptr, ptr %203, align 8, !tbaa !28
  %205 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %204, i32 0, i32 4
  store i32 %202, ptr %205, align 4, !tbaa !18
  %206 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 3
  %207 = load i32, ptr %206, align 8, !tbaa !13
  %208 = load i32, ptr %28, align 4, !tbaa !19
  %209 = add nsw i32 %207, %208
  %210 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 2
  %211 = load ptr, ptr %210, align 8, !tbaa !29
  %212 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %211, i32 0, i32 3
  store i32 %209, ptr %212, align 8, !tbaa !13
  %213 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 4
  %214 = load i32, ptr %213, align 4, !tbaa !18
  %215 = load i32, ptr %28, align 4, !tbaa !19
  %216 = sub nsw i32 %214, %215
  %217 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %29, i32 0, i32 2
  %218 = load ptr, ptr %217, align 8, !tbaa !29
  %219 = getelementptr inbounds %"class.Riemann::AABBTreeNodeOffline", ptr %218, i32 0, i32 4
  store i32 %216, ptr %219, align 4, !tbaa !18
  store i32 0, ptr %18, align 4
  br label %220

220:                                              ; preds = %196, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #6
  br label %221

221:                                              ; preds = %220, %106
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %222 = load i32, ptr %18, align 4
  switch i32 %222, label %224 [
    i32 0, label %223
    i32 1, label %223
  ]

223:                                              ; preds = %221, %221
  ret void

224:                                              ; preds = %221
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7Riemann19AABBTreeNodeOffline10IsLeafNodeEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7Riemann19AABBTreeNodeOffline16SplitAxisBySpaceERKNS_17AABBTreeBuildDataEPiii(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(41), ptr noundef, i32 noundef, i32 noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7Riemann19AABBTreeNodeOffline24SplitAxisByNumGeometriesERKNS_17AABBTreeBuildDataEPiii(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(41), ptr noundef, i32 noundef, i32 noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfE3MinERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfE3MaxERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

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

; 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)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmlERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5Maths8TVector3IfE11LargestAxisEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7Riemann15AABBTreeOffline10AllocNodesEv(ptr noundef nonnull align 8 dereferenceable(40)) #0 align 2

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { 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, !6, i64 24}
!10 = !{!"_ZTSN7Riemann17AABBTreeBuildDataE", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN7Riemann14SplitHeuristicE", !7, i64 0}
!13 = !{!14, !11, i64 40}
!14 = !{!"_ZTSN7Riemann19AABBTreeNodeOfflineE", !15, i64 0, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44}
!15 = !{!"_ZTSN5Maths6TAABB3IfEE", !16, i64 0, !16, i64 12}
!16 = !{!"_ZTSN5Maths8TVector3IfEE", !17, i64 0, !17, i64 4, !17, i64 8}
!17 = !{!"float", !7, i64 0}
!18 = !{!14, !11, i64 44}
!19 = !{!11, !11, i64 0}
!20 = !{!10, !6, i64 16}
!21 = !{!10, !6, i64 8}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!10, !11, i64 0}
!25 = distinct !{!25, !23}
!26 = !{!10, !12, i64 40}
!27 = !{!10, !6, i64 32}
!28 = !{!14, !6, i64 24}
!29 = !{!14, !6, i64 32}


; 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::TVector3" = type { float, float, float }
%"class.Maths::TAABB3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@__PRETTY_FUNCTION__._ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(41) %1) local_unnamed_addr #0 align 2 {
  %3 = alloca %"class.Maths::TVector3", align 4
  %4 = alloca %"class.Maths::TVector3", align 4
  %5 = alloca %"class.Maths::TVector3", align 4
  %6 = alloca %"class.Maths::TVector3", align 4
  %7 = alloca %"class.Maths::TVector3", align 4
  %8 = alloca %"class.Maths::TAABB3", align 4
  %9 = alloca %"class.Maths::TVector3", align 4
  %10 = alloca %"class.Maths::TVector3", align 4
  %11 = alloca %"class.Maths::TVector3", align 4
  %12 = alloca %"class.Maths::TVector3", align 4
  %13 = alloca %"class.Maths::TVector3", align 4
  %14 = alloca %"class.Maths::TVector3", align 4
  %15 = getelementptr inbounds i8, ptr %1, i64 24
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = load i32, ptr %17, align 8, !tbaa !12
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i32, ptr %16, i64 %19
  %21 = getelementptr inbounds i8, ptr %0, i64 44
  %22 = load i32, ptr %21, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #6
  %23 = getelementptr inbounds i8, ptr %1, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !18
  %25 = load i32, ptr %20, align 4, !tbaa !19
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %"class.Maths::TVector3", ptr %24, i64 %26
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %27)
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #6
  %30 = load i32, ptr %20, align 4, !tbaa !19
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds %"class.Maths::TAABB3", ptr %29, i64 %31
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %32)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #6
  %33 = load i32, ptr %20, align 4, !tbaa !19
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %"class.Maths::TAABB3", ptr %29, i64 %34, i32 1
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %35)
  %36 = icmp sgt i32 %22, 1
  br i1 %36, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = zext nneg i32 %22 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @_ZN5Maths6TAABB3IfEC2ERKNS_8TVector3IfEES5_(ptr noundef nonnull align 4 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %37 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN5Maths6TAABB3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  %38 = load i32, ptr %1, align 8, !tbaa !21
  %.not = icmp sgt i32 %22, %38
  br i1 %.not, label %48, label %100

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %39 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv
  %40 = load i32, ptr %39, align 4, !tbaa !19
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds %"class.Maths::TAABB3", ptr %29, i64 %41
  %43 = getelementptr inbounds i8, ptr %42, i64 12
  %44 = load ptr, ptr %23, align 8, !tbaa !18
  %45 = getelementptr inbounds %"class.Maths::TVector3", ptr %44, i64 %41
  call void @_ZN5Maths8TVector3IfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %45)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #6
  call void @_ZNK5Maths8TVector3IfE3MinERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %42)
  %46 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  call void @_ZNK5Maths8TVector3IfE3MaxERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %43)
  %47 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

48:                                               ; preds = %._crit_edge
  %49 = sitofp i32 %22 to float
  %50 = fdiv float 1.000000e+00, %49
  call void @_ZN5Maths8TVector3IfEmLEf(ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef %50)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #6
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %9)
  %51 = icmp sgt i32 %22, 0
  br i1 %51, label %.lr.ph57.preheader, label %._crit_edge58

.lr.ph57.preheader:                               ; preds = %48
  %wide.trip.count63 = zext nneg i32 %22 to i64
  br label %.lr.ph57

._crit_edge58:                                    ; preds = %.lr.ph57, %48
  %52 = add nsw i32 %22, -1
  %53 = sitofp i32 %52 to float
  %54 = fdiv float 1.000000e+00, %53
  call void @_ZN5Maths8TVector3IfEmLEf(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef %54)
  %55 = call noundef i32 @_ZNK5Maths8TVector3IfE11LargestAxisEv(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %56 = getelementptr inbounds i8, ptr %1, i64 40
  %57 = load i8, ptr %56, align 8, !tbaa !24
  switch i8 %57, label %70 [
    i8 0, label %64
    i8 1, label %67
  ]

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %.lr.ph57
  %indvars.iv60 = phi i64 [ 0, %.lr.ph57.preheader ], [ %indvars.iv.next61, %.lr.ph57 ]
  %58 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv60
  %59 = load i32, ptr %58, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #6
  %60 = load ptr, ptr %23, align 8, !tbaa !18
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds %"class.Maths::TVector3", ptr %60, i64 %61
  call void @_ZN5Maths8TVector3IfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %62)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #6
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #6
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %3)
  call void @_ZNK5Maths8TVector3IfEmlERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %12)
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #6
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count63
  br i1 %exitcond64.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !25

64:                                               ; preds = %._crit_edge58
  %65 = load i32, ptr %21, align 4, !tbaa !17
  %66 = call noundef i32 @_ZN7Riemann19AABBTreeNodeOffline16SplitAxisBySpaceERKNS_17AABBTreeBuildDataEPiii(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(41) %1, ptr noundef nonnull %20, i32 noundef %65, i32 noundef %55)
  br label %71

67:                                               ; preds = %._crit_edge58
  %68 = load i32, ptr %21, align 4, !tbaa !17
  %69 = call noundef i32 @_ZN7Riemann19AABBTreeNodeOffline24SplitAxisByNumGeometriesERKNS_17AABBTreeBuildDataEPiii(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(41) %1, ptr noundef nonnull %20, i32 noundef %68, i32 noundef %55)
  br label %71

70:                                               ; preds = %._crit_edge58
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 119, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE) #7
  unreachable

71:                                               ; preds = %67, %64
  %.0 = phi i32 [ %66, %64 ], [ %69, %67 ]
  %72 = icmp eq i32 %.0, 0
  %73 = icmp eq i32 %.0, %22
  %or.cond = select i1 %72, i1 true, i1 %73
  br i1 %or.cond, label %74, label %79

74:                                               ; preds = %71
  %75 = load i32, ptr %1, align 8, !tbaa !21
  %76 = icmp sgt i32 %22, %75
  br i1 %76, label %77, label %99

77:                                               ; preds = %74
  %78 = ashr i32 %22, 1
  br label %79

79:                                               ; preds = %71, %77
  %.1 = phi i32 [ %78, %77 ], [ %.0, %71 ]
  %80 = getelementptr inbounds i8, ptr %1, i64 32
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = call noundef ptr @_ZN7Riemann15AABBTreeOffline10AllocNodesEv(ptr noundef nonnull align 8 dereferenceable(40) %81)
  %83 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %82, ptr %83, align 8, !tbaa !27
  %84 = getelementptr inbounds i8, ptr %82, i64 48
  %85 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %84, ptr %85, align 8, !tbaa !28
  %86 = call noundef zeroext i1 @_ZNK7Riemann19AABBTreeNodeOffline10IsLeafNodeEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  br i1 %86, label %87, label %88

87:                                               ; preds = %79
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 137, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7Riemann19AABBTreeNodeOffline18SubDivideAABBArrayERNS_17AABBTreeBuildDataE) #7
  unreachable

88:                                               ; preds = %79
  %89 = load i32, ptr %17, align 8, !tbaa !12
  %90 = load ptr, ptr %83, align 8, !tbaa !27
  %91 = getelementptr inbounds i8, ptr %90, i64 40
  store i32 %89, ptr %91, align 8, !tbaa !12
  %92 = getelementptr inbounds i8, ptr %90, i64 44
  store i32 %.1, ptr %92, align 4, !tbaa !17
  %93 = add nsw i32 %89, %.1
  %94 = load ptr, ptr %85, align 8, !tbaa !28
  %95 = getelementptr inbounds i8, ptr %94, i64 40
  store i32 %93, ptr %95, align 8, !tbaa !12
  %96 = load i32, ptr %21, align 4, !tbaa !17
  %97 = sub nsw i32 %96, %.1
  %98 = getelementptr inbounds i8, ptr %94, i64 44
  store i32 %97, ptr %98, align 4, !tbaa !17
  br label %99

99:                                               ; preds = %74, %88
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  br label %100

100:                                              ; preds = %._crit_edge, %99
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #6
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7Riemann19AABBTreeNodeOffline16SplitAxisBySpaceERKNS_17AABBTreeBuildDataEPiii(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(41), ptr noundef, i32 noundef, i32 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) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7Riemann19AABBTreeNodeOffline24SplitAxisByNumGeometriesERKNS_17AABBTreeBuildDataEPiii(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(41), ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfE3MinERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfE3MaxERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

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

; 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 #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEplERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmlERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5Maths8TVector3IfE11LargestAxisEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { 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, !10, i64 24}
!6 = !{!"_ZTSN7Riemann17AABBTreeBuildDataE", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !11, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN7Riemann14SplitHeuristicE", !8, i64 0}
!12 = !{!13, !7, i64 40}
!13 = !{!"_ZTSN7Riemann19AABBTreeNodeOfflineE", !14, i64 0, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 44}
!14 = !{!"_ZTSN5Maths6TAABB3IfEE", !15, i64 0, !15, i64 12}
!15 = !{!"_ZTSN5Maths8TVector3IfEE", !16, i64 0, !16, i64 4, !16, i64 8}
!16 = !{!"float", !8, i64 0}
!17 = !{!13, !7, i64 44}
!18 = !{!6, !10, i64 16}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !10, i64 8}
!21 = !{!6, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!6, !11, i64 40}
!25 = distinct !{!25, !23}
!26 = !{!6, !10, i64 32}
!27 = !{!13, !10, i64 24}
!28 = !{!13, !10, i64 32}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass