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

; 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.(anonymous namespace)::LightweightPair" = type { i32, i32 }
%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 }
%struct.b2ParticleContact = type { i32, i32, float, %struct.b2Vec2, i32 }
%struct.b2Vec2 = type { float, 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK17b2ParticleContact9GetIndexAEv(ptr noundef nonnull align 4 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem32NotifyContactListenerPostContactER17b2ParticlePairSet(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.(anonymous namespace)::LightweightPair", align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %16 = call noundef ptr @_ZNK16b2ParticleSystem26GetParticleContactListenerEv(ptr noundef nonnull align 8 dereferenceable(632) %15)
  store ptr %16, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  store i32 1, ptr %6, align 4
  br label %95

20:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %21 = getelementptr inbounds %class.b2ParticleSystem, ptr %15, i32 0, i32 35
  %22 = call noundef ptr @_ZN16b2GrowableBufferI17b2ParticleContactE3EndEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  store ptr %22, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %23 = getelementptr inbounds %class.b2ParticleSystem, ptr %15, i32 0, i32 35
  %24 = call noundef ptr @_ZN16b2GrowableBufferI17b2ParticleContactE5BeginEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  store ptr %24, ptr %8, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %51, %20
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = icmp ult ptr %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %54

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexAEv(ptr noundef nonnull align 4 dereferenceable(24) %31)
  %33 = getelementptr inbounds %"struct.(anonymous namespace)::LightweightPair", ptr %9, i32 0, i32 0
  store i32 %32, ptr %33, align 4, !tbaa !9
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24) %34)
  %36 = getelementptr inbounds %"struct.(anonymous namespace)::LightweightPair", ptr %9, i32 0, i32 1
  store i32 %35, ptr %36, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = call noundef i32 @_ZNK17b2ParticlePairSet4FindERKN12_GLOBAL__N_115LightweightPairIiiEE(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store i32 %38, ptr %10, align 4, !tbaa !13
  %39 = load i32, ptr %10, align 4, !tbaa !13
  %40 = icmp sge i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %30
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = load i32, ptr %10, align 4, !tbaa !13
  call void @_ZN12_GLOBAL__N_117FixedSetAllocator10InvalidateEi(ptr noundef nonnull align 8 dereferenceable(32) %42, i32 noundef %43)
  br label %50

44:                                               ; preds = %30
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = load ptr, ptr %45, align 8, !tbaa !14
  %48 = getelementptr inbounds ptr, ptr %47, i64 6
  %49 = load ptr, ptr %48, align 8
  call void %49(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef %15, ptr noundef %46)
  br label %50

50:                                               ; preds = %44, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2ParticleContact, ptr %52, i32 1
  store ptr %53, ptr %8, align 8, !tbaa !5
  br label %25, !llvm.loop !16

54:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = call noundef i32 @_ZNK12_GLOBAL__N_117FixedSetAllocator8GetCountEv(ptr noundef nonnull align 8 dereferenceable(32) %55)
  store i32 %56, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = call noundef ptr @_ZN12_GLOBAL__N_122TypedFixedSetAllocatorINS_15LightweightPairIiiEEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(32) %57)
  store ptr %58, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = call noundef ptr @_ZNK12_GLOBAL__N_117FixedSetAllocator14GetValidBufferEv(ptr noundef nonnull align 8 dereferenceable(32) %59)
  store ptr %60, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !13
  br label %61

61:                                               ; preds = %91, %54
  %62 = load i32, ptr %14, align 4, !tbaa !13
  %63 = load i32, ptr %11, align 4, !tbaa !13
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %94

66:                                               ; preds = %61
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = load i32, ptr %14, align 4, !tbaa !13
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %67, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !18
  %72 = icmp ne i8 %71, 0
  br i1 %72, label %73, label %90

73:                                               ; preds = %66
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = load i32, ptr %14, align 4, !tbaa !13
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %"struct.(anonymous namespace)::LightweightPair", ptr %75, i64 %77
  %79 = getelementptr inbounds %"struct.(anonymous namespace)::LightweightPair", ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = load i32, ptr %14, align 4, !tbaa !13
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %"struct.(anonymous namespace)::LightweightPair", ptr %81, i64 %83
  %85 = getelementptr inbounds %"struct.(anonymous namespace)::LightweightPair", ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !12
  %87 = load ptr, ptr %74, align 8, !tbaa !14
  %88 = getelementptr inbounds ptr, ptr %87, i64 7
  %89 = load ptr, ptr %88, align 8
  call void %89(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef %15, i32 noundef %80, i32 noundef %86)
  br label %90

90:                                               ; preds = %73, %66
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %14, align 4, !tbaa !13
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %14, align 4, !tbaa !13
  br label %61, !llvm.loop !19

94:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  store i32 0, ptr %6, align 4
  br label %95

95:                                               ; preds = %94, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  %96 = load i32, ptr %6, align 4
  switch i32 %96, label %98 [
    i32 0, label %97
    i32 1, label %97
  ]

97:                                               ; preds = %95, %95
  ret void

98:                                               ; preds = %95
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN16b2GrowableBufferI17b2ParticleContactE3EndEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN16b2GrowableBufferI17b2ParticleContactE5BeginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZNK17b2ParticlePairSet4FindERKN12_GLOBAL__N_115LightweightPairIiiEE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_117FixedSetAllocator10InvalidateEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZNK12_GLOBAL__N_117FixedSetAllocator8GetCountEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN12_GLOBAL__N_122TypedFixedSetAllocatorINS_15LightweightPairIiiEEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZNK12_GLOBAL__N_117FixedSetAllocator14GetValidBufferEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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, !11, i64 0}
!10 = !{!"_ZTSN12_GLOBAL__N_115LightweightPairIiiEE", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !17}


; 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.(anonymous namespace)::LightweightPair" = type { i32, i32 }

; 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK17b2ParticleContact9GetIndexAEv(ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem32NotifyContactListenerPostContactER17b2ParticlePairSet(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %"struct.(anonymous namespace)::LightweightPair", align 4
  %4 = tail call noundef ptr @_ZNK16b2ParticleSystem26GetParticleContactListenerEv(ptr noundef nonnull align 8 dereferenceable(632) %0)
  %5 = icmp eq ptr %4, null
  br i1 %5, label %.loopexit, label %6

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 368
  %8 = tail call noundef ptr @_ZN16b2GrowableBufferI17b2ParticleContactE3EndEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %9 = tail call noundef ptr @_ZN16b2GrowableBufferI17b2ParticleContactE5BeginEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %10 = icmp ult ptr %9, %8
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %11 = getelementptr inbounds i8, ptr %3, i64 4
  br label %16

._crit_edge:                                      ; preds = %26, %6
  %12 = call noundef i32 @_ZNK12_GLOBAL__N_117FixedSetAllocator8GetCountEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %13 = call noundef ptr @_ZN12_GLOBAL__N_122TypedFixedSetAllocatorINS_15LightweightPairIiiEEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %14 = call noundef ptr @_ZNK12_GLOBAL__N_117FixedSetAllocator14GetValidBufferEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %15 = icmp sgt i32 %12, 0
  br i1 %15, label %.lr.ph31.preheader, label %.loopexit

.lr.ph31.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %12 to i64
  br label %.lr.ph31

16:                                               ; preds = %.lr.ph, %26
  %.02528 = phi ptr [ %9, %.lr.ph ], [ %27, %26 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %17 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexAEv(ptr noundef nonnull align 4 dereferenceable(24) %.02528)
  store i32 %17, ptr %3, align 4, !tbaa !5
  %18 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24) %.02528)
  store i32 %18, ptr %11, align 4, !tbaa !10
  %19 = call noundef i32 @_ZNK17b2ParticlePairSet4FindERKN12_GLOBAL__N_115LightweightPairIiiEE(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %20 = icmp sgt i32 %19, -1
  br i1 %20, label %21, label %22

21:                                               ; preds = %16
  call void @_ZN12_GLOBAL__N_117FixedSetAllocator10InvalidateEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %19)
  br label %26

22:                                               ; preds = %16
  %23 = load ptr, ptr %4, align 8, !tbaa !11
  %24 = getelementptr inbounds i8, ptr %23, i64 48
  %25 = load ptr, ptr %24, align 8
  call void %25(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %0, ptr noundef nonnull %.02528)
  br label %26

26:                                               ; preds = %22, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %27 = getelementptr inbounds i8, ptr %.02528, i64 24
  %28 = icmp ult ptr %27, %8
  br i1 %28, label %16, label %._crit_edge, !llvm.loop !13

.lr.ph31:                                         ; preds = %.lr.ph31.preheader, %39
  %indvars.iv = phi i64 [ 0, %.lr.ph31.preheader ], [ %indvars.iv.next, %39 ]
  %29 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv
  %30 = load i8, ptr %29, align 1, !tbaa !15
  %.not = icmp eq i8 %30, 0
  br i1 %.not, label %39, label %31

31:                                               ; preds = %.lr.ph31
  %32 = getelementptr inbounds %"struct.(anonymous namespace)::LightweightPair", ptr %13, i64 %indvars.iv
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %32, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !10
  %36 = load ptr, ptr %4, align 8, !tbaa !11
  %37 = getelementptr inbounds i8, ptr %36, i64 56
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %0, i32 noundef %33, i32 noundef %35)
  br label %39

39:                                               ; preds = %.lr.ph31, %31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph31, !llvm.loop !16

.loopexit:                                        ; preds = %39, %._crit_edge, %2
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN16b2GrowableBufferI17b2ParticleContactE3EndEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN16b2GrowableBufferI17b2ParticleContactE5BeginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZNK17b2ParticlePairSet4FindERKN12_GLOBAL__N_115LightweightPairIiiEE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_117FixedSetAllocator10InvalidateEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZNK12_GLOBAL__N_117FixedSetAllocator8GetCountEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN12_GLOBAL__N_122TypedFixedSetAllocatorINS_15LightweightPairIiiEEE9GetBufferEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZNK12_GLOBAL__N_117FixedSetAllocator14GetValidBufferEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 = !{!"_ZTSN12_GLOBAL__N_115LightweightPairIiiEE", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !9, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!8, !8, i64 0}
!16 = distinct !{!16, !14}


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