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

; 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.b2WorldId = type { i16, i16 }
%struct.b2Vec2 = type { float, float }
%struct.ExplosionContext = type { ptr, %struct.b2Vec2, float, float, float }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2TreeStats = type { i32, i32 }
%struct.b2ExplosionDef = type { i64, %struct.b2Vec2, float, float, float }
%struct.b2World = type { %struct.b2ArenaAllocator, %struct.b2BroadPhase, %struct.b2ConstraintGraph, %struct.b2IdPool, %struct.b2BodyArray, %struct.b2IdPool, %struct.b2SolverSetArray, %struct.b2IdPool, %struct.b2JointArray, %struct.b2IdPool, %struct.b2ContactArray, %struct.b2IdPool, %struct.b2IslandArray, %struct.b2IdPool, %struct.b2IdPool, %struct.b2ShapeArray, %struct.b2ChainShapeArray, %struct.b2SensorArray, %struct.b2TaskContextArray, %struct.b2SensorTaskContextArray, %struct.b2BodyMoveEventArray, %struct.b2SensorBeginTouchEventArray, %struct.b2ContactBeginTouchEventArray, [2 x %struct.b2SensorEndTouchEventArray], [2 x %struct.b2ContactEndTouchEventArray], i32, %struct.b2ContactHitEventArray, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, i64, i32, %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i16, %struct.b2Profile, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, float, i32, i32, i16, i8, i8, i8, i8, i8, i8 }
%struct.b2ArenaAllocator = type { ptr, i32, i32, i32, i32, %struct.b2ArenaEntryArray }
%struct.b2ArenaEntryArray = type { ptr, i32, i32 }
%struct.b2BroadPhase = type { [3 x %struct.b2DynamicTree], i32, %struct.b2HashSet, %struct.b2IntArray, ptr, ptr, i32, %struct.b2AtomicInt, %struct.b2HashSet }
%struct.b2DynamicTree = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2IntArray = type { ptr, i32, i32 }
%struct.b2AtomicInt = type { i32 }
%struct.b2HashSet = type { ptr, i32, i32 }
%struct.b2ConstraintGraph = type { [12 x %struct.b2GraphColor] }
%struct.b2GraphColor = type { %struct.b2BitSet, %struct.b2ContactSimArray, %struct.b2JointSimArray, %union.anon }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon = type { ptr }
%struct.b2BodyArray = type { ptr, i32, i32 }
%struct.b2SolverSetArray = type { ptr, i32, i32 }
%struct.b2JointArray = type { ptr, i32, i32 }
%struct.b2ContactArray = type { ptr, i32, i32 }
%struct.b2IslandArray = type { ptr, i32, i32 }
%struct.b2IdPool = type { %struct.b2IntArray, i32 }
%struct.b2ShapeArray = type { ptr, i32, i32 }
%struct.b2ChainShapeArray = type { ptr, i32, i32 }
%struct.b2SensorArray = type { ptr, i32, i32 }
%struct.b2TaskContextArray = type { ptr, i32, i32 }
%struct.b2SensorTaskContextArray = type { ptr, i32, i32 }
%struct.b2BodyMoveEventArray = type { ptr, i32, i32 }
%struct.b2SensorBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2SensorEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactHitEventArray = type { ptr, i32, i32 }
%struct.b2BitSet = type { ptr, i32, i32 }
%struct.b2Profile = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }

@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @b2GetWorldFromId(i32) #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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

declare zeroext i1 @b2IsValidFloat(float noundef) #1

declare i64 @b2DynamicTree_Query(ptr noundef, <2 x float>, <2 x float>, i64 noundef, ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @b2World_Explode(i32 %0, ptr noundef %1) #5 {
  %3 = alloca %struct.b2WorldId, align 2
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca %struct.b2Vec2, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.ExplosionContext, align 8
  %13 = alloca %struct.b2AABB, align 4
  %14 = alloca %struct.b2TreeStats, align 4
  store i32 %0, ptr %3, align 2
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.b2ExplosionDef, ptr %15, i32 0, i32 0
  %17 = load i64, ptr %16, align 8, !tbaa !9
  store i64 %17, ptr %5, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.b2ExplosionDef, ptr %18, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %19, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.b2ExplosionDef, ptr %20, i32 0, i32 2
  %22 = load float, ptr %21, align 8, !tbaa !17
  store float %22, ptr %7, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.b2ExplosionDef, ptr %23, i32 0, i32 3
  %25 = load float, ptr %24, align 4, !tbaa !18
  store float %25, ptr %8, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.b2ExplosionDef, ptr %26, i32 0, i32 4
  %28 = load float, ptr %27, align 8, !tbaa !19
  store float %28, ptr %9, align 4, !tbaa !16
  br label %29

29:                                               ; preds = %2
  %30 = load <2 x float>, ptr %6, align 4
  %31 = call zeroext i1 @b2IsValidVec2(<2 x float> %30)
  br i1 %31, label %36, label %32

32:                                               ; preds = %29
  %33 = call i32 @b2InternalAssertFcn(ptr noundef @.str.67, ptr noundef @.str.1, i32 noundef 2753)
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  call void @llvm.trap()
  br label %36

36:                                               ; preds = %35, %32, %29
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load float, ptr %7, align 4, !tbaa !16
  %41 = call zeroext i1 @b2IsValidFloat(float noundef %40)
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = load float, ptr %7, align 4, !tbaa !16
  %44 = fcmp oge float %43, 0.000000e+00
  br i1 %44, label %49, label %45

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

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

49:                                               ; preds = %48, %45, %42
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = load float, ptr %8, align 4, !tbaa !16
  %54 = call zeroext i1 @b2IsValidFloat(float noundef %53)
  br i1 %54, label %55, label %58

55:                                               ; preds = %52
  %56 = load float, ptr %8, align 4, !tbaa !16
  %57 = fcmp oge float %56, 0.000000e+00
  br i1 %57, label %62, label %58

58:                                               ; preds = %55, %52
  %59 = call i32 @b2InternalAssertFcn(ptr noundef @.str.69, ptr noundef @.str.1, i32 noundef 2755)
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %62

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

62:                                               ; preds = %61, %58, %55
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = load float, ptr %9, align 4, !tbaa !16
  %67 = call zeroext i1 @b2IsValidFloat(float noundef %66)
  br i1 %67, label %72, label %68

68:                                               ; preds = %65
  %69 = call i32 @b2InternalAssertFcn(ptr noundef @.str.70, ptr noundef @.str.1, i32 noundef 2756)
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  call void @llvm.trap()
  br label %72

72:                                               ; preds = %71, %68, %65
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %75 = load i32, ptr %3, align 2
  %76 = call ptr @b2GetWorldFromId(i32 %75)
  store ptr %76, ptr %10, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %74
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.b2World, ptr %78, i32 0, i32 61
  %80 = load i8, ptr %79, align 1, !tbaa !20, !range !34, !noundef !35
  %81 = trunc i8 %80 to i1
  %82 = zext i1 %81 to i32
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %88, label %84

84:                                               ; preds = %77
  %85 = call i32 @b2InternalAssertFcn(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 2759)
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %84
  call void @llvm.trap()
  br label %88

88:                                               ; preds = %87, %84, %77
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.b2World, ptr %91, i32 0, i32 61
  %93 = load i8, ptr %92, align 1, !tbaa !20, !range !34, !noundef !35
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  store i32 1, ptr %11, align 4
  br label %149

96:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  %97 = getelementptr inbounds %struct.ExplosionContext, ptr %12, i32 0, i32 0
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %98, ptr %97, align 8, !tbaa !36
  %99 = getelementptr inbounds %struct.ExplosionContext, ptr %12, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %99, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !15
  %100 = getelementptr inbounds %struct.ExplosionContext, ptr %12, i32 0, i32 2
  %101 = load float, ptr %7, align 4, !tbaa !16
  store float %101, ptr %100, align 8, !tbaa !38
  %102 = getelementptr inbounds %struct.ExplosionContext, ptr %12, i32 0, i32 3
  %103 = load float, ptr %8, align 4, !tbaa !16
  store float %103, ptr %102, align 4, !tbaa !39
  %104 = getelementptr inbounds %struct.ExplosionContext, ptr %12, i32 0, i32 4
  %105 = load float, ptr %9, align 4, !tbaa !16
  store float %105, ptr %104, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %106 = getelementptr inbounds %struct.b2Vec2, ptr %6, i32 0, i32 0
  %107 = load float, ptr %106, align 4, !tbaa !41
  %108 = load float, ptr %7, align 4, !tbaa !16
  %109 = load float, ptr %8, align 4, !tbaa !16
  %110 = fadd float %108, %109
  %111 = fsub float %107, %110
  %112 = getelementptr inbounds %struct.b2AABB, ptr %13, i32 0, i32 0
  %113 = getelementptr inbounds %struct.b2Vec2, ptr %112, i32 0, i32 0
  store float %111, ptr %113, align 4, !tbaa !42
  %114 = getelementptr inbounds %struct.b2Vec2, ptr %6, i32 0, i32 1
  %115 = load float, ptr %114, align 4, !tbaa !44
  %116 = load float, ptr %7, align 4, !tbaa !16
  %117 = load float, ptr %8, align 4, !tbaa !16
  %118 = fadd float %116, %117
  %119 = fsub float %115, %118
  %120 = getelementptr inbounds %struct.b2AABB, ptr %13, i32 0, i32 0
  %121 = getelementptr inbounds %struct.b2Vec2, ptr %120, i32 0, i32 1
  store float %119, ptr %121, align 4, !tbaa !45
  %122 = getelementptr inbounds %struct.b2Vec2, ptr %6, i32 0, i32 0
  %123 = load float, ptr %122, align 4, !tbaa !41
  %124 = load float, ptr %7, align 4, !tbaa !16
  %125 = load float, ptr %8, align 4, !tbaa !16
  %126 = fadd float %124, %125
  %127 = fadd float %123, %126
  %128 = getelementptr inbounds %struct.b2AABB, ptr %13, i32 0, i32 1
  %129 = getelementptr inbounds %struct.b2Vec2, ptr %128, i32 0, i32 0
  store float %127, ptr %129, align 4, !tbaa !46
  %130 = getelementptr inbounds %struct.b2Vec2, ptr %6, i32 0, i32 1
  %131 = load float, ptr %130, align 4, !tbaa !44
  %132 = load float, ptr %7, align 4, !tbaa !16
  %133 = load float, ptr %8, align 4, !tbaa !16
  %134 = fadd float %132, %133
  %135 = fadd float %131, %134
  %136 = getelementptr inbounds %struct.b2AABB, ptr %13, i32 0, i32 1
  %137 = getelementptr inbounds %struct.b2Vec2, ptr %136, i32 0, i32 1
  store float %135, ptr %137, align 4, !tbaa !47
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.b2World, ptr %138, i32 0, i32 1
  %140 = getelementptr inbounds %struct.b2BroadPhase, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds [3 x %struct.b2DynamicTree], ptr %140, i64 0, i64 0
  %142 = getelementptr inbounds %struct.b2DynamicTree, ptr %141, i64 2
  %143 = load i64, ptr %5, align 8, !tbaa !14
  %144 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 0
  %145 = load <2 x float>, ptr %144, align 4
  %146 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 1
  %147 = load <2 x float>, ptr %146, align 4
  %148 = call i64 @b2DynamicTree_Query(ptr noundef %142, <2 x float> %145, <2 x float> %147, i64 noundef %143, ptr noundef @ExplosionCallback, ptr noundef %12)
  store i64 %148, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  store i32 0, ptr %11, align 4
  br label %149

149:                                              ; preds = %96, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %150 = load i32, ptr %11, align 4
  switch i32 %150, label %152 [
    i32 0, label %151
    i32 1, label %151
  ]

151:                                              ; preds = %149, %149
  ret void

152:                                              ; preds = %149
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @ExplosionCallback(i32 noundef, i64 noundef, ptr noundef) #5

attributes #0 = { 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 #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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !11, i64 0}
!10 = !{!"b2ExplosionDef", !11, i64 0, !12, i64 8, !13, i64 16, !13, i64 20, !13, i64 24}
!11 = !{!"long", !7, i64 0}
!12 = !{!"b2Vec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{i64 0, i64 4, !16, i64 4, i64 4, !16}
!16 = !{!13, !13, i64 0}
!17 = !{!10, !13, i64 16}
!18 = !{!10, !13, i64 20}
!19 = !{!10, !13, i64 24}
!20 = !{!21, !33, i64 1799}
!21 = !{!"b2World", !22, i64 0, !25, i64 40, !28, i64 336, !29, i64 1008, !24, i64 1032, !29, i64 1048, !24, i64 1072, !29, i64 1088, !24, i64 1112, !29, i64 1128, !24, i64 1152, !29, i64 1168, !24, i64 1192, !29, i64 1208, !29, i64 1232, !24, i64 1256, !24, i64 1272, !24, i64 1288, !24, i64 1304, !24, i64 1320, !24, i64 1336, !24, i64 1352, !24, i64 1368, !7, i64 1384, !7, i64 1416, !23, i64 1448, !24, i64 1456, !30, i64 1472, !30, i64 1488, !30, i64 1504, !30, i64 1520, !11, i64 1536, !23, i64 1544, !12, i64 1548, !13, i64 1556, !13, i64 1560, !13, i64 1564, !13, i64 1568, !13, i64 1572, !13, i64 1576, !13, i64 1580, !13, i64 1584, !6, i64 1592, !6, i64 1600, !31, i64 1608, !32, i64 1612, !6, i64 1704, !6, i64 1712, !6, i64 1720, !6, i64 1728, !23, i64 1736, !6, i64 1744, !6, i64 1752, !6, i64 1760, !6, i64 1768, !6, i64 1776, !13, i64 1784, !23, i64 1788, !23, i64 1792, !31, i64 1796, !33, i64 1798, !33, i64 1799, !33, i64 1800, !33, i64 1801, !33, i64 1802, !33, i64 1803}
!22 = !{!"b2ArenaAllocator", !6, i64 0, !23, i64 8, !23, i64 12, !23, i64 16, !23, i64 20, !24, i64 24}
!23 = !{!"int", !7, i64 0}
!24 = !{!"", !6, i64 0, !23, i64 8, !23, i64 12}
!25 = !{!"b2BroadPhase", !7, i64 0, !23, i64 216, !26, i64 224, !24, i64 240, !6, i64 256, !6, i64 264, !23, i64 272, !27, i64 276, !26, i64 280}
!26 = !{!"b2HashSet", !6, i64 0, !23, i64 8, !23, i64 12}
!27 = !{!"b2AtomicInt", !23, i64 0}
!28 = !{!"b2ConstraintGraph", !7, i64 0}
!29 = !{!"b2IdPool", !24, i64 0, !23, i64 16}
!30 = !{!"b2BitSet", !6, i64 0, !23, i64 8, !23, i64 12}
!31 = !{!"short", !7, i64 0}
!32 = !{!"b2Profile", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84}
!33 = !{!"_Bool", !7, i64 0}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!37, !6, i64 0}
!37 = !{!"ExplosionContext", !6, i64 0, !12, i64 8, !13, i64 16, !13, i64 20, !13, i64 24}
!38 = !{!37, !13, i64 16}
!39 = !{!37, !13, i64 20}
!40 = !{!37, !13, i64 24}
!41 = !{!12, !13, i64 0}
!42 = !{!43, !13, i64 0}
!43 = !{!"b2AABB", !12, i64 0, !12, i64 8}
!44 = !{!12, !13, i64 4}
!45 = !{!43, !13, i64 4}
!46 = !{!43, !13, i64 8}
!47 = !{!43, !13, i64 12}


; 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.ExplosionContext = type { ptr, %struct.b2Vec2, float, float, float }
%struct.b2Vec2 = type { float, float }

@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @b2GetWorldFromId(i32) local_unnamed_addr #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

declare zeroext i1 @b2IsValidFloat(float noundef) local_unnamed_addr #1

declare i64 @b2DynamicTree_Query(ptr noundef, <2 x float>, <2 x float>, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i1 @b2IsValidVec2(<2 x float>) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @b2World_Explode(i32 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #4 {
  %3 = alloca %struct.ExplosionContext, align 8
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.026.0.copyload = load <2 x float>, ptr %5, align 8
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load <2 x float>, ptr %6, align 8, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %1, i64 24
  %9 = load float, ptr %8, align 8, !tbaa !13
  %10 = tail call zeroext i1 @b2IsValidVec2(<2 x float> %.sroa.026.0.copyload) #5
  br i1 %10, label %14, label %11

11:                                               ; preds = %2
  %12 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.67, ptr noundef nonnull @.str.1, i32 noundef 2753) #5
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %14, label %13

13:                                               ; preds = %11
  tail call void @llvm.trap()
  unreachable

14:                                               ; preds = %2, %11
  %15 = extractelement <2 x float> %7, i64 0
  %16 = tail call zeroext i1 @b2IsValidFloat(float noundef %15) #5
  %17 = fcmp oge float %15, 0.000000e+00
  %or.cond = and i1 %16, %17
  br i1 %or.cond, label %21, label %18

18:                                               ; preds = %14
  %19 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.68, ptr noundef nonnull @.str.1, i32 noundef 2754) #5
  %.not39 = icmp eq i32 %19, 0
  br i1 %.not39, label %21, label %20

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

21:                                               ; preds = %18, %14
  %22 = extractelement <2 x float> %7, i64 1
  %23 = tail call zeroext i1 @b2IsValidFloat(float noundef %22) #5
  %24 = fcmp oge float %22, 0.000000e+00
  %or.cond3 = and i1 %23, %24
  br i1 %or.cond3, label %28, label %25

25:                                               ; preds = %21
  %26 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.69, ptr noundef nonnull @.str.1, i32 noundef 2755) #5
  %.not40 = icmp eq i32 %26, 0
  br i1 %.not40, label %28, label %27

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

28:                                               ; preds = %25, %21
  %29 = tail call zeroext i1 @b2IsValidFloat(float noundef %9) #5
  br i1 %29, label %33, label %30

30:                                               ; preds = %28
  %31 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.70, ptr noundef nonnull @.str.1, i32 noundef 2756) #5
  %.not41 = icmp eq i32 %31, 0
  br i1 %.not41, label %33, label %32

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

33:                                               ; preds = %30, %28
  %34 = tail call ptr @b2GetWorldFromId(i32 %0)
  %35 = getelementptr inbounds i8, ptr %34, i64 1799
  %36 = load i8, ptr %35, align 1, !tbaa !14, !range !29, !noundef !30
  %37 = icmp eq i8 %36, 0
  br i1 %37, label %.thread, label %38

38:                                               ; preds = %33
  %39 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 2759) #5
  %.not42 = icmp eq i32 %39, 0
  br i1 %.not42, label %41, label %40

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

41:                                               ; preds = %38
  %.pre = load i8, ptr %35, align 1, !tbaa !14, !range !29
  %42 = trunc nuw i8 %.pre to i1
  br i1 %42, label %53, label %.thread

.thread:                                          ; preds = %33, %41
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  store ptr %34, ptr %3, align 8, !tbaa !31
  %43 = getelementptr inbounds i8, ptr %3, i64 8
  store <2 x float> %.sroa.026.0.copyload, ptr %43, align 8
  %44 = getelementptr inbounds i8, ptr %3, i64 16
  store <2 x float> %7, ptr %44, align 8, !tbaa !12
  %45 = getelementptr inbounds i8, ptr %3, i64 24
  store float %9, ptr %45, align 8, !tbaa !33
  %46 = fadd float %15, %22
  %47 = insertelement <2 x float> poison, float %46, i64 0
  %48 = shufflevector <2 x float> %47, <2 x float> poison, <2 x i32> zeroinitializer
  %49 = fsub <2 x float> %.sroa.026.0.copyload, %48
  %50 = fadd <2 x float> %.sroa.026.0.copyload, %48
  %51 = getelementptr inbounds i8, ptr %34, i64 184
  %52 = call i64 @b2DynamicTree_Query(ptr noundef nonnull %51, <2 x float> %49, <2 x float> %50, i64 noundef %4, ptr noundef nonnull @ExplosionCallback, ptr noundef nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br label %53

53:                                               ; preds = %41, %.thread
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @ExplosionCallback(i32 noundef, i64 noundef, ptr noundef) #4

attributes #0 = { 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 #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 nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"b2ExplosionDef", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 20, !11, i64 24}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!11 = !{!"float", !8, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!6, !11, i64 24}
!14 = !{!15, !28, i64 1799}
!15 = !{!"b2World", !16, i64 0, !20, i64 40, !23, i64 336, !24, i64 1008, !19, i64 1032, !24, i64 1048, !19, i64 1072, !24, i64 1088, !19, i64 1112, !24, i64 1128, !19, i64 1152, !24, i64 1168, !19, i64 1192, !24, i64 1208, !24, i64 1232, !19, i64 1256, !19, i64 1272, !19, i64 1288, !19, i64 1304, !19, i64 1320, !19, i64 1336, !19, i64 1352, !19, i64 1368, !8, i64 1384, !8, i64 1416, !18, i64 1448, !19, i64 1456, !25, i64 1472, !25, i64 1488, !25, i64 1504, !25, i64 1520, !7, i64 1536, !18, i64 1544, !10, i64 1548, !11, i64 1556, !11, i64 1560, !11, i64 1564, !11, i64 1568, !11, i64 1572, !11, i64 1576, !11, i64 1580, !11, i64 1584, !17, i64 1592, !17, i64 1600, !26, i64 1608, !27, i64 1612, !17, i64 1704, !17, i64 1712, !17, i64 1720, !17, i64 1728, !18, i64 1736, !17, i64 1744, !17, i64 1752, !17, i64 1760, !17, i64 1768, !17, i64 1776, !11, i64 1784, !18, i64 1788, !18, i64 1792, !26, i64 1796, !28, i64 1798, !28, i64 1799, !28, i64 1800, !28, i64 1801, !28, i64 1802, !28, i64 1803}
!16 = !{!"b2ArenaAllocator", !17, i64 0, !18, i64 8, !18, i64 12, !18, i64 16, !18, i64 20, !19, i64 24}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"int", !8, i64 0}
!19 = !{!"", !17, i64 0, !18, i64 8, !18, i64 12}
!20 = !{!"b2BroadPhase", !8, i64 0, !18, i64 216, !21, i64 224, !19, i64 240, !17, i64 256, !17, i64 264, !18, i64 272, !22, i64 276, !21, i64 280}
!21 = !{!"b2HashSet", !17, i64 0, !18, i64 8, !18, i64 12}
!22 = !{!"b2AtomicInt", !18, i64 0}
!23 = !{!"b2ConstraintGraph", !8, i64 0}
!24 = !{!"b2IdPool", !19, i64 0, !18, i64 16}
!25 = !{!"b2BitSet", !17, i64 0, !18, i64 8, !18, i64 12}
!26 = !{!"short", !8, i64 0}
!27 = !{!"b2Profile", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84}
!28 = !{!"_Bool", !8, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!32, !17, i64 0}
!32 = !{!"ExplosionContext", !17, i64 0, !10, i64 8, !11, i64 16, !11, i64 20, !11, i64 24}
!33 = !{!32, !11, i64 24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass