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

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

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN16b2ParticleSystem19SetParticleLifetimeEif = external hidden unnamed_addr constant [71 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem19SetParticleLifetimeEif(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %1, float noundef %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca float, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store float %2, ptr %6, align 4, !tbaa !11
  %12 = load ptr, ptr %4, align 8
  %13 = load i32, ptr %5, align 4, !tbaa !9
  %14 = call noundef zeroext i1 @_ZNK16b2ParticleSystem21ValidateParticleIndexEi(ptr noundef nonnull align 8 dereferenceable(632) %12, i32 noundef %13)
  br i1 %14, label %15, label %16

15:                                               ; preds = %3
  br label %18

16:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.34, ptr noundef @.str.1, i32 noundef 4011, ptr noundef @__PRETTY_FUNCTION__._ZN16b2ParticleSystem19SetParticleLifetimeEif) #5
  unreachable

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  %19 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 40
  %20 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = icmp eq ptr %21, null
  %23 = zext i1 %22 to i8
  store i8 %23, ptr %7, align 1, !tbaa !36
  %24 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 39
  %25 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !37
  %27 = call noundef ptr @_ZN16b2ParticleSystem13RequestBufferIiEEPT_S2_(ptr noundef nonnull align 8 dereferenceable(632) %12, ptr noundef %26)
  %28 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 39
  %29 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %28, i32 0, i32 0
  store ptr %27, ptr %29, align 8, !tbaa !37
  %30 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 40
  %31 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = call noundef ptr @_ZN16b2ParticleSystem13RequestBufferIiEEPT_S2_(ptr noundef nonnull align 8 dereferenceable(632) %12, ptr noundef %32)
  %34 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 40
  %35 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %34, i32 0, i32 0
  store ptr %33, ptr %35, align 8, !tbaa !13
  %36 = load i8, ptr %7, align 1, !tbaa !36, !range !38, !noundef !39
  %37 = trunc i8 %36 to i1
  br i1 %37, label %38, label %57

38:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %39 = call noundef i32 @_ZNK16b2ParticleSystem16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(632) %12)
  store i32 %39, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %53, %38
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %56

45:                                               ; preds = %40
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 40
  %48 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  store i32 %46, ptr %52, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %45
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %9, align 4, !tbaa !9
  br label %40, !llvm.loop !40

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

57:                                               ; preds = %56, %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %58 = load float, ptr %6, align 4, !tbaa !11
  %59 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 45
  %60 = getelementptr inbounds %struct.b2ParticleSystemDef, ptr %59, i32 0, i32 20
  %61 = load float, ptr %60, align 8, !tbaa !42
  %62 = fdiv float %58, %61
  %63 = fptosi float %62 to i32
  store i32 %63, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %66, label %70

66:                                               ; preds = %57
  %67 = call noundef i32 @_ZNK16b2ParticleSystem23GetQuantizedTimeElapsedEv(ptr noundef nonnull align 8 dereferenceable(632) %12)
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = add nsw i32 %67, %68
  br label %72

70:                                               ; preds = %57
  %71 = load i32, ptr %10, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %70, %66
  %73 = phi i32 [ %69, %66 ], [ %71, %70 ]
  store i32 %73, ptr %11, align 4, !tbaa !9
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 39
  %76 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !37
  %78 = load i32, ptr %5, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i32, ptr %77, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = icmp ne i32 %74, %81
  br i1 %82, label %83, label %92

83:                                               ; preds = %72
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 39
  %86 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !37
  %88 = load i32, ptr %5, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %87, i64 %89
  store i32 %84, ptr %90, align 4, !tbaa !9
  %91 = getelementptr inbounds %class.b2ParticleSystem, ptr %12, i32 0, i32 42
  store i8 1, ptr %91, align 8, !tbaa !43
  br label %92

92:                                               ; preds = %83, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK16b2ParticleSystem21ValidateParticleIndexEi(ptr noundef nonnull align 8 dereferenceable(632), i32 noundef) #4 align 2

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

attributes #0 = { noreturn nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 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 = { noreturn nounwind }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 480}
!14 = !{!"_ZTS16b2ParticleSystem", !15, i64 0, !10, i64 4, !10, i64 8, !15, i64 12, !10, i64 16, !15, i64 20, !15, i64 21, !10, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !10, i64 44, !10, i64 48, !16, i64 56, !22, i64 112, !23, i64 128, !24, i64 144, !24, i64 160, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !25, i64 224, !6, i64 240, !26, i64 248, !10, i64 264, !27, i64 272, !27, i64 288, !27, i64 304, !28, i64 320, !29, i64 344, !30, i64 368, !31, i64 392, !32, i64 416, !33, i64 440, !27, i64 464, !27, i64 480, !34, i64 496, !15, i64 504, !10, i64 508, !6, i64 512, !35, i64 520, !6, i64 608, !6, i64 616, !6, i64 624}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !17, i64 0, !10, i64 16, !20, i64 24}
!17 = !{!"_ZTS23b2TrackedBlockAllocator", !18, i64 0}
!18 = !{!"_ZTS24b2TypedIntrusiveListNodeI14b2TrackedBlockE", !19, i64 0}
!19 = !{!"_ZTS19b2IntrusiveListNode", !6, i64 0, !6, i64 8}
!20 = !{!"_ZTS15b2TypedFreeListI16b2ParticleHandleE", !21, i64 0}
!21 = !{!"_ZTS10b2FreeList", !19, i64 0, !19, i64 16}
!22 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIP16b2ParticleHandleEE", !6, i64 0, !10, i64 8}
!23 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !6, i64 0, !10, i64 8}
!24 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !6, i64 0, !10, i64 8}
!25 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !6, i64 0, !10, i64 8}
!26 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !6, i64 0, !10, i64 8}
!27 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !6, i64 0, !10, i64 8}
!28 = !{!"_ZTS16b2GrowableBufferIiE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!29 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!30 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!31 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!32 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!33 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!34 = !{!"long long", !7, i64 0}
!35 = !{!"_ZTS19b2ParticleSystemDef", !15, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !10, 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, !10, i64 68, !12, i64 72, !15, i64 76, !12, i64 80}
!36 = !{!15, !15, i64 0}
!37 = !{!14, !6, i64 464}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!14, !12, i64 600}
!43 = !{!14, !15, i64 504}


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

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN16b2ParticleSystem19SetParticleLifetimeEif = external hidden unnamed_addr constant [71 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem19SetParticleLifetimeEif(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %1, float noundef %2) local_unnamed_addr #1 align 2 {
  %4 = tail call noundef zeroext i1 @_ZNK16b2ParticleSystem21ValidateParticleIndexEi(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %1)
  br i1 %4, label %6, label %5

5:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.34, ptr noundef nonnull @.str.1, i32 noundef 4011, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16b2ParticleSystem19SetParticleLifetimeEif) #4
  unreachable

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 480
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  %10 = getelementptr inbounds i8, ptr %0, i64 464
  %11 = load ptr, ptr %10, align 8, !tbaa !33
  %12 = tail call noundef ptr @_ZN16b2ParticleSystem13RequestBufferIiEEPT_S2_(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %11)
  store ptr %12, ptr %10, align 8, !tbaa !33
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = tail call noundef ptr @_ZN16b2ParticleSystem13RequestBufferIiEEPT_S2_(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %13)
  store ptr %14, ptr %7, align 8, !tbaa !5
  br i1 %9, label %15, label %.loopexit

15:                                               ; preds = %6
  %16 = tail call noundef i32 @_ZNK16b2ParticleSystem16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(632) %0)
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %15
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %wide.trip.count = zext nneg i32 %16 to i64
  %min.iters.check = icmp ult i32 %16, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %19 = getelementptr inbounds i32, ptr %18, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  store <4 x i32> %vec.ind, ptr %19, align 4, !tbaa !34
  store <4 x i32> %step.add, ptr %20, align 4, !tbaa !34
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %21 = icmp eq i64 %index.next, %n.vec
  br i1 %21, label %middle.block, label %vector.body, !llvm.loop !35

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %22 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv
  %23 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %23, ptr %22, align 4, !tbaa !34
  %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 %scalar.ph, !llvm.loop !39

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %15, %6
  %24 = getelementptr inbounds i8, ptr %0, i64 600
  %25 = load float, ptr %24, align 8, !tbaa !40
  %26 = fdiv float %2, %25
  %27 = fptosi float %26 to i32
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %.loopexit
  %30 = tail call noundef i32 @_ZNK16b2ParticleSystem23GetQuantizedTimeElapsedEv(ptr noundef nonnull align 8 dereferenceable(632) %0)
  %31 = add nsw i32 %30, %27
  br label %32

32:                                               ; preds = %.loopexit, %29
  %33 = phi i32 [ %31, %29 ], [ %27, %.loopexit ]
  %34 = load ptr, ptr %10, align 8, !tbaa !33
  %35 = sext i32 %1 to i64
  %36 = getelementptr inbounds i32, ptr %34, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !34
  %.not = icmp eq i32 %33, %37
  br i1 %.not, label %40, label %38

38:                                               ; preds = %32
  store i32 %33, ptr %36, align 4, !tbaa !34
  %39 = getelementptr inbounds i8, ptr %0, i64 504
  store i8 1, ptr %39, align 8, !tbaa !41
  br label %40

40:                                               ; preds = %38, %32
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK16b2ParticleSystem21ValidateParticleIndexEi(ptr noundef nonnull align 8 dereferenceable(632), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN16b2ParticleSystem13RequestBufferIiEEPT_S2_(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef) local_unnamed_addr #1 align 2

attributes #0 = { noreturn nounwind "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 = { 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 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 = { noreturn 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, !16, i64 480}
!6 = !{!"_ZTS16b2ParticleSystem", !7, i64 0, !10, i64 4, !10, i64 8, !7, i64 12, !10, i64 16, !7, i64 20, !7, i64 21, !10, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !10, i64 44, !10, i64 48, !12, i64 56, !19, i64 112, !20, i64 128, !21, i64 144, !21, i64 160, !16, i64 176, !16, i64 184, !16, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !22, i64 224, !16, i64 240, !23, i64 248, !10, i64 264, !24, i64 272, !24, i64 288, !24, i64 304, !25, i64 320, !26, i64 344, !27, i64 368, !28, i64 392, !29, i64 416, !30, i64 440, !24, i64 464, !24, i64 480, !31, i64 496, !7, i64 504, !10, i64 508, !16, i64 512, !32, i64 520, !16, i64 608, !16, i64 616, !16, i64 624}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !13, i64 0, !10, i64 16, !17, i64 24}
!13 = !{!"_ZTS23b2TrackedBlockAllocator", !14, i64 0}
!14 = !{!"_ZTS24b2TypedIntrusiveListNodeI14b2TrackedBlockE", !15, i64 0}
!15 = !{!"_ZTS19b2IntrusiveListNode", !16, i64 0, !16, i64 8}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"_ZTS15b2TypedFreeListI16b2ParticleHandleE", !18, i64 0}
!18 = !{!"_ZTS10b2FreeList", !15, i64 0, !15, i64 16}
!19 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIP16b2ParticleHandleEE", !16, i64 0, !10, i64 8}
!20 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !16, i64 0, !10, i64 8}
!21 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !16, i64 0, !10, i64 8}
!22 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !16, i64 0, !10, i64 8}
!23 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !16, i64 0, !10, i64 8}
!24 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !16, i64 0, !10, i64 8}
!25 = !{!"_ZTS16b2GrowableBufferIiE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!26 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!27 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!28 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!29 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!30 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!31 = !{!"long long", !8, i64 0}
!32 = !{!"_ZTS19b2ParticleSystemDef", !7, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !10, 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, !10, i64 68, !11, i64 72, !7, i64 76, !11, i64 80}
!33 = !{!6, !16, i64 464}
!34 = !{!10, !10, i64 0}
!35 = distinct !{!35, !36, !37, !38}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!"llvm.loop.isvectorized", i32 1}
!38 = !{!"llvm.loop.unroll.runtime.disable"}
!39 = distinct !{!39, !36, !38, !37}
!40 = !{!6, !11, i64 600}
!41 = !{!6, !7, i64 504}


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