; 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.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Vec2 = type { float, 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: nounwind uwtable
declare hidden zeroext i1 @b2IsLeaf(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local i64 @b2DynamicTree_Query(ptr noundef %0, <2 x float> %1, <2 x float> %2, i64 noundef %3, ptr noundef %4, ptr noundef %5) #5 {
  %7 = alloca %struct.b2TreeStats, align 4
  %8 = alloca %struct.b2AABB, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [1024 x i32], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i8, align 1
  %19 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  store <2 x float> %1, ptr %19, align 4
  %20 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  store <2 x float> %2, ptr %20, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i64 %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %7, i8 0, i64 8, i1 false)
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.b2DynamicTree, ptr %21, i32 0, i32 2
  %23 = load i32, ptr %22, align 4, !tbaa !11
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %6
  br label %145

26:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4096, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !14
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.b2DynamicTree, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 8, !tbaa !15
  %30 = load i32, ptr %14, align 4, !tbaa !14
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %14, align 4, !tbaa !14
  %32 = sext i32 %30 to i64
  %33 = getelementptr inbounds [1024 x i32], ptr %13, i64 0, i64 %32
  store i32 %29, ptr %33, align 4, !tbaa !14
  br label %34

34:                                               ; preds = %142, %140, %26
  %35 = load i32, ptr %14, align 4, !tbaa !14
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %37, label %143

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %38 = load i32, ptr %14, align 4, !tbaa !14
  %39 = add nsw i32 %38, -1
  store i32 %39, ptr %14, align 4, !tbaa !14
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1024 x i32], ptr %13, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !14
  store i32 %42, ptr %15, align 4, !tbaa !14
  %43 = load i32, ptr %15, align 4, !tbaa !14
  %44 = icmp eq i32 %43, -1
  br i1 %44, label %45, label %53

45:                                               ; preds = %37
  br label %46

46:                                               ; preds = %45
  %47 = call i32 @b2InternalAssertFcn(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 1134)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  call void @llvm.trap()
  br label %50

50:                                               ; preds = %49, %46
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  store i32 2, ptr %16, align 4
  br label %140, !llvm.loop !16

53:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.b2DynamicTree, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !18
  %57 = load i32, ptr %15, align 4, !tbaa !14
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %struct.b2TreeNode, ptr %56, i64 %58
  store ptr %59, ptr %17, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.b2TreeStats, ptr %7, i32 0, i32 0
  %61 = load i32, ptr %60, align 4, !tbaa !19
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %60, align 4, !tbaa !19
  %63 = load ptr, ptr %17, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b2TreeNode, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %64, i32 0, i32 0
  %66 = load <2 x float>, ptr %65, align 8
  %67 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %64, i32 0, i32 1
  %68 = load <2 x float>, ptr %67, align 8
  %69 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %70 = load <2 x float>, ptr %69, align 4
  %71 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %72 = load <2 x float>, ptr %71, align 4
  %73 = call zeroext i1 @b2AABB_Overlaps(<2 x float> %66, <2 x float> %68, <2 x float> %70, <2 x float> %72)
  br i1 %73, label %74, label %138

74:                                               ; preds = %53
  %75 = load ptr, ptr %17, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.b2TreeNode, ptr %75, i32 0, i32 1
  %77 = load i64, ptr %76, align 8, !tbaa !21
  %78 = load i64, ptr %10, align 8, !tbaa !9
  %79 = and i64 %77, %78
  %80 = icmp ne i64 %79, 0
  br i1 %80, label %81, label %138

81:                                               ; preds = %74
  %82 = load ptr, ptr %17, align 8, !tbaa !5
  %83 = call zeroext i1 @b2IsLeaf(ptr noundef %82)
  br i1 %83, label %84, label %105

84:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #7
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = load i32, ptr %15, align 4, !tbaa !14
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.b2TreeNode, ptr %87, i32 0, i32 2
  %89 = load i64, ptr %88, align 8, !tbaa !27
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = call zeroext i1 %85(i32 noundef %86, i64 noundef %89, ptr noundef %90)
  %92 = zext i1 %91 to i8
  store i8 %92, ptr %18, align 1, !tbaa !28
  %93 = getelementptr inbounds %struct.b2TreeStats, ptr %7, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !30
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %93, align 4, !tbaa !30
  %96 = load i8, ptr %18, align 1, !tbaa !28, !range !31, !noundef !32
  %97 = trunc i8 %96 to i1
  %98 = zext i1 %97 to i32
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %84
  store i32 1, ptr %16, align 4
  br label %102

101:                                              ; preds = %84
  store i32 0, ptr %16, align 4
  br label %102

102:                                              ; preds = %101, %100
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #7
  %103 = load i32, ptr %16, align 4
  switch i32 %103, label %139 [
    i32 0, label %104
  ]

104:                                              ; preds = %102
  br label %137

105:                                              ; preds = %81
  %106 = load i32, ptr %14, align 4, !tbaa !14
  %107 = icmp slt i32 %106, 1023
  br i1 %107, label %108, label %125

108:                                              ; preds = %105
  %109 = load ptr, ptr %17, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.b2TreeNode, ptr %109, i32 0, i32 2
  %111 = getelementptr inbounds %struct.anon, ptr %110, i32 0, i32 0
  %112 = load i32, ptr %111, align 8, !tbaa !27
  %113 = load i32, ptr %14, align 4, !tbaa !14
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %14, align 4, !tbaa !14
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds [1024 x i32], ptr %13, i64 0, i64 %115
  store i32 %112, ptr %116, align 4, !tbaa !14
  %117 = load ptr, ptr %17, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.b2TreeNode, ptr %117, i32 0, i32 2
  %119 = getelementptr inbounds %struct.anon, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !27
  %121 = load i32, ptr %14, align 4, !tbaa !14
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %14, align 4, !tbaa !14
  %123 = sext i32 %121 to i64
  %124 = getelementptr inbounds [1024 x i32], ptr %13, i64 0, i64 %123
  store i32 %120, ptr %124, align 4, !tbaa !14
  br label %136

125:                                              ; preds = %105
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %14, align 4, !tbaa !14
  %128 = icmp slt i32 %127, 1023
  br i1 %128, label %133, label %129

129:                                              ; preds = %126
  %130 = call i32 @b2InternalAssertFcn(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 1163)
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %133

132:                                              ; preds = %129
  call void @llvm.trap()
  br label %133

133:                                              ; preds = %132, %129, %126
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135, %108
  br label %137

137:                                              ; preds = %136, %104
  br label %138

138:                                              ; preds = %137, %74, %53
  store i32 0, ptr %16, align 4
  br label %139

139:                                              ; preds = %138, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %140

140:                                              ; preds = %139, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  %141 = load i32, ptr %16, align 4
  switch i32 %141, label %144 [
    i32 0, label %142
    i32 2, label %34
  ]

142:                                              ; preds = %140
  br label %34, !llvm.loop !16

143:                                              ; preds = %34
  store i32 1, ptr %16, align 4
  br label %144

144:                                              ; preds = %143, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr %13) #7
  br label %145

145:                                              ; preds = %144, %25
  %146 = load i64, ptr %7, align 4
  ret i64 %146
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @b2AABB_Overlaps(<2 x float>, <2 x float>, <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 = { 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 = { 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 = { 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 }

!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 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!12, !6, i64 0}
!19 = !{!20, !13, i64 0}
!20 = !{!"b2TreeStats", !13, i64 0, !13, i64 4}
!21 = !{!22, !10, i64 16}
!22 = !{!"b2TreeNode", !23, i64 0, !10, i64 16, !7, i64 24, !7, i64 32, !26, i64 36, !26, i64 38}
!23 = !{!"b2AABB", !24, i64 0, !24, i64 8}
!24 = !{!"b2Vec2", !25, i64 0, !25, i64 4}
!25 = !{!"float", !7, i64 0}
!26 = !{!"short", !7, i64 0}
!27 = !{!7, !7, i64 0}
!28 = !{!29, !29, i64 0}
!29 = !{!"_Bool", !7, i64 0}
!30 = !{!20, !13, i64 4}
!31 = !{i8 0, i8 2}
!32 = !{}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.b2TreeNode = type { %struct.b2AABB, i64, %union.anon, %union.anon.0, i16, i16 }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Vec2 = type { float, float }
%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: nounwind uwtable
declare hidden zeroext i1 @b2IsLeaf(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i64 @b2DynamicTree_Query(ptr nocapture noundef readonly %0, <2 x float> %1, <2 x float> %2, i64 noundef %3, ptr nocapture noundef readonly %4, ptr noundef %5) local_unnamed_addr #4 {
  %7 = alloca [1024 x i32], align 16
  %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 %61, label %11

11:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %7) #6
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i32, ptr %12, align 8, !tbaa !11
  store i32 %13, ptr %7, align 16, !tbaa !12
  br label %14

14:                                               ; preds = %11, %select.unfold
  %.sroa.024.041 = phi i32 [ 0, %11 ], [ %.sroa.024.1, %select.unfold ]
  %.sroa.4.040 = phi i32 [ 0, %11 ], [ %.sroa.4.3, %select.unfold ]
  %.02839 = phi i32 [ 1, %11 ], [ %.3, %select.unfold ]
  %15 = add nsw i32 %.02839, -1
  %16 = zext nneg i32 %15 to i64
  %17 = getelementptr inbounds [1024 x i32], ptr %7, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !12
  %19 = icmp eq i32 %18, -1
  br i1 %19, label %20, label %23

20:                                               ; preds = %14
  %21 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 1134) #6
  %.not34 = icmp eq i32 %21, 0
  br i1 %.not34, label %select.unfold, label %22, !llvm.loop !13

22:                                               ; preds = %20
  tail call void @llvm.trap()
  unreachable

23:                                               ; preds = %14
  %24 = load ptr, ptr %0, align 8, !tbaa !15
  %25 = sext i32 %18 to i64
  %26 = getelementptr inbounds %struct.b2TreeNode, ptr %24, i64 %25
  %27 = add nsw i32 %.sroa.024.041, 1
  %28 = load <2 x float>, ptr %26, align 8
  %29 = getelementptr inbounds i8, ptr %26, i64 8
  %30 = load <2 x float>, ptr %29, align 8
  %31 = tail call zeroext i1 @b2AABB_Overlaps(<2 x float> %28, <2 x float> %30, <2 x float> %1, <2 x float> %2)
  br i1 %31, label %32, label %select.unfold

32:                                               ; preds = %23
  %33 = getelementptr inbounds i8, ptr %26, i64 16
  %34 = load i64, ptr %33, align 8, !tbaa !16
  %35 = and i64 %34, %3
  %.not = icmp eq i64 %35, 0
  br i1 %.not, label %select.unfold, label %36

36:                                               ; preds = %32
  %37 = tail call zeroext i1 @b2IsLeaf(ptr noundef nonnull %26)
  br i1 %37, label %38, label %43

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %26, i64 24
  %40 = load i64, ptr %39, align 8, !tbaa !23
  %41 = tail call zeroext i1 %4(i32 noundef %18, i64 noundef %40, ptr noundef %5) #6
  %42 = add nsw i32 %.sroa.4.040, 1
  br i1 %41, label %select.unfold, label %.thread

43:                                               ; preds = %36
  %44 = icmp ult i32 %.02839, 1024
  br i1 %44, label %45, label %53

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %26, i64 24
  %47 = load i32, ptr %46, align 8, !tbaa !23
  store i32 %47, ptr %17, align 4, !tbaa !12
  %48 = getelementptr inbounds i8, ptr %26, i64 28
  %49 = load i32, ptr %48, align 4, !tbaa !23
  %50 = add nuw nsw i32 %.02839, 1
  %51 = zext nneg i32 %.02839 to i64
  %52 = getelementptr inbounds [1024 x i32], ptr %7, i64 0, i64 %51
  store i32 %49, ptr %52, align 4, !tbaa !12
  br label %select.unfold

53:                                               ; preds = %43
  %54 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 1163) #6
  %.not33 = icmp eq i32 %54, 0
  br i1 %.not33, label %select.unfold, label %55

55:                                               ; preds = %53
  tail call void @llvm.trap()
  unreachable

select.unfold:                                    ; preds = %38, %53, %45, %32, %23, %20
  %.3 = phi i32 [ %15, %20 ], [ %50, %45 ], [ %15, %53 ], [ %15, %32 ], [ %15, %23 ], [ %15, %38 ]
  %.sroa.4.3 = phi i32 [ %.sroa.4.040, %20 ], [ %.sroa.4.040, %45 ], [ %.sroa.4.040, %53 ], [ %.sroa.4.040, %32 ], [ %.sroa.4.040, %23 ], [ %42, %38 ]
  %.sroa.024.1 = phi i32 [ %.sroa.024.041, %20 ], [ %27, %45 ], [ %27, %53 ], [ %27, %32 ], [ %27, %23 ], [ %27, %38 ]
  %56 = icmp sgt i32 %.3, 0
  br i1 %56, label %14, label %.thread

.thread:                                          ; preds = %38, %select.unfold
  %.sroa.4.4 = phi i32 [ %.sroa.4.3, %select.unfold ], [ %42, %38 ]
  %.sroa.024.2 = phi i32 [ %.sroa.024.1, %select.unfold ], [ %27, %38 ]
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %7) #6
  %57 = zext i32 %.sroa.4.4 to i64
  %58 = shl nuw i64 %57, 32
  %59 = zext i32 %.sroa.024.2 to i64
  %60 = or disjoint i64 %58, %59
  br label %61

61:                                               ; preds = %6, %.thread
  %.sroa.024.0.insert.insert = phi i64 [ 0, %6 ], [ %60, %.thread ]
  ret i64 %.sroa.024.0.insert.insert
}

; 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

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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 }

!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 = !{!6, !10, i64 8}
!12 = !{!10, !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !7, i64 0}
!16 = !{!17, !21, i64 16}
!17 = !{!"b2TreeNode", !18, i64 0, !21, i64 16, !8, i64 24, !8, i64 32, !22, i64 36, !22, i64 38}
!18 = !{!"b2AABB", !19, i64 0, !19, i64 8}
!19 = !{!"b2Vec2", !20, i64 0, !20, i64 4}
!20 = !{!"float", !8, i64 0}
!21 = !{!"long", !8, i64 0}
!22 = !{!"short", !8, i64 0}
!23 = !{!8, !8, i64 0}


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