; 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"

%"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> }
%"struct.JPH::BodyPair" = type { %"class.JPH::BodyID", %"class.JPH::BodyID" }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::UVec4" = type { %union.anon.17 }
%union.anon.17 = type { <2 x i64> }
%"struct.JPH::QuadTree::RootNode" = type { %"struct.std::atomic.0" }
%"struct.std::atomic.0" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = 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.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
@.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.31 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [32 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 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) #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsBodyEv(ptr noundef nonnull align 4 dereferenceable(4)) #4 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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81)) #6 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH8QuadTree18FindCollidingPairsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEEPKNS_6BodyIDEifRNS_18CollisionCollectorINS_8BodyPairENS_36CollisionCollectorTraitsCollideShapeEEERKNS_21ObjectLayerPairFilterE(ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef %2, i32 noundef %3, float noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"struct.JPH::AssertLastParam", align 1
  %17 = alloca %"struct.JPH::AssertLastParam", align 1
  %18 = alloca %"struct.JPH::AssertLastParam", align 1
  %19 = alloca [128 x %"class.JPH::QuadTree::NodeID"], align 16
  %20 = alloca i32, align 4
  %21 = alloca %"class.JPH::BodyID", align 4
  %22 = alloca ptr, align 8
  %23 = alloca %"struct.JPH::AssertLastParam", align 1
  %24 = alloca %"class.JPH::AABox", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %27 = alloca i32, align 4
  %28 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %29 = alloca %"class.JPH::BodyID", align 4
  %30 = alloca ptr, align 8
  %31 = alloca %"struct.JPH::BodyPair", align 8
  %32 = alloca %"class.JPH::BodyID", align 4
  %33 = alloca %"class.JPH::BodyID", align 4
  %34 = alloca ptr, align 8
  %35 = alloca %"struct.JPH::AssertLastParam", align 1
  %36 = alloca %"class.JPH::Vec4", align 16
  %37 = alloca %"class.JPH::Vec4", align 16
  %38 = alloca %"class.JPH::Vec4", align 16
  %39 = alloca %"class.JPH::Vec4", align 16
  %40 = alloca %"class.JPH::Vec4", align 16
  %41 = alloca %"class.JPH::Vec4", align 16
  %42 = alloca %"class.JPH::UVec4", align 16
  %43 = alloca %"class.JPH::Vec4", align 16
  %44 = alloca %"class.JPH::Vec4", align 16
  %45 = alloca %"class.JPH::Vec4", align 16
  %46 = alloca %"class.JPH::Vec4", align 16
  %47 = alloca %"class.JPH::Vec4", align 16
  %48 = alloca %"class.JPH::Vec4", align 16
  %49 = alloca i32, align 4
  %50 = alloca %"class.JPH::UVec4", align 16
  %51 = alloca %"class.JPH::UVec4", align 16
  %52 = alloca %"class.JPH::UVec4", align 16
  %53 = alloca %"class.JPH::UVec4", align 16
  %54 = alloca %"struct.JPH::AssertLastParam", align 1
  %55 = alloca %"struct.JPH::AssertLastParam", align 1
  %56 = alloca %"struct.JPH::AssertLastParam", align 1
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i32 %3, ptr %11, align 4, !tbaa !9
  store float %4, ptr %12, align 4, !tbaa !11
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %57 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81) %57)
  store ptr %58, ptr %15, align 8, !tbaa !5
  br label %59

59:                                               ; preds = %7
  %60 = load ptr, ptr %15, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.JPH::QuadTree::RootNode", ptr %60, i32 0, i32 0
  %62 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %61) #9
  %63 = icmp ne i32 %62, -1
  br i1 %63, label %67, label %64

64:                                               ; preds = %59
  %65 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.31, ptr noundef @.str.1, i32 noundef 1403)
  br i1 %65, label %66, label %67

66:                                               ; preds = %64
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !13
  br label %67

67:                                               ; preds = %66, %64, %59
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %76, label %73

73:                                               ; preds = %70
  %74 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.32, ptr noundef @.str.1, i32 noundef 1406)
  br i1 %74, label %75, label %76

75:                                               ; preds = %73
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !14
  br label %76

76:                                               ; preds = %75, %73, %70
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %85, label %82

82:                                               ; preds = %79
  %83 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.33, ptr noundef @.str.1, i32 noundef 1407)
  br i1 %83, label %84, label %85

84:                                               ; preds = %82
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !15
  br label %85

85:                                               ; preds = %84, %82, %79
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 512, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %322, %87
  %89 = load i32, ptr %20, align 4, !tbaa !9
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %325

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = load i32, ptr %20, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds %"class.JPH::BodyID", ptr %94, i64 %96
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %97, i64 4, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %21)
  %100 = zext i32 %99 to i64
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %100)
  %102 = load ptr, ptr %101, align 8, !tbaa !5
  store ptr %102, ptr %22, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %93
  %104 = load ptr, ptr %22, align 8, !tbaa !5
  %105 = call noundef zeroext i1 @_ZNK3JPH4Body8IsStaticEv(ptr noundef nonnull align 16 dereferenceable(122) %104)
  br i1 %105, label %106, label %109

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

108:                                              ; preds = %106
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !17
  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 32, ptr %24) #9
  %112 = load ptr, ptr %22, align 8, !tbaa !5
  %113 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122) %112)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %113, i64 32, i1 false), !tbaa.struct !18
  %114 = load float, ptr %12, align 4, !tbaa !11
  %115 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %114)
  %116 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %117 = getelementptr inbounds %union.anon.1, ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds { double, double }, ptr %117, i32 0, i32 0
  %119 = extractvalue { double, double } %115, 0
  store double %119, ptr %118, align 16
  %120 = getelementptr inbounds { double, double }, ptr %117, i32 0, i32 1
  %121 = extractvalue { double, double } %115, 1
  store double %121, ptr %120, align 8
  %122 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %123 = load double, ptr %122, align 16
  %124 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %125 = load double, ptr %124, align 8
  call void @_ZN3JPH5AABox8ExpandByENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32) %24, double %123, double %125)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = call i32 @_ZNK3JPH8QuadTree8RootNode9GetNodeIDEv(ptr noundef nonnull align 4 dereferenceable(4) %126)
  %128 = getelementptr inbounds %"class.JPH::QuadTree::NodeID", ptr %26, i32 0, i32 0
  store i32 %127, ptr %128, align 4
  %129 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %19, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %129, ptr align 4 %26, i64 4, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %318, %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  %131 = load i32, ptr %27, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %19, i64 0, i64 %132
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %133, i64 4, i1 false), !tbaa.struct !16
  %134 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsBodyEv(ptr noundef nonnull align 4 dereferenceable(4) %28)
  br i1 %134, label %135, label %173

135:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  %136 = call i32 @_ZNK3JPH8QuadTree6NodeID9GetBodyIDEv(ptr noundef nonnull align 4 dereferenceable(4) %28)
  %137 = getelementptr inbounds %"class.JPH::BodyID", ptr %29, i32 0, i32 0
  store i32 %136, ptr %137, align 4
  %138 = call noundef zeroext i1 @_ZNK3JPH6BodyIDneERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %29)
  br i1 %138, label %139, label %172

139:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %29)
  %142 = zext i32 %141 to i64
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %140, i64 noundef %142)
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  store ptr %144, ptr %30, align 8, !tbaa !5
  %145 = load ptr, ptr %14, align 8, !tbaa !5
  %146 = load ptr, ptr %22, align 8, !tbaa !5
  %147 = call noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122) %146)
  %148 = load ptr, ptr %30, align 8, !tbaa !5
  %149 = call noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122) %148)
  %150 = load ptr, ptr %145, align 8, !tbaa !20
  %151 = getelementptr inbounds ptr, ptr %150, i64 2
  %152 = load ptr, ptr %151, align 8
  %153 = call noundef zeroext i1 %152(ptr noundef nonnull align 8 dereferenceable(8) %145, i16 noundef zeroext %147, i16 noundef zeroext %149)
  br i1 %153, label %154, label %171

154:                                              ; preds = %139
  %155 = load ptr, ptr %22, align 8, !tbaa !5
  %156 = load ptr, ptr %30, align 8, !tbaa !5
  %157 = call noundef zeroext i1 @_ZN3JPH4Body29sFindCollidingPairsCanCollideERKS0_S2_(ptr noundef nonnull align 16 dereferenceable(122) %155, ptr noundef nonnull align 16 dereferenceable(122) %156)
  br i1 %157, label %158, label %171

158:                                              ; preds = %154
  %159 = load ptr, ptr %30, align 8, !tbaa !5
  %160 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122) %159)
  %161 = call noundef zeroext i1 @_ZNK3JPH5AABox8OverlapsERKS0_(ptr noundef nonnull align 16 dereferenceable(32) %24, ptr noundef nonnull align 16 dereferenceable(32) %160)
  br i1 %161, label %162, label %171

162:                                              ; preds = %158
  %163 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %21, i64 4, i1 false), !tbaa.struct !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %29, i64 4, i1 false), !tbaa.struct !16
  %164 = getelementptr inbounds %"class.JPH::BodyID", ptr %32, i32 0, i32 0
  %165 = load i32, ptr %164, align 4
  %166 = getelementptr inbounds %"class.JPH::BodyID", ptr %33, i32 0, i32 0
  %167 = load i32, ptr %166, align 4
  call void @_ZN3JPH8BodyPairC2ENS_6BodyIDES1_(ptr noundef nonnull align 8 dereferenceable(8) %31, i32 %165, i32 %167)
  %168 = load ptr, ptr %163, align 8, !tbaa !20
  %169 = getelementptr inbounds ptr, ptr %168, i64 6
  %170 = load ptr, ptr %169, align 8
  call void %170(ptr noundef nonnull align 8 dereferenceable(24) %163, ptr noundef nonnull align 8 dereferenceable(8) %31)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  br label %171

171:                                              ; preds = %162, %158, %154, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  br label %172

172:                                              ; preds = %171, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %315

173:                                              ; preds = %130
  %174 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %28)
  br i1 %174, label %175, label %314

175:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  %176 = getelementptr inbounds %"class.JPH::QuadTree", ptr %57, i32 0, i32 0
  %177 = load ptr, ptr %176, align 64, !tbaa !22
  %178 = call noundef i32 @_ZNK3JPH8QuadTree6NodeID12GetNodeIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %28)
  %179 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %177, i32 noundef %178)
  store ptr %179, ptr %34, align 8, !tbaa !5
  br label %180

180:                                              ; preds = %175
  %181 = load ptr, ptr %34, align 8, !tbaa !5
  %182 = call noundef zeroext i1 @_ZN3JPH9IsAlignedIPKNS_8QuadTree4NodeEEEbT_m(ptr noundef %181, i64 noundef 64)
  br i1 %182, label %186, label %183

183:                                              ; preds = %180
  %184 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.35, ptr noundef @.str.1, i32 noundef 1450)
  br i1 %184, label %185, label %186

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

186:                                              ; preds = %185, %183, %180
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #9
  %189 = load ptr, ptr %34, align 8, !tbaa !5
  %190 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %189, i32 0, i32 0
  %191 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef %190)
  %192 = getelementptr inbounds %"class.JPH::Vec4", ptr %36, i32 0, i32 0
  %193 = getelementptr inbounds %union.anon, ptr %192, i32 0, i32 0
  %194 = getelementptr inbounds { double, double }, ptr %193, i32 0, i32 0
  %195 = extractvalue { double, double } %191, 0
  store double %195, ptr %194, align 16
  %196 = getelementptr inbounds { double, double }, ptr %193, i32 0, i32 1
  %197 = extractvalue { double, double } %191, 1
  store double %197, ptr %196, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %37) #9
  %198 = load ptr, ptr %34, align 8, !tbaa !5
  %199 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %198, i32 0, i32 1
  %200 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef %199)
  %201 = getelementptr inbounds %"class.JPH::Vec4", ptr %37, i32 0, i32 0
  %202 = getelementptr inbounds %union.anon, ptr %201, i32 0, i32 0
  %203 = getelementptr inbounds { double, double }, ptr %202, i32 0, i32 0
  %204 = extractvalue { double, double } %200, 0
  store double %204, ptr %203, align 16
  %205 = getelementptr inbounds { double, double }, ptr %202, i32 0, i32 1
  %206 = extractvalue { double, double } %200, 1
  store double %206, ptr %205, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %38) #9
  %207 = load ptr, ptr %34, align 8, !tbaa !5
  %208 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %207, i32 0, i32 2
  %209 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef %208)
  %210 = getelementptr inbounds %"class.JPH::Vec4", ptr %38, i32 0, i32 0
  %211 = getelementptr inbounds %union.anon, ptr %210, i32 0, i32 0
  %212 = getelementptr inbounds { double, double }, ptr %211, i32 0, i32 0
  %213 = extractvalue { double, double } %209, 0
  store double %213, ptr %212, align 16
  %214 = getelementptr inbounds { double, double }, ptr %211, i32 0, i32 1
  %215 = extractvalue { double, double } %209, 1
  store double %215, ptr %214, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %39) #9
  %216 = load ptr, ptr %34, align 8, !tbaa !5
  %217 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %216, i32 0, i32 3
  %218 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef %217)
  %219 = getelementptr inbounds %"class.JPH::Vec4", ptr %39, i32 0, i32 0
  %220 = getelementptr inbounds %union.anon, ptr %219, i32 0, i32 0
  %221 = getelementptr inbounds { double, double }, ptr %220, i32 0, i32 0
  %222 = extractvalue { double, double } %218, 0
  store double %222, ptr %221, align 16
  %223 = getelementptr inbounds { double, double }, ptr %220, i32 0, i32 1
  %224 = extractvalue { double, double } %218, 1
  store double %224, ptr %223, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %40) #9
  %225 = load ptr, ptr %34, align 8, !tbaa !5
  %226 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %225, i32 0, i32 4
  %227 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef %226)
  %228 = getelementptr inbounds %"class.JPH::Vec4", ptr %40, i32 0, i32 0
  %229 = getelementptr inbounds %union.anon, ptr %228, i32 0, i32 0
  %230 = getelementptr inbounds { double, double }, ptr %229, i32 0, i32 0
  %231 = extractvalue { double, double } %227, 0
  store double %231, ptr %230, align 16
  %232 = getelementptr inbounds { double, double }, ptr %229, i32 0, i32 1
  %233 = extractvalue { double, double } %227, 1
  store double %233, ptr %232, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %41) #9
  %234 = load ptr, ptr %34, align 8, !tbaa !5
  %235 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %234, i32 0, i32 5
  %236 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef %235)
  %237 = getelementptr inbounds %"class.JPH::Vec4", ptr %41, i32 0, i32 0
  %238 = getelementptr inbounds %union.anon, ptr %237, i32 0, i32 0
  %239 = getelementptr inbounds { double, double }, ptr %238, i32 0, i32 0
  %240 = extractvalue { double, double } %236, 0
  store double %240, ptr %239, align 16
  %241 = getelementptr inbounds { double, double }, ptr %238, i32 0, i32 1
  %242 = extractvalue { double, double } %236, 1
  store double %242, ptr %241, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %42) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %43, ptr align 16 %36, i64 16, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %44, ptr align 16 %37, i64 16, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %45, ptr align 16 %38, i64 16, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %46, ptr align 16 %39, i64 16, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %47, ptr align 16 %40, i64 16, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %48, ptr align 16 %41, i64 16, i1 false), !tbaa.struct !31
  %243 = getelementptr inbounds { double, double }, ptr %43, i32 0, i32 0
  %244 = load double, ptr %243, align 16
  %245 = getelementptr inbounds { double, double }, ptr %43, i32 0, i32 1
  %246 = load double, ptr %245, align 8
  %247 = getelementptr inbounds { double, double }, ptr %44, i32 0, i32 0
  %248 = load double, ptr %247, align 16
  %249 = getelementptr inbounds { double, double }, ptr %44, i32 0, i32 1
  %250 = load double, ptr %249, align 8
  %251 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 0
  %252 = load double, ptr %251, align 16
  %253 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 1
  %254 = load double, ptr %253, align 8
  %255 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 0
  %256 = load double, ptr %255, align 16
  %257 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 1
  %258 = load double, ptr %257, align 8
  %259 = call { i64, i64 } @_ZN3JPH11AABox4VsBoxERKNS_5AABoxENS_4Vec4ES3_S3_S3_S3_S3_(ptr noundef nonnull align 16 dereferenceable(32) %24, double %244, double %246, double %248, double %250, double %252, double %254, double %256, double %258, ptr noundef byval(%"class.JPH::Vec4") align 16 %47, ptr noundef byval(%"class.JPH::Vec4") align 16 %48)
  %260 = getelementptr inbounds %"class.JPH::UVec4", ptr %42, i32 0, i32 0
  %261 = getelementptr inbounds %union.anon.17, ptr %260, i32 0, i32 0
  %262 = getelementptr inbounds { i64, i64 }, ptr %261, i32 0, i32 0
  %263 = extractvalue { i64, i64 } %259, 0
  store i64 %263, ptr %262, align 16
  %264 = getelementptr inbounds { i64, i64 }, ptr %261, i32 0, i32 1
  %265 = extractvalue { i64, i64 } %259, 1
  store i64 %265, ptr %264, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #9
  %266 = call noundef i32 @_ZNK3JPH5UVec410CountTruesEv(ptr noundef nonnull align 16 dereferenceable(16) %42)
  store i32 %266, ptr %49, align 4, !tbaa !9
  %267 = load i32, ptr %49, align 4, !tbaa !9
  %268 = icmp sgt i32 %267, 0
  br i1 %268, label %269, label %313

269:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 16, ptr %50) #9
  %270 = load ptr, ptr %34, align 8, !tbaa !5
  %271 = getelementptr inbounds %"class.JPH::QuadTree::Node", ptr %270, i32 0, i32 6
  %272 = getelementptr inbounds [4 x %"class.JPH::QuadTree::AtomicNodeID"], ptr %271, i64 0, i64 0
  %273 = call { i64, i64 } @_ZN3JPH5UVec416sLoadInt4AlignedEPKj(ptr noundef %272)
  %274 = getelementptr inbounds %"class.JPH::UVec4", ptr %50, i32 0, i32 0
  %275 = getelementptr inbounds %union.anon.17, ptr %274, i32 0, i32 0
  %276 = getelementptr inbounds { i64, i64 }, ptr %275, i32 0, i32 0
  %277 = extractvalue { i64, i64 } %273, 0
  store i64 %277, ptr %276, align 16
  %278 = getelementptr inbounds { i64, i64 }, ptr %275, i32 0, i32 1
  %279 = extractvalue { i64, i64 } %273, 1
  store i64 %279, ptr %278, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %51) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %52, ptr align 16 %42, i64 16, i1 false), !tbaa.struct !31
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %53, ptr align 16 %50, i64 16, i1 false), !tbaa.struct !31
  %280 = getelementptr inbounds { i64, i64 }, ptr %52, i32 0, i32 0
  %281 = load i64, ptr %280, align 16
  %282 = getelementptr inbounds { i64, i64 }, ptr %52, i32 0, i32 1
  %283 = load i64, ptr %282, align 8
  %284 = getelementptr inbounds { i64, i64 }, ptr %53, i32 0, i32 0
  %285 = load i64, ptr %284, align 16
  %286 = getelementptr inbounds { i64, i64 }, ptr %53, i32 0, i32 1
  %287 = load i64, ptr %286, align 8
  %288 = call { i64, i64 } @_ZN3JPH5UVec410sSort4TrueES0_S0_(i64 %281, i64 %283, i64 %285, i64 %287)
  %289 = getelementptr inbounds %"class.JPH::UVec4", ptr %51, i32 0, i32 0
  %290 = getelementptr inbounds %union.anon.17, ptr %289, i32 0, i32 0
  %291 = getelementptr inbounds { i64, i64 }, ptr %290, i32 0, i32 0
  %292 = extractvalue { i64, i64 } %288, 0
  store i64 %292, ptr %291, align 16
  %293 = getelementptr inbounds { i64, i64 }, ptr %290, i32 0, i32 1
  %294 = extractvalue { i64, i64 } %288, 1
  store i64 %294, ptr %293, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %50, ptr align 16 %51, i64 16, i1 false), !tbaa.struct !31
  call void @llvm.lifetime.end.p0(i64 16, ptr %51) #9
  %295 = load i32, ptr %27, align 4, !tbaa !9
  %296 = add nsw i32 %295, 4
  %297 = icmp slt i32 %296, 128
  br i1 %297, label %298, label %305

298:                                              ; preds = %269
  %299 = load i32, ptr %27, align 4, !tbaa !9
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %19, i64 0, i64 %300
  call void @_ZNK3JPH5UVec49StoreInt4EPj(ptr noundef nonnull align 16 dereferenceable(16) %50, ptr noundef %301)
  %302 = load i32, ptr %49, align 4, !tbaa !9
  %303 = load i32, ptr %27, align 4, !tbaa !9
  %304 = add nsw i32 %303, %302
  store i32 %304, ptr %27, align 4, !tbaa !9
  br label %312

305:                                              ; preds = %269
  br label %306

306:                                              ; preds = %305
  %307 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 1480, ptr noundef @.str.18)
  br i1 %307, label %308, label %309

308:                                              ; preds = %306
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !32
  br label %309

309:                                              ; preds = %308, %306
  br label %310

310:                                              ; preds = %309
  br label %311

311:                                              ; preds = %310
  br label %312

312:                                              ; preds = %311, %298
  call void @llvm.lifetime.end.p0(i64 16, ptr %50) #9
  br label %313

313:                                              ; preds = %312, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %42) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %41) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %37) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  br label %314

314:                                              ; preds = %313, %173
  br label %315

315:                                              ; preds = %314, %172
  %316 = load i32, ptr %27, align 4, !tbaa !9
  %317 = add nsw i32 %316, -1
  store i32 %317, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %318

318:                                              ; preds = %315
  %319 = load i32, ptr %27, align 4, !tbaa !9
  %320 = icmp sge i32 %319, 0
  br i1 %320, label %130, label %321, !llvm.loop !33

321:                                              ; preds = %318
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %322

322:                                              ; preds = %321
  %323 = load i32, ptr %20, align 4, !tbaa !9
  %324 = add nsw i32 %323, 1
  store i32 %324, ptr %20, align 4, !tbaa !9
  br label %88, !llvm.loop !35

325:                                              ; preds = %92
  br label %326

326:                                              ; preds = %325
  %327 = load ptr, ptr %15, align 8, !tbaa !5
  %328 = getelementptr inbounds %"struct.JPH::QuadTree::RootNode", ptr %327, i32 0, i32 0
  %329 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %328) #9
  %330 = icmp ne i32 %329, -1
  br i1 %330, label %334, label %331

331:                                              ; preds = %326
  %332 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.31, ptr noundef @.str.1, i32 noundef 1490)
  br i1 %332, label %333, label %334

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

334:                                              ; preds = %333, %331, %326
  br label %335

335:                                              ; preds = %334
  br label %336

336:                                              ; preds = %335
  br label %337

337:                                              ; preds = %336
  %338 = load ptr, ptr %15, align 8, !tbaa !5
  %339 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81) %57)
  %340 = icmp eq ptr %338, %339
  br i1 %340, label %344, label %341

341:                                              ; preds = %337
  %342 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.36, ptr noundef @.str.1, i32 noundef 1491)
  br i1 %342, label %343, label %344

343:                                              ; preds = %341
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !37
  br label %344

344:                                              ; preds = %343, %341, %337
  br label %345

345:                                              ; preds = %344
  br label %346

346:                                              ; preds = %345
  call void @llvm.lifetime.end.p0(i64 512, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox8ExpandByENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32), double, double) #7 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH4Body29sFindCollidingPairsCanCollideERKS0_S2_(ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH5AABox8OverlapsERKS0_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH8BodyPairC2ENS_6BodyIDES1_(ptr noundef nonnull align 8 dereferenceable(8), i32, i32) unnamed_addr #5 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { i64, i64 } @_ZN3JPH11AABox4VsBoxERKNS_5AABoxENS_4Vec4ES3_S3_S3_S3_S3_(ptr noundef nonnull align 16 dereferenceable(32), double, double, double, double, double, double, double, double, ptr noundef byval(%"class.JPH::Vec4") align 16, ptr noundef byval(%"class.JPH::Vec4") align 16) #8

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH5UVec410CountTruesEv(ptr noundef nonnull align 16 dereferenceable(16)) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { i64, i64 } @_ZN3JPH5UVec416sLoadInt4AlignedEPKj(ptr noundef) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { i64, i64 } @_ZN3JPH5UVec410sSort4TrueES0_S0_(i64, i64, i64, i64) #8 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH5UVec49StoreInt4EPj(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef) #3 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 = { 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 #4 = { 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 #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 = { 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 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{i64 2158753938}
!14 = !{i64 2158754296}
!15 = !{i64 2158754646}
!16 = !{i64 0, i64 4, !9}
!17 = !{i64 2158754988}
!18 = !{i64 0, i64 16, !19, i64 16, i64 16, !19}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !8, i64 0}
!22 = !{!23, !6, i64 0}
!23 = !{!"_ZTSN3JPH8QuadTreeE", !6, i64 0, !24, i64 8, !25, i64 64, !7, i64 68, !25, i64 76, !27, i64 80}
!24 = !{!"_ZTSN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE5BatchE", !10, i64 0, !10, i64 4, !10, i64 8}
!25 = !{!"_ZTSSt6atomicIjE", !26, i64 0}
!26 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!27 = !{!"_ZTSSt6atomicIbE", !28, i64 0}
!28 = !{!"_ZTSSt13__atomic_baseIbE", !29, i64 0}
!29 = !{!"bool", !7, i64 0}
!30 = !{i64 2158755357}
!31 = !{i64 0, i64 16, !19}
!32 = !{i64 2158755955}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}
!36 = !{i64 2158756337}
!37 = !{i64 2158756707}


; 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::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> }
%"struct.JPH::BodyPair" = type { %"class.JPH::BodyID", %"class.JPH::BodyID" }
%"class.JPH::UVec4" = type { %union.anon.17 }
%union.anon.17 = type { <2 x i64> }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }

@.str.1 = external hidden unnamed_addr constant [99 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.31 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [32 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 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 #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZNK3JPH8QuadTree8RootNode9GetNodeIDEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 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 #4 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 #4 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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81)) 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 #2 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 #2 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 #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH8QuadTree18FindCollidingPairsERKNS_5ArrayIPNS_4BodyENS_12STLAllocatorIS3_EEEEPKNS_6BodyIDEifRNS_18CollisionCollectorINS_8BodyPairENS_36CollisionCollectorTraitsCollideShapeEEERKNS_21ObjectLayerPairFilterE(ptr noundef nonnull align 64 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef readonly %2, i32 noundef %3, float noundef %4, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) local_unnamed_addr #7 align 2 {
  %8 = alloca [128 x %"class.JPH::QuadTree::NodeID"], align 16
  %9 = alloca %"class.JPH::BodyID", align 4
  %10 = alloca %"class.JPH::AABox", align 16
  %11 = alloca %"class.JPH::QuadTree::NodeID", align 4
  %12 = alloca %"class.JPH::BodyID", align 4
  %13 = alloca %"struct.JPH::BodyPair", align 8
  %14 = alloca %"class.JPH::UVec4", align 16
  %15 = alloca %"class.JPH::Vec4", align 16
  %16 = alloca %"class.JPH::Vec4", align 16
  %17 = alloca %"class.JPH::UVec4", align 16
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81) %0)
  %19 = tail call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %18) #9
  %.not = icmp eq i32 %19, -1
  br i1 %.not, label %20, label %23

20:                                               ; preds = %7
  %21 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.31, ptr noundef nonnull @.str.1, i32 noundef 1403)
  br i1 %21, label %22, label %23

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

23:                                               ; preds = %7, %20, %22
  %.not70 = icmp eq ptr %2, null
  br i1 %.not70, label %24, label %27

24:                                               ; preds = %23
  %25 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.32, ptr noundef nonnull @.str.1, i32 noundef 1406)
  br i1 %25, label %26, label %27

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

27:                                               ; preds = %23, %24, %26
  %28 = icmp sgt i32 %3, 0
  br i1 %28, label %.lr.ph, label %29

29:                                               ; preds = %27
  %30 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.33, ptr noundef nonnull @.str.1, i32 noundef 1407)
  br i1 %30, label %31, label %.thread

31:                                               ; preds = %29
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !7
  br label %.thread

.thread:                                          ; preds = %31, %29
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %8) #9
  br label %._crit_edge

.lr.ph:                                           ; preds = %27
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %8) #9
  %.sroa.416.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  %.sroa.414.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 8
  %32 = getelementptr inbounds i8, ptr %14, i64 8
  %33 = getelementptr inbounds i8, ptr %17, i64 8
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %35

._crit_edge:                                      ; preds = %139, %.thread
  %34 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %18) #9
  %.not71 = icmp eq i32 %34, -1
  br i1 %.not71, label %140, label %143

35:                                               ; preds = %.lr.ph, %139
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %139 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  %36 = getelementptr inbounds %"class.JPH::BodyID", ptr %2, i64 %indvars.iv
  %37 = load i32, ptr %36, align 4, !tbaa !8
  store i32 %37, ptr %9, align 4, !tbaa !8
  %38 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  %39 = zext i32 %38 to i64
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %39)
  %41 = load ptr, ptr %40, align 8, !tbaa !12
  %42 = call noundef zeroext i1 @_ZNK3JPH4Body8IsStaticEv(ptr noundef nonnull align 16 dereferenceable(122) %41)
  br i1 %42, label %43, label %46

43:                                               ; preds = %35
  %44 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.34, ptr noundef nonnull @.str.1, i32 noundef 1416)
  br i1 %44, label %45, label %46

45:                                               ; preds = %43
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !14
  br label %46

46:                                               ; preds = %45, %43, %35
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #9
  %47 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122) %41)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %10, ptr noundef nonnull align 16 dereferenceable(32) %47, i64 32, i1 false), !tbaa.struct !15
  %48 = call { double, double } @_ZN3JPH4Vec310sReplicateEf(float noundef %4)
  %49 = extractvalue { double, double } %48, 0
  %50 = extractvalue { double, double } %48, 1
  call void @_ZN3JPH5AABox8ExpandByENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32) %10, double %49, double %50)
  %51 = call i32 @_ZNK3JPH8QuadTree8RootNode9GetNodeIDEv(ptr noundef nonnull align 4 dereferenceable(4) %18)
  store i32 %51, ptr %8, align 16, !tbaa !8
  br label %52

52:                                               ; preds = %136, %46
  %.067 = phi i32 [ 0, %46 ], [ %137, %136 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  %53 = zext nneg i32 %.067 to i64
  %54 = getelementptr inbounds [128 x %"class.JPH::QuadTree::NodeID"], ptr %8, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !8
  store i32 %55, ptr %11, align 4, !tbaa !8
  %56 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID6IsBodyEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  br i1 %56, label %57, label %81

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #9
  %58 = call i32 @_ZNK3JPH8QuadTree6NodeID9GetBodyIDEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  store i32 %58, ptr %12, align 4
  %59 = call noundef zeroext i1 @_ZNK3JPH6BodyIDneERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %12)
  br i1 %59, label %60, label %80

60:                                               ; preds = %57
  %61 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %12)
  %62 = zext i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %62)
  %64 = load ptr, ptr %63, align 8, !tbaa !12
  %65 = call noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122) %41)
  %66 = call noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122) %64)
  %67 = load ptr, ptr %6, align 8, !tbaa !17
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  %69 = load ptr, ptr %68, align 8
  %70 = call noundef zeroext i1 %69(ptr noundef nonnull align 8 dereferenceable(8) %6, i16 noundef zeroext %65, i16 noundef zeroext %66)
  br i1 %70, label %71, label %80

71:                                               ; preds = %60
  %72 = call noundef zeroext i1 @_ZN3JPH4Body29sFindCollidingPairsCanCollideERKS0_S2_(ptr noundef nonnull align 16 dereferenceable(122) %41, ptr noundef nonnull align 16 dereferenceable(122) %64)
  br i1 %72, label %73, label %80

73:                                               ; preds = %71
  %74 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122) %64)
  %75 = call noundef zeroext i1 @_ZNK3JPH5AABox8OverlapsERKS0_(ptr noundef nonnull align 16 dereferenceable(32) %10, ptr noundef nonnull align 16 dereferenceable(32) %74)
  br i1 %75, label %76, label %80

76:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %.sroa.033.0.copyload = load i32, ptr %9, align 4, !tbaa !8
  %.sroa.032.0.copyload = load i32, ptr %12, align 4, !tbaa !8
  call void @_ZN3JPH8BodyPairC2ENS_6BodyIDES1_(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 %.sroa.033.0.copyload, i32 %.sroa.032.0.copyload)
  %77 = load ptr, ptr %5, align 8, !tbaa !17
  %78 = getelementptr inbounds i8, ptr %77, i64 48
  %79 = load ptr, ptr %78, align 8
  call void %79(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  br label %80

80:                                               ; preds = %60, %71, %73, %76, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #9
  br label %136

81:                                               ; preds = %52
  %82 = call noundef zeroext i1 @_ZNK3JPH8QuadTree6NodeID7IsValidEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  br i1 %82, label %83, label %136

83:                                               ; preds = %81
  %84 = load ptr, ptr %0, align 64, !tbaa !19
  %85 = call noundef i32 @_ZNK3JPH8QuadTree6NodeID12GetNodeIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  %86 = call noundef nonnull align 4 dereferenceable(124) ptr @_ZN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE3GetEj(ptr noundef nonnull align 64 dereferenceable(132) %84, i32 noundef %85)
  %87 = call noundef zeroext i1 @_ZN3JPH9IsAlignedIPKNS_8QuadTree4NodeEEEbT_m(ptr noundef nonnull %86, i64 noundef 64)
  br i1 %87, label %91, label %88

88:                                               ; preds = %83
  %89 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.35, ptr noundef nonnull @.str.1, i32 noundef 1450)
  br i1 %89, label %90, label %91

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

91:                                               ; preds = %90, %88, %83
  %92 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef nonnull %86)
  %93 = extractvalue { double, double } %92, 0
  %94 = extractvalue { double, double } %92, 1
  %95 = getelementptr inbounds i8, ptr %86, i64 16
  %96 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef nonnull %95)
  %97 = extractvalue { double, double } %96, 0
  %98 = extractvalue { double, double } %96, 1
  %99 = getelementptr inbounds i8, ptr %86, i64 32
  %100 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef nonnull %99)
  %101 = extractvalue { double, double } %100, 0
  %102 = extractvalue { double, double } %100, 1
  %103 = getelementptr inbounds i8, ptr %86, i64 48
  %104 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef nonnull %103)
  %105 = extractvalue { double, double } %104, 0
  %106 = extractvalue { double, double } %104, 1
  %107 = getelementptr inbounds i8, ptr %86, i64 64
  %108 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef nonnull %107)
  %109 = extractvalue { double, double } %108, 0
  %110 = extractvalue { double, double } %108, 1
  %111 = getelementptr inbounds i8, ptr %86, i64 80
  %112 = call { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef nonnull %111)
  %113 = extractvalue { double, double } %112, 0
  %114 = extractvalue { double, double } %112, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #9
  store double %109, ptr %15, align 16
  store double %110, ptr %.sroa.416.0..sroa_idx, align 8, !tbaa !16
  store double %113, ptr %16, align 16
  store double %114, ptr %.sroa.414.0..sroa_idx, align 8, !tbaa !16
  %115 = call { i64, i64 } @_ZN3JPH11AABox4VsBoxERKNS_5AABoxENS_4Vec4ES3_S3_S3_S3_S3_(ptr noundef nonnull align 16 dereferenceable(32) %10, double %93, double %94, double %97, double %98, double %101, double %102, double %105, double %106, ptr noundef nonnull byval(%"class.JPH::Vec4") align 16 %15, ptr noundef nonnull byval(%"class.JPH::Vec4") align 16 %16)
  %116 = extractvalue { i64, i64 } %115, 0
  store i64 %116, ptr %14, align 16
  %117 = extractvalue { i64, i64 } %115, 1
  store i64 %117, ptr %32, align 8
  %118 = call noundef i32 @_ZNK3JPH5UVec410CountTruesEv(ptr noundef nonnull align 16 dereferenceable(16) %14)
  %119 = icmp sgt i32 %118, 0
  br i1 %119, label %120, label %135

120:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #9
  %121 = getelementptr inbounds i8, ptr %86, i64 96
  %122 = call { i64, i64 } @_ZN3JPH5UVec416sLoadInt4AlignedEPKj(ptr noundef nonnull %121)
  %123 = extractvalue { i64, i64 } %122, 0
  store i64 %123, ptr %17, align 16
  %124 = extractvalue { i64, i64 } %122, 1
  store i64 %124, ptr %33, align 8
  %.sroa.01.0.copyload = load i64, ptr %14, align 16
  %.sroa.22.0.copyload = load i64, ptr %32, align 8, !tbaa !16
  %125 = call { i64, i64 } @_ZN3JPH5UVec410sSort4TrueES0_S0_(i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload, i64 %123, i64 %124)
  %126 = extractvalue { i64, i64 } %125, 0
  %127 = extractvalue { i64, i64 } %125, 1
  store i64 %126, ptr %17, align 16
  store i64 %127, ptr %33, align 8, !tbaa !16
  %128 = icmp ult i32 %.067, 124
  br i1 %128, label %129, label %131

129:                                              ; preds = %120
  call void @_ZNK3JPH5UVec49StoreInt4EPj(ptr noundef nonnull align 16 dereferenceable(16) %17, ptr noundef nonnull %54)
  %130 = add nuw nsw i32 %118, %.067
  br label %134

131:                                              ; preds = %120
  %132 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 1480, ptr noundef nonnull @.str.18)
  br i1 %132, label %133, label %134

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

134:                                              ; preds = %131, %133, %129
  %.1 = phi i32 [ %130, %129 ], [ %.067, %133 ], [ %.067, %131 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #9
  br label %135

135:                                              ; preds = %134, %91
  %.2 = phi i32 [ %.1, %134 ], [ %.067, %91 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #9
  br label %136

136:                                              ; preds = %81, %135, %80
  %.3 = phi i32 [ %.067, %80 ], [ %.2, %135 ], [ %.067, %81 ]
  %137 = add nsw i32 %.3, -1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  %138 = icmp sgt i32 %.3, 0
  br i1 %138, label %52, label %139, !llvm.loop !29

139:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %35, !llvm.loop !31

140:                                              ; preds = %._crit_edge
  %141 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.31, ptr noundef nonnull @.str.1, i32 noundef 1490)
  br i1 %141, label %142, label %143

142:                                              ; preds = %140
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #9, !srcloc !32
  br label %143

143:                                              ; preds = %._crit_edge, %140, %142
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH8QuadTree14GetCurrentRootEv(ptr noundef nonnull align 64 dereferenceable(81) %0)
  %145 = icmp eq ptr %18, %144
  br i1 %145, label %149, label %146

146:                                              ; preds = %143
  %147 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.1, i32 noundef 1491)
  br i1 %147, label %148, label %149

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

149:                                              ; preds = %148, %146, %143
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %8) #9
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH5AABox8ExpandByENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32), double, double) local_unnamed_addr #7 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH4Body29sFindCollidingPairsCanCollideERKS0_S2_(ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH5AABox8OverlapsERKS0_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH8BodyPairC2ENS_6BodyIDES1_(ptr noundef nonnull align 8 dereferenceable(8), i32, i32) unnamed_addr #5 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec418sLoadFloat4AlignedEPKNS_6Float4E(ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { i64, i64 } @_ZN3JPH11AABox4VsBoxERKNS_5AABoxENS_4Vec4ES3_S3_S3_S3_S3_(ptr noundef nonnull align 16 dereferenceable(32), double, double, double, double, double, double, double, double, ptr noundef byval(%"class.JPH::Vec4") align 16, ptr noundef byval(%"class.JPH::Vec4") align 16) local_unnamed_addr #8

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH5UVec410CountTruesEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { i64, i64 } @_ZN3JPH5UVec416sLoadInt4AlignedEPKj(ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { i64, i64 } @_ZN3JPH5UVec410sSort4TrueES0_S0_(i64, i64, i64, i64) local_unnamed_addr #8 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZNK3JPH5UVec49StoreInt4EPj(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef) local_unnamed_addr #3 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 = { 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 #4 = { 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 #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 = { 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 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 2158753938}
!6 = !{i64 2158754296}
!7 = !{i64 2158754646}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{i64 2158754988}
!15 = !{i64 0, i64 16, !16, i64 16, i64 16, !16}
!16 = !{!10, !10, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !11, i64 0}
!19 = !{!20, !13, i64 0}
!20 = !{!"_ZTSN3JPH8QuadTreeE", !13, i64 0, !21, i64 8, !22, i64 64, !10, i64 68, !22, i64 76, !24, i64 80}
!21 = !{!"_ZTSN3JPH17FixedSizeFreeListINS_8QuadTree4NodeEE5BatchE", !9, i64 0, !9, i64 4, !9, i64 8}
!22 = !{!"_ZTSSt6atomicIjE", !23, i64 0}
!23 = !{!"_ZTSSt13__atomic_baseIjE", !9, i64 0}
!24 = !{!"_ZTSSt6atomicIbE", !25, i64 0}
!25 = !{!"_ZTSSt13__atomic_baseIbE", !26, i64 0}
!26 = !{!"bool", !10, i64 0}
!27 = !{i64 2158755357}
!28 = !{i64 2158755955}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{i64 2158756337}
!33 = !{i64 2158756707}


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