; LLVM IR from erincatto/box2d :: src (dynamic_tree)

; 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.b2TreeStats = type { i32, i32 }
%struct.b2Vec2 = type { float, float }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2RayCastInput = type { %struct.b2Vec2, %struct.b2Vec2, float }
%struct.b2DynamicTree = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2TreeNode = type { %struct.b2AABB, i64, %union.anon, %union.anon.0, i16, i16 }
%union.anon = type { i64 }
%union.anon.0 = type { i32 }
%struct.anon = type { i32, i32 }

@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

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

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #3

; 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) #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @b2IsLeaf(ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @b2AABB_Overlaps(<2 x float>, <2 x float>, <2 x float>, <2 x float>) #6

; Function Attrs: nounwind uwtable
define dso_local i64 @b2DynamicTree_RayCast(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #7 {
  %6 = alloca %struct.b2TreeStats, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca %struct.b2Vec2, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca %struct.b2Vec2, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca float, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca %struct.b2AABB, align 4
  %20 = alloca [1024 x i32], align 16
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca %struct.b2RayCastInput, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca %struct.b2AABB, align 4
  %28 = alloca %struct.b2Vec2, align 4
  %29 = alloca %struct.b2Vec2, align 4
  %30 = alloca float, align 4
  %31 = alloca %struct.b2Vec2, align 4
  %32 = alloca float, align 4
  %33 = alloca float, align 4
  %34 = alloca %struct.b2Vec2, align 4
  %35 = alloca %struct.b2Vec2, align 4
  %36 = alloca %struct.b2Vec2, align 4
  %37 = alloca %struct.b2Vec2, align 4
  %38 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i64 %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %6, i8 0, i64 8, i1 false)
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.b2DynamicTree, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 4, !tbaa !11
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %5
  br label %290

44:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.b2RayCastInput, ptr %45, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %46, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.b2RayCastInput, ptr %47, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %48, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %49 = load <2 x float>, ptr %13, align 4
  %50 = call <2 x float> @b2Normalize(<2 x float> %49)
  store <2 x float> %50, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %51 = load <2 x float>, ptr %14, align 4
  %52 = call <2 x float> @b2CrossSV(float noundef 1.000000e+00, <2 x float> %51)
  store <2 x float> %52, ptr %15, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %53 = load <2 x float>, ptr %15, align 4
  %54 = call <2 x float> @b2Abs(<2 x float> %53)
  store <2 x float> %54, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.b2RayCastInput, ptr %55, i32 0, i32 2
  %57 = load float, ptr %56, align 4, !tbaa !17
  store float %57, ptr %17, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %58 = load float, ptr %17, align 4, !tbaa !15
  %59 = load <2 x float>, ptr %12, align 4
  %60 = load <2 x float>, ptr %13, align 4
  %61 = call <2 x float> @b2MulAdd(<2 x float> %59, float noundef %58, <2 x float> %60)
  store <2 x float> %61, ptr %18, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #9
  %62 = getelementptr inbounds %struct.b2AABB, ptr %19, i32 0, i32 0
  %63 = load <2 x float>, ptr %12, align 4
  %64 = load <2 x float>, ptr %18, align 4
  %65 = call <2 x float> @b2Min(<2 x float> %63, <2 x float> %64)
  store <2 x float> %65, ptr %62, align 4
  %66 = getelementptr inbounds %struct.b2AABB, ptr %19, i32 0, i32 1
  %67 = load <2 x float>, ptr %12, align 4
  %68 = load <2 x float>, ptr %18, align 4
  %69 = call <2 x float> @b2Max(<2 x float> %67, <2 x float> %68)
  store <2 x float> %69, ptr %66, align 4
  call void @llvm.lifetime.start.p0(i64 4096, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 0, ptr %21, align 4, !tbaa !20
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.b2DynamicTree, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !21
  %73 = load i32, ptr %21, align 4, !tbaa !20
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %21, align 4, !tbaa !20
  %75 = sext i32 %73 to i64
  %76 = getelementptr inbounds [1024 x i32], ptr %20, i64 0, i64 %75
  store i32 %72, ptr %76, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.b2DynamicTree, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !22
  store ptr %79, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %23) #9
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %80, i64 20, i1 false), !tbaa.struct !23
  br label %81

81:                                               ; preds = %287, %285, %44
  %82 = load i32, ptr %21, align 4, !tbaa !20
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %84, label %288

84:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %85 = load i32, ptr %21, align 4, !tbaa !20
  %86 = add nsw i32 %85, -1
  store i32 %86, ptr %21, align 4, !tbaa !20
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1024 x i32], ptr %20, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !20
  store i32 %89, ptr %24, align 4, !tbaa !20
  %90 = load i32, ptr %24, align 4, !tbaa !20
  %91 = icmp eq i32 %90, -1
  br i1 %91, label %92, label %100

92:                                               ; preds = %84
  br label %93

93:                                               ; preds = %92
  %94 = call i32 @b2InternalAssertFcn(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 1215)
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %97

96:                                               ; preds = %93
  call void @llvm.trap()
  br label %97

97:                                               ; preds = %96, %93
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98
  store i32 2, ptr %25, align 4
  br label %285, !llvm.loop !24

100:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %101 = load ptr, ptr %22, align 8, !tbaa !5
  %102 = load i32, ptr %24, align 4, !tbaa !20
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds %struct.b2TreeNode, ptr %101, i64 %103
  store ptr %104, ptr %26, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.b2TreeStats, ptr %6, i32 0, i32 0
  %106 = load i32, ptr %105, align 4, !tbaa !26
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %105, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #9
  %108 = load ptr, ptr %26, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.b2TreeNode, ptr %108, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 8 %109, i64 16, i1 false), !tbaa.struct !28
  %110 = load ptr, ptr %26, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.b2TreeNode, ptr %110, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !29
  %113 = load i64, ptr %9, align 8, !tbaa !9
  %114 = and i64 %112, %113
  %115 = icmp eq i64 %114, 0
  br i1 %115, label %128, label %116

116:                                              ; preds = %100
  %117 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 0
  %118 = load <2 x float>, ptr %117, align 4
  %119 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 1
  %120 = load <2 x float>, ptr %119, align 4
  %121 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %19, i32 0, i32 0
  %122 = load <2 x float>, ptr %121, align 4
  %123 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %19, i32 0, i32 1
  %124 = load <2 x float>, ptr %123, align 4
  %125 = call zeroext i1 @b2AABB_Overlaps(<2 x float> %118, <2 x float> %120, <2 x float> %122, <2 x float> %124)
  %126 = zext i1 %125 to i32
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %116, %100
  store i32 2, ptr %25, align 4
  br label %284, !llvm.loop !24

129:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %130 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 0
  %131 = load <2 x float>, ptr %130, align 4
  %132 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 1
  %133 = load <2 x float>, ptr %132, align 4
  %134 = call <2 x float> @b2AABB_Center(<2 x float> %131, <2 x float> %133)
  store <2 x float> %134, ptr %28, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %135 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 0
  %136 = load <2 x float>, ptr %135, align 4
  %137 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 1
  %138 = load <2 x float>, ptr %137, align 4
  %139 = call <2 x float> @b2AABB_Extents(<2 x float> %136, <2 x float> %138)
  store <2 x float> %139, ptr %29, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  %140 = load <2 x float>, ptr %12, align 4
  %141 = load <2 x float>, ptr %28, align 4
  %142 = call <2 x float> @b2Sub(<2 x float> %140, <2 x float> %141)
  store <2 x float> %142, ptr %31, align 4
  %143 = load <2 x float>, ptr %15, align 4
  %144 = load <2 x float>, ptr %31, align 4
  %145 = call float @b2Dot(<2 x float> %143, <2 x float> %144)
  %146 = call float @b2AbsFloat(float noundef %145)
  store float %146, ptr %30, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  %147 = load <2 x float>, ptr %16, align 4
  %148 = load <2 x float>, ptr %29, align 4
  %149 = call float @b2Dot(<2 x float> %147, <2 x float> %148)
  store float %149, ptr %32, align 4, !tbaa !15
  %150 = load float, ptr %32, align 4, !tbaa !15
  %151 = load float, ptr %30, align 4, !tbaa !15
  %152 = fcmp olt float %150, %151
  br i1 %152, label %153, label %154

153:                                              ; preds = %129
  store i32 2, ptr %25, align 4
  br label %283, !llvm.loop !24

154:                                              ; preds = %129
  %155 = load ptr, ptr %26, align 8, !tbaa !5
  %156 = call zeroext i1 @b2IsLeaf(ptr noundef %155)
  br i1 %156, label %157, label %198

157:                                              ; preds = %154
  %158 = load float, ptr %17, align 4, !tbaa !15
  %159 = getelementptr inbounds %struct.b2RayCastInput, ptr %23, i32 0, i32 2
  store float %158, ptr %159, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = load i32, ptr %24, align 4, !tbaa !20
  %162 = load ptr, ptr %26, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.b2TreeNode, ptr %162, i32 0, i32 2
  %164 = load i64, ptr %163, align 8, !tbaa !33
  %165 = load ptr, ptr %11, align 8, !tbaa !5
  %166 = call float %160(ptr noundef %23, i32 noundef %161, i64 noundef %164, ptr noundef %165)
  store float %166, ptr %33, align 4, !tbaa !15
  %167 = getelementptr inbounds %struct.b2TreeStats, ptr %6, i32 0, i32 1
  %168 = load i32, ptr %167, align 4, !tbaa !34
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %167, align 4, !tbaa !34
  %170 = load float, ptr %33, align 4, !tbaa !15
  %171 = fcmp oeq float %170, 0.000000e+00
  br i1 %171, label %172, label %173

172:                                              ; preds = %157
  store i32 1, ptr %25, align 4
  br label %195

173:                                              ; preds = %157
  %174 = load float, ptr %33, align 4, !tbaa !15
  %175 = fcmp olt float 0.000000e+00, %174
  br i1 %175, label %176, label %194

176:                                              ; preds = %173
  %177 = load float, ptr %33, align 4, !tbaa !15
  %178 = load float, ptr %17, align 4, !tbaa !15
  %179 = fcmp ole float %177, %178
  br i1 %179, label %180, label %194

180:                                              ; preds = %176
  %181 = load float, ptr %33, align 4, !tbaa !15
  store float %181, ptr %17, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  %182 = load float, ptr %17, align 4, !tbaa !15
  %183 = load <2 x float>, ptr %12, align 4
  %184 = load <2 x float>, ptr %13, align 4
  %185 = call <2 x float> @b2MulAdd(<2 x float> %183, float noundef %182, <2 x float> %184)
  store <2 x float> %185, ptr %34, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %34, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  %186 = getelementptr inbounds %struct.b2AABB, ptr %19, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  %187 = load <2 x float>, ptr %12, align 4
  %188 = load <2 x float>, ptr %18, align 4
  %189 = call <2 x float> @b2Min(<2 x float> %187, <2 x float> %188)
  store <2 x float> %189, ptr %35, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %186, ptr align 4 %35, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  %190 = getelementptr inbounds %struct.b2AABB, ptr %19, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #9
  %191 = load <2 x float>, ptr %12, align 4
  %192 = load <2 x float>, ptr %18, align 4
  %193 = call <2 x float> @b2Max(<2 x float> %191, <2 x float> %192)
  store <2 x float> %193, ptr %36, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %190, ptr align 4 %36, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #9
  br label %194

194:                                              ; preds = %180, %176, %173
  store i32 0, ptr %25, align 4
  br label %195

195:                                              ; preds = %194, %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  %196 = load i32, ptr %25, align 4
  switch i32 %196, label %283 [
    i32 0, label %197
  ]

197:                                              ; preds = %195
  br label %282

198:                                              ; preds = %154
  %199 = load i32, ptr %21, align 4, !tbaa !20
  %200 = icmp slt i32 %199, 1023
  br i1 %200, label %201, label %270

201:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #9
  %202 = load ptr, ptr %22, align 8, !tbaa !5
  %203 = load ptr, ptr %26, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.b2TreeNode, ptr %203, i32 0, i32 2
  %205 = getelementptr inbounds %struct.anon, ptr %204, i32 0, i32 0
  %206 = load i32, ptr %205, align 8, !tbaa !33
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds %struct.b2TreeNode, ptr %202, i64 %207
  %209 = getelementptr inbounds %struct.b2TreeNode, ptr %208, i32 0, i32 0
  %210 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %209, i32 0, i32 0
  %211 = load <2 x float>, ptr %210, align 8
  %212 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %209, i32 0, i32 1
  %213 = load <2 x float>, ptr %212, align 8
  %214 = call <2 x float> @b2AABB_Center(<2 x float> %211, <2 x float> %213)
  store <2 x float> %214, ptr %37, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #9
  %215 = load ptr, ptr %22, align 8, !tbaa !5
  %216 = load ptr, ptr %26, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.b2TreeNode, ptr %216, i32 0, i32 2
  %218 = getelementptr inbounds %struct.anon, ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 4, !tbaa !33
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds %struct.b2TreeNode, ptr %215, i64 %220
  %222 = getelementptr inbounds %struct.b2TreeNode, ptr %221, i32 0, i32 0
  %223 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %222, i32 0, i32 0
  %224 = load <2 x float>, ptr %223, align 8
  %225 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %222, i32 0, i32 1
  %226 = load <2 x float>, ptr %225, align 8
  %227 = call <2 x float> @b2AABB_Center(<2 x float> %224, <2 x float> %226)
  store <2 x float> %227, ptr %38, align 4
  %228 = load <2 x float>, ptr %37, align 4
  %229 = load <2 x float>, ptr %12, align 4
  %230 = call float @b2DistanceSquared(<2 x float> %228, <2 x float> %229)
  %231 = load <2 x float>, ptr %38, align 4
  %232 = load <2 x float>, ptr %12, align 4
  %233 = call float @b2DistanceSquared(<2 x float> %231, <2 x float> %232)
  %234 = fcmp olt float %230, %233
  br i1 %234, label %235, label %252

235:                                              ; preds = %201
  %236 = load ptr, ptr %26, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.b2TreeNode, ptr %236, i32 0, i32 2
  %238 = getelementptr inbounds %struct.anon, ptr %237, i32 0, i32 1
  %239 = load i32, ptr %238, align 4, !tbaa !33
  %240 = load i32, ptr %21, align 4, !tbaa !20
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %21, align 4, !tbaa !20
  %242 = sext i32 %240 to i64
  %243 = getelementptr inbounds [1024 x i32], ptr %20, i64 0, i64 %242
  store i32 %239, ptr %243, align 4, !tbaa !20
  %244 = load ptr, ptr %26, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.b2TreeNode, ptr %244, i32 0, i32 2
  %246 = getelementptr inbounds %struct.anon, ptr %245, i32 0, i32 0
  %247 = load i32, ptr %246, align 8, !tbaa !33
  %248 = load i32, ptr %21, align 4, !tbaa !20
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %21, align 4, !tbaa !20
  %250 = sext i32 %248 to i64
  %251 = getelementptr inbounds [1024 x i32], ptr %20, i64 0, i64 %250
  store i32 %247, ptr %251, align 4, !tbaa !20
  br label %269

252:                                              ; preds = %201
  %253 = load ptr, ptr %26, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.b2TreeNode, ptr %253, i32 0, i32 2
  %255 = getelementptr inbounds %struct.anon, ptr %254, i32 0, i32 0
  %256 = load i32, ptr %255, align 8, !tbaa !33
  %257 = load i32, ptr %21, align 4, !tbaa !20
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %21, align 4, !tbaa !20
  %259 = sext i32 %257 to i64
  %260 = getelementptr inbounds [1024 x i32], ptr %20, i64 0, i64 %259
  store i32 %256, ptr %260, align 4, !tbaa !20
  %261 = load ptr, ptr %26, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.b2TreeNode, ptr %261, i32 0, i32 2
  %263 = getelementptr inbounds %struct.anon, ptr %262, i32 0, i32 1
  %264 = load i32, ptr %263, align 4, !tbaa !33
  %265 = load i32, ptr %21, align 4, !tbaa !20
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %21, align 4, !tbaa !20
  %267 = sext i32 %265 to i64
  %268 = getelementptr inbounds [1024 x i32], ptr %20, i64 0, i64 %267
  store i32 %264, ptr %268, align 4, !tbaa !20
  br label %269

269:                                              ; preds = %252, %235
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #9
  br label %281

270:                                              ; preds = %198
  br label %271

271:                                              ; preds = %270
  %272 = load i32, ptr %21, align 4, !tbaa !20
  %273 = icmp slt i32 %272, 1023
  br i1 %273, label %278, label %274

274:                                              ; preds = %271
  %275 = call i32 @b2InternalAssertFcn(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 1284)
  %276 = icmp ne i32 %275, 0
  br i1 %276, label %277, label %278

277:                                              ; preds = %274
  call void @llvm.trap()
  br label %278

278:                                              ; preds = %277, %274, %271
  br label %279

279:                                              ; preds = %278
  br label %280

280:                                              ; preds = %279
  br label %281

281:                                              ; preds = %280, %269
  br label %282

282:                                              ; preds = %281, %197
  store i32 0, ptr %25, align 4
  br label %283

283:                                              ; preds = %282, %195, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 4, 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 %284

284:                                              ; preds = %283, %128
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %285

285:                                              ; preds = %284, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  %286 = load i32, ptr %25, align 4
  switch i32 %286, label %289 [
    i32 0, label %287
    i32 2, label %81
  ]

287:                                              ; preds = %285
  br label %81, !llvm.loop !24

288:                                              ; preds = %81
  store i32 1, ptr %25, align 4
  br label %289

289:                                              ; preds = %288, %285
  call void @llvm.lifetime.end.p0(i64 20, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 4096, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, 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 @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %290

290:                                              ; preds = %289, %43
  %291 = load i64, ptr %6, align 4
  ret i64 %291
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Normalize(<2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2CrossSV(float noundef, <2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Abs(<2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Min(<2 x float>, <2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Max(<2 x float>, <2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2AABB_Center(<2 x float>, <2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2AABB_Extents(<2 x float>, <2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2AbsFloat(float noundef) #8

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Dot(<2 x float>, <2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Sub(<2 x float>, <2 x float>) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2DistanceSquared(<2 x float>, <2 x float>) #6

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "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 uwtable "min-legal-vector-width"="64" "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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 12}
!12 = !{!"b2DynamicTree", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !13, i64 64}
!13 = !{!"int", !7, i64 0}
!14 = !{i64 0, i64 4, !15, i64 4, i64 4, !15}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!18, !16, i64 16}
!18 = !{!"b2RayCastInput", !19, i64 0, !19, i64 8, !16, i64 16}
!19 = !{!"b2Vec2", !16, i64 0, !16, i64 4}
!20 = !{!13, !13, i64 0}
!21 = !{!12, !13, i64 8}
!22 = !{!12, !6, i64 0}
!23 = !{i64 0, i64 4, !15, i64 4, i64 4, !15, i64 8, i64 4, !15, i64 12, i64 4, !15, i64 16, i64 4, !15}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !13, i64 0}
!27 = !{!"b2TreeStats", !13, i64 0, !13, i64 4}
!28 = !{i64 0, i64 4, !15, i64 4, i64 4, !15, i64 8, i64 4, !15, i64 12, i64 4, !15}
!29 = !{!30, !10, i64 16}
!30 = !{!"b2TreeNode", !31, i64 0, !10, i64 16, !7, i64 24, !7, i64 32, !32, i64 36, !32, i64 38}
!31 = !{!"b2AABB", !19, i64 0, !19, i64 8}
!32 = !{!"short", !7, i64 0}
!33 = !{!7, !7, i64 0}
!34 = !{!27, !13, i64 4}


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

%struct.b2RayCastInput = type { %struct.b2Vec2, %struct.b2Vec2, float }
%struct.b2Vec2 = type { float, float }
%struct.b2TreeNode = type { %struct.b2AABB, i64, %union.anon, %union.anon.0, i16, i16 }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%union.anon = type { i64 }
%union.anon.0 = type { i32 }

@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [36 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

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #2

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @b2IsLeaf(ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @b2AABB_Overlaps(<2 x float>, <2 x float>, <2 x float>, <2 x float>) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local i64 @b2DynamicTree_RayCast(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i64 noundef %2, ptr nocapture noundef readonly %3, ptr noundef %4) local_unnamed_addr #6 {
  %6 = alloca [1024 x i32], align 16
  %7 = alloca %struct.b2RayCastInput, align 4
  %8 = getelementptr inbounds i8, ptr %0, i64 12
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %100, label %11

11:                                               ; preds = %5
  %.sroa.060.0.copyload = load <2 x float>, ptr %1, align 4
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.057.0.copyload = load <2 x float>, ptr %12, align 4
  %13 = tail call <2 x float> @b2Normalize(<2 x float> %.sroa.057.0.copyload)
  %14 = tail call <2 x float> @b2CrossSV(float noundef 1.000000e+00, <2 x float> %13)
  %15 = tail call <2 x float> @b2Abs(<2 x float> %14)
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load float, ptr %16, align 4, !tbaa !11
  %18 = tail call <2 x float> @b2MulAdd(<2 x float> %.sroa.060.0.copyload, float noundef %17, <2 x float> %.sroa.057.0.copyload)
  %19 = tail call <2 x float> @b2Min(<2 x float> %.sroa.060.0.copyload, <2 x float> %18)
  %20 = tail call <2 x float> @b2Max(<2 x float> %.sroa.060.0.copyload, <2 x float> %18)
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %6) #8
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = load i32, ptr %21, align 8, !tbaa !15
  store i32 %22, ptr %6, align 16, !tbaa !16
  %23 = load ptr, ptr %0, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %7) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %7, ptr noundef nonnull align 4 dereferenceable(20) %1, i64 20, i1 false), !tbaa.struct !18
  %24 = getelementptr inbounds i8, ptr %7, i64 16
  br label %25

25:                                               ; preds = %11, %94
  %.sroa.079.0116 = phi i32 [ 0, %11 ], [ %.sroa.079.1, %94 ]
  %.sroa.4.0115 = phi i32 [ 0, %11 ], [ %.sroa.4.4, %94 ]
  %.0114 = phi float [ %17, %11 ], [ %.6, %94 ]
  %.sroa.5.0113 = phi <2 x float> [ %20, %11 ], [ %.sroa.5.6, %94 ]
  %.sroa.044.0112 = phi <2 x float> [ %19, %11 ], [ %.sroa.044.6, %94 ]
  %.083111 = phi i32 [ 1, %11 ], [ %.588, %94 ]
  %26 = add nsw i32 %.083111, -1
  %27 = zext nneg i32 %26 to i64
  %28 = getelementptr inbounds [1024 x i32], ptr %6, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !16
  %30 = icmp eq i32 %29, -1
  br i1 %30, label %31, label %34

31:                                               ; preds = %25
  %32 = call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 1215) #8
  %.not96 = icmp eq i32 %32, 0
  br i1 %.not96, label %94, label %33, !llvm.loop !20

33:                                               ; preds = %31
  call void @llvm.trap()
  unreachable

34:                                               ; preds = %25
  %35 = sext i32 %29 to i64
  %36 = getelementptr inbounds %struct.b2TreeNode, ptr %23, i64 %35
  %37 = add nsw i32 %.sroa.079.0116, 1
  %.sroa.013.0.copyload = load <2 x float>, ptr %36, align 8
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %36, i64 8
  %.sroa.6.0.copyload = load <2 x float>, ptr %.sroa.6.0..sroa_idx, align 8
  %38 = getelementptr inbounds i8, ptr %36, i64 16
  %39 = load i64, ptr %38, align 8, !tbaa !22
  %40 = and i64 %39, %2
  %41 = icmp eq i64 %40, 0
  br i1 %41, label %94, label %42, !llvm.loop !20

42:                                               ; preds = %34
  %43 = call zeroext i1 @b2AABB_Overlaps(<2 x float> %.sroa.013.0.copyload, <2 x float> %.sroa.6.0.copyload, <2 x float> %.sroa.044.0112, <2 x float> %.sroa.5.0113)
  br i1 %43, label %44, label %94, !llvm.loop !20

44:                                               ; preds = %42
  %45 = call <2 x float> @b2AABB_Center(<2 x float> %.sroa.013.0.copyload, <2 x float> %.sroa.6.0.copyload)
  %46 = call <2 x float> @b2AABB_Extents(<2 x float> %.sroa.013.0.copyload, <2 x float> %.sroa.6.0.copyload)
  %47 = call <2 x float> @b2Sub(<2 x float> %.sroa.060.0.copyload, <2 x float> %45)
  %48 = call float @b2Dot(<2 x float> %14, <2 x float> %47)
  %49 = call float @b2AbsFloat(float noundef %48)
  %50 = call float @b2Dot(<2 x float> %15, <2 x float> %46)
  %51 = fcmp olt float %50, %49
  br i1 %51, label %94, label %52, !llvm.loop !20

52:                                               ; preds = %44
  %53 = call zeroext i1 @b2IsLeaf(ptr noundef nonnull %36)
  br i1 %53, label %54, label %67

54:                                               ; preds = %52
  store float %.0114, ptr %24, align 4, !tbaa !11
  %55 = getelementptr inbounds i8, ptr %36, i64 24
  %56 = load i64, ptr %55, align 8, !tbaa !27
  %57 = call float %3(ptr noundef nonnull %7, i32 noundef %29, i64 noundef %56, ptr noundef %4) #8
  %58 = add nsw i32 %.sroa.4.0115, 1
  %59 = fcmp une float %57, 0.000000e+00
  br i1 %59, label %60, label %.thread103

60:                                               ; preds = %54
  %61 = fcmp ule float %57, 0.000000e+00
  %62 = fcmp ugt float %57, %.0114
  %or.cond = select i1 %61, i1 true, i1 %62
  br i1 %or.cond, label %94, label %63

63:                                               ; preds = %60
  %64 = call <2 x float> @b2MulAdd(<2 x float> %.sroa.060.0.copyload, float noundef %57, <2 x float> %.sroa.057.0.copyload)
  %65 = call <2 x float> @b2Min(<2 x float> %.sroa.060.0.copyload, <2 x float> %64)
  %66 = call <2 x float> @b2Max(<2 x float> %.sroa.060.0.copyload, <2 x float> %64)
  br label %94

67:                                               ; preds = %52
  %68 = icmp ult i32 %.083111, 1024
  br i1 %68, label %69, label %91

69:                                               ; preds = %67
  %70 = getelementptr inbounds i8, ptr %36, i64 24
  %71 = load i32, ptr %70, align 8, !tbaa !27
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds %struct.b2TreeNode, ptr %23, i64 %72
  %74 = load <2 x float>, ptr %73, align 8
  %75 = getelementptr inbounds i8, ptr %73, i64 8
  %76 = load <2 x float>, ptr %75, align 8
  %77 = call <2 x float> @b2AABB_Center(<2 x float> %74, <2 x float> %76)
  %78 = getelementptr inbounds i8, ptr %36, i64 28
  %79 = load i32, ptr %78, align 4, !tbaa !27
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds %struct.b2TreeNode, ptr %23, i64 %80
  %82 = load <2 x float>, ptr %81, align 8
  %83 = getelementptr inbounds i8, ptr %81, i64 8
  %84 = load <2 x float>, ptr %83, align 8
  %85 = call <2 x float> @b2AABB_Center(<2 x float> %82, <2 x float> %84)
  %86 = call float @b2DistanceSquared(<2 x float> %77, <2 x float> %.sroa.060.0.copyload)
  %87 = call float @b2DistanceSquared(<2 x float> %85, <2 x float> %.sroa.060.0.copyload)
  %88 = fcmp olt float %86, %87
  %89 = zext nneg i32 %.083111 to i64
  %90 = getelementptr inbounds [1024 x i32], ptr %6, i64 0, i64 %89
  %. = select i1 %88, ptr %78, ptr %70
  %.117 = select i1 %88, ptr %70, ptr %78
  %storemerge = load i32, ptr %., align 4, !tbaa !27
  store i32 %storemerge, ptr %28, align 4, !tbaa !16
  %.sink = load i32, ptr %.117, align 4, !tbaa !27
  store i32 %.sink, ptr %90, align 4, !tbaa !16
  %.184 = add nuw nsw i32 %.083111, 1
  br label %94

91:                                               ; preds = %67
  %92 = call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 1284) #8
  %.not = icmp eq i32 %92, 0
  br i1 %.not, label %94, label %93

93:                                               ; preds = %91
  call void @llvm.trap()
  unreachable

94:                                               ; preds = %63, %60, %42, %34, %91, %69, %44, %31
  %.588 = phi i32 [ %26, %31 ], [ %26, %42 ], [ %26, %34 ], [ %26, %44 ], [ %.184, %69 ], [ %26, %91 ], [ %26, %60 ], [ %26, %63 ]
  %.sroa.044.6 = phi <2 x float> [ %.sroa.044.0112, %31 ], [ %.sroa.044.0112, %42 ], [ %.sroa.044.0112, %34 ], [ %.sroa.044.0112, %44 ], [ %.sroa.044.0112, %69 ], [ %.sroa.044.0112, %91 ], [ %.sroa.044.0112, %60 ], [ %65, %63 ]
  %.sroa.5.6 = phi <2 x float> [ %.sroa.5.0113, %31 ], [ %.sroa.5.0113, %42 ], [ %.sroa.5.0113, %34 ], [ %.sroa.5.0113, %44 ], [ %.sroa.5.0113, %69 ], [ %.sroa.5.0113, %91 ], [ %.sroa.5.0113, %60 ], [ %66, %63 ]
  %.6 = phi float [ %.0114, %31 ], [ %.0114, %42 ], [ %.0114, %34 ], [ %.0114, %44 ], [ %.0114, %69 ], [ %.0114, %91 ], [ %.0114, %60 ], [ %57, %63 ]
  %.sroa.4.4 = phi i32 [ %.sroa.4.0115, %31 ], [ %.sroa.4.0115, %42 ], [ %.sroa.4.0115, %34 ], [ %.sroa.4.0115, %44 ], [ %.sroa.4.0115, %69 ], [ %.sroa.4.0115, %91 ], [ %58, %60 ], [ %58, %63 ]
  %.sroa.079.1 = phi i32 [ %.sroa.079.0116, %31 ], [ %37, %42 ], [ %37, %34 ], [ %37, %44 ], [ %37, %69 ], [ %37, %91 ], [ %37, %60 ], [ %37, %63 ]
  %95 = icmp sgt i32 %.588, 0
  br i1 %95, label %25, label %.thread103

.thread103:                                       ; preds = %54, %94
  %.sroa.4.5 = phi i32 [ %.sroa.4.4, %94 ], [ %58, %54 ]
  %.sroa.079.2 = phi i32 [ %.sroa.079.1, %94 ], [ %37, %54 ]
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %6) #8
  %96 = zext i32 %.sroa.4.5 to i64
  %97 = shl nuw i64 %96, 32
  %98 = zext i32 %.sroa.079.2 to i64
  %99 = or disjoint i64 %97, %98
  br label %100

100:                                              ; preds = %5, %.thread103
  %.sroa.079.0.insert.insert = phi i64 [ 0, %5 ], [ %99, %.thread103 ]
  ret i64 %.sroa.079.0.insert.insert
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Normalize(<2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2CrossSV(float noundef, <2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Abs(<2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Min(<2 x float>, <2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Max(<2 x float>, <2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2AABB_Center(<2 x float>, <2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2AABB_Extents(<2 x float>, <2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2AbsFloat(float noundef) local_unnamed_addr #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Dot(<2 x float>, <2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Sub(<2 x float>, <2 x float>) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2DistanceSquared(<2 x float>, <2 x float>) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { inlinehint 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 #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 12}
!6 = !{!"b2DynamicTree", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !10, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !14, i64 16}
!12 = !{!"b2RayCastInput", !13, i64 0, !13, i64 8, !14, i64 16}
!13 = !{!"b2Vec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !8, i64 0}
!15 = !{!6, !10, i64 8}
!16 = !{!10, !10, i64 0}
!17 = !{!6, !7, i64 0}
!18 = !{i64 0, i64 4, !19, i64 4, i64 4, !19, i64 8, i64 4, !19, i64 12, i64 4, !19, i64 16, i64 4, !19}
!19 = !{!14, !14, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !25, i64 16}
!23 = !{!"b2TreeNode", !24, i64 0, !25, i64 16, !8, i64 24, !8, i64 32, !26, i64 36, !26, i64 38}
!24 = !{!"b2AABB", !13, i64 0, !13, i64 8}
!25 = !{!"long", !8, i64 0}
!26 = !{!"short", !8, i64 0}
!27 = !{!8, !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass