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

; 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.b2Vec2 = type { float, float }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%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.27 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__._ZNK16b2ParticleSystem11ComputeAABBEP6b2AABB = external hidden unnamed_addr constant [56 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: 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) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16b2ParticleSystem11ComputeAABBEP6b2AABB(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, 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
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %11 = call noundef i32 @_ZNK16b2ParticleSystem16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(632) %10)
  store i32 %11, ptr %5, align 4, !tbaa !9
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  br label %17

15:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.27, ptr noundef @.str.1, i32 noundef 2105, ptr noundef @__PRETTY_FUNCTION__._ZNK16b2ParticleSystem11ComputeAABBEP6b2AABB) #7
  unreachable

16:                                               ; No predecessors!
  br label %17

17:                                               ; preds = %16, %14
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.b2AABB, ptr %18, i32 0, i32 0
  %20 = getelementptr inbounds %struct.b2Vec2, ptr %19, i32 0, i32 0
  store float 0x47EFFFFFE0000000, ptr %20, align 4, !tbaa !11
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.b2AABB, ptr %21, i32 0, i32 0
  %23 = getelementptr inbounds %struct.b2Vec2, ptr %22, i32 0, i32 1
  store float 0x47EFFFFFE0000000, ptr %23, align 4, !tbaa !15
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.b2AABB, ptr %24, i32 0, i32 1
  %26 = getelementptr inbounds %struct.b2Vec2, ptr %25, i32 0, i32 0
  store float 0xC7EFFFFFE0000000, ptr %26, align 4, !tbaa !16
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.b2AABB, ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds %struct.b2Vec2, ptr %28, i32 0, i32 1
  store float 0xC7EFFFFFE0000000, ptr %29, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %52, %17
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = load i32, ptr %5, align 4, !tbaa !9
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %55

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

52:                                               ; preds = %35
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %6, align 4, !tbaa !9
  br label %30, !llvm.loop !43

55:                                               ; preds = %34
  %56 = getelementptr inbounds %class.b2ParticleSystem, ptr %10, i32 0, i32 9
  %57 = load float, ptr %56, align 8, !tbaa !45
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.b2AABB, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds %struct.b2Vec2, ptr %59, i32 0, i32 0
  %61 = load float, ptr %60, align 4, !tbaa !11
  %62 = fsub float %61, %57
  store float %62, ptr %60, align 4, !tbaa !11
  %63 = getelementptr inbounds %class.b2ParticleSystem, ptr %10, i32 0, i32 9
  %64 = load float, ptr %63, align 8, !tbaa !45
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.b2AABB, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds %struct.b2Vec2, ptr %66, i32 0, i32 1
  %68 = load float, ptr %67, align 4, !tbaa !15
  %69 = fsub float %68, %64
  store float %69, ptr %67, align 4, !tbaa !15
  %70 = getelementptr inbounds %class.b2ParticleSystem, ptr %10, i32 0, i32 9
  %71 = load float, ptr %70, align 8, !tbaa !45
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.b2AABB, ptr %72, i32 0, i32 1
  %74 = getelementptr inbounds %struct.b2Vec2, ptr %73, i32 0, i32 0
  %75 = load float, ptr %74, align 4, !tbaa !16
  %76 = fadd float %75, %71
  store float %76, ptr %74, align 4, !tbaa !16
  %77 = getelementptr inbounds %class.b2ParticleSystem, ptr %10, i32 0, i32 9
  %78 = load float, ptr %77, align 8, !tbaa !45
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.b2AABB, ptr %79, i32 0, i32 1
  %81 = getelementptr inbounds %struct.b2Vec2, ptr %80, i32 0, i32 1
  %82 = load float, ptr %81, align 4, !tbaa !17
  %83 = fadd float %82, %78
  store float %83, ptr %81, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void
}

; 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)) #5

; 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)) #5

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { 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, !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, !14, i64 0}
!12 = !{!"_ZTS6b2AABB", !13, i64 0, !13, i64 8}
!13 = !{!"_ZTS6b2Vec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!12, !14, i64 4}
!16 = !{!12, !14, i64 8}
!17 = !{!12, !14, i64 12}
!18 = !{!19, !6, i64 144}
!19 = !{!"_ZTS16b2ParticleSystem", !20, i64 0, !10, i64 4, !10, i64 8, !20, i64 12, !10, i64 16, !20, i64 20, !20, i64 21, !10, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !10, i64 44, !10, 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, !10, 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, !10, 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, !10, 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, !10, i64 8}
!28 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !6, i64 0, !10, i64 8}
!29 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !6, i64 0, !10, i64 8}
!30 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !6, i64 0, !10, i64 8}
!31 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !6, i64 0, !10, i64 8}
!32 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !6, i64 0, !10, i64 8}
!33 = !{!"_ZTS16b2GrowableBufferIiE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!34 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!35 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!36 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!37 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!38 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!39 = !{!"long long", !7, i64 0}
!40 = !{!"_ZTS19b2ParticleSystemDef", !20, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !10, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60, !14, i64 64, !10, i64 68, !14, i64 72, !20, i64 76, !14, i64 80}
!41 = !{i64 0, i64 4, !42, i64 4, i64 4, !42}
!42 = !{!14, !14, i64 0}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = !{!19, !14, i64 32}


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

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__._ZNK16b2ParticleSystem11ComputeAABBEP6b2AABB = external hidden unnamed_addr constant [56 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK16b2ParticleSystem11ComputeAABBEP6b2AABB(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %struct.b2Vec2, align 8
  %4 = tail call noundef i32 @_ZNK16b2ParticleSystem16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(632) %0)
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %5, label %6

5:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.1, i32 noundef 2105, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK16b2ParticleSystem11ComputeAABBEP6b2AABB) #5
  unreachable

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  store <4 x float> <float 0x47EFFFFFE0000000, float 0x47EFFFFFE0000000, float 0xC7EFFFFFE0000000, float 0xC7EFFFFFE0000000>, ptr %1, align 4, !tbaa !5
  %8 = icmp sgt i32 %4, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 144
  %wide.trip.count = zext nneg i32 %4 to i64
  br label %19

._crit_edge.loopexit:                             ; preds = %19
  %10 = load <2 x float>, ptr %1, align 4, !tbaa !5
  %11 = shufflevector <2 x float> %24, <2 x float> %10, <4 x i32> <i32 2, i32 3, i32 0, i32 1>
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %6
  %12 = phi <4 x float> [ %11, %._crit_edge.loopexit ], [ <float 0x47EFFFFFE0000000, float 0x47EFFFFFE0000000, float 0xC7EFFFFFE0000000, float 0xC7EFFFFFE0000000>, %6 ]
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = load <4 x float>, ptr %13, align 8
  %15 = shufflevector <4 x float> %14, <4 x float> poison, <4 x i32> zeroinitializer
  %16 = fsub <4 x float> %12, %15
  %17 = fadd <4 x float> %12, %15
  %18 = shufflevector <4 x float> %16, <4 x float> %17, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
  store <4 x float> %18, ptr %1, align 4, !tbaa !5
  ret void

19:                                               ; preds = %.lr.ph, %19
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %19 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %20 = load ptr, ptr %9, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.b2Vec2, ptr %20, i64 %indvars.iv
  %22 = load i64, ptr %21, align 4
  store i64 %22, ptr %3, align 8
  %23 = call <2 x float> @_Z5b2MinRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %23, ptr %1, align 4
  %24 = call <2 x float> @_Z5b2MaxRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %24, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %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 %._crit_edge.loopexit, label %19, !llvm.loop !34
}

; 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 #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)) local_unnamed_addr #4

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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"="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 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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !17, i64 144}
!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 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass