; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/BroadPhase (QuadTree)

; 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.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.1 }
%union.anon.1 = type { <4 x float> }
%"class.JPH::QuadTree::NodeID" = type { i32 }
%"struct.JPH::AssertLastParam" = type { i8 }
%struct.StackEntry = type { i32, i32, [5 x i32], i32, %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::QuadTree" = type <{ ptr, %"struct.JPH::FixedSizeFreeList<JPH::QuadTree::Node>::Batch", [44 x i8], %"struct.std::atomic.0", [2 x %"struct.JPH::QuadTree::RootNode"], %"struct.std::atomic.0", %"struct.std::atomic.6", [47 x i8] }>
%"struct.JPH::FixedSizeFreeList<JPH::QuadTree::Node>::Batch" = type { i32, i32, i32 }
%"struct.JPH::QuadTree::RootNode" = type { %"struct.std::atomic.0" }
%"struct.std::atomic.0" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"struct.std::atomic.6" = type { %"struct.std::__atomic_base.7" }
%"struct.std::__atomic_base.7" = type { i8 }
%"class.JPH::QuadTree::Node" = type { [4 x %"struct.std::atomic"], [4 x %"struct.std::atomic"], [4 x %"struct.std::atomic"], [4 x %"struct.std::atomic"], [4 x %"struct.std::atomic"], [4 x %"struct.std::atomic"], [4 x %"class.JPH::QuadTree::AtomicNodeID"], %"struct.std::atomic.0", %"struct.std::atomic.0", i32 }
%"struct.std::atomic" = type { float }
%"class.JPH::QuadTree::AtomicNodeID" = type { %"struct.std::atomic.0" }

@.str.1 = external hidden unnamed_addr constant [99 x i8], align 1
@_ZN3JPH8QuadTree14cInvalidBoundsE = external dso_local global %"class.JPH::AABox", align 16
@.str.22 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [21 x i8], align 1

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN3JPH8QuadTree6NodeID8sInvalidEv() #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH8QuadTree4Node14SetChildBoundsEiRKNS_5AABoxE(ptr noundef nonnull align 4 dereferenceable(124), i32 noundef, ptr noundef nonnull align 16 dereferenceable(32)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5AABoxC2ENS_4Vec3ES1_(ptr noundef nonnull align 16 dereferenceable(32), double, double, double, double) unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH8QuadTree15SetBodyLocationERNS_5ArrayINS0_8TrackingENS_12STLAllocatorIS2_EEEENS_6BodyIDEjj(ptr noundef nonnull align 64 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(24), i32, i32 noundef, i32 noundef) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81), i1 noundef zeroext) #2 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #7

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @_ZN3JPH8QuadTree9BuildTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERNS1_INS0_8TrackingENS4_IS9_EEEEPNS0_6NodeIDEijRNS_5AABoxE(ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef nonnull align 16 dereferenceable(32) %6) #4 align 2 {
  %8 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %"class.JPH::AABox", align 16
  %18 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %19 = alloca ptr, align 8
  %20 = alloca %"struct.JPH::AssertLastParam", align 1
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::AABox", align 16
  %26 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %27 = alloca [32 x %struct.StackEntry], align 16
  %28 = alloca i32, align 4
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca %"class.JPH::Vec3", align 16
  %35 = alloca %"class.JPH::Vec3", align 16
  %36 = alloca %"class.JPH::Vec3", align 16
  %37 = alloca %"class.JPH::Vec3", align 16
  %38 = alloca %"class.JPH::Vec3", align 16
  %39 = alloca %"class.JPH::Vec3", align 16
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %43 = alloca %"class.JPH::AABox", align 16
  %44 = alloca %"class.JPH::Vec3", align 16
  %45 = alloca %"class.JPH::Vec3", align 16
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  %49 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %50 = alloca %"class.JPH::AABox", align 16
  %51 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %52 = alloca ptr, align 8
  %53 = alloca ptr, align 8
  %54 = alloca %"class.JPH::BodyID", align 4
  %55 = alloca %"class.JPH::Vec3", align 16
  %56 = alloca %"class.JPH::Vec3", align 16
  %57 = alloca %"class.JPH::Vec3", align 16
  %58 = alloca %"class.JPH::Vec3", align 16
  %59 = alloca %"class.JPH::Vec3", align 16
  %60 = alloca %"class.JPH::Vec3", align 16
  %61 = alloca ptr, align 8
  %62 = alloca %"struct.JPH::AssertLastParam", align 1
  %63 = alloca i32, align 4
  %64 = alloca %"class.JPH::Vec3", align 16
  %65 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  %66 = load ptr, ptr %9, align 8
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %73

69:                                               ; preds = %7
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %70, ptr align 16 @_ZN3JPH8QuadTree14cInvalidBoundsE, i64 32, i1 false), !tbaa.struct !11
  %71 = call i32 @_ZN3JPH8QuadTree6NodeID8sInvalidEv()
  %72 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %8, i32 0, i32 0
  store i32 %71, ptr %72, align 4
  br label %480

73:                                               ; preds = %7
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %76, label %95

76:                                               ; preds = %73
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %77)
  br i1 %78, label %79, label %88

79:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #10
  %80 = getelementptr inbounds %"class.JPH::QuadTree", ptr %66, i32 0, i32 0
  %81 = load ptr, ptr %80, align 64, !tbaa !13
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = call noundef i32 @_ZNK3JPH8QuadTree6NodeID12GetNodeIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %82)
  %84 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %81, i32 noundef %83)
  store ptr %84, ptr %16, align 8, !tbaa !5
  %85 = load ptr, ptr %16, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %85, i32 0, i32 7
  %87 = call noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4) %86, i32 noundef -1) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  br label %88

88:                                               ; preds = %79, %76
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #10
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %90, i64 4, i1 false), !tbaa.struct !21
  %91 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %18, i32 0, i32 0
  %92 = load i32, ptr %91, align 4
  call void @_ZNK3JPH8QuadTree19GetNodeOrBodyBoundsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEENS0_6NodeIDE(ptr dead_on_unwind writable sret(%"class.JPH::AABox") align 16 %17, ptr noundef nonnull align 64 dereferenceable(81) %66, ptr noundef nonnull align 8 dereferenceable(24) %89, i32 %92)
  %93 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %93, ptr align 16 %17, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #10
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %94, i64 4, i1 false), !tbaa.struct !21
  br label %480

95:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #10
  %96 = load i32, ptr %13, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %97, i64 16)
  %99 = extractvalue { i64, i1 } %98, 1
  %100 = extractvalue { i64, i1 } %98, 0
  %101 = select i1 %99, i64 -1, i64 %100
  %102 = call noundef ptr @_ZN3JPH4Vec3naEm(i64 noundef %101)
  store ptr %102, ptr %19, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %95
  %104 = load ptr, ptr %19, align 8, !tbaa !5
  %105 = call noundef zeroext i1 @_ZN3JPH9IsAlignedIPNS_4Vec3EEEbT_m(ptr noundef %104, i64 noundef 16)
  br i1 %105, label %109, label %106

106:                                              ; preds = %103
  %107 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.22, ptr noundef @.str.1, i32 noundef 551)
  br i1 %107, label %108, label %109

108:                                              ; preds = %106
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #10, !srcloc !22
  br label %109

109:                                              ; preds = %108, %106, %103
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #10
  %112 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %112, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %113, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = load i32, ptr %13, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %114, i64 %116
  store ptr %117, ptr %23, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %136, %111
  %119 = load ptr, ptr %22, align 8, !tbaa !5
  %120 = load ptr, ptr %23, align 8, !tbaa !5
  %121 = icmp ult ptr %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %141

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #10
  %124 = load ptr, ptr %10, align 8, !tbaa !5
  %125 = load ptr, ptr %22, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %125, i64 4, i1 false), !tbaa.struct !21
  %126 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %26, i32 0, i32 0
  %127 = load i32, ptr %126, align 4
  call void @_ZNK3JPH8QuadTree19GetNodeOrBodyBoundsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEENS0_6NodeIDE(ptr dead_on_unwind writable sret(%"class.JPH::AABox") align 16 %25, ptr noundef nonnull align 64 dereferenceable(81) %66, ptr noundef nonnull align 8 dereferenceable(24) %124, i32 %127)
  %128 = call { double, double } @_ZNK3JPH5AABox9GetCenterEv(ptr noundef nonnull align 16 dereferenceable(32) %25)
  %129 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %130 = getelementptr inbounds %union.anon.1, ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds { double, double }, ptr %130, i32 0, i32 0
  %132 = extractvalue { double, double } %128, 0
  store double %132, ptr %131, align 16
  %133 = getelementptr inbounds { double, double }, ptr %130, i32 0, i32 1
  %134 = extractvalue { double, double } %128, 1
  store double %134, ptr %133, align 8
  %135 = load ptr, ptr %21, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %135, ptr align 16 %24, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #10
  br label %136

136:                                              ; preds = %123
  %137 = load ptr, ptr %22, align 8, !tbaa !5
  %138 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %137, i32 1
  store ptr %138, ptr %22, align 8, !tbaa !5
  %139 = load ptr, ptr %21, align 8, !tbaa !5
  %140 = getelementptr inbounds %"class.JPH::Vec3", ptr %139, i32 1
  store ptr %140, ptr %21, align 8, !tbaa !5
  br label %118, !llvm.loop !24

141:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 2048, ptr %27) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #10
  store i32 0, ptr %28, align 4, !tbaa !9
  %142 = load i32, ptr %14, align 4, !tbaa !9
  %143 = icmp ugt i32 %142, 0
  %144 = call noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81) %66, i1 noundef zeroext %143)
  %145 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %146 = getelementptr inbounds %struct.StackEntry, ptr %145, i32 0, i32 0
  store i32 %144, ptr %146, align 16, !tbaa !26
  %147 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %148 = getelementptr inbounds %struct.StackEntry, ptr %147, i32 0, i32 1
  store i32 -1, ptr %148, align 4, !tbaa !29
  %149 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %150 = getelementptr inbounds %struct.StackEntry, ptr %149, i32 0, i32 3
  store i32 0, ptr %150, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #10
  %151 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0x430C6BF520000000)
  %152 = getelementptr inbounds %"class.JPH::Vec3", ptr %29, i32 0, i32 0
  %153 = getelementptr inbounds %union.anon.1, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds { double, double }, ptr %153, i32 0, i32 0
  %155 = extractvalue { double, double } %151, 0
  store double %155, ptr %154, align 16
  %156 = getelementptr inbounds { double, double }, ptr %153, i32 0, i32 1
  %157 = extractvalue { double, double } %151, 1
  store double %157, ptr %156, align 8
  %158 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %159 = getelementptr inbounds %struct.StackEntry, ptr %158, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %159, ptr align 16 %29, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #10
  %160 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0xC30C6BF520000000)
  %161 = getelementptr inbounds %"class.JPH::Vec3", ptr %30, i32 0, i32 0
  %162 = getelementptr inbounds %union.anon.1, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds { double, double }, ptr %162, i32 0, i32 0
  %164 = extractvalue { double, double } %160, 0
  store double %164, ptr %163, align 16
  %165 = getelementptr inbounds { double, double }, ptr %162, i32 0, i32 1
  %166 = extractvalue { double, double } %160, 1
  store double %166, ptr %165, align 8
  %167 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %168 = getelementptr inbounds %struct.StackEntry, ptr %167, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %168, ptr align 16 %30, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #10
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  %170 = load ptr, ptr %19, align 8, !tbaa !5
  %171 = load i32, ptr %13, align 4, !tbaa !9
  %172 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %173 = getelementptr inbounds %struct.StackEntry, ptr %172, i32 0, i32 2
  %174 = getelementptr inbounds [5 x i32], ptr %173, i64 0, i64 0
  call void @_ZN3JPH8QuadTree11sPartition4EPNS0_6NodeIDEPNS_4Vec3EiiPi(ptr noundef %169, ptr noundef %170, i32 noundef 0, i32 noundef %171, ptr noundef %174)
  br label %175

175:                                              ; preds = %461, %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #10
  %176 = load i32, ptr %28, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 %177
  store ptr %178, ptr %31, align 8, !tbaa !5
  %179 = load ptr, ptr %31, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.StackEntry, ptr %179, i32 0, i32 1
  %181 = load i32, ptr %180, align 4, !tbaa !29
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %180, align 4, !tbaa !29
  %183 = load ptr, ptr %31, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.StackEntry, ptr %183, i32 0, i32 1
  %185 = load i32, ptr %184, align 4, !tbaa !29
  %186 = icmp sge i32 %185, 4
  br i1 %186, label %187, label %286

187:                                              ; preds = %175
  %188 = load i32, ptr %28, align 4, !tbaa !9
  %189 = icmp sle i32 %188, 0
  br i1 %189, label %190, label %191

190:                                              ; preds = %187
  store i32 7, ptr %32, align 4
  br label %459

191:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #10
  %192 = load i32, ptr %28, align 4, !tbaa !9
  %193 = sub nsw i32 %192, 1
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 %194
  store ptr %195, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #10
  %196 = load ptr, ptr %33, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.StackEntry, ptr %196, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %35, ptr align 16 %197, i64 16, i1 false), !tbaa.struct !23
  %198 = load ptr, ptr %31, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.StackEntry, ptr %198, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %36, ptr align 16 %199, i64 16, i1 false), !tbaa.struct !23
  %200 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 0
  %201 = load double, ptr %200, align 16
  %202 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 1
  %203 = load double, ptr %202, align 8
  %204 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %205 = load double, ptr %204, align 16
  %206 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %207 = load double, ptr %206, align 8
  %208 = call { double, double } @_ZN3JPH4Vec34sMinES0_S0_(double %201, double %203, double %205, double %207)
  %209 = getelementptr inbounds %"class.JPH::Vec3", ptr %34, i32 0, i32 0
  %210 = getelementptr inbounds %union.anon.1, ptr %209, i32 0, i32 0
  %211 = getelementptr inbounds { double, double }, ptr %210, i32 0, i32 0
  %212 = extractvalue { double, double } %208, 0
  store double %212, ptr %211, align 16
  %213 = getelementptr inbounds { double, double }, ptr %210, i32 0, i32 1
  %214 = extractvalue { double, double } %208, 1
  store double %214, ptr %213, align 8
  %215 = load ptr, ptr %33, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.StackEntry, ptr %215, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %216, ptr align 16 %34, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %37) #10
  %217 = load ptr, ptr %33, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.StackEntry, ptr %217, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %38, ptr align 16 %218, i64 16, i1 false), !tbaa.struct !23
  %219 = load ptr, ptr %31, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.StackEntry, ptr %219, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %39, ptr align 16 %220, i64 16, i1 false), !tbaa.struct !23
  %221 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 0
  %222 = load double, ptr %221, align 16
  %223 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 1
  %224 = load double, ptr %223, align 8
  %225 = getelementptr inbounds { double, double }, ptr %39, i32 0, i32 0
  %226 = load double, ptr %225, align 16
  %227 = getelementptr inbounds { double, double }, ptr %39, i32 0, i32 1
  %228 = load double, ptr %227, align 8
  %229 = call { double, double } @_ZN3JPH4Vec34sMaxES0_S0_(double %222, double %224, double %226, double %228)
  %230 = getelementptr inbounds %"class.JPH::Vec3", ptr %37, i32 0, i32 0
  %231 = getelementptr inbounds %union.anon.1, ptr %230, i32 0, i32 0
  %232 = getelementptr inbounds { double, double }, ptr %231, i32 0, i32 0
  %233 = extractvalue { double, double } %229, 0
  store double %233, ptr %232, align 16
  %234 = getelementptr inbounds { double, double }, ptr %231, i32 0, i32 1
  %235 = extractvalue { double, double } %229, 1
  store double %235, ptr %234, align 8
  %236 = load ptr, ptr %33, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.StackEntry, ptr %236, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %237, ptr align 16 %37, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %37) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #10
  %238 = getelementptr inbounds %"class.JPH::QuadTree", ptr %66, i32 0, i32 0
  %239 = load ptr, ptr %238, align 64, !tbaa !13
  %240 = load ptr, ptr %31, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.StackEntry, ptr %240, i32 0, i32 0
  %242 = load i32, ptr %241, align 16, !tbaa !26
  %243 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %239, i32 noundef %242)
  store ptr %243, ptr %40, align 8, !tbaa !5
  %244 = load ptr, ptr %33, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.StackEntry, ptr %244, i32 0, i32 0
  %246 = load i32, ptr %245, align 16, !tbaa !26
  %247 = load ptr, ptr %40, align 8, !tbaa !5
  %248 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %247, i32 0, i32 7
  %249 = call noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4) %248, i32 noundef %246) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #10
  %250 = getelementptr inbounds %"class.JPH::QuadTree", ptr %66, i32 0, i32 0
  %251 = load ptr, ptr %250, align 64, !tbaa !13
  %252 = load ptr, ptr %33, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.StackEntry, ptr %252, i32 0, i32 0
  %254 = load i32, ptr %253, align 16, !tbaa !26
  %255 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %251, i32 noundef %254)
  store ptr %255, ptr %41, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #10
  %256 = load ptr, ptr %31, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.StackEntry, ptr %256, i32 0, i32 0
  %258 = load i32, ptr %257, align 16, !tbaa !26
  %259 = call i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef %258)
  %260 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %42, i32 0, i32 0
  store i32 %259, ptr %260, align 4
  %261 = load ptr, ptr %41, align 8, !tbaa !5
  %262 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %261, i32 0, i32 6
  %263 = load ptr, ptr %33, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.StackEntry, ptr %263, i32 0, i32 1
  %265 = load i32, ptr %264, align 4, !tbaa !29
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [4 x %"class.JPH::QuadTree::AtomicNodeID"], ptr %262, i64 0, i64 %266
  call void @_ZN3JPH8QuadTree12AtomicNodeIDaSERKNS0_6NodeIDE(ptr noundef nonnull align 4 dereferenceable(4) %267, ptr noundef nonnull align 4 dereferenceable(4) %42)
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #10
  %268 = load ptr, ptr %41, align 8, !tbaa !5
  %269 = load ptr, ptr %33, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.StackEntry, ptr %269, i32 0, i32 1
  %271 = load i32, ptr %270, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 32, ptr %43) #10
  %272 = load ptr, ptr %31, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.StackEntry, ptr %272, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %44, ptr align 16 %273, i64 16, i1 false), !tbaa.struct !23
  %274 = load ptr, ptr %31, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.StackEntry, ptr %274, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %45, ptr align 16 %275, i64 16, i1 false), !tbaa.struct !23
  %276 = getelementptr inbounds { double, double }, ptr %44, i32 0, i32 0
  %277 = load double, ptr %276, align 16
  %278 = getelementptr inbounds { double, double }, ptr %44, i32 0, i32 1
  %279 = load double, ptr %278, align 8
  %280 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 0
  %281 = load double, ptr %280, align 16
  %282 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 1
  %283 = load double, ptr %282, align 8
  call void @_ZN3JPH5AABoxC2ENS_4Vec3ES1_(ptr noundef nonnull align 16 dereferenceable(32) %43, double %277, double %279, double %281, double %283)
  call void @_ZN3JPH8QuadTree4Node14SetChildBoundsEiRKNS_5AABoxE(ptr noundef nonnull align 4 dereferenceable(124) %268, i32 noundef %271, ptr noundef nonnull align 16 dereferenceable(32) %43)
  call void @llvm.lifetime.end.p0(i64 32, ptr %43) #10
  %284 = load i32, ptr %28, align 4, !tbaa !9
  %285 = add nsw i32 %284, -1
  store i32 %285, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  br label %458

286:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #10
  %287 = load ptr, ptr %31, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.StackEntry, ptr %287, i32 0, i32 2
  %289 = load ptr, ptr %31, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.StackEntry, ptr %289, i32 0, i32 1
  %291 = load i32, ptr %290, align 4, !tbaa !29
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [5 x i32], ptr %288, i64 0, i64 %292
  %294 = load i32, ptr %293, align 4, !tbaa !9
  store i32 %294, ptr %46, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #10
  %295 = load ptr, ptr %31, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.StackEntry, ptr %295, i32 0, i32 2
  %297 = load ptr, ptr %31, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.StackEntry, ptr %297, i32 0, i32 1
  %299 = load i32, ptr %298, align 4, !tbaa !29
  %300 = add nsw i32 %299, 1
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [5 x i32], ptr %296, i64 0, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !9
  store i32 %303, ptr %47, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #10
  %304 = load i32, ptr %47, align 4, !tbaa !9
  %305 = load i32, ptr %46, align 4, !tbaa !9
  %306 = sub nsw i32 %304, %305
  store i32 %306, ptr %48, align 4, !tbaa !9
  %307 = load i32, ptr %48, align 4, !tbaa !9
  %308 = icmp eq i32 %307, 1
  br i1 %308, label %309, label %399

309:                                              ; preds = %286
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #10
  %310 = load ptr, ptr %12, align 8, !tbaa !5
  %311 = load i32, ptr %46, align 4, !tbaa !9
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %310, i64 %312
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %49, ptr align 4 %313, i64 4, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.start.p0(i64 32, ptr %50) #10
  %314 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %51, ptr align 4 %49, i64 4, i1 false), !tbaa.struct !21
  %315 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %51, i32 0, i32 0
  %316 = load i32, ptr %315, align 4
  call void @_ZNK3JPH8QuadTree19GetNodeOrBodyBoundsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEENS0_6NodeIDE(ptr dead_on_unwind writable sret(%"class.JPH::AABox") align 16 %50, ptr noundef nonnull align 64 dereferenceable(81) %66, ptr noundef nonnull align 8 dereferenceable(24) %314, i32 %316)
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #10
  %317 = getelementptr inbounds %"class.JPH::QuadTree", ptr %66, i32 0, i32 0
  %318 = load ptr, ptr %317, align 64, !tbaa !13
  %319 = load ptr, ptr %31, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.StackEntry, ptr %319, i32 0, i32 0
  %321 = load i32, ptr %320, align 16, !tbaa !26
  %322 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %318, i32 noundef %321)
  store ptr %322, ptr %52, align 8, !tbaa !5
  %323 = load ptr, ptr %52, align 8, !tbaa !5
  %324 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %323, i32 0, i32 6
  %325 = load ptr, ptr %31, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.StackEntry, ptr %325, i32 0, i32 1
  %327 = load i32, ptr %326, align 4, !tbaa !29
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [4 x %"class.JPH::QuadTree::AtomicNodeID"], ptr %324, i64 0, i64 %328
  call void @_ZN3JPH8QuadTree12AtomicNodeIDaSERKNS0_6NodeIDE(ptr noundef nonnull align 4 dereferenceable(4) %329, ptr noundef nonnull align 4 dereferenceable(4) %49)
  %330 = load ptr, ptr %52, align 8, !tbaa !5
  %331 = load ptr, ptr %31, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.StackEntry, ptr %331, i32 0, i32 1
  %333 = load i32, ptr %332, align 4, !tbaa !29
  call void @_ZN3JPH8QuadTree4Node14SetChildBoundsEiRKNS_5AABoxE(ptr noundef nonnull align 4 dereferenceable(124) %330, i32 noundef %333, ptr noundef nonnull align 16 dereferenceable(32) %50)
  %334 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  br i1 %334, label %335, label %346

335:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #10
  %336 = getelementptr inbounds %"class.JPH::QuadTree", ptr %66, i32 0, i32 0
  %337 = load ptr, ptr %336, align 64, !tbaa !13
  %338 = call noundef i32 @_ZNK3JPH8QuadTree6NodeID12GetNodeIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  %339 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %337, i32 noundef %338)
  store ptr %339, ptr %53, align 8, !tbaa !5
  %340 = load ptr, ptr %31, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.StackEntry, ptr %340, i32 0, i32 0
  %342 = load i32, ptr %341, align 16, !tbaa !26
  %343 = load ptr, ptr %53, align 8, !tbaa !5
  %344 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %343, i32 0, i32 7
  %345 = call noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4) %344, i32 noundef %342) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #10
  br label %358

346:                                              ; preds = %309
  %347 = load ptr, ptr %11, align 8, !tbaa !5
  %348 = call i32 @_ZNK3JPH8QuadTree6NodeID9GetBodyIDEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  %349 = getelementptr inbounds %"class.JPH::BodyID", ptr %54, i32 0, i32 0
  store i32 %348, ptr %349, align 4
  %350 = load ptr, ptr %31, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.StackEntry, ptr %350, i32 0, i32 0
  %352 = load i32, ptr %351, align 16, !tbaa !26
  %353 = load ptr, ptr %31, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct.StackEntry, ptr %353, i32 0, i32 1
  %355 = load i32, ptr %354, align 4, !tbaa !29
  %356 = getelementptr inbounds %"class.JPH::BodyID", ptr %54, i32 0, i32 0
  %357 = load i32, ptr %356, align 4
  call void @_ZNK3JPH8QuadTree15SetBodyLocationERNS_5ArrayINS0_8TrackingENS_12STLAllocatorIS2_EEEENS_6BodyIDEjj(ptr noundef nonnull align 64 dereferenceable(81) %66, ptr noundef nonnull align 8 dereferenceable(24) %347, i32 %357, i32 noundef %352, i32 noundef %355)
  br label %358

358:                                              ; preds = %346, %335
  call void @llvm.lifetime.start.p0(i64 16, ptr %55) #10
  %359 = load ptr, ptr %31, align 8, !tbaa !5
  %360 = getelementptr inbounds %struct.StackEntry, ptr %359, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %56, ptr align 16 %360, i64 16, i1 false), !tbaa.struct !23
  %361 = getelementptr inbounds %"class.JPH::AABox", ptr %50, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %57, ptr align 16 %361, i64 16, i1 false), !tbaa.struct !23
  %362 = getelementptr inbounds { double, double }, ptr %56, i32 0, i32 0
  %363 = load double, ptr %362, align 16
  %364 = getelementptr inbounds { double, double }, ptr %56, i32 0, i32 1
  %365 = load double, ptr %364, align 8
  %366 = getelementptr inbounds { double, double }, ptr %57, i32 0, i32 0
  %367 = load double, ptr %366, align 16
  %368 = getelementptr inbounds { double, double }, ptr %57, i32 0, i32 1
  %369 = load double, ptr %368, align 8
  %370 = call { double, double } @_ZN3JPH4Vec34sMinES0_S0_(double %363, double %365, double %367, double %369)
  %371 = getelementptr inbounds %"class.JPH::Vec3", ptr %55, i32 0, i32 0
  %372 = getelementptr inbounds %union.anon.1, ptr %371, i32 0, i32 0
  %373 = getelementptr inbounds { double, double }, ptr %372, i32 0, i32 0
  %374 = extractvalue { double, double } %370, 0
  store double %374, ptr %373, align 16
  %375 = getelementptr inbounds { double, double }, ptr %372, i32 0, i32 1
  %376 = extractvalue { double, double } %370, 1
  store double %376, ptr %375, align 8
  %377 = load ptr, ptr %31, align 8, !tbaa !5
  %378 = getelementptr inbounds %struct.StackEntry, ptr %377, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %378, ptr align 16 %55, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %55) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %58) #10
  %379 = load ptr, ptr %31, align 8, !tbaa !5
  %380 = getelementptr inbounds %struct.StackEntry, ptr %379, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %59, ptr align 16 %380, i64 16, i1 false), !tbaa.struct !23
  %381 = getelementptr inbounds %"class.JPH::AABox", ptr %50, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %60, ptr align 16 %381, i64 16, i1 false), !tbaa.struct !23
  %382 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 0
  %383 = load double, ptr %382, align 16
  %384 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 1
  %385 = load double, ptr %384, align 8
  %386 = getelementptr inbounds { double, double }, ptr %60, i32 0, i32 0
  %387 = load double, ptr %386, align 16
  %388 = getelementptr inbounds { double, double }, ptr %60, i32 0, i32 1
  %389 = load double, ptr %388, align 8
  %390 = call { double, double } @_ZN3JPH4Vec34sMaxES0_S0_(double %383, double %385, double %387, double %389)
  %391 = getelementptr inbounds %"class.JPH::Vec3", ptr %58, i32 0, i32 0
  %392 = getelementptr inbounds %union.anon.1, ptr %391, i32 0, i32 0
  %393 = getelementptr inbounds { double, double }, ptr %392, i32 0, i32 0
  %394 = extractvalue { double, double } %390, 0
  store double %394, ptr %393, align 16
  %395 = getelementptr inbounds { double, double }, ptr %392, i32 0, i32 1
  %396 = extractvalue { double, double } %390, 1
  store double %396, ptr %395, align 8
  %397 = load ptr, ptr %31, align 8, !tbaa !5
  %398 = getelementptr inbounds %struct.StackEntry, ptr %397, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %398, ptr align 16 %58, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %58) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %50) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #10
  br label %457

399:                                              ; preds = %286
  %400 = load i32, ptr %48, align 4, !tbaa !9
  %401 = icmp sgt i32 %400, 1
  br i1 %401, label %402, label %456

402:                                              ; preds = %399
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #10
  %403 = load i32, ptr %28, align 4, !tbaa !9
  %404 = add nsw i32 %403, 1
  store i32 %404, ptr %28, align 4, !tbaa !9
  %405 = sext i32 %404 to i64
  %406 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 %405
  store ptr %406, ptr %61, align 8, !tbaa !5
  br label %407

407:                                              ; preds = %402
  %408 = load i32, ptr %28, align 4, !tbaa !9
  %409 = icmp slt i32 %408, 32
  br i1 %409, label %413, label %410

410:                                              ; preds = %407
  %411 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.23, ptr noundef @.str.1, i32 noundef 647)
  br i1 %411, label %412, label %413

412:                                              ; preds = %410
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #10, !srcloc !31
  br label %413

413:                                              ; preds = %412, %410, %407
  br label %414

414:                                              ; preds = %413
  br label %415

415:                                              ; preds = %414
  call void @llvm.lifetime.start.p0(i64 4, ptr %63) #10
  %416 = load ptr, ptr %31, align 8, !tbaa !5
  %417 = getelementptr inbounds %struct.StackEntry, ptr %416, i32 0, i32 3
  %418 = load i32, ptr %417, align 4, !tbaa !30
  %419 = add i32 %418, 1
  store i32 %419, ptr %63, align 4, !tbaa !9
  %420 = load i32, ptr %14, align 4, !tbaa !9
  %421 = load i32, ptr %63, align 4, !tbaa !9
  %422 = icmp ugt i32 %420, %421
  %423 = call noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81) %66, i1 noundef zeroext %422)
  %424 = load ptr, ptr %61, align 8, !tbaa !5
  %425 = getelementptr inbounds %struct.StackEntry, ptr %424, i32 0, i32 0
  store i32 %423, ptr %425, align 16, !tbaa !26
  %426 = load ptr, ptr %61, align 8, !tbaa !5
  %427 = getelementptr inbounds %struct.StackEntry, ptr %426, i32 0, i32 1
  store i32 -1, ptr %427, align 4, !tbaa !29
  %428 = load i32, ptr %63, align 4, !tbaa !9
  %429 = load ptr, ptr %61, align 8, !tbaa !5
  %430 = getelementptr inbounds %struct.StackEntry, ptr %429, i32 0, i32 3
  store i32 %428, ptr %430, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 16, ptr %64) #10
  %431 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0x430C6BF520000000)
  %432 = getelementptr inbounds %"class.JPH::Vec3", ptr %64, i32 0, i32 0
  %433 = getelementptr inbounds %union.anon.1, ptr %432, i32 0, i32 0
  %434 = getelementptr inbounds { double, double }, ptr %433, i32 0, i32 0
  %435 = extractvalue { double, double } %431, 0
  store double %435, ptr %434, align 16
  %436 = getelementptr inbounds { double, double }, ptr %433, i32 0, i32 1
  %437 = extractvalue { double, double } %431, 1
  store double %437, ptr %436, align 8
  %438 = load ptr, ptr %61, align 8, !tbaa !5
  %439 = getelementptr inbounds %struct.StackEntry, ptr %438, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %439, ptr align 16 %64, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %64) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %65) #10
  %440 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0xC30C6BF520000000)
  %441 = getelementptr inbounds %"class.JPH::Vec3", ptr %65, i32 0, i32 0
  %442 = getelementptr inbounds %union.anon.1, ptr %441, i32 0, i32 0
  %443 = getelementptr inbounds { double, double }, ptr %442, i32 0, i32 0
  %444 = extractvalue { double, double } %440, 0
  store double %444, ptr %443, align 16
  %445 = getelementptr inbounds { double, double }, ptr %442, i32 0, i32 1
  %446 = extractvalue { double, double } %440, 1
  store double %446, ptr %445, align 8
  %447 = load ptr, ptr %61, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.StackEntry, ptr %447, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %448, ptr align 16 %65, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %65) #10
  %449 = load ptr, ptr %12, align 8, !tbaa !5
  %450 = load ptr, ptr %19, align 8, !tbaa !5
  %451 = load i32, ptr %46, align 4, !tbaa !9
  %452 = load i32, ptr %47, align 4, !tbaa !9
  %453 = load ptr, ptr %61, align 8, !tbaa !5
  %454 = getelementptr inbounds %struct.StackEntry, ptr %453, i32 0, i32 2
  %455 = getelementptr inbounds [5 x i32], ptr %454, i64 0, i64 0
  call void @_ZN3JPH8QuadTree11sPartition4EPNS0_6NodeIDEPNS_4Vec3EiiPi(ptr noundef %449, ptr noundef %450, i32 noundef %451, i32 noundef %452, ptr noundef %455)
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #10
  br label %456

456:                                              ; preds = %415, %399
  br label %457

457:                                              ; preds = %456, %358
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #10
  br label %458

458:                                              ; preds = %457, %191
  store i32 0, ptr %32, align 4
  br label %459

459:                                              ; preds = %458, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #10
  %460 = load i32, ptr %32, align 4
  switch i32 %460, label %483 [
    i32 0, label %461
    i32 7, label %462
  ]

461:                                              ; preds = %459
  br label %175, !llvm.loop !32

462:                                              ; preds = %459
  %463 = load ptr, ptr %19, align 8, !tbaa !5
  %464 = icmp eq ptr %463, null
  br i1 %464, label %466, label %465

465:                                              ; preds = %462
  call void @_ZN3JPH4Vec3daEPv(ptr noundef %463) #10
  br label %466

466:                                              ; preds = %465, %462
  %467 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %468 = getelementptr inbounds %struct.StackEntry, ptr %467, i32 0, i32 4
  %469 = load ptr, ptr %15, align 8, !tbaa !5
  %470 = getelementptr inbounds %"class.JPH::AABox", ptr %469, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %470, ptr align 16 %468, i64 16, i1 false), !tbaa.struct !23
  %471 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %472 = getelementptr inbounds %struct.StackEntry, ptr %471, i32 0, i32 5
  %473 = load ptr, ptr %15, align 8, !tbaa !5
  %474 = getelementptr inbounds %"class.JPH::AABox", ptr %473, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %474, ptr align 16 %472, i64 16, i1 false), !tbaa.struct !23
  %475 = getelementptr inbounds [32 x %struct.StackEntry], ptr %27, i64 0, i64 0
  %476 = getelementptr inbounds %struct.StackEntry, ptr %475, i32 0, i32 0
  %477 = load i32, ptr %476, align 16, !tbaa !26
  %478 = call i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef %477)
  %479 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %8, i32 0, i32 0
  store i32 %478, ptr %479, align 4
  store i32 1, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #10
  call void @llvm.lifetime.end.p0(i64 2048, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  br label %480

480:                                              ; preds = %466, %88, %69
  %481 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %8, i32 0, i32 0
  %482 = load i32, ptr %481, align 4
  ret i32 %482

483:                                              ; preds = %459
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec34sMinES0_S0_(double, double, double, double) #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec34sMaxES0_S0_(double, double, double, double) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH8QuadTree11sPartition4EPNS0_6NodeIDEPNS_4Vec3EiiPi(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3JPH8QuadTree19GetNodeOrBodyBoundsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEENS0_6NodeIDE(ptr dead_on_unwind noalias writable sret(%"class.JPH::AABox") align 16, ptr noundef nonnull align 64 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(24), i32) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH4Vec3naEm(i64 noundef) #8 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH9IsAlignedIPNS_4Vec3EEEbT_m(ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5AABox9GetCenterEv(ptr noundef nonnull align 16 dereferenceable(32)) #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH4Vec3daEPv(ptr noundef) #9 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { alwaysinline 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 #9 = { alwaysinline 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 #10 = { 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 = !{i64 0, i64 16, !12, i64 16, i64 16, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN3JPH8QuadTreeE", !6, i64 0, !15, i64 8, !16, i64 64, !7, i64 68, !16, i64 76, !18, i64 80}
!15 = !{!"_ZTSN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE5BatchE", !10, i64 0, !10, i64 4, !10, i64 8}
!16 = !{!"_ZTSSt6atomicIjE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!18 = !{!"_ZTSSt6atomicIbE", !19, i64 0}
!19 = !{!"_ZTSSt13__atomic_baseIbE", !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i64 0, i64 4, !9}
!22 = !{i64 2158742562}
!23 = !{i64 0, i64 16, !12}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !10, i64 0}
!27 = !{!"_ZTSZN3JPH8QuadTree9BuildTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERNS1_INS0_8TrackingENS4_IS9_EEEEPNS0_6NodeIDEijRNS_5AABoxEE10StackEntry", !10, i64 0, !10, i64 4, !7, i64 8, !10, i64 28, !28, i64 32, !28, i64 48}
!28 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!29 = !{!27, !10, i64 4}
!30 = !{!27, !10, i64 28}
!31 = !{i64 2158742909}
!32 = distinct !{!32, !25}


; 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.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.1 }
%union.anon.1 = type { <4 x float> }
%struct.StackEntry = type { i32, i32, [5 x i32], i32, %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::QuadTree::NodeID" = type { i32 }
%"class.JPH::QuadTree::AtomicNodeID" = type { %"struct.std::atomic.0" }
%"struct.std::atomic.0" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }

@.str.1 = external hidden unnamed_addr constant [99 x i8], align 1
@_ZN3JPH8QuadTree14cInvalidBoundsE = external dso_local local_unnamed_addr global %"class.JPH::AABox", align 16
@.str.22 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [21 x i8], align 1

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN3JPH8QuadTree6NodeID8sInvalidEv() local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH8QuadTree4Node14SetChildBoundsEiRKNS_5AABoxE(ptr noundef nonnull align 4 dereferenceable(124), i32 noundef, ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5AABoxC2ENS_4Vec3ES1_(ptr noundef nonnull align 16 dereferenceable(32), double, double, double, double) unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132), i32 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81), i1 noundef zeroext) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @_ZN3JPH8QuadTree9BuildTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERNS1_INS0_8TrackingENS4_IS9_EEEEPNS0_6NodeIDEijRNS_5AABoxE(ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, ptr nocapture noundef nonnull writeonly align 16 dereferenceable(32) %6) local_unnamed_addr #4 align 2 {
  %8 = alloca %"class.JPH::AABox", align 16
  %9 = alloca %"class.JPH::AABox", align 16
  %10 = alloca [32 x %struct.StackEntry], align 16
  %11 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %12 = alloca %"class.JPH::AABox", align 16
  %13 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %14 = alloca %"class.JPH::AABox", align 16
  switch i32 %4, label %26 [
    i32 0, label %15
    i32 1, label %17
  ]

15:                                               ; preds = %7
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %6, ptr noundef nonnull align 16 dereferenceable(32) @_ZN3JPH8QuadTree14cInvalidBoundsE, i64 32, i1 false), !tbaa.struct !5
  %16 = tail call i32 @_ZN3JPH8QuadTree6NodeID8sInvalidEv()
  br label %177

17:                                               ; preds = %7
  %18 = tail call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %3)
  br i1 %18, label %19, label %25

19:                                               ; preds = %17
  %20 = load ptr, ptr %0, align 64, !tbaa !9
  %21 = tail call noundef i32 @_ZNK3JPH8QuadTree6NodeID12GetNodeIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %3)
  %22 = tail call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %20, i32 noundef %21)
  %23 = getelementptr inbounds i8, ptr %22, i64 112
  %24 = tail call noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4) %23, i32 noundef -1) #9
  br label %25

25:                                               ; preds = %19, %17
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #9
  %.sroa.0107.0.copyload = load i32, ptr %3, align 4, !tbaa !19
  call void @_ZNK3JPH8QuadTree19GetNodeOrBodyBoundsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEENS0_6NodeIDE(ptr dead_on_unwind nonnull writable sret(%"class.JPH::AABox") align 16 %8, ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 %.sroa.0107.0.copyload)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %6, ptr noundef nonnull align 16 dereferenceable(32) %8, i64 32, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  %.sroa.0134.0.copyload = load i32, ptr %3, align 4, !tbaa !19
  br label %177

26:                                               ; preds = %7
  %27 = sext i32 %4 to i64
  %28 = icmp slt i32 %4, 0
  %29 = shl nsw i64 %27, 4
  %30 = select i1 %28, i64 -1, i64 %29
  %31 = tail call noundef ptr @_ZN3JPH4Vec3naEm(i64 noundef %30)
  %32 = tail call noundef zeroext i1 @_ZN3JPH9IsAlignedIPNS_4Vec3EEEbT_m(ptr noundef %31, i64 noundef 16)
  br i1 %32, label %36, label %33

33:                                               ; preds = %26
  %34 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.1, i32 noundef 551)
  br i1 %34, label %35, label %36

35:                                               ; preds = %33
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !20
  br label %36

36:                                               ; preds = %35, %33, %26
  %37 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %3, i64 %27
  %38 = icmp sgt i32 %4, 0
  br i1 %38, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %36
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %10) #9
  %39 = icmp ne i32 %5, 0
  %40 = call noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81) %0, i1 noundef zeroext %39)
  store i32 %40, ptr %10, align 16, !tbaa !21
  %41 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 -1, ptr %41, align 4, !tbaa !24
  %42 = getelementptr inbounds i8, ptr %10, i64 28
  store i32 0, ptr %42, align 4, !tbaa !25
  %43 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0x430C6BF520000000)
  %44 = extractvalue { double, double } %43, 0
  %45 = extractvalue { double, double } %43, 1
  %46 = getelementptr inbounds i8, ptr %10, i64 32
  store double %44, ptr %46, align 16
  %.sroa.486.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 40
  store double %45, ptr %.sroa.486.0..sroa_idx, align 8, !tbaa !6
  %47 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0xC30C6BF520000000)
  %48 = extractvalue { double, double } %47, 0
  %49 = extractvalue { double, double } %47, 1
  %50 = getelementptr inbounds i8, ptr %10, i64 48
  store double %48, ptr %50, align 16
  %.sroa.484.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 56
  store double %49, ptr %.sroa.484.0..sroa_idx, align 8, !tbaa !6
  %51 = getelementptr inbounds i8, ptr %10, i64 8
  call void @_ZN3JPH8QuadTree11sPartition4EPNS0_6NodeIDEPNS_4Vec3EiiPi(ptr noundef %3, ptr noundef %31, i32 noundef 0, i32 noundef %4, ptr noundef nonnull %51)
  %.sroa.215.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  %52 = getelementptr inbounds i8, ptr %14, i64 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 24
  br label %.outer

.lr.ph:                                           ; preds = %36, %.lr.ph
  %.0146 = phi ptr [ %57, %.lr.ph ], [ %31, %36 ]
  %.0135145 = phi ptr [ %56, %.lr.ph ], [ %3, %36 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #9
  %.sroa.093.0.copyload = load i32, ptr %.0135145, align 4, !tbaa !19
  call void @_ZNK3JPH8QuadTree19GetNodeOrBodyBoundsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEENS0_6NodeIDE(ptr dead_on_unwind nonnull writable sret(%"class.JPH::AABox") align 16 %9, ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 %.sroa.093.0.copyload)
  %53 = call { double, double } @_ZNK3JPH5AABox9GetCenterEv(ptr noundef nonnull align 16 dereferenceable(32) %9)
  %54 = extractvalue { double, double } %53, 0
  %55 = extractvalue { double, double } %53, 1
  store double %54, ptr %.0146, align 16
  %.sroa.495.0..sroa_idx = getelementptr inbounds i8, ptr %.0146, i64 8
  store double %55, ptr %.sroa.495.0..sroa_idx, align 8, !tbaa !6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #9
  %56 = getelementptr inbounds i8, ptr %.0135145, i64 4
  %57 = getelementptr inbounds i8, ptr %.0146, i64 16
  %58 = icmp ult ptr %56, %37
  br i1 %58, label %.lr.ph, label %._crit_edge, !llvm.loop !26

59:                                               ; preds = %.backedge, %.outer
  %60 = load i32, ptr %98, align 4, !tbaa !24
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %98, align 4, !tbaa !24
  %62 = icmp sgt i32 %60, 2
  br i1 %62, label %63, label %102

63:                                               ; preds = %59
  %64 = icmp slt i32 %.0136.ph, 1
  br i1 %64, label %170, label %65

65:                                               ; preds = %63
  %66 = add nsw i32 %.0136.ph, -1
  %67 = zext nneg i32 %66 to i64
  %68 = getelementptr inbounds [32 x %struct.StackEntry], ptr %10, i64 0, i64 %67
  %69 = getelementptr inbounds i8, ptr %68, i64 32
  %.sroa.047.0.copyload = load double, ptr %69, align 16
  %.sroa.248.0..sroa_idx = getelementptr inbounds i8, ptr %68, i64 40
  %.sroa.248.0.copyload = load double, ptr %.sroa.248.0..sroa_idx, align 8, !tbaa !6
  %70 = getelementptr inbounds i8, ptr %97, i64 32
  %.sroa.045.0.copyload = load double, ptr %70, align 16
  %.sroa.246.0..sroa_idx = getelementptr inbounds i8, ptr %97, i64 40
  %.sroa.246.0.copyload = load double, ptr %.sroa.246.0..sroa_idx, align 8, !tbaa !6
  %71 = call { double, double } @_ZN3JPH4Vec34sMinES0_S0_(double %.sroa.047.0.copyload, double %.sroa.248.0.copyload, double %.sroa.045.0.copyload, double %.sroa.246.0.copyload)
  %72 = extractvalue { double, double } %71, 0
  %73 = extractvalue { double, double } %71, 1
  store double %72, ptr %69, align 16
  store double %73, ptr %.sroa.248.0..sroa_idx, align 8, !tbaa !6
  %74 = getelementptr inbounds i8, ptr %68, i64 48
  %.sroa.041.0.copyload = load double, ptr %74, align 16
  %.sroa.242.0..sroa_idx = getelementptr inbounds i8, ptr %68, i64 56
  %.sroa.242.0.copyload = load double, ptr %.sroa.242.0..sroa_idx, align 8, !tbaa !6
  %75 = getelementptr inbounds i8, ptr %97, i64 48
  %.sroa.039.0.copyload = load double, ptr %75, align 16
  %.sroa.240.0..sroa_idx = getelementptr inbounds i8, ptr %97, i64 56
  %.sroa.240.0.copyload = load double, ptr %.sroa.240.0..sroa_idx, align 8, !tbaa !6
  %76 = call { double, double } @_ZN3JPH4Vec34sMaxES0_S0_(double %.sroa.041.0.copyload, double %.sroa.242.0.copyload, double %.sroa.039.0.copyload, double %.sroa.240.0.copyload)
  %77 = extractvalue { double, double } %76, 0
  %78 = extractvalue { double, double } %76, 1
  store double %77, ptr %74, align 16
  store double %78, ptr %.sroa.242.0..sroa_idx, align 8, !tbaa !6
  %79 = load ptr, ptr %0, align 64, !tbaa !9
  %80 = load i32, ptr %97, align 16, !tbaa !21
  %81 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %79, i32 noundef %80)
  %82 = load i32, ptr %68, align 16, !tbaa !21
  %83 = getelementptr inbounds i8, ptr %81, i64 112
  %84 = call noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4) %83, i32 noundef %82) #9
  %85 = load ptr, ptr %0, align 64, !tbaa !9
  %86 = load i32, ptr %68, align 16, !tbaa !21
  %87 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %85, i32 noundef %86)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  %88 = load i32, ptr %97, align 16, !tbaa !21
  %89 = call i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef %88)
  store i32 %89, ptr %11, align 4
  %90 = getelementptr inbounds i8, ptr %87, i64 96
  %91 = getelementptr inbounds i8, ptr %68, i64 4
  %92 = load i32, ptr %91, align 4, !tbaa !24
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [4 x %"class.JPH::QuadTree::AtomicNodeID"], ptr %90, i64 0, i64 %93
  call void @_ZN3JPH8QuadTree12AtomicNodeIDaSERKNS0_6NodeIDE(ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  %95 = load i32, ptr %91, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #9
  %.sroa.034.0.copyload = load double, ptr %70, align 16
  %.sroa.235.0.copyload = load double, ptr %.sroa.246.0..sroa_idx, align 8, !tbaa !6
  %.sroa.032.0.copyload = load double, ptr %75, align 16
  %.sroa.233.0.copyload = load double, ptr %.sroa.240.0..sroa_idx, align 8, !tbaa !6
  call void @_ZN3JPH5AABoxC2ENS_4Vec3ES1_(ptr noundef nonnull align 16 dereferenceable(32) %12, double %.sroa.034.0.copyload, double %.sroa.235.0.copyload, double %.sroa.032.0.copyload, double %.sroa.233.0.copyload)
  call void @_ZN3JPH8QuadTree4Node14SetChildBoundsEiRKNS_5AABoxE(ptr noundef nonnull align 4 dereferenceable(124) %87, i32 noundef %95, ptr noundef nonnull align 16 dereferenceable(32) %12)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #9
  br label %.outer.backedge

.outer.backedge:                                  ; preds = %65, %153
  %.0136.ph.be = phi i32 [ %146, %153 ], [ %66, %65 ]
  br label %.outer

.outer:                                           ; preds = %.outer.backedge, %._crit_edge
  %.0136.ph = phi i32 [ 0, %._crit_edge ], [ %.0136.ph.be, %.outer.backedge ]
  %96 = sext i32 %.0136.ph to i64
  %97 = getelementptr inbounds [32 x %struct.StackEntry], ptr %10, i64 0, i64 %96
  %98 = getelementptr inbounds i8, ptr %97, i64 4
  %99 = getelementptr inbounds i8, ptr %97, i64 8
  %100 = getelementptr inbounds i8, ptr %97, i64 32
  %.sroa.217.0..sroa_idx = getelementptr inbounds i8, ptr %97, i64 40
  %101 = getelementptr inbounds i8, ptr %97, i64 48
  %.sroa.211.0..sroa_idx = getelementptr inbounds i8, ptr %97, i64 56
  br label %59

102:                                              ; preds = %59
  %103 = sext i32 %61 to i64
  %104 = getelementptr inbounds [5 x i32], ptr %99, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !19
  %106 = add nsw i32 %60, 2
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [5 x i32], ptr %99, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !19
  %110 = sub nsw i32 %109, %105
  %111 = icmp eq i32 %110, 1
  br i1 %111, label %112, label %143

112:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #9
  %113 = sext i32 %105 to i64
  %114 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %3, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !19
  store i32 %115, ptr %13, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #9
  call void @_ZNK3JPH8QuadTree19GetNodeOrBodyBoundsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEENS0_6NodeIDE(ptr dead_on_unwind nonnull writable sret(%"class.JPH::AABox") align 16 %14, ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 %115)
  %116 = load ptr, ptr %0, align 64, !tbaa !9
  %117 = load i32, ptr %97, align 16, !tbaa !21
  %118 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %116, i32 noundef %117)
  %119 = getelementptr inbounds i8, ptr %118, i64 96
  %120 = load i32, ptr %98, align 4, !tbaa !24
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [4 x %"class.JPH::QuadTree::AtomicNodeID"], ptr %119, i64 0, i64 %121
  call void @_ZN3JPH8QuadTree12AtomicNodeIDaSERKNS0_6NodeIDE(ptr noundef nonnull align 4 dereferenceable(4) %122, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %123 = load i32, ptr %98, align 4, !tbaa !24
  call void @_ZN3JPH8QuadTree4Node14SetChildBoundsEiRKNS_5AABoxE(ptr noundef nonnull align 4 dereferenceable(124) %118, i32 noundef %123, ptr noundef nonnull align 16 dereferenceable(32) %14)
  %124 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %13)
  br i1 %124, label %125, label %132

125:                                              ; preds = %112
  %126 = load ptr, ptr %0, align 64, !tbaa !9
  %127 = call noundef i32 @_ZNK3JPH8QuadTree6NodeID12GetNodeIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %13)
  %128 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %126, i32 noundef %127)
  %129 = load i32, ptr %97, align 16, !tbaa !21
  %130 = getelementptr inbounds i8, ptr %128, i64 112
  %131 = call noundef i32 @_ZNSt13__atomic_baseIjEaSEj(ptr noundef nonnull align 4 dereferenceable(4) %130, i32 noundef %129) #9
  br label %136

132:                                              ; preds = %112
  %133 = call i32 @_ZNK3JPH8QuadTree6NodeID9GetBodyIDEv(ptr noundef nonnull align 4 dereferenceable(4) %13)
  %134 = load i32, ptr %97, align 16, !tbaa !21
  %135 = load i32, ptr %98, align 4, !tbaa !24
  call void @_ZNK3JPH8QuadTree15SetBodyLocationERNS_5ArrayINS0_8TrackingENS_12STLAllocatorIS2_EEEENS_6BodyIDEjj(ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 %133, i32 noundef %134, i32 noundef %135)
  br label %136

136:                                              ; preds = %132, %125
  %.sroa.016.0.copyload = load double, ptr %100, align 16
  %.sroa.217.0.copyload = load double, ptr %.sroa.217.0..sroa_idx, align 8, !tbaa !6
  %.sroa.014.0.copyload = load double, ptr %14, align 16
  %.sroa.215.0.copyload = load double, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !6
  %137 = call { double, double } @_ZN3JPH4Vec34sMinES0_S0_(double %.sroa.016.0.copyload, double %.sroa.217.0.copyload, double %.sroa.014.0.copyload, double %.sroa.215.0.copyload)
  %138 = extractvalue { double, double } %137, 0
  %139 = extractvalue { double, double } %137, 1
  store double %138, ptr %100, align 16
  store double %139, ptr %.sroa.217.0..sroa_idx, align 8, !tbaa !6
  %.sroa.010.0.copyload = load double, ptr %101, align 16
  %.sroa.211.0.copyload = load double, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !6
  %.sroa.09.0.copyload = load double, ptr %52, align 16
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !6
  %140 = call { double, double } @_ZN3JPH4Vec34sMaxES0_S0_(double %.sroa.010.0.copyload, double %.sroa.211.0.copyload, double %.sroa.09.0.copyload, double %.sroa.2.0.copyload)
  %141 = extractvalue { double, double } %140, 0
  %142 = extractvalue { double, double } %140, 1
  store double %141, ptr %101, align 16
  store double %142, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #9
  br label %.backedge

143:                                              ; preds = %102
  %144 = icmp sgt i32 %110, 1
  br i1 %144, label %145, label %.backedge

.backedge:                                        ; preds = %143, %136
  br label %59

145:                                              ; preds = %143
  %146 = add nsw i32 %.0136.ph, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [32 x %struct.StackEntry], ptr %10, i64 0, i64 %147
  %149 = icmp slt i32 %.0136.ph, 31
  br i1 %149, label %153, label %150

150:                                              ; preds = %145
  %151 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.1, i32 noundef 647)
  br i1 %151, label %152, label %153

152:                                              ; preds = %150
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !28
  br label %153

153:                                              ; preds = %152, %150, %145
  %154 = getelementptr inbounds i8, ptr %97, i64 28
  %155 = load i32, ptr %154, align 4, !tbaa !25
  %156 = add i32 %155, 1
  %157 = icmp ult i32 %156, %5
  %158 = call noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81) %0, i1 noundef zeroext %157)
  store i32 %158, ptr %148, align 16, !tbaa !21
  %159 = getelementptr inbounds i8, ptr %148, i64 4
  store i32 -1, ptr %159, align 4, !tbaa !24
  %160 = getelementptr inbounds i8, ptr %148, i64 28
  store i32 %156, ptr %160, align 4, !tbaa !25
  %161 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0x430C6BF520000000)
  %162 = extractvalue { double, double } %161, 0
  %163 = extractvalue { double, double } %161, 1
  %164 = getelementptr inbounds i8, ptr %148, i64 32
  store double %162, ptr %164, align 16
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %148, i64 40
  store double %163, ptr %.sroa.42.0..sroa_idx, align 8, !tbaa !6
  %165 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef 0xC30C6BF520000000)
  %166 = extractvalue { double, double } %165, 0
  %167 = extractvalue { double, double } %165, 1
  %168 = getelementptr inbounds i8, ptr %148, i64 48
  store double %166, ptr %168, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %148, i64 56
  store double %167, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !6
  %169 = getelementptr inbounds i8, ptr %148, i64 8
  call void @_ZN3JPH8QuadTree11sPartition4EPNS0_6NodeIDEPNS_4Vec3EiiPi(ptr noundef %3, ptr noundef %31, i32 noundef %105, i32 noundef %109, ptr noundef nonnull %169)
  br label %.outer.backedge

170:                                              ; preds = %63
  %171 = icmp eq ptr %31, null
  br i1 %171, label %173, label %172

172:                                              ; preds = %170
  call void @_ZN3JPH4Vec3daEPv(ptr noundef nonnull %31) #9
  br label %173

173:                                              ; preds = %172, %170
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %46, i64 16, i1 false), !tbaa.struct !29
  %174 = getelementptr inbounds i8, ptr %6, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %174, ptr noundef nonnull align 16 dereferenceable(16) %50, i64 16, i1 false), !tbaa.struct !29
  %175 = load i32, ptr %10, align 16, !tbaa !21
  %176 = call i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef %175)
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %10) #9
  br label %177

177:                                              ; preds = %173, %25, %15
  %.sroa.0134.0 = phi i32 [ %16, %15 ], [ %.sroa.0134.0.copyload, %25 ], [ %176, %173 ]
  ret i32 %.sroa.0134.0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec34sMinES0_S0_(double, double, double, double) local_unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec34sMaxES0_S0_(double, double, double, double) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH8QuadTree11sPartition4EPNS0_6NodeIDEPNS_4Vec3EiiPi(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3JPH8QuadTree19GetNodeOrBodyBoundsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEENS0_6NodeIDE(ptr dead_on_unwind noalias writable sret(%"class.JPH::AABox") align 16, ptr noundef nonnull align 64 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(24), i32) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH4Vec3naEm(i64 noundef) local_unnamed_addr #7 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH9IsAlignedIPNS_4Vec3EEEbT_m(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5AABox9GetCenterEv(ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH4Vec3daEPv(ptr noundef) local_unnamed_addr #8 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { alwaysinline 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 #8 = { alwaysinline 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 #9 = { 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 = !{i64 0, i64 16, !6, i64 16, i64 16, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN3JPH8QuadTreeE", !11, i64 0, !12, i64 8, !14, i64 64, !7, i64 68, !14, i64 76, !16, i64 80}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"_ZTSN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE5BatchE", !13, i64 0, !13, i64 4, !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt6atomicIjE", !15, i64 0}
!15 = !{!"_ZTSSt13__atomic_baseIjE", !13, i64 0}
!16 = !{!"_ZTSSt6atomicIbE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIbE", !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!13, !13, i64 0}
!20 = !{i64 2158742562}
!21 = !{!22, !13, i64 0}
!22 = !{!"_ZTSZN3JPH8QuadTree9BuildTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERNS1_INS0_8TrackingENS4_IS9_EEEEPNS0_6NodeIDEijRNS_5AABoxEE10StackEntry", !13, i64 0, !13, i64 4, !7, i64 8, !13, i64 28, !23, i64 32, !23, i64 48}
!23 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!24 = !{!22, !13, i64 4}
!25 = !{!22, !13, i64 28}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{i64 2158742909}
!29 = !{i64 0, i64 16, !6}


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