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

%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.b2ParticleSystem::Proxy" = type { i32, i32 }

; 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 ptr @_ZNK16b2GrowableBufferIN16b2ParticleSystem5ProxyEE5BeginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16b2ParticleSystem12FindContactsER16b2GrowableBufferI17b2ParticleContactE(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  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) #5
  %16 = getelementptr inbounds %class.b2ParticleSystem, ptr %15, i32 0, i32 34
  %17 = call noundef ptr @_ZNK16b2GrowableBufferIN16b2ParticleSystem5ProxyEE5BeginEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  store ptr %17, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %18 = getelementptr inbounds %class.b2ParticleSystem, ptr %15, i32 0, i32 34
  %19 = call noundef ptr @_ZNK16b2GrowableBufferIN16b2ParticleSystem5ProxyEE3EndEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  store ptr %19, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN16b2GrowableBufferI17b2ParticleContactE8SetCountEi(ptr noundef nonnull align 8 dereferenceable(24) %20, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %21, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %22, ptr %8, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %110, %2
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = icmp ult ptr %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %113

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = call noundef i32 @_ZL18computeRelativeTagjii(i32 noundef %31, i32 noundef 1, i32 noundef 0)
  store i32 %32, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %33, i64 1
  store ptr %34, ptr %11, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %55, %28
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = icmp ult ptr %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 5, ptr %9, align 4
  br label %58

40:                                               ; preds = %35
  %41 = load i32, ptr %10, align 4, !tbaa !12
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = icmp ult i32 %41, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %40
  store i32 5, ptr %9, align 4
  br label %58

47:                                               ; preds = %40
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 4, !tbaa !13
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK16b2ParticleSystem10AddContactEiiR16b2GrowableBufferI17b2ParticleContactE(ptr noundef nonnull align 8 dereferenceable(632) %15, i32 noundef %50, i32 noundef %53, ptr noundef nonnull align 8 dereferenceable(24) %54)
  br label %55

55:                                               ; preds = %47
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %56, i32 1
  store ptr %57, ptr %11, align 8, !tbaa !5
  br label %35, !llvm.loop !14

58:                                               ; preds = %46, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %59

59:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = call noundef i32 @_ZL18computeRelativeTagjii(i32 noundef %62, i32 noundef -1, i32 noundef 1)
  store i32 %63, ptr %12, align 4, !tbaa !12
  br label %64

64:                                               ; preds = %76, %59
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = icmp ult ptr %65, %66
  br i1 %67, label %68, label %79

68:                                               ; preds = %64
  %69 = load i32, ptr %12, align 4, !tbaa !12
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = icmp ule i32 %69, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %68
  br label %79

75:                                               ; preds = %68
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %77, i32 1
  store ptr %78, ptr %8, align 8, !tbaa !5
  br label %64, !llvm.loop !16

79:                                               ; preds = %74, %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = call noundef i32 @_ZL18computeRelativeTagjii(i32 noundef %82, i32 noundef 1, i32 noundef 1)
  store i32 %83, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %84, ptr %14, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %105, %79
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = icmp ult ptr %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 11, ptr %9, align 4
  br label %108

90:                                               ; preds = %85
  %91 = load i32, ptr %13, align 4, !tbaa !12
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = icmp ult i32 %91, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %90
  store i32 11, ptr %9, align 4
  br label %108

97:                                               ; preds = %90
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !13
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %101, i32 0, i32 0
  %103 = load i32, ptr %102, align 4, !tbaa !13
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK16b2ParticleSystem10AddContactEiiR16b2GrowableBufferI17b2ParticleContactE(ptr noundef nonnull align 8 dereferenceable(632) %15, i32 noundef %100, i32 noundef %103, ptr noundef nonnull align 8 dereferenceable(24) %104)
  br label %105

105:                                              ; preds = %97
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %106, i32 1
  store ptr %107, ptr %14, align 8, !tbaa !5
  br label %85, !llvm.loop !17

108:                                              ; preds = %96, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %109

109:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %111, i32 1
  store ptr %112, ptr %7, align 8, !tbaa !5
  br label %23, !llvm.loop !18

113:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL18computeRelativeTagjii(i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK16b2ParticleSystem10AddContactEiiR16b2GrowableBufferI17b2ParticleContactE(ptr noundef nonnull align 8 dereferenceable(632), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #4 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 = { 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 = { 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 #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 = { 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 4}
!10 = !{!"_ZTSN16b2ParticleSystem5ProxyE", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16b2ParticleSystem12FindContactsER16b2GrowableBufferI17b2ParticleContactE(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 344
  %4 = tail call noundef ptr @_ZNK16b2GrowableBufferIN16b2ParticleSystem5ProxyEE5BeginEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %5 = tail call noundef ptr @_ZNK16b2GrowableBufferIN16b2ParticleSystem5ProxyEE3EndEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  tail call void @_ZN16b2GrowableBufferI17b2ParticleContactE8SetCountEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 0)
  %6 = icmp ult ptr %4, %5
  br i1 %6, label %.lr.ph52, label %._crit_edge53

._crit_edge53:                                    ; preds = %._crit_edge47, %2
  ret void

.lr.ph52:                                         ; preds = %2, %._crit_edge47
  %.03250 = phi ptr [ %10, %._crit_edge47 ], [ %4, %2 ]
  %.03349 = phi ptr [ %.1.lcssa, %._crit_edge47 ], [ %4, %2 ]
  %7 = getelementptr inbounds i8, ptr %.03250, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = tail call noundef i32 @_ZL18computeRelativeTagjii(i32 noundef %8, i32 noundef 1, i32 noundef 0)
  %10 = getelementptr inbounds i8, ptr %.03250, i64 8
  %11 = icmp ult ptr %10, %5
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph52, %15
  %.03436 = phi ptr [ %18, %15 ], [ %10, %.lr.ph52 ]
  %12 = getelementptr inbounds i8, ptr %.03436, i64 4
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = icmp ult i32 %9, %13
  br i1 %14, label %._crit_edge, label %15

15:                                               ; preds = %.lr.ph
  %16 = load i32, ptr %.03250, align 4, !tbaa !10
  %17 = load i32, ptr %.03436, align 4, !tbaa !10
  tail call void @_ZNK16b2ParticleSystem10AddContactEiiR16b2GrowableBufferI17b2ParticleContactE(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %16, i32 noundef %17, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %18 = getelementptr inbounds i8, ptr %.03436, i64 8
  %19 = icmp ult ptr %18, %5
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %15, %.lr.ph, %.lr.ph52
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = tail call noundef i32 @_ZL18computeRelativeTagjii(i32 noundef %20, i32 noundef -1, i32 noundef 1)
  %22 = icmp ult ptr %.03349, %5
  br i1 %22, label %.lr.ph40, label %._crit_edge41

.lr.ph40:                                         ; preds = %._crit_edge, %25
  %.138 = phi ptr [ %26, %25 ], [ %.03349, %._crit_edge ]
  %23 = getelementptr inbounds i8, ptr %.138, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %.not = icmp ugt i32 %21, %24
  br i1 %.not, label %25, label %._crit_edge41

25:                                               ; preds = %.lr.ph40
  %26 = getelementptr inbounds i8, ptr %.138, i64 8
  %27 = icmp ult ptr %26, %5
  br i1 %27, label %.lr.ph40, label %._crit_edge41, !llvm.loop !13

._crit_edge41:                                    ; preds = %25, %.lr.ph40, %._crit_edge
  %.1.lcssa = phi ptr [ %.03349, %._crit_edge ], [ %.138, %.lr.ph40 ], [ %26, %25 ]
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = tail call noundef i32 @_ZL18computeRelativeTagjii(i32 noundef %28, i32 noundef 1, i32 noundef 1)
  %30 = icmp ult ptr %.1.lcssa, %5
  br i1 %30, label %.lr.ph46, label %._crit_edge47

.lr.ph46:                                         ; preds = %._crit_edge41, %34
  %.044 = phi ptr [ %37, %34 ], [ %.1.lcssa, %._crit_edge41 ]
  %31 = getelementptr inbounds i8, ptr %.044, i64 4
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = icmp ult i32 %29, %32
  br i1 %33, label %._crit_edge47, label %34

34:                                               ; preds = %.lr.ph46
  %35 = load i32, ptr %.03250, align 4, !tbaa !10
  %36 = load i32, ptr %.044, align 4, !tbaa !10
  tail call void @_ZNK16b2ParticleSystem10AddContactEiiR16b2GrowableBufferI17b2ParticleContactE(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %35, i32 noundef %36, ptr noundef nonnull align 8 dereferenceable(24) %1)
  %37 = getelementptr inbounds i8, ptr %.044, i64 8
  %38 = icmp ult ptr %37, %5
  br i1 %38, label %.lr.ph46, label %._crit_edge47, !llvm.loop !14

._crit_edge47:                                    ; preds = %34, %.lr.ph46, %._crit_edge41
  br i1 %11, label %.lr.ph52, label %._crit_edge53, !llvm.loop !15
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16b2GrowableBufferI17b2ParticleContactE8SetCountEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL18computeRelativeTagjii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK16b2ParticleSystem10AddContactEiiR16b2GrowableBufferI17b2ParticleContactE(ptr noundef nonnull align 8 dereferenceable(632), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { 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 = { 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 = { 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" }

!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 4}
!6 = !{!"_ZTSN16b2ParticleSystem5ProxyE", !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 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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