; LLVM IR from mtsamis/box2d-optimized :: src/particle/b2_particle_system.ll (ZN16b2ParticleSystem14SolveCollisionERK10b2TimeStep)

; 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 }
%class.SolveCollisionCallback = type { %class.b2FixtureParticleQueryCallback, %struct.b2TimeStep, ptr }
%class.b2FixtureParticleQueryCallback = type { %class.b2QueryCallback, ptr }
%class.b2QueryCallback = type { ptr }
%struct.b2TimeStep = type { float, float, float, i32, i32, i32, i8 }
%class.b2ParticleSystem = type { i8, i32, i32, i8, i32, i8, i8, i32, float, float, float, float, i32, i32, %class.b2SlabAllocator, %"struct.b2ParticleSystem::UserOverridableBuffer", %"struct.b2ParticleSystem::UserOverridableBuffer.0", %"struct.b2ParticleSystem::UserOverridableBuffer.2", %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr, ptr, ptr, ptr, ptr, ptr, %"struct.b2ParticleSystem::UserOverridableBuffer.4", ptr, %"struct.b2ParticleSystem::UserOverridableBuffer.6", i32, [4 x i8], %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", %class.b2GrowableBuffer, %class.b2GrowableBuffer.10, %class.b2GrowableBuffer.11, %class.b2GrowableBuffer.12, %class.b2GrowableBuffer.13, %class.b2GrowableBuffer.14, %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", i64, i8, i32, ptr, %struct.b2ParticleSystemDef, ptr, ptr, ptr }
%class.b2SlabAllocator = type { %class.b2TrackedBlockAllocator, i32, %class.b2TypedFreeList }
%class.b2TrackedBlockAllocator = type { %class.b2TypedIntrusiveListNode }
%class.b2TypedIntrusiveListNode = type { %class.b2IntrusiveListNode }
%class.b2IntrusiveListNode = type { ptr, ptr }
%class.b2TypedFreeList = type { %class.b2FreeList }
%class.b2FreeList = type { %class.b2IntrusiveListNode, %class.b2IntrusiveListNode }
%"struct.b2ParticleSystem::UserOverridableBuffer" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.0" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.2" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.4" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.6" = type <{ ptr, i32, [4 x i8] }>
%class.b2GrowableBuffer = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.10 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.11 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.12 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.13 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.14 = type { ptr, i32, i32, ptr }
%"struct.b2ParticleSystem::UserOverridableBuffer.8" = type <{ ptr, i32, [4 x i8] }>
%struct.b2ParticleSystemDef = type { i8, float, float, float, i32, float, float, float, float, float, float, float, float, float, float, float, float, i32, float, i8, float }

; 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 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6b2AABBC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #2 align 2

declare void @_ZN7b2World9QueryAABBEP15b2QueryCallbackRK6b2AABB(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef, ptr noundef nonnull align 4 dereferenceable(16)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmlfRK6b2Vec2(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z5b2MinRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z5b2MaxRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK16b2ParticleSystem23GetFixtureContactFilterEv(ptr noundef nonnull align 8 dereferenceable(632)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem14SolveCollisionERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 4 dereferenceable(28) %1) #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.b2AABB, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.b2Vec2, align 4
  %8 = alloca %struct.b2Vec2, align 4
  %9 = alloca %struct.b2Vec2, align 4
  %10 = alloca %struct.b2Vec2, align 4
  %11 = alloca %struct.b2Vec2, align 4
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca %struct.b2Vec2, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca %class.SolveCollisionCallback, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #8
  call void @_ZN6b2AABBC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %5)
  %19 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 0
  %20 = getelementptr inbounds %struct.b2Vec2, ptr %19, i32 0, i32 0
  store float 0x47EFFFFFE0000000, ptr %20, align 4, !tbaa !9
  %21 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 0
  %22 = getelementptr inbounds %struct.b2Vec2, ptr %21, i32 0, i32 1
  store float 0x47EFFFFFE0000000, ptr %22, align 4, !tbaa !13
  %23 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 1
  %24 = getelementptr inbounds %struct.b2Vec2, ptr %23, i32 0, i32 0
  store float 0xC7EFFFFFE0000000, ptr %24, align 4, !tbaa !14
  %25 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 1
  %26 = getelementptr inbounds %struct.b2Vec2, ptr %25, i32 0, i32 1
  store float 0xC7EFFFFFE0000000, ptr %26, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !16
  br label %27

27:                                               ; preds = %59, %2
  %28 = load i32, ptr %6, align 4, !tbaa !16
  %29 = getelementptr inbounds %class.b2ParticleSystem, ptr %18, i32 0, i32 12
  %30 = load i32, ptr %29, align 4, !tbaa !18
  %31 = icmp slt i32 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %62

33:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %34 = getelementptr inbounds %class.b2ParticleSystem, ptr %18, i32 0, i32 18
  %35 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !41
  %37 = load i32, ptr %6, align 4, !tbaa !16
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %struct.b2Vec2, ptr %36, i64 %38
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %39, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %40 = getelementptr inbounds %class.b2ParticleSystem, ptr %18, i32 0, i32 17
  %41 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !44
  %43 = load i32, ptr %6, align 4, !tbaa !16
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %struct.b2Vec2, ptr %42, i64 %44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %45, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.b2TimeStep, ptr %46, i32 0, i32 0
  %48 = load float, ptr %47, align 4, !tbaa !45
  %49 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %48, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %49, ptr %10, align 4
  %50 = call <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %50, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %51 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %52 = call <2 x float> @_Z5b2MinRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %52, ptr %12, align 4
  %53 = call <2 x float> @_Z5b2MinRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %51, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %53, ptr %11, align 4
  %54 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %54, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %55 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %56 = call <2 x float> @_Z5b2MaxRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %56, ptr %14, align 4
  %57 = call <2 x float> @_Z5b2MaxRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %55, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %57, ptr %13, align 4
  %58 = getelementptr inbounds %struct.b2AABB, ptr %5, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %58, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %59

59:                                               ; preds = %33
  %60 = load i32, ptr %6, align 4, !tbaa !16
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %6, align 4, !tbaa !16
  br label %27, !llvm.loop !47

62:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 56, ptr %15) #8
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = call noundef ptr @_ZNK16b2ParticleSystem23GetFixtureContactFilterEv(ptr noundef nonnull align 8 dereferenceable(632) %18)
  call void @_ZZN16b2ParticleSystem14SolveCollisionERK10b2TimeStepEN22SolveCollisionCallbackC2EPS_S2_P15b2ContactFilter(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef %18, ptr noundef nonnull align 4 dereferenceable(28) %63, ptr noundef %64)
  %65 = getelementptr inbounds %class.b2ParticleSystem, ptr %18, i32 0, i32 46
  %66 = load ptr, ptr %65, align 8, !tbaa !49
  invoke void @_ZN7b2World9QueryAABBEP15b2QueryCallbackRK6b2AABB(ptr noundef nonnull align 8 dereferenceable(103352) %66, ptr noundef %15, ptr noundef nonnull align 4 dereferenceable(16) %5)
          to label %67 unwind label %68

67:                                               ; preds = %62
  call void @_ZN15b2QueryCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %15) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #8
  ret void

68:                                               ; preds = %62
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %16, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %17, align 4
  call void @_ZN15b2QueryCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %15) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #8
  br label %72

72:                                               ; preds = %68
  %73 = load ptr, ptr %16, align 8
  %74 = load i32, ptr %17, align 4
  %75 = insertvalue { ptr, i32 } poison, ptr %73, 0
  %76 = insertvalue { ptr, i32 } %75, i32 %74, 1
  resume { ptr, i32 } %76
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZZN16b2ParticleSystem14SolveCollisionERK10b2TimeStepEN22SolveCollisionCallbackC2EPS_S2_P15b2ContactFilter(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef nonnull align 4 dereferenceable(28), ptr noundef) unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN15b2QueryCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #7 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress 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 mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 0}
!10 = !{!"_ZTS6b2AABB", !11, i64 0, !11, i64 8}
!11 = !{!"_ZTS6b2Vec2", !12, i64 0, !12, i64 4}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !12, i64 4}
!14 = !{!10, !12, i64 8}
!15 = !{!10, !12, i64 12}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!19, !17, i64 44}
!19 = !{!"_ZTS16b2ParticleSystem", !20, i64 0, !17, i64 4, !17, i64 8, !20, i64 12, !17, i64 16, !20, i64 20, !20, i64 21, !17, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !17, i64 44, !17, i64 48, !21, i64 56, !27, i64 112, !28, i64 128, !29, i64 144, !29, i64 160, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !30, i64 224, !6, i64 240, !31, i64 248, !17, i64 264, !32, i64 272, !32, i64 288, !32, i64 304, !33, i64 320, !34, i64 344, !35, i64 368, !36, i64 392, !37, i64 416, !38, i64 440, !32, i64 464, !32, i64 480, !39, i64 496, !20, i64 504, !17, i64 508, !6, i64 512, !40, i64 520, !6, i64 608, !6, i64 616, !6, i64 624}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !22, i64 0, !17, i64 16, !25, i64 24}
!22 = !{!"_ZTS23b2TrackedBlockAllocator", !23, i64 0}
!23 = !{!"_ZTS24b2TypedIntrusiveListNodeI14b2TrackedBlockE", !24, i64 0}
!24 = !{!"_ZTS19b2IntrusiveListNode", !6, i64 0, !6, i64 8}
!25 = !{!"_ZTS15b2TypedFreeListI16b2ParticleHandleE", !26, i64 0}
!26 = !{!"_ZTS10b2FreeList", !24, i64 0, !24, i64 16}
!27 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIP16b2ParticleHandleEE", !6, i64 0, !17, i64 8}
!28 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !6, i64 0, !17, i64 8}
!29 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !6, i64 0, !17, i64 8}
!30 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !6, i64 0, !17, i64 8}
!31 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !6, i64 0, !17, i64 8}
!32 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !6, i64 0, !17, i64 8}
!33 = !{!"_ZTS16b2GrowableBufferIiE", !6, i64 0, !17, i64 8, !17, i64 12, !6, i64 16}
!34 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !6, i64 0, !17, i64 8, !17, i64 12, !6, i64 16}
!35 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !6, i64 0, !17, i64 8, !17, i64 12, !6, i64 16}
!36 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !6, i64 0, !17, i64 8, !17, i64 12, !6, i64 16}
!37 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !6, i64 0, !17, i64 8, !17, i64 12, !6, i64 16}
!38 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !6, i64 0, !17, i64 8, !17, i64 12, !6, i64 16}
!39 = !{!"long long", !7, i64 0}
!40 = !{!"_ZTS19b2ParticleSystemDef", !20, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !17, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !17, i64 68, !12, i64 72, !20, i64 76, !12, i64 80}
!41 = !{!19, !6, i64 160}
!42 = !{i64 0, i64 4, !43, i64 4, i64 4, !43}
!43 = !{!12, !12, i64 0}
!44 = !{!19, !6, i64 144}
!45 = !{!46, !12, i64 0}
!46 = !{!"_ZTS10b2TimeStep", !12, i64 0, !12, i64 4, !12, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !20, i64 24}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}
!49 = !{!19, !6, i64 608}


; 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.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Vec2 = type { float, float }
%class.SolveCollisionCallback = type { %class.b2FixtureParticleQueryCallback, %struct.b2TimeStep, ptr }
%class.b2FixtureParticleQueryCallback = type { %class.b2QueryCallback, ptr }
%class.b2QueryCallback = type { ptr }
%struct.b2TimeStep = type { float, float, float, i32, i32, i32, i8 }

; 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 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6b2AABBC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #1 align 2

declare void @_ZN7b2World9QueryAABBEP15b2QueryCallbackRK6b2AABB(ptr noundef nonnull align 8 dereferenceable(103352), ptr noundef, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmlfRK6b2Vec2(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z5b2MinRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z5b2MaxRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK16b2ParticleSystem23GetFixtureContactFilterEv(ptr noundef nonnull align 8 dereferenceable(632)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem14SolveCollisionERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 4 dereferenceable(28) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.b2AABB, align 16
  %4 = alloca %struct.b2Vec2, align 8
  %5 = alloca %struct.b2Vec2, align 8
  %6 = alloca %struct.b2Vec2, align 8
  %7 = alloca %struct.b2Vec2, align 8
  %8 = alloca %struct.b2Vec2, align 8
  %9 = alloca %struct.b2Vec2, align 8
  %10 = alloca %class.SolveCollisionCallback, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @_ZN6b2AABBC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %3)
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  store <4 x float> <float 0x47EFFFFFE0000000, float 0x47EFFFFFE0000000, float 0xC7EFFFFFE0000000, float 0xC7EFFFFFE0000000>, ptr %3, align 16, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 44
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %15 = getelementptr inbounds i8, ptr %0, i64 160
  %16 = getelementptr inbounds i8, ptr %0, i64 144
  br label %20

._crit_edge:                                      ; preds = %20, %2
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %10) #7
  %17 = call noundef ptr @_ZNK16b2ParticleSystem23GetFixtureContactFilterEv(ptr noundef nonnull align 8 dereferenceable(632) %0)
  call void @_ZZN16b2ParticleSystem14SolveCollisionERK10b2TimeStepEN22SolveCollisionCallbackC2EPS_S2_P15b2ContactFilter(ptr noundef nonnull align 8 dereferenceable(56) %10, ptr noundef nonnull %0, ptr noundef nonnull align 4 dereferenceable(28) %1, ptr noundef %17)
  %18 = getelementptr inbounds i8, ptr %0, i64 608
  %19 = load ptr, ptr %18, align 8, !tbaa !34
  invoke void @_ZN7b2World9QueryAABBEP15b2QueryCallbackRK6b2AABB(ptr noundef nonnull align 8 dereferenceable(103352) %19, ptr noundef nonnull %10, ptr noundef nonnull align 4 dereferenceable(16) %3)
          to label %37 unwind label %38

20:                                               ; preds = %.lr.ph, %20
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %20 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %21 = load ptr, ptr %15, align 8, !tbaa !35
  %22 = getelementptr inbounds %struct.b2Vec2, ptr %21, i64 %indvars.iv
  %23 = load i64, ptr %22, align 4
  store i64 %23, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %24 = load ptr, ptr %16, align 8, !tbaa !36
  %25 = getelementptr inbounds %struct.b2Vec2, ptr %24, i64 %indvars.iv
  %26 = load i64, ptr %25, align 4
  store i64 %26, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %27 = load float, ptr %1, align 4, !tbaa !37
  %28 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %27, ptr noundef nonnull align 4 dereferenceable(8) %4)
  store <2 x float> %28, ptr %7, align 8
  %29 = call <2 x float> @_ZplRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %29, ptr %6, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %30 = call <2 x float> @_Z5b2MinRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %30, ptr %8, align 8
  %31 = call <2 x float> @_Z5b2MinRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %31, ptr %3, align 16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %32 = call <2 x float> @_Z5b2MaxRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %32, ptr %9, align 8
  %33 = call <2 x float> @_Z5b2MaxRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store <2 x float> %33, ptr %11, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %12, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %20, label %._crit_edge, !llvm.loop !39

37:                                               ; preds = %._crit_edge
  call void @_ZN15b2QueryCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %10) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  ret void

38:                                               ; preds = %._crit_edge
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN15b2QueryCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %10) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  resume { ptr, i32 } %39
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZZN16b2ParticleSystem14SolveCollisionERK10b2TimeStepEN22SolveCollisionCallbackC2EPS_S2_P15b2ContactFilter(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef nonnull align 4 dereferenceable(28), ptr noundef) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN15b2QueryCallbackD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { inlinehint mustprogress 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 mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 44}
!10 = !{!"_ZTS16b2ParticleSystem", !11, i64 0, !12, i64 4, !12, i64 8, !11, i64 12, !12, i64 16, !11, i64 20, !11, i64 21, !12, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !12, i64 44, !12, i64 48, !13, i64 56, !20, i64 112, !21, i64 128, !22, i64 144, !22, i64 160, !17, i64 176, !17, i64 184, !17, i64 192, !17, i64 200, !17, i64 208, !17, i64 216, !23, i64 224, !17, i64 240, !24, i64 248, !12, i64 264, !25, i64 272, !25, i64 288, !25, i64 304, !26, i64 320, !27, i64 344, !28, i64 368, !29, i64 392, !30, i64 416, !31, i64 440, !25, i64 464, !25, i64 480, !32, i64 496, !11, i64 504, !12, i64 508, !17, i64 512, !33, i64 520, !17, i64 608, !17, i64 616, !17, i64 624}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !14, i64 0, !12, i64 16, !18, i64 24}
!14 = !{!"_ZTS23b2TrackedBlockAllocator", !15, i64 0}
!15 = !{!"_ZTS24b2TypedIntrusiveListNodeI14b2TrackedBlockE", !16, i64 0}
!16 = !{!"_ZTS19b2IntrusiveListNode", !17, i64 0, !17, i64 8}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"_ZTS15b2TypedFreeListI16b2ParticleHandleE", !19, i64 0}
!19 = !{!"_ZTS10b2FreeList", !16, i64 0, !16, i64 16}
!20 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIP16b2ParticleHandleEE", !17, i64 0, !12, i64 8}
!21 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !17, i64 0, !12, i64 8}
!22 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !17, i64 0, !12, i64 8}
!23 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !17, i64 0, !12, i64 8}
!24 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !17, i64 0, !12, i64 8}
!25 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !17, i64 0, !12, i64 8}
!26 = !{!"_ZTS16b2GrowableBufferIiE", !17, i64 0, !12, i64 8, !12, i64 12, !17, i64 16}
!27 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !17, i64 0, !12, i64 8, !12, i64 12, !17, i64 16}
!28 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !17, i64 0, !12, i64 8, !12, i64 12, !17, i64 16}
!29 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !17, i64 0, !12, i64 8, !12, i64 12, !17, i64 16}
!30 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !17, i64 0, !12, i64 8, !12, i64 12, !17, i64 16}
!31 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !17, i64 0, !12, i64 8, !12, i64 12, !17, i64 16}
!32 = !{!"long long", !7, i64 0}
!33 = !{!"_ZTS19b2ParticleSystemDef", !11, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !12, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !12, i64 68, !6, i64 72, !11, i64 76, !6, i64 80}
!34 = !{!10, !17, i64 608}
!35 = !{!10, !17, i64 160}
!36 = !{!10, !17, i64 144}
!37 = !{!38, !6, i64 0}
!38 = !{!"_ZTS10b2TimeStep", !6, i64 0, !6, i64 4, !6, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !11, i64 24}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass