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

; 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.b2TimeStep = type { float, float, float, i32, i32, i32, i8 }
%class.b2ParticleSystem = type { i8, i32, i32, i8, i32, i8, i8, i32, float, float, float, float, i32, i32, %class.b2SlabAllocator, %"struct.b2ParticleSystem::UserOverridableBuffer", %"struct.b2ParticleSystem::UserOverridableBuffer.0", %"struct.b2ParticleSystem::UserOverridableBuffer.2", %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr, ptr, ptr, ptr, ptr, ptr, %"struct.b2ParticleSystem::UserOverridableBuffer.4", ptr, %"struct.b2ParticleSystem::UserOverridableBuffer.6", i32, [4 x i8], %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", %class.b2GrowableBuffer, %class.b2GrowableBuffer.10, %class.b2GrowableBuffer.11, %class.b2GrowableBuffer.12, %class.b2GrowableBuffer.13, %class.b2GrowableBuffer.14, %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", i64, i8, i32, ptr, %struct.b2ParticleSystemDef, ptr, ptr, ptr }
%class.b2SlabAllocator = type { %class.b2TrackedBlockAllocator, i32, %class.b2TypedFreeList }
%class.b2TrackedBlockAllocator = type { %class.b2TypedIntrusiveListNode }
%class.b2TypedIntrusiveListNode = type { %class.b2IntrusiveListNode }
%class.b2IntrusiveListNode = type { ptr, ptr }
%class.b2TypedFreeList = type { %class.b2FreeList }
%class.b2FreeList = type { %class.b2IntrusiveListNode, %class.b2IntrusiveListNode }
%"struct.b2ParticleSystem::UserOverridableBuffer" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.0" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.2" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.4" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.6" = type <{ ptr, i32, [4 x i8] }>
%class.b2GrowableBuffer = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.10 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.11 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.12 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.13 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.14 = type { ptr, i32, i32, ptr }
%"struct.b2ParticleSystem::UserOverridableBuffer.8" = type <{ ptr, i32, [4 x i8] }>
%struct.b2ParticleSystemDef = type { i8, float, float, float, i32, float, float, float, float, float, float, float, float, float, float, float, float, i32, float, i8, float }
%struct.b2ParticlePair = type { i32, i32, i32, 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZN16b2GrowableBufferI14b2ParticlePairEixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

29:                                               ; preds = %106, %2
  %30 = load i32, ptr %6, align 4, !tbaa !37
  %31 = getelementptr inbounds %class.b2ParticleSystem, ptr %21, i32 0, i32 37
  %32 = call noundef i32 @_ZNK16b2GrowableBufferI14b2ParticlePairE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %36 = getelementptr inbounds %class.b2ParticleSystem, ptr %21, i32 0, i32 37
  %37 = load i32, ptr %6, align 4, !tbaa !37
  %38 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN16b2GrowableBufferI14b2ParticlePairEixEi(ptr noundef nonnull align 8 dereferenceable(24) %36, i32 noundef %37)
  store ptr %38, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.b2ParticlePair, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 4, !tbaa !38
  %42 = and i32 %41, 8
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %105

44:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.b2ParticlePair, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 4, !tbaa !40
  store i32 %47, ptr %8, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.b2ParticlePair, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !41
  store i32 %50, ptr %9, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %51 = getelementptr inbounds %class.b2ParticleSystem, ptr %21, i32 0, i32 17
  %52 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !42
  %54 = load i32, ptr %8, align 4, !tbaa !37
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds %struct.b2Vec2, ptr %53, i64 %55
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %56, i64 8, i1 false), !tbaa.struct !43
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %57 = getelementptr inbounds %class.b2ParticleSystem, ptr %21, i32 0, i32 17
  %58 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !42
  %60 = load i32, ptr %9, align 4, !tbaa !37
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds %struct.b2Vec2, ptr %59, i64 %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %62, i64 8, i1 false), !tbaa.struct !43
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %63 = getelementptr inbounds %class.b2ParticleSystem, ptr %21, i32 0, i32 18
  %64 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !44
  %66 = load i32, ptr %8, align 4, !tbaa !37
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %struct.b2Vec2, ptr %65, i64 %67
  store ptr %68, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %69 = getelementptr inbounds %class.b2ParticleSystem, ptr %21, i32 0, i32 18
  %70 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !44
  %72 = load i32, ptr %9, align 4, !tbaa !37
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.b2Vec2, ptr %71, i64 %73
  store ptr %74, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.b2TimeStep, ptr %75, i32 0, i32 0
  %77 = load float, ptr %76, align 4, !tbaa !45
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %77, ptr noundef nonnull align 4 dereferenceable(8) %78)
  store <2 x float> %79, ptr %14, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.b2TimeStep, ptr %80, i32 0, i32 0
  %82 = load float, ptr %81, align 4, !tbaa !45
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %82, ptr noundef nonnull align 4 dereferenceable(8) %83)
  store <2 x float> %84, ptr %15, align 4
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %85 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %85, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.b2ParticlePair, ptr %86, i32 0, i32 4
  %88 = load float, ptr %87, align 4, !tbaa !46
  store float %88, ptr %17, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %89 = call noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %16)
  store float %89, ptr %18, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %90 = load float, ptr %5, align 4, !tbaa !36
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.b2ParticlePair, ptr %91, i32 0, i32 3
  %93 = load float, ptr %92, align 4, !tbaa !47
  %94 = fmul float %90, %93
  store float %94, ptr %19, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %95 = load float, ptr %19, align 4, !tbaa !36
  %96 = load float, ptr %17, align 4, !tbaa !36
  %97 = load float, ptr %18, align 4, !tbaa !36
  %98 = fsub float %96, %97
  %99 = fmul float %95, %98
  %100 = load float, ptr %18, align 4, !tbaa !36
  %101 = fdiv float %99, %100
  %102 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %101, ptr noundef nonnull align 4 dereferenceable(8) %16)
  store <2 x float> %102, ptr %20, align 4
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %103, ptr noundef nonnull align 4 dereferenceable(8) %20)
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %104, ptr noundef nonnull align 4 dereferenceable(8) %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %105

105:                                              ; preds = %44, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %6, align 4, !tbaa !37
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %6, align 4, !tbaa !37
  br label %29, !llvm.loop !48

109:                                              ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="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 #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 = { 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 = !{!"_ZTS10b2TimeStep", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !13, i64 24}
!11 = !{!"float", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !11, i64 552}
!15 = !{!"_ZTS16b2ParticleSystem", !13, i64 0, !12, i64 4, !12, i64 8, !13, i64 12, !12, i64 16, !13, i64 20, !13, i64 21, !12, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 44, !12, 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, !12, 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, !13, i64 504, !12, i64 508, !6, i64 512, !35, i64 520, !6, i64 608, !6, i64 616, !6, i64 624}
!16 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !17, i64 0, !12, 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, !12, i64 8}
!23 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !6, i64 0, !12, i64 8}
!24 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !6, i64 0, !12, i64 8}
!25 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !6, i64 0, !12, i64 8}
!26 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !6, i64 0, !12, i64 8}
!27 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !6, i64 0, !12, i64 8}
!28 = !{!"_ZTS16b2GrowableBufferIiE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!29 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!30 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!31 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!32 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!33 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!34 = !{!"long long", !7, i64 0}
!35 = !{!"_ZTS19b2ParticleSystemDef", !13, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, 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, !12, i64 68, !11, i64 72, !13, i64 76, !11, i64 80}
!36 = !{!11, !11, i64 0}
!37 = !{!12, !12, i64 0}
!38 = !{!39, !12, i64 8}
!39 = !{!"_ZTS14b2ParticlePair", !12, i64 0, !12, i64 4, !12, i64 8, !11, i64 12, !11, i64 16}
!40 = !{!39, !12, i64 0}
!41 = !{!39, !12, i64 4}
!42 = !{!15, !6, i64 144}
!43 = !{i64 0, i64 4, !36, i64 4, i64 4, !36}
!44 = !{!15, !6, i64 160}
!45 = !{!10, !11, i64 0}
!46 = !{!39, !11, i64 16}
!47 = !{!39, !11, i64 12}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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

; 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: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem11SolveSpringERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(28) %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %struct.b2Vec2, align 8
  %4 = alloca %struct.b2Vec2, align 8
  %5 = alloca %struct.b2Vec2, align 8
  %6 = alloca %struct.b2Vec2, align 8
  %7 = alloca %struct.b2Vec2, align 8
  %8 = alloca %struct.b2Vec2, align 8
  %9 = getelementptr inbounds i8, ptr %1, i64 4
  %10 = load float, ptr %9, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 552
  %12 = load float, ptr %11, align 8, !tbaa !12
  %13 = fmul float %10, %12
  %14 = getelementptr inbounds i8, ptr %0, i64 416
  %15 = tail call noundef i32 @_ZNK16b2GrowableBufferI14b2ParticlePairE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %17 = getelementptr inbounds i8, ptr %0, i64 144
  %18 = getelementptr inbounds i8, ptr %0, i64 160
  br label %19

._crit_edge:                                      ; preds = %53, %2
  ret void

19:                                               ; preds = %.lr.ph, %53
  %.024 = phi i32 [ 0, %.lr.ph ], [ %54, %53 ]
  %20 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN16b2GrowableBufferI14b2ParticlePairEixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %.024)
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = load i32, ptr %21, align 4, !tbaa !35
  %23 = and i32 %22, 8
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %53, label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %20, align 4, !tbaa !37
  %26 = getelementptr inbounds i8, ptr %20, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %28 = load ptr, ptr %17, align 8, !tbaa !39
  %29 = sext i32 %25 to i64
  %30 = getelementptr inbounds %struct.b2Vec2, ptr %28, i64 %29
  %31 = load i64, ptr %30, align 4
  store i64 %31, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %32 = sext i32 %27 to i64
  %33 = getelementptr inbounds %struct.b2Vec2, ptr %28, i64 %32
  %34 = load i64, ptr %33, align 4
  store i64 %34, ptr %4, align 8
  %35 = load ptr, ptr %18, align 8, !tbaa !40
  %36 = getelementptr inbounds %struct.b2Vec2, ptr %35, i64 %29
  %37 = getelementptr inbounds %struct.b2Vec2, ptr %35, i64 %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %38 = load float, ptr %1, align 4, !tbaa !41
  %39 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %38, ptr noundef nonnull align 4 dereferenceable(8) %36)
  store <2 x float> %39, ptr %5, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %40 = load float, ptr %1, align 4, !tbaa !41
  %41 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %40, ptr noundef nonnull align 4 dereferenceable(8) %37)
  store <2 x float> %41, ptr %6, align 8
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %42 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %42, ptr %7, align 8
  %43 = getelementptr inbounds i8, ptr %20, i64 16
  %44 = load float, ptr %43, align 4, !tbaa !42
  %45 = call noundef float @_ZNK6b2Vec26LengthEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %46 = getelementptr inbounds i8, ptr %20, i64 12
  %47 = load float, ptr %46, align 4, !tbaa !43
  %48 = fmul float %13, %47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %49 = fsub float %44, %45
  %50 = fmul float %49, %48
  %51 = fdiv float %50, %45
  %52 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %51, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %52, ptr %8, align 8
  call void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %36, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %53

53:                                               ; preds = %24, %19
  %54 = add nuw nsw i32 %.024, 1
  %55 = call noundef i32 @_ZNK16b2GrowableBufferI14b2ParticlePairE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %19, label %._crit_edge, !llvm.loop !44
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

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


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