; 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.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 }

@b2_lengthUnitsPerMeter = external global float, align 4
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [54 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

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

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

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

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

declare zeroext i1 @b2IsValidAABB(<2 x float>, <2 x float>) #1

; Function Attrs: nounwind uwtable
define dso_local void @b2DynamicTree_EnlargeProxy(ptr noundef %0, i32 noundef %1, <2 x float> %2, <2 x float> %3) #5 {
  %5 = alloca %struct.b2AABB, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  store <2 x float> %2, ptr %12, align 4
  %13 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  store <2 x float> %3, ptr %13, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.b2DynamicTree, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %16, ptr %8, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %4
  %18 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  %19 = load <2 x float>, ptr %18, align 4
  %20 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  %21 = load <2 x float>, ptr %20, align 4
  %22 = call zeroext i1 @b2IsValidAABB(<2 x float> %19, <2 x float> %21)
  br i1 %22, label %27, label %23

23:                                               ; preds = %17
  %24 = call i32 @b2InternalAssertFcn(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 831)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  call void @llvm.trap()
  br label %27

27:                                               ; preds = %26, %23, %17
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  %31 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 1
  %32 = getelementptr inbounds %struct.b2Vec2, ptr %31, i32 0, i32 0
  %33 = load float, ptr %32, align 4, !tbaa !13
  %34 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 0
  %35 = getelementptr inbounds %struct.b2Vec2, ptr %34, i32 0, i32 0
  %36 = load float, ptr %35, align 4, !tbaa !17
  %37 = fsub float %33, %36
  %38 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !18
  %39 = fmul float 1.000000e+05, %38
  %40 = fcmp olt float %37, %39
  br i1 %40, label %45, label %41

41:                                               ; preds = %30
  %42 = call i32 @b2InternalAssertFcn(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 832)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  call void @llvm.trap()
  br label %45

45:                                               ; preds = %44, %41, %30
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 1
  %50 = getelementptr inbounds %struct.b2Vec2, ptr %49, i32 0, i32 1
  %51 = load float, ptr %50, align 4, !tbaa !19
  %52 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 0
  %53 = getelementptr inbounds %struct.b2Vec2, ptr %52, i32 0, i32 1
  %54 = load float, ptr %53, align 4, !tbaa !20
  %55 = fsub float %51, %54
  %56 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !18
  %57 = fmul float 1.000000e+05, %56
  %58 = fcmp olt float %55, %57
  br i1 %58, label %63, label %59

59:                                               ; preds = %48
  %60 = call i32 @b2InternalAssertFcn(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 833)
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  call void @llvm.trap()
  br label %63

63:                                               ; preds = %62, %59, %48
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = icmp sle i32 0, %67
  br i1 %68, label %69, label %75

69:                                               ; preds = %66
  %70 = load i32, ptr %7, align 4, !tbaa !9
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.b2DynamicTree, ptr %71, i32 0, i32 3
  %73 = load i32, ptr %72, align 8, !tbaa !21
  %74 = icmp slt i32 %70, %73
  br i1 %74, label %79, label %75

75:                                               ; preds = %69, %66
  %76 = call i32 @b2InternalAssertFcn(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 834)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  call void @llvm.trap()
  br label %79

79:                                               ; preds = %78, %75, %69
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.b2DynamicTree, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !11
  %86 = load i32, ptr %7, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.b2TreeNode, ptr %85, i64 %87
  %89 = call zeroext i1 @b2IsLeaf(ptr noundef %88)
  br i1 %89, label %94, label %90

90:                                               ; preds = %82
  %91 = call i32 @b2InternalAssertFcn(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 835)
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

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

94:                                               ; preds = %93, %90, %82
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds %struct.b2TreeNode, ptr %98, i64 %100
  %102 = getelementptr inbounds %struct.b2TreeNode, ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %102, i32 0, i32 0
  %104 = load <2 x float>, ptr %103, align 8
  %105 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %102, i32 0, i32 1
  %106 = load <2 x float>, ptr %105, align 8
  %107 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  %108 = load <2 x float>, ptr %107, align 4
  %109 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  %110 = load <2 x float>, ptr %109, align 4
  %111 = call zeroext i1 @b2AABB_Contains(<2 x float> %104, <2 x float> %106, <2 x float> %108, <2 x float> %110)
  %112 = zext i1 %111 to i32
  %113 = icmp eq i32 %112, 0
  br i1 %113, label %118, label %114

114:                                              ; preds = %97
  %115 = call i32 @b2InternalAssertFcn(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 838)
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %114
  call void @llvm.trap()
  br label %118

118:                                              ; preds = %117, %114, %97
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds %struct.b2TreeNode, ptr %121, i64 %123
  %125 = getelementptr inbounds %struct.b2TreeNode, ptr %124, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %125, ptr align 4 %5, i64 16, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = load i32, ptr %7, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds %struct.b2TreeNode, ptr %126, i64 %128
  %130 = getelementptr inbounds %struct.b2TreeNode, ptr %129, i32 0, i32 3
  %131 = load i32, ptr %130, align 8, !tbaa !23
  store i32 %131, ptr %9, align 4, !tbaa !9
  br label %132

132:                                              ; preds = %170, %120
  %133 = load i32, ptr %9, align 4, !tbaa !9
  %134 = icmp ne i32 %133, -1
  br i1 %134, label %135, label %171

135:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = load i32, ptr %9, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds %struct.b2TreeNode, ptr %136, i64 %138
  %140 = getelementptr inbounds %struct.b2TreeNode, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  %142 = load <2 x float>, ptr %141, align 4
  %143 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  %144 = load <2 x float>, ptr %143, align 4
  %145 = call zeroext i1 @b2EnlargeAABB(ptr noundef %140, <2 x float> %142, <2 x float> %144)
  %146 = zext i1 %145 to i8
  store i8 %146, ptr %10, align 1, !tbaa !24
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = load i32, ptr %9, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds %struct.b2TreeNode, ptr %147, i64 %149
  %151 = getelementptr inbounds %struct.b2TreeNode, ptr %150, i32 0, i32 5
  %152 = load i16, ptr %151, align 2, !tbaa !26
  %153 = zext i16 %152 to i32
  %154 = or i32 %153, 2
  %155 = trunc i32 %154 to i16
  store i16 %155, ptr %151, align 2, !tbaa !26
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = load i32, ptr %9, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds %struct.b2TreeNode, ptr %156, i64 %158
  %160 = getelementptr inbounds %struct.b2TreeNode, ptr %159, i32 0, i32 3
  %161 = load i32, ptr %160, align 8, !tbaa !23
  store i32 %161, ptr %9, align 4, !tbaa !9
  %162 = load i8, ptr %10, align 1, !tbaa !24, !range !30, !noundef !31
  %163 = trunc i8 %162 to i1
  %164 = zext i1 %163 to i32
  %165 = icmp eq i32 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %135
  store i32 15, ptr %11, align 4
  br label %168

167:                                              ; preds = %135
  store i32 0, ptr %11, align 4
  br label %168

168:                                              ; preds = %167, %166
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  %169 = load i32, ptr %11, align 4
  switch i32 %169, label %203 [
    i32 0, label %170
    i32 15, label %171
  ]

170:                                              ; preds = %168
  br label %132, !llvm.loop !32

171:                                              ; preds = %168, %132
  br label %172

172:                                              ; preds = %186, %171
  %173 = load i32, ptr %9, align 4, !tbaa !9
  %174 = icmp ne i32 %173, -1
  br i1 %174, label %175, label %202

175:                                              ; preds = %172
  %176 = load ptr, ptr %8, align 8, !tbaa !5
  %177 = load i32, ptr %9, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds %struct.b2TreeNode, ptr %176, i64 %178
  %180 = getelementptr inbounds %struct.b2TreeNode, ptr %179, i32 0, i32 5
  %181 = load i16, ptr %180, align 2, !tbaa !26
  %182 = zext i16 %181 to i32
  %183 = and i32 %182, 2
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %186

185:                                              ; preds = %175
  br label %202

186:                                              ; preds = %175
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = load i32, ptr %9, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds %struct.b2TreeNode, ptr %187, i64 %189
  %191 = getelementptr inbounds %struct.b2TreeNode, ptr %190, i32 0, i32 5
  %192 = load i16, ptr %191, align 2, !tbaa !26
  %193 = zext i16 %192 to i32
  %194 = or i32 %193, 2
  %195 = trunc i32 %194 to i16
  store i16 %195, ptr %191, align 2, !tbaa !26
  %196 = load ptr, ptr %8, align 8, !tbaa !5
  %197 = load i32, ptr %9, align 4, !tbaa !9
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds %struct.b2TreeNode, ptr %196, i64 %198
  %200 = getelementptr inbounds %struct.b2TreeNode, ptr %199, i32 0, i32 3
  %201 = load i32, ptr %200, align 8, !tbaa !23
  store i32 %201, ptr %9, align 4, !tbaa !9
  br label %172, !llvm.loop !34

202:                                              ; preds = %185, %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  ret void

203:                                              ; preds = %168
  unreachable
}

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

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

attributes #0 = { 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 = { 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"b2DynamicTree", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64}
!13 = !{!14, !16, i64 8}
!14 = !{!"b2AABB", !15, i64 0, !15, i64 8}
!15 = !{!"b2Vec2", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = !{!14, !16, i64 0}
!18 = !{!16, !16, i64 0}
!19 = !{!14, !16, i64 12}
!20 = !{!14, !16, i64 4}
!21 = !{!12, !10, i64 16}
!22 = !{i64 0, i64 4, !18, i64 4, i64 4, !18, i64 8, i64 4, !18, i64 12, i64 4, !18}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"_Bool", !7, i64 0}
!26 = !{!27, !29, i64 38}
!27 = !{!"b2TreeNode", !14, i64 0, !28, i64 16, !7, i64 24, !7, i64 32, !29, i64 36, !29, i64 38}
!28 = !{!"long", !7, i64 0}
!29 = !{!"short", !7, i64 0}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}


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

@b2_lengthUnitsPerMeter = external local_unnamed_addr global float, align 4
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [54 x i8], align 1

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

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

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

declare zeroext i1 @b2IsValidAABB(<2 x float>, <2 x float>) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @b2DynamicTree_EnlargeProxy(ptr nocapture noundef readonly %0, i32 noundef %1, <2 x float> %2, <2 x float> %3) local_unnamed_addr #3 {
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = tail call zeroext i1 @b2IsValidAABB(<2 x float> %2, <2 x float> %3) #5
  br i1 %6, label %10, label %7

7:                                                ; preds = %4
  %8 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 831) #5
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %10, label %9

9:                                                ; preds = %7
  tail call void @llvm.trap()
  unreachable

10:                                               ; preds = %4, %7
  %11 = fsub <2 x float> %3, %2
  %12 = extractelement <2 x float> %11, i64 0
  %13 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !11
  %14 = fmul float %13, 1.000000e+05
  %15 = fcmp olt float %12, %14
  br i1 %15, label %19, label %16

16:                                               ; preds = %10
  %17 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 832) #5
  %.not35 = icmp eq i32 %17, 0
  br i1 %.not35, label %._crit_edge46, label %18

._crit_edge46:                                    ; preds = %16
  %.pre = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !11
  %.pre47 = fmul float %.pre, 1.000000e+05
  br label %19

18:                                               ; preds = %16
  tail call void @llvm.trap()
  unreachable

19:                                               ; preds = %._crit_edge46, %10
  %.pre-phi = phi float [ %.pre47, %._crit_edge46 ], [ %14, %10 ]
  %20 = fsub <2 x float> %3, %2
  %21 = extractelement <2 x float> %20, i64 1
  %22 = fcmp olt float %21, %.pre-phi
  br i1 %22, label %26, label %23

23:                                               ; preds = %19
  %24 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 833) #5
  %.not36 = icmp eq i32 %24, 0
  br i1 %.not36, label %26, label %25

25:                                               ; preds = %23
  tail call void @llvm.trap()
  unreachable

26:                                               ; preds = %19, %23
  %27 = icmp sgt i32 %1, -1
  br i1 %27, label %28, label %32

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  %30 = load i32, ptr %29, align 8, !tbaa !13
  %31 = icmp sgt i32 %30, %1
  br i1 %31, label %35, label %32

32:                                               ; preds = %28, %26
  %33 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 834) #5
  %.not37 = icmp eq i32 %33, 0
  br i1 %.not37, label %35, label %34

34:                                               ; preds = %32
  tail call void @llvm.trap()
  unreachable

35:                                               ; preds = %28, %32
  %36 = load ptr, ptr %0, align 8, !tbaa !5
  %37 = sext i32 %1 to i64
  %38 = getelementptr inbounds %struct.b2TreeNode, ptr %36, i64 %37
  %39 = tail call zeroext i1 @b2IsLeaf(ptr noundef %38)
  br i1 %39, label %43, label %40

40:                                               ; preds = %35
  %41 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 835) #5
  %.not38 = icmp eq i32 %41, 0
  br i1 %.not38, label %43, label %42

42:                                               ; preds = %40
  tail call void @llvm.trap()
  unreachable

43:                                               ; preds = %35, %40
  %44 = getelementptr inbounds %struct.b2TreeNode, ptr %5, i64 %37
  %45 = load <2 x float>, ptr %44, align 8
  %46 = getelementptr inbounds i8, ptr %44, i64 8
  %47 = load <2 x float>, ptr %46, align 8
  %48 = tail call zeroext i1 @b2AABB_Contains(<2 x float> %45, <2 x float> %47, <2 x float> %2, <2 x float> %3)
  br i1 %48, label %49, label %52

49:                                               ; preds = %43
  %50 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 838) #5
  %.not39 = icmp eq i32 %50, 0
  br i1 %.not39, label %52, label %51

51:                                               ; preds = %49
  tail call void @llvm.trap()
  unreachable

52:                                               ; preds = %49, %43
  store <2 x float> %2, ptr %44, align 8
  store <2 x float> %3, ptr %46, align 8
  %53 = getelementptr inbounds i8, ptr %44, i64 32
  %54 = load i32, ptr %53, align 8, !tbaa !14
  br label %55

55:                                               ; preds = %56, %52
  %.033 = phi i32 [ %54, %52 ], [ %64, %56 ]
  %.not40 = icmp eq i32 %.033, -1
  br i1 %.not40, label %._crit_edge, label %56

56:                                               ; preds = %55
  %57 = sext i32 %.033 to i64
  %58 = getelementptr inbounds %struct.b2TreeNode, ptr %5, i64 %57
  %59 = tail call zeroext i1 @b2EnlargeAABB(ptr noundef %58, <2 x float> %2, <2 x float> %3)
  %60 = getelementptr inbounds i8, ptr %58, i64 38
  %61 = load i16, ptr %60, align 2, !tbaa !15
  %62 = or i16 %61, 2
  store i16 %62, ptr %60, align 2, !tbaa !15
  %63 = getelementptr inbounds i8, ptr %58, i64 32
  %64 = load i32, ptr %63, align 8, !tbaa !14
  br i1 %59, label %55, label %65

65:                                               ; preds = %56
  %.not4143 = icmp eq i32 %64, -1
  br i1 %.not4143, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %65, %71
  %.244 = phi i32 [ %74, %71 ], [ %64, %65 ]
  %66 = sext i32 %.244 to i64
  %67 = getelementptr inbounds %struct.b2TreeNode, ptr %5, i64 %66
  %68 = getelementptr inbounds i8, ptr %67, i64 38
  %69 = load i16, ptr %68, align 2, !tbaa !15
  %70 = and i16 %69, 2
  %.not42 = icmp eq i16 %70, 0
  br i1 %.not42, label %71, label %._crit_edge

71:                                               ; preds = %.lr.ph
  %72 = or disjoint i16 %69, 2
  store i16 %72, ptr %68, align 2, !tbaa !15
  %73 = getelementptr inbounds i8, ptr %67, i64 32
  %74 = load i32, ptr %73, align 8, !tbaa !14
  %.not41 = icmp eq i32 %74, -1
  br i1 %.not41, label %._crit_edge, label %.lr.ph, !llvm.loop !21

._crit_edge:                                      ; preds = %55, %71, %.lr.ph, %65
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @b2EnlargeAABB(ptr noundef, <2 x float>, <2 x float>) local_unnamed_addr #4

attributes #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 #1 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { 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, !7, i64 0}
!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, !12, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!6, !10, i64 16}
!14 = !{!8, !8, i64 0}
!15 = !{!16, !20, i64 38}
!16 = !{!"b2TreeNode", !17, i64 0, !19, i64 16, !8, i64 24, !8, i64 32, !20, i64 36, !20, i64 38}
!17 = !{!"b2AABB", !18, i64 0, !18, i64 8}
!18 = !{!"b2Vec2", !12, i64 0, !12, i64 4}
!19 = !{!"long", !8, i64 0}
!20 = !{!"short", !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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