; 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::BodyAccess::Grant" = type { i8 }
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::QuadTree::NodeID" = type { i32 }
%"class.JPH::BodyID" = type { i32 }
%"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" = 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 }
%"struct.JPH::QuadTree::Tracking" = type { %"struct.std::atomic.2", %"struct.std::atomic.4", %"struct.std::atomic.0" }
%"struct.std::atomic.2" = type { %"struct.std::__atomic_base.3" }
%"struct.std::__atomic_base.3" = type { i8 }
%"struct.std::atomic.4" = type { %"struct.std::__atomic_base.5" }
%"struct.std::__atomic_base.5" = type { i16 }
%"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" }
%"struct.JPH::QuadTree::UpdateState" = type { %"class.JPH::QuadTree::NodeID" }

@.str.1 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [263 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [71 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

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local void @_ZN3JPH8QuadTree12AtomicNodeIDaSERKNS0_6NodeIDE(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2 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)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABoxC2Ev(ptr noundef nonnull align 16 dereferenceable(32)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4)) #5 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) #2 align 2

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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81)) #6 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE16AddObjectToBatchERNS3_5BatchEj(ptr noundef nonnull align 64 dereferenceable(132), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH8QuadTree13UpdatePrepareERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERNS1_INS0_8TrackingENS4_IS9_EEEERNS0_11UpdateStateEb(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 nonnull align 4 dereferenceable(4) %3, i1 noundef zeroext %4) #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca %"class.JPH::BodyAccess::Grant", align 1
  %12 = alloca %"struct.JPH::AssertLastParam", align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca [128 x %"class.JPH::QuadTree::NodeID"], align 16
  %19 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %20 = alloca %"struct.JPH::AssertLastParam", align 1
  %21 = alloca i32, align 4
  %22 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %23 = alloca i32, align 4
  %24 = alloca %"class.JPH::BodyID", align 4
  %25 = alloca %"struct.JPH::AssertLastParam", align 1
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %32 = alloca %"struct.JPH::AssertLastParam", align 1
  %33 = alloca i32, align 4
  %34 = alloca %"struct.JPH::AssertLastParam", align 1
  %35 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %36 = alloca i32, align 4
  %37 = alloca %"class.JPH::AABox", align 16
  %38 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %39 = alloca i32, align 4
  %40 = alloca ptr, align 8
  %41 = alloca %"class.JPH::BodyID", align 4
  %42 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %43 = alloca i32, align 4
  %44 = alloca %"class.JPH::QuadTree::NodeID", align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %45 = zext i1 %4 to i8
  store i8 %45, ptr %10, align 1, !tbaa !9
  %46 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #9
  call void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1) %11, i8 noundef zeroext 0, i8 noundef zeroext 1)
  br label %47

47:                                               ; preds = %5
  %48 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 1
  %49 = getelementptr inbounds %"struct.JPH::FixedSizeFreeList<JPH::QuadTree::Node>::Batch", ptr %48, i32 0, i32 2
  %50 = load i32, ptr %49, align 8, !tbaa !11
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %60, label %52

52:                                               ; preds = %47
  %53 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 274)
          to label %54 unwind label %56

54:                                               ; preds = %52
  br i1 %53, label %55, label %60

55:                                               ; preds = %54
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !19
  br label %60

56:                                               ; preds = %52
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %13, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %14, align 4
  br label %387

60:                                               ; preds = %55, %54, %47
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 6
  %64 = call noundef zeroext i1 @_ZNSt6atomicIbEaSEb(ptr noundef nonnull align 1 dereferenceable(1) %63, i1 noundef zeroext false) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %65 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81) %46)
          to label %66 unwind label %98

66:                                               ; preds = %62
  store ptr %65, ptr %15, align 8, !tbaa !5
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.JPH::QuadTree::RootNode", ptr %69, i32 0, i32 0
  %71 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %70) #9
  %72 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 3
  %73 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %72) #9
  invoke void @_ZNK3JPH8QuadTree12ValidateTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERKNS1_INS0_8TrackingENS4_IS9_EEEEjj(ptr noundef nonnull align 64 dereferenceable(81) %46, ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 8 dereferenceable(24) %68, i32 noundef %71, i32 noundef %73)
          to label %74 unwind label %98

74:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %75 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 3
  %76 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %75) #9
  %77 = zext i32 %76 to i64
  %78 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %77, i64 4)
  %79 = extractvalue { i64, i1 } %78, 1
  %80 = extractvalue { i64, i1 } %78, 0
  %81 = select i1 %79, i64 -1, i64 %80
  %82 = invoke noundef ptr @_ZN3JPH8QuadTree6NodeIDnaEm(i64 noundef %81)
          to label %83 unwind label %102

83:                                               ; preds = %74
  store ptr %82, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %84 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %84, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 512, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  %86 = invoke i32 @_ZNK3JPH8QuadTree8RootNode9GetNodeIDEv(ptr noundef nonnull align 4 dereferenceable(4) %85)
          to label %87 unwind label %106

87:                                               ; preds = %83
  %88 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %19, i32 0, i32 0
  store i32 %86, ptr %88, align 4
  %89 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %18, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %89, ptr align 4 %19, i64 4, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %90

90:                                               ; preds = %87
  %91 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %18, i64 0, i64 0
  %92 = invoke noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %91)
          to label %93 unwind label %110

93:                                               ; preds = %90
  br i1 %92, label %114, label %94

94:                                               ; preds = %93
  %95 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 298)
          to label %96 unwind label %110

96:                                               ; preds = %94
  br i1 %95, label %97, label %114

97:                                               ; preds = %96
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !22
  br label %114

98:                                               ; preds = %66, %62
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %13, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %14, align 4
  br label %386

102:                                              ; preds = %74
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %13, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %14, align 4
  br label %385

106:                                              ; preds = %83
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %13, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %384

110:                                              ; preds = %94, %90
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %13, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %14, align 4
  br label %384

114:                                              ; preds = %97, %96, %93
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 0, ptr %21, align 4, !tbaa !21
  br label %117

117:                                              ; preds = %259, %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  %118 = load i32, ptr %21, align 4, !tbaa !21
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %18, i64 0, i64 %119
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %120, i64 4, i1 false), !tbaa.struct !20
  %121 = invoke noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsBodyEv(ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %122 unwind label %152

122:                                              ; preds = %117
  br i1 %121, label %123, label %171

123:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %124 = invoke i32 @_ZNK3JPH8QuadTree6NodeID9GetBodyIDEv(ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %125 unwind label %156

125:                                              ; preds = %123
  %126 = getelementptr inbounds %"class.JPH::BodyID", ptr %24, i32 0, i32 0
  store i32 %124, ptr %126, align 4
  %127 = invoke noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %128 unwind label %156

128:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  store i32 %127, ptr %23, align 4, !tbaa !21
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = load i32, ptr %23, align 4, !tbaa !21
  %132 = zext i32 %131 to i64
  %133 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_8QuadTree8TrackingENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %130, i64 noundef %132)
          to label %134 unwind label %160

134:                                              ; preds = %129
  %135 = getelementptr inbounds %"struct.JPH::QuadTree::Tracking", ptr %133, i32 0, i32 1
  %136 = call noundef zeroext i16 @_ZNKSt13__atomic_baseItEcvtEv(ptr noundef nonnull align 2 dereferenceable(2) %135) #9
  %137 = zext i16 %136 to i32
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = load i32, ptr %23, align 4, !tbaa !21
  %140 = zext i32 %139 to i64
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %138, i64 noundef %140)
          to label %142 unwind label %160

142:                                              ; preds = %134
  %143 = load ptr, ptr %141, align 8, !tbaa !5
  %144 = invoke noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122) %143)
          to label %145 unwind label %160

145:                                              ; preds = %142
  %146 = zext i16 %144 to i32
  %147 = icmp eq i32 %137, %146
  br i1 %147, label %164, label %148

148:                                              ; preds = %145
  %149 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 309)
          to label %150 unwind label %160

150:                                              ; preds = %148
  br i1 %149, label %151, label %164

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

152:                                              ; preds = %117
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %13, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %14, align 4
  br label %287

156:                                              ; preds = %125, %123
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %13, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %170

160:                                              ; preds = %148, %142, %134, %129
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %13, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %14, align 4
  br label %170

164:                                              ; preds = %151, %150, %145
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %167, ptr align 4 %22, i64 4, i1 false), !tbaa.struct !20
  %168 = load ptr, ptr %17, align 8, !tbaa !5
  %169 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %168, i32 1
  store ptr %169, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %256

170:                                              ; preds = %160, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %287

171:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  %172 = invoke noundef i32 @_ZNK3JPH8QuadTree6NodeID12GetNodeIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %173 unwind label %190

173:                                              ; preds = %171
  store i32 %172, ptr %26, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %174 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 0
  %175 = load ptr, ptr %174, align 64, !tbaa !24
  %176 = load i32, ptr %26, align 4, !tbaa !21
  %177 = invoke noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %175, i32 noundef %176)
          to label %178 unwind label %194

178:                                              ; preds = %173
  store ptr %177, ptr %27, align 8, !tbaa !5
  %179 = load ptr, ptr %27, align 8, !tbaa !5
  %180 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %179, i32 0, i32 8
  %181 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %180) #9
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %198, label %183

183:                                              ; preds = %178
  %184 = load i8, ptr %10, align 1, !tbaa !9, !range !25, !noundef !26
  %185 = trunc i8 %184 to i1
  br i1 %185, label %198, label %186

186:                                              ; preds = %183
  %187 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %187, ptr align 4 %22, i64 4, i1 false), !tbaa.struct !20
  %188 = load ptr, ptr %17, align 8, !tbaa !5
  %189 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %188, i32 1
  store ptr %189, ptr %17, align 8, !tbaa !5
  br label %253

190:                                              ; preds = %171
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %13, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %14, align 4
  br label %255

194:                                              ; preds = %247, %173
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %13, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %14, align 4
  br label %254

198:                                              ; preds = %183, %178
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %199 = load ptr, ptr %27, align 8, !tbaa !5
  %200 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %199, i32 0, i32 6
  store ptr %200, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %201 = load ptr, ptr %28, align 8, !tbaa !5
  %202 = getelementptr inbounds [4 x %"class.JPH::QuadTree::AtomicNodeID"], ptr %201, i64 0, i64 0
  store ptr %202, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %203 = load ptr, ptr %28, align 8, !tbaa !5
  %204 = getelementptr inbounds [4 x %"class.JPH::QuadTree::AtomicNodeID"], ptr %203, i64 0, i64 0
  %205 = getelementptr inbounds %"class.JPH::QuadTree::AtomicNodeID", ptr %204, i64 4
  store ptr %205, ptr %30, align 8, !tbaa !5
  br label %206

206:                                              ; preds = %244, %198
  %207 = load ptr, ptr %29, align 8, !tbaa !5
  %208 = load ptr, ptr %30, align 8, !tbaa !5
  %209 = icmp ne ptr %207, %208
  br i1 %209, label %211, label %210

210:                                              ; preds = %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  br label %247

211:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  %212 = load ptr, ptr %29, align 8, !tbaa !5
  %213 = invoke i32 @_ZNK3JPH8QuadTree12AtomicNodeIDcvNS0_6NodeIDEEv(ptr noundef nonnull align 4 dereferenceable(4) %212)
          to label %214 unwind label %227

214:                                              ; preds = %211
  %215 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %31, i32 0, i32 0
  store i32 %213, ptr %215, align 4
  %216 = invoke noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %217 unwind label %227

217:                                              ; preds = %214
  br i1 %216, label %218, label %243

218:                                              ; preds = %217
  %219 = load i32, ptr %21, align 4, !tbaa !21
  %220 = icmp slt i32 %219, 128
  br i1 %220, label %221, label %231

221:                                              ; preds = %218
  %222 = load i32, ptr %21, align 4, !tbaa !21
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %18, i64 0, i64 %223
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %224, ptr align 4 %31, i64 4, i1 false), !tbaa.struct !20
  %225 = load i32, ptr %21, align 4, !tbaa !21
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %21, align 4, !tbaa !21
  br label %242

227:                                              ; preds = %232, %214, %211
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %13, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  br label %254

231:                                              ; preds = %218
  br label %232

232:                                              ; preds = %231
  %233 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 343, ptr noundef @.str.18)
          to label %234 unwind label %227

234:                                              ; preds = %232
  br i1 %233, label %235, label %236

235:                                              ; preds = %234
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !27
  br label %236

236:                                              ; preds = %235, %234
  br label %237

237:                                              ; preds = %236
  br label %238

238:                                              ; preds = %237
  %239 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %239, ptr align 4 %31, i64 4, i1 false), !tbaa.struct !20
  %240 = load ptr, ptr %17, align 8, !tbaa !5
  %241 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %240, i32 1
  store ptr %241, ptr %17, align 8, !tbaa !5
  br label %242

242:                                              ; preds = %238, %221
  br label %243

243:                                              ; preds = %242, %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  br label %244

244:                                              ; preds = %243
  %245 = load ptr, ptr %29, align 8, !tbaa !5
  %246 = getelementptr inbounds %"class.JPH::QuadTree::AtomicNodeID", ptr %245, i32 1
  store ptr %246, ptr %29, align 8, !tbaa !5
  br label %206

247:                                              ; preds = %210
  %248 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 0
  %249 = load ptr, ptr %248, align 64, !tbaa !24
  %250 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 1
  %251 = load i32, ptr %26, align 4, !tbaa !21
  invoke void @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE16AddObjectToBatchERNS3_5BatchEj(ptr noundef nonnull align 64 dereferenceable(132) %249, ptr noundef nonnull align 4 dereferenceable(12) %250, i32 noundef %251)
          to label %252 unwind label %194

252:                                              ; preds = %247
  br label %253

253:                                              ; preds = %252, %186
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  br label %256

254:                                              ; preds = %227, %194
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  br label %255

255:                                              ; preds = %254, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  br label %287

256:                                              ; preds = %253, %166
  %257 = load i32, ptr %21, align 4, !tbaa !21
  %258 = add nsw i32 %257, -1
  store i32 %258, ptr %21, align 4, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %259

259:                                              ; preds = %256
  %260 = load i32, ptr %21, align 4, !tbaa !21
  %261 = icmp sge i32 %260, 0
  br i1 %261, label %117, label %262, !llvm.loop !28

262:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  %263 = load ptr, ptr %17, align 8, !tbaa !5
  %264 = load ptr, ptr %16, align 8, !tbaa !5
  %265 = ptrtoint ptr %263 to i64
  %266 = ptrtoint ptr %264 to i64
  %267 = sub i64 %265, %266
  %268 = sdiv exact i64 %267, 4
  %269 = trunc i64 %268 to i32
  store i32 %269, ptr %33, align 4, !tbaa !21
  br label %270

270:                                              ; preds = %262
  %271 = load i8, ptr %10, align 1, !tbaa !9, !range !25, !noundef !26
  %272 = trunc i8 %271 to i1
  br i1 %272, label %273, label %278

273:                                              ; preds = %270
  %274 = load i32, ptr %33, align 4, !tbaa !21
  %275 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 3
  %276 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %275) #9
  %277 = icmp eq i32 %274, %276
  br i1 %277, label %292, label %283

278:                                              ; preds = %270
  %279 = load i32, ptr %33, align 4, !tbaa !21
  %280 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 3
  %281 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %280) #9
  %282 = icmp ule i32 %279, %281
  br i1 %282, label %292, label %283

283:                                              ; preds = %278, %273
  %284 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.19, ptr noundef @.str.1, i32 noundef 361)
          to label %285 unwind label %288

285:                                              ; preds = %283
  br i1 %284, label %286, label %292

286:                                              ; preds = %285
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !30
  br label %292

287:                                              ; preds = %255, %170, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %383

288:                                              ; preds = %283
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %13, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %14, align 4
  br label %382

292:                                              ; preds = %286, %285, %278, %273
  br label %293

293:                                              ; preds = %292
  br label %294

294:                                              ; preds = %293
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  %295 = load i32, ptr %33, align 4, !tbaa !21
  %296 = icmp ugt i32 %295, 0
  br i1 %296, label %297, label %358

297:                                              ; preds = %294
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  store i32 5, ptr %36, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 32, ptr %37) #9
  invoke void @_ZN3JPH5AABoxC2Ev(ptr noundef nonnull align 16 dereferenceable(32) %37)
          to label %298 unwind label %334

298:                                              ; preds = %297
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #9
  %299 = load ptr, ptr %7, align 8, !tbaa !5
  %300 = load ptr, ptr %8, align 8, !tbaa !5
  %301 = load ptr, ptr %16, align 8, !tbaa !5
  %302 = load i32, ptr %33, align 4, !tbaa !21
  %303 = invoke i32 @_ZN3JPH8QuadTree9BuildTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERNS1_INS0_8TrackingENS4_IS9_EEEEPNS0_6NodeIDEijRNS_5AABoxE(ptr noundef nonnull align 64 dereferenceable(81) %46, ptr noundef nonnull align 8 dereferenceable(24) %299, ptr noundef nonnull align 8 dereferenceable(24) %300, ptr noundef %301, i32 noundef %302, i32 noundef 5, ptr noundef nonnull align 16 dereferenceable(32) %37)
          to label %304 unwind label %338

304:                                              ; preds = %298
  %305 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %38, i32 0, i32 0
  store i32 %303, ptr %305, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %38, i64 4, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #9
  %306 = invoke noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsBodyEv(ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %307 unwind label %334

307:                                              ; preds = %304
  br i1 %306, label %308, label %356

308:                                              ; preds = %307
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #9
  %309 = invoke noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81) %46, i1 noundef zeroext false)
          to label %310 unwind label %342

310:                                              ; preds = %308
  store i32 %309, ptr %39, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #9
  %311 = getelementptr inbounds %"class.JPH::QuadTree", ptr %46, i32 0, i32 0
  %312 = load ptr, ptr %311, align 64, !tbaa !24
  %313 = load i32, ptr %39, align 4, !tbaa !21
  %314 = invoke noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %312, i32 noundef %313)
          to label %315 unwind label %346

315:                                              ; preds = %310
  store ptr %314, ptr %40, align 8, !tbaa !5
  %316 = load ptr, ptr %40, align 8, !tbaa !5
  invoke void @_ZN3JPH8QuadTree4Node14SetChildBoundsEiRKNS_5AABoxE(ptr noundef nonnull align 4 dereferenceable(124) %316, i32 noundef 0, ptr noundef nonnull align 16 dereferenceable(32) %37)
          to label %317 unwind label %346

317:                                              ; preds = %315
  %318 = load ptr, ptr %40, align 8, !tbaa !5
  %319 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %318, i32 0, i32 6
  %320 = getelementptr inbounds [4 x %"class.JPH::QuadTree::AtomicNodeID"], ptr %319, i64 0, i64 0
  invoke void @_ZN3JPH8QuadTree12AtomicNodeIDaSERKNS0_6NodeIDE(ptr noundef nonnull align 4 dereferenceable(4) %320, ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %321 unwind label %346

321:                                              ; preds = %317
  %322 = load ptr, ptr %8, align 8, !tbaa !5
  %323 = invoke i32 @_ZNK3JPH8QuadTree6NodeID9GetBodyIDEv(ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %324 unwind label %346

324:                                              ; preds = %321
  %325 = getelementptr inbounds %"class.JPH::BodyID", ptr %41, i32 0, i32 0
  store i32 %323, ptr %325, align 4
  %326 = load i32, ptr %39, align 4, !tbaa !21
  %327 = getelementptr inbounds %"class.JPH::BodyID", ptr %41, i32 0, i32 0
  %328 = load i32, ptr %327, align 4
  invoke void @_ZNK3JPH8QuadTree15SetBodyLocationERNS_5ArrayINS0_8TrackingENS_12STLAllocatorIS2_EEEENS_6BodyIDEjj(ptr noundef nonnull align 64 dereferenceable(81) %46, ptr noundef nonnull align 8 dereferenceable(24) %322, i32 %328, i32 noundef %326, i32 noundef 0)
          to label %329 unwind label %346

329:                                              ; preds = %324
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  %330 = load i32, ptr %39, align 4, !tbaa !21
  %331 = invoke i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef %330)
          to label %332 unwind label %350

332:                                              ; preds = %329
  %333 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %42, i32 0, i32 0
  store i32 %331, ptr %333, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %42, i64 4, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %356

334:                                              ; preds = %304, %297
  %335 = landingpad { ptr, i32 }
          cleanup
  %336 = extractvalue { ptr, i32 } %335, 0
  store ptr %336, ptr %13, align 8
  %337 = extractvalue { ptr, i32 } %335, 1
  store i32 %337, ptr %14, align 4
  br label %357

338:                                              ; preds = %298
  %339 = landingpad { ptr, i32 }
          cleanup
  %340 = extractvalue { ptr, i32 } %339, 0
  store ptr %340, ptr %13, align 8
  %341 = extractvalue { ptr, i32 } %339, 1
  store i32 %341, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #9
  br label %357

342:                                              ; preds = %308
  %343 = landingpad { ptr, i32 }
          cleanup
  %344 = extractvalue { ptr, i32 } %343, 0
  store ptr %344, ptr %13, align 8
  %345 = extractvalue { ptr, i32 } %343, 1
  store i32 %345, ptr %14, align 4
  br label %355

346:                                              ; preds = %324, %321, %317, %315, %310
  %347 = landingpad { ptr, i32 }
          cleanup
  %348 = extractvalue { ptr, i32 } %347, 0
  store ptr %348, ptr %13, align 8
  %349 = extractvalue { ptr, i32 } %347, 1
  store i32 %349, ptr %14, align 4
  br label %354

350:                                              ; preds = %329
  %351 = landingpad { ptr, i32 }
          cleanup
  %352 = extractvalue { ptr, i32 } %351, 0
  store ptr %352, ptr %13, align 8
  %353 = extractvalue { ptr, i32 } %351, 1
  store i32 %353, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  br label %354

354:                                              ; preds = %350, %346
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #9
  br label %355

355:                                              ; preds = %354, %342
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %357

356:                                              ; preds = %332, %307
  call void @llvm.lifetime.end.p0(i64 32, ptr %37) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  br label %374

357:                                              ; preds = %355, %338, %334
  call void @llvm.lifetime.end.p0(i64 32, ptr %37) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  br label %381

358:                                              ; preds = %294
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #9
  %359 = invoke noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81) %46, i1 noundef zeroext false)
          to label %360 unwind label %365

360:                                              ; preds = %358
  store i32 %359, ptr %43, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #9
  %361 = load i32, ptr %43, align 4, !tbaa !21
  %362 = invoke i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef %361)
          to label %363 unwind label %369

363:                                              ; preds = %360
  %364 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %44, i32 0, i32 0
  store i32 %362, ptr %364, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %44, i64 4, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  br label %374

365:                                              ; preds = %358
  %366 = landingpad { ptr, i32 }
          cleanup
  %367 = extractvalue { ptr, i32 } %366, 0
  store ptr %367, ptr %13, align 8
  %368 = extractvalue { ptr, i32 } %366, 1
  store i32 %368, ptr %14, align 4
  br label %373

369:                                              ; preds = %360
  %370 = landingpad { ptr, i32 }
          cleanup
  %371 = extractvalue { ptr, i32 } %370, 0
  store ptr %371, ptr %13, align 8
  %372 = extractvalue { ptr, i32 } %370, 1
  store i32 %372, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  br label %373

373:                                              ; preds = %369, %365
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  br label %381

374:                                              ; preds = %363, %356
  %375 = load ptr, ptr %16, align 8, !tbaa !5
  %376 = icmp eq ptr %375, null
  br i1 %376, label %378, label %377

377:                                              ; preds = %374
  call void @_ZN3JPH8QuadTree6NodeIDdaEPv(ptr noundef %375) #9
  br label %378

378:                                              ; preds = %377, %374
  %379 = load ptr, ptr %9, align 8, !tbaa !5
  %380 = getelementptr inbounds %"struct.JPH::QuadTree::UpdateState", ptr %379, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %380, ptr align 4 %35, i64 4, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 512, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #9
  ret void

381:                                              ; preds = %373, %357
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  br label %382

382:                                              ; preds = %381, %288
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  br label %383

383:                                              ; preds = %382, %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %384

384:                                              ; preds = %383, %110, %106
  call void @llvm.lifetime.end.p0(i64 512, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %385

385:                                              ; preds = %384, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %386

386:                                              ; preds = %385, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %387

387:                                              ; preds = %386, %56
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #9
  br label %388

388:                                              ; preds = %387
  %389 = load ptr, ptr %13, align 8
  %390 = load i32, ptr %14, align 4
  %391 = insertvalue { ptr, i32 } poison, ptr %389, 0
  %392 = insertvalue { ptr, i32 } %391, i32 %390, 1
  resume { ptr, i32 } %392
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt6atomicIbEaSEb(ptr noundef nonnull align 1 dereferenceable(1), i1 noundef zeroext) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH8QuadTree12ValidateTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERKNS1_INS0_8TrackingENS4_IS9_EEEEjj(ptr noundef nonnull align 64 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) #3 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: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH8QuadTree6NodeIDnaEm(i64 noundef) #8 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNKSt13__atomic_baseItEcvtEv(ptr noundef nonnull align 2 dereferenceable(2)) #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN3JPH8QuadTree9BuildTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERNS1_INS0_8TrackingENS4_IS9_EEEEPNS0_6NodeIDEijRNS_5AABoxE(ptr noundef nonnull align 64 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 16 dereferenceable(32)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { 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 #6 = { 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 #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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !14, i64 16}
!12 = !{!"_ZTSN3JPH8QuadTreeE", !6, i64 0, !13, i64 8, !15, i64 64, !7, i64 68, !15, i64 76, !17, i64 80}
!13 = !{!"_ZTSN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE5BatchE", !14, i64 0, !14, i64 4, !14, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !14, i64 0}
!17 = !{!"_ZTSSt6atomicIbE", !18, i64 0}
!18 = !{!"_ZTSSt13__atomic_baseIbE", !10, i64 0}
!19 = !{i64 2158739610}
!20 = !{i64 0, i64 4, !21}
!21 = !{!14, !14, i64 0}
!22 = !{i64 2158739963}
!23 = !{i64 2158740424}
!24 = !{!12, !6, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{i64 2158741022}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{i64 2158741469}


; 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::BodyAccess::Grant" = type { i8 }
%"class.JPH::QuadTree::NodeID" = type { i32 }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::Vec3" = type { %union.anon.1 }
%union.anon.1 = type { <4 x float> }

@.str.1 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [263 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [71 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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABoxC2Ev(ptr noundef nonnull align 16 dereferenceable(32)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 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 #1 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_8QuadTree8TrackingENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81)) local_unnamed_addr #5 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE16AddObjectToBatchERNS3_5BatchEj(ptr noundef nonnull align 64 dereferenceable(132), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) local_unnamed_addr #3 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 #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH8QuadTree13UpdatePrepareERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERNS1_INS0_8TrackingENS4_IS9_EEEERNS0_11UpdateStateEb(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 nocapture noundef nonnull writeonly align 4 dereferenceable(4) %3, i1 noundef zeroext %4) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.JPH::BodyAccess::Grant", align 1
  %7 = alloca [128 x %"class.JPH::QuadTree::NodeID"], align 16
  %8 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %9 = alloca %"class.JPH::BodyID", align 4
  %10 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %11 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %12 = alloca %"class.JPH::AABox", align 16
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  call void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1) %6, i8 noundef zeroext 0, i8 noundef zeroext 1)
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = load i32, ptr %14, align 16, !tbaa !5
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %23, label %17

17:                                               ; preds = %5
  %18 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 274)
          to label %19 unwind label %21

19:                                               ; preds = %17
  br i1 %18, label %20, label %23

20:                                               ; preds = %19
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !17
  br label %23

21:                                               ; preds = %17
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %228

23:                                               ; preds = %20, %19, %5
  %24 = getelementptr inbounds i8, ptr %0, i64 80
  %25 = call noundef zeroext i1 @_ZNSt6atomicIbEaSEb(ptr noundef nonnull align 1 dereferenceable(1) %24, i1 noundef zeroext false) #7
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81) %0)
  %27 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %26) #7
  %28 = getelementptr inbounds i8, ptr %0, i64 64
  %29 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %28) #7
  invoke void @_ZNK3JPH8QuadTree12ValidateTreeERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEERKNS1_INS0_8TrackingENS4_IS9_EEEEjj(ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %27, i32 noundef %29)
          to label %30 unwind label %43

30:                                               ; preds = %23
  %31 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %28) #7
  %32 = zext i32 %31 to i64
  %33 = shl nuw nsw i64 %32, 2
  %34 = invoke noundef ptr @_ZN3JPH8QuadTree6NodeIDnaEm(i64 noundef %33)
          to label %35 unwind label %45

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %7) #7
  %36 = invoke i32 @_ZNK3JPH8QuadTree8RootNode9GetNodeIDEv(ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %37 unwind label %47

37:                                               ; preds = %35
  store i32 %36, ptr %7, align 16, !tbaa !18
  %38 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %7)
  br i1 %38, label %.preheader, label %39

.preheader:                                       ; preds = %42, %41, %37
  br label %51

39:                                               ; preds = %37
  %40 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 298)
          to label %41 unwind label %49

41:                                               ; preds = %39
  br i1 %40, label %42, label %.preheader

42:                                               ; preds = %41
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !19
  br label %.preheader

43:                                               ; preds = %23
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %228

45:                                               ; preds = %30
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %228

47:                                               ; preds = %35
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %227

49:                                               ; preds = %39
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %227

51:                                               ; preds = %.preheader, %162
  %.077 = phi i32 [ %163, %162 ], [ 0, %.preheader ]
  %.072 = phi ptr [ %.476, %162 ], [ %34, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %52 = zext nneg i32 %.077 to i64
  %53 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %7, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !18
  store i32 %54, ptr %8, align 4, !tbaa !18
  %55 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsBodyEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
  br i1 %55, label %56, label %78

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %57 = invoke i32 @_ZNK3JPH8QuadTree6NodeID9GetBodyIDEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %58 unwind label %74

58:                                               ; preds = %56
  store i32 %57, ptr %9, align 4
  %59 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %60 = zext i32 %59 to i64
  %61 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayINS_8QuadTree8TrackingENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %60)
          to label %62 unwind label %76

62:                                               ; preds = %58
  %63 = getelementptr inbounds i8, ptr %61, i64 2
  %64 = call noundef zeroext i16 @_ZNKSt13__atomic_baseItEcvtEv(ptr noundef nonnull align 2 dereferenceable(2) %63) #7
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %60)
          to label %66 unwind label %76

66:                                               ; preds = %62
  %67 = load ptr, ptr %65, align 8, !tbaa !20
  %68 = call noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122) %67)
  %69 = icmp eq i16 %64, %68
  br i1 %69, label %.sink.split, label %70

70:                                               ; preds = %66
  %71 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 309)
          to label %72 unwind label %76

72:                                               ; preds = %70
  br i1 %71, label %73, label %.sink.split

73:                                               ; preds = %72
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !21
  br label %.sink.split

74:                                               ; preds = %56
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %179

76:                                               ; preds = %70, %62, %58
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %179

78:                                               ; preds = %51
  %79 = invoke noundef i32 @_ZNK3JPH8QuadTree6NodeID12GetNodeIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %80 unwind label %86

80:                                               ; preds = %78
  %81 = load ptr, ptr %0, align 64, !tbaa !22
  %82 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %81, i32 noundef %79)
  %83 = getelementptr inbounds i8, ptr %82, i64 116
  %84 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %83) #7
  %.not = icmp ne i32 %84, 0
  %brmerge = or i1 %.not, %4
  br i1 %brmerge, label %.preheader.preheader, label %.sink.split

.preheader.preheader:                             ; preds = %80
  %.082.ptr = getelementptr inbounds i8, ptr %82, i64 96
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %85 = invoke i32 @_ZNK3JPH8QuadTree12AtomicNodeIDcvNS0_6NodeIDEEv(ptr noundef nonnull align 4 dereferenceable(4) %.082.ptr)
          to label %90 unwind label %99

86:                                               ; preds = %78
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %179

88:                                               ; preds = %159
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %179

90:                                               ; preds = %.preheader.preheader
  store i32 %85, ptr %10, align 4
  %91 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %10)
  br i1 %91, label %92, label %.preheader.1

92:                                               ; preds = %90
  %93 = icmp ult i32 %.077, 128
  br i1 %93, label %94, label %101

94:                                               ; preds = %92
  %95 = zext nneg i32 %.077 to i64
  %96 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %7, i64 0, i64 %95
  %97 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %97, ptr %96, align 4, !tbaa !18
  %98 = add nuw nsw i32 %.077, 1
  br label %.preheader.1

99:                                               ; preds = %147, %.preheader.3, %130, %.preheader.2, %113, %.preheader.1, %101, %.preheader.preheader
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %179

101:                                              ; preds = %92
  %102 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 343, ptr noundef nonnull @.str.18)
          to label %103 unwind label %99

103:                                              ; preds = %101
  br i1 %102, label %104, label %105

104:                                              ; preds = %103
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !23
  br label %105

105:                                              ; preds = %104, %103
  %106 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %106, ptr %.072, align 4, !tbaa !18
  %107 = getelementptr inbounds i8, ptr %.072, i64 4
  br label %.preheader.1

.preheader.1:                                     ; preds = %94, %105, %90
  %.279 = phi i32 [ %98, %94 ], [ %.077, %105 ], [ %.077, %90 ]
  %.274 = phi ptr [ %.072, %94 ], [ %107, %105 ], [ %.072, %90 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %.082.ptr.1 = getelementptr inbounds i8, ptr %82, i64 100
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %108 = invoke i32 @_ZNK3JPH8QuadTree12AtomicNodeIDcvNS0_6NodeIDEEv(ptr noundef nonnull align 4 dereferenceable(4) %.082.ptr.1)
          to label %109 unwind label %99

109:                                              ; preds = %.preheader.1
  store i32 %108, ptr %10, align 4
  %110 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %10)
  br i1 %110, label %111, label %.preheader.2

111:                                              ; preds = %109
  %112 = icmp ult i32 %.279, 128
  br i1 %112, label %120, label %113

113:                                              ; preds = %111
  %114 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 343, ptr noundef nonnull @.str.18)
          to label %115 unwind label %99

115:                                              ; preds = %113
  br i1 %114, label %116, label %117

116:                                              ; preds = %115
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !23
  br label %117

117:                                              ; preds = %116, %115
  %118 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %118, ptr %.274, align 4, !tbaa !18
  %119 = getelementptr inbounds i8, ptr %.274, i64 4
  br label %.preheader.2

120:                                              ; preds = %111
  %121 = zext nneg i32 %.279 to i64
  %122 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %7, i64 0, i64 %121
  %123 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %123, ptr %122, align 4, !tbaa !18
  %124 = add nuw nsw i32 %.279, 1
  br label %.preheader.2

.preheader.2:                                     ; preds = %120, %117, %109
  %.279.1 = phi i32 [ %124, %120 ], [ %.279, %117 ], [ %.279, %109 ]
  %.274.1 = phi ptr [ %.274, %120 ], [ %119, %117 ], [ %.274, %109 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %.082.ptr.2 = getelementptr inbounds i8, ptr %82, i64 104
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %125 = invoke i32 @_ZNK3JPH8QuadTree12AtomicNodeIDcvNS0_6NodeIDEEv(ptr noundef nonnull align 4 dereferenceable(4) %.082.ptr.2)
          to label %126 unwind label %99

126:                                              ; preds = %.preheader.2
  store i32 %125, ptr %10, align 4
  %127 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %10)
  br i1 %127, label %128, label %.preheader.3

128:                                              ; preds = %126
  %129 = icmp ult i32 %.279.1, 128
  br i1 %129, label %137, label %130

130:                                              ; preds = %128
  %131 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 343, ptr noundef nonnull @.str.18)
          to label %132 unwind label %99

132:                                              ; preds = %130
  br i1 %131, label %133, label %134

133:                                              ; preds = %132
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !23
  br label %134

134:                                              ; preds = %133, %132
  %135 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %135, ptr %.274.1, align 4, !tbaa !18
  %136 = getelementptr inbounds i8, ptr %.274.1, i64 4
  br label %.preheader.3

137:                                              ; preds = %128
  %138 = zext nneg i32 %.279.1 to i64
  %139 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %7, i64 0, i64 %138
  %140 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %140, ptr %139, align 4, !tbaa !18
  %141 = add nuw nsw i32 %.279.1, 1
  br label %.preheader.3

.preheader.3:                                     ; preds = %137, %134, %126
  %.279.2 = phi i32 [ %141, %137 ], [ %.279.1, %134 ], [ %.279.1, %126 ]
  %.274.2 = phi ptr [ %.274.1, %137 ], [ %136, %134 ], [ %.274.1, %126 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %.082.ptr.3 = getelementptr inbounds i8, ptr %82, i64 108
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %142 = invoke i32 @_ZNK3JPH8QuadTree12AtomicNodeIDcvNS0_6NodeIDEEv(ptr noundef nonnull align 4 dereferenceable(4) %.082.ptr.3)
          to label %143 unwind label %99

143:                                              ; preds = %.preheader.3
  store i32 %142, ptr %10, align 4
  %144 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %10)
  br i1 %144, label %145, label %159

145:                                              ; preds = %143
  %146 = icmp ult i32 %.279.2, 128
  br i1 %146, label %154, label %147

147:                                              ; preds = %145
  %148 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 343, ptr noundef nonnull @.str.18)
          to label %149 unwind label %99

149:                                              ; preds = %147
  br i1 %148, label %150, label %151

150:                                              ; preds = %149
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !23
  br label %151

151:                                              ; preds = %150, %149
  %152 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %152, ptr %.274.2, align 4, !tbaa !18
  %153 = getelementptr inbounds i8, ptr %.274.2, i64 4
  br label %159

154:                                              ; preds = %145
  %155 = zext nneg i32 %.279.2 to i64
  %156 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %7, i64 0, i64 %155
  %157 = load i32, ptr %10, align 4, !tbaa !18
  store i32 %157, ptr %156, align 4, !tbaa !18
  %158 = add nuw nsw i32 %.279.2, 1
  br label %159

159:                                              ; preds = %154, %151, %143
  %.279.3 = phi i32 [ %158, %154 ], [ %.279.2, %151 ], [ %.279.2, %143 ]
  %.274.3 = phi ptr [ %.274.2, %154 ], [ %153, %151 ], [ %.274.2, %143 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %160 = load ptr, ptr %0, align 64, !tbaa !22
  invoke void @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE16AddObjectToBatchERNS3_5BatchEj(ptr noundef nonnull align 64 dereferenceable(132) %160, ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef %79)
          to label %162 unwind label %88

.sink.split:                                      ; preds = %80, %66, %72, %73
  %.sink = load i32, ptr %8, align 4, !tbaa !18
  store i32 %.sink, ptr %.072, align 4, !tbaa !18
  %161 = getelementptr inbounds i8, ptr %.072, i64 4
  br label %162

162:                                              ; preds = %.sink.split, %159
  %.481 = phi i32 [ %.279.3, %159 ], [ %.077, %.sink.split ]
  %.476 = phi ptr [ %.274.3, %159 ], [ %161, %.sink.split ]
  %163 = add nsw i32 %.481, -1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %164 = icmp sgt i32 %.481, 0
  br i1 %164, label %51, label %165, !llvm.loop !24

165:                                              ; preds = %162
  %166 = ptrtoint ptr %.476 to i64
  %167 = ptrtoint ptr %34 to i64
  %168 = sub i64 %166, %167
  %169 = lshr exact i64 %168, 2
  %170 = trunc i64 %169 to i32
  %171 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %28) #7
  br i1 %4, label %172, label %174

172:                                              ; preds = %165
  %173 = icmp eq i32 %171, %170
  br i1 %173, label %182, label %175

174:                                              ; preds = %165
  %.not93 = icmp ult i32 %171, %170
  br i1 %.not93, label %175, label %182

175:                                              ; preds = %174, %172
  %176 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, i32 noundef 361)
          to label %177 unwind label %180

177:                                              ; preds = %175
  br i1 %176, label %178, label %182

178:                                              ; preds = %177
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !26
  br label %182

179:                                              ; preds = %86, %99, %88, %74, %76
  %.pn90.pn = phi { ptr, i32 } [ %77, %76 ], [ %75, %74 ], [ %87, %86 ], [ %100, %99 ], [ %89, %88 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %227

180:                                              ; preds = %175
  %181 = landingpad { ptr, i32 }
          cleanup
  br label %227

182:                                              ; preds = %178, %177, %174, %172
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %.not94 = icmp eq i32 %170, 0
  br i1 %.not94, label %212, label %183

183:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #7
  invoke void @_ZN3JPH5AABoxC2Ev(ptr noundef nonnull align 16 dereferenceable(32) %12)
          to label %184 unwind label %200

184:                                              ; preds = %183
  %185 = invoke 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 %34, i32 noundef %170, i32 noundef 5, ptr noundef nonnull align 16 dereferenceable(32) %12)
          to label %186 unwind label %202

186:                                              ; preds = %184
  store i32 %185, ptr %11, align 4, !tbaa !18
  %187 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsBodyEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  br i1 %187, label %188, label %210

188:                                              ; preds = %186
  %189 = invoke noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81) %0, i1 noundef zeroext false)
          to label %190 unwind label %204

190:                                              ; preds = %188
  %191 = load ptr, ptr %0, align 64, !tbaa !22
  %192 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %191, i32 noundef %189)
  invoke void @_ZN3JPH8QuadTree4Node14SetChildBoundsEiRKNS_5AABoxE(ptr noundef nonnull align 4 dereferenceable(124) %192, i32 noundef 0, ptr noundef nonnull align 16 dereferenceable(32) %12)
          to label %193 unwind label %206

193:                                              ; preds = %190
  %194 = getelementptr inbounds i8, ptr %192, i64 96
  call void @_ZN3JPH8QuadTree12AtomicNodeIDaSERKNS0_6NodeIDE(ptr noundef nonnull align 4 dereferenceable(4) %194, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %195 = invoke i32 @_ZNK3JPH8QuadTree6NodeID9GetBodyIDEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %196 unwind label %206

196:                                              ; preds = %193
  invoke void @_ZNK3JPH8QuadTree15SetBodyLocationERNS_5ArrayINS0_8TrackingENS_12STLAllocatorIS2_EEEENS_6BodyIDEjj(ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 %195, i32 noundef %189, i32 noundef 0)
          to label %197 unwind label %206

197:                                              ; preds = %196
  %198 = invoke i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef %189)
          to label %199 unwind label %208

199:                                              ; preds = %197
  store i32 %198, ptr %11, align 4, !tbaa !18
  br label %210

200:                                              ; preds = %183
  %201 = landingpad { ptr, i32 }
          cleanup
  br label %211

202:                                              ; preds = %184
  %203 = landingpad { ptr, i32 }
          cleanup
  br label %211

204:                                              ; preds = %188
  %205 = landingpad { ptr, i32 }
          cleanup
  br label %211

206:                                              ; preds = %196, %193, %190
  %207 = landingpad { ptr, i32 }
          cleanup
  br label %211

208:                                              ; preds = %197
  %209 = landingpad { ptr, i32 }
          cleanup
  br label %211

210:                                              ; preds = %199, %186
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  br label %221

211:                                              ; preds = %204, %208, %206, %202, %200
  %.pn97.pn.pn = phi { ptr, i32 } [ %203, %202 ], [ %201, %200 ], [ %205, %204 ], [ %209, %208 ], [ %207, %206 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  br label %226

212:                                              ; preds = %182
  %213 = invoke noundef i32 @_ZN3JPH8QuadTree12AllocateNodeEb(ptr noundef nonnull align 64 dereferenceable(81) %0, i1 noundef zeroext false)
          to label %214 unwind label %217

214:                                              ; preds = %212
  %215 = invoke i32 @_ZN3JPH8QuadTree6NodeID14sFromNodeIndexEj(i32 noundef %213)
          to label %216 unwind label %219

216:                                              ; preds = %214
  store i32 %215, ptr %11, align 4, !tbaa !18
  br label %221

217:                                              ; preds = %212
  %218 = landingpad { ptr, i32 }
          cleanup
  br label %226

219:                                              ; preds = %214
  %220 = landingpad { ptr, i32 }
          cleanup
  br label %226

221:                                              ; preds = %216, %210
  %222 = icmp eq ptr %34, null
  br i1 %222, label %224, label %223

223:                                              ; preds = %221
  call void @_ZN3JPH8QuadTree6NodeIDdaEPv(ptr noundef nonnull %34) #7
  br label %224

224:                                              ; preds = %223, %221
  %225 = load i32, ptr %11, align 4, !tbaa !18
  store i32 %225, ptr %3, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %7) #7
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  ret void

226:                                              ; preds = %217, %219, %211
  %.pn97.pn.pn.pn = phi { ptr, i32 } [ %.pn97.pn.pn, %211 ], [ %220, %219 ], [ %218, %217 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %227

227:                                              ; preds = %179, %226, %180, %49, %47
  %.pn97.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ], [ %.pn90.pn, %179 ], [ %.pn97.pn.pn.pn, %226 ], [ %181, %180 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %7) #7
  br label %228

228:                                              ; preds = %43, %227, %45, %21
  %.pn97.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %22, %21 ], [ %44, %43 ], [ %.pn97.pn.pn.pn.pn.pn.pn, %227 ], [ %46, %45 ]
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  resume { ptr, i32 } %.pn97.pn.pn.pn.pn.pn.pn.pn.pn.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt6atomicIbEaSEb(ptr noundef nonnull align 1 dereferenceable(1), i1 noundef zeroext) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNKSt13__atomic_baseItEcvtEv(ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #1 align 2

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 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 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 #5 = { 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 #6 = { 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 #7 = { 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, !11, i64 16}
!6 = !{!"_ZTSN3JPH8QuadTreeE", !7, i64 0, !10, i64 8, !12, i64 64, !8, i64 68, !12, i64 76, !14, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE5BatchE", !11, i64 0, !11, i64 4, !11, i64 8}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTSSt6atomicIjE", !13, i64 0}
!13 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!14 = !{!"_ZTSSt6atomicIbE", !15, i64 0}
!15 = !{!"_ZTSSt13__atomic_baseIbE", !16, i64 0}
!16 = !{!"bool", !8, i64 0}
!17 = !{i64 2158739610}
!18 = !{!11, !11, i64 0}
!19 = !{i64 2158739963}
!20 = !{!7, !7, i64 0}
!21 = !{i64 2158740424}
!22 = !{!6, !7, i64 0}
!23 = !{i64 2158741022}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{i64 2158741469}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass