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

; 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 }
%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.b2ParticleBodyContact = type { i32, ptr, ptr, float, %struct.b2Vec2, 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: 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 @_ZNK16b2GrowableBufferI17b2ParticleContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2MinIfET_S0_S0_(float noundef, float noundef) #4

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4

; 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 @_ZN16b2ParticleSystem12SolveDampingERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 4 dereferenceable(28) %1) #5 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca %struct.b2Vec2, align 4
  %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 %struct.b2Vec2, align 4
  %20 = alloca %struct.b2Vec2, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca float, align 4
  %27 = alloca %struct.b2Vec2, align 4
  %28 = alloca %struct.b2Vec2, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %32 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %33 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 45
  %34 = getelementptr inbounds %struct.b2ParticleSystemDef, ptr %33, i32 0, i32 6
  %35 = load float, ptr %34, align 8, !tbaa !9
  store float %35, ptr %5, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = call noundef float @_ZNK16b2ParticleSystem19GetCriticalVelocityERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %32, ptr noundef nonnull align 4 dereferenceable(28) %36)
  %38 = fdiv float 1.000000e+00, %37
  store float %38, ptr %6, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !35
  br label %39

39:                                               ; preds = %108, %2
  %40 = load i32, ptr %7, align 4, !tbaa !35
  %41 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 36
  %42 = call noundef i32 @_ZNK16b2GrowableBufferI21b2ParticleBodyContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %41)
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %111

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %46 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 36
  %47 = load i32, ptr %7, align 4, !tbaa !35
  %48 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN16b2GrowableBufferI21b2ParticleBodyContactEixEi(ptr noundef nonnull align 8 dereferenceable(24) %46, i32 noundef %47)
  store ptr %48, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.b2ParticleBodyContact, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !36
  store i32 %51, ptr %9, align 4, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2ParticleBodyContact, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !39
  store ptr %54, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.b2ParticleBodyContact, ptr %55, i32 0, i32 3
  %57 = load float, ptr %56, align 8, !tbaa !40
  store float %57, ptr %11, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.b2ParticleBodyContact, ptr %58, i32 0, i32 5
  %60 = load float, ptr %59, align 4, !tbaa !41
  store float %60, ptr %12, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.b2ParticleBodyContact, ptr %61, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %62, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %63 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 17
  %64 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !43
  %66 = load i32, ptr %9, align 4, !tbaa !35
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %struct.b2Vec2, ptr %65, i64 %67
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %68, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = call <2 x float> @_ZNK6b2Body31GetLinearVelocityFromWorldPointERK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(208) %69, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %70, ptr %16, align 4
  %71 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 18
  %72 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !44
  %74 = load i32, ptr %9, align 4, !tbaa !35
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.b2Vec2, ptr %73, i64 %75
  %77 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %76)
  store <2 x float> %77, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %78 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %13)
  store float %78, ptr %17, align 4, !tbaa !34
  %79 = load float, ptr %17, align 4, !tbaa !34
  %80 = fcmp olt float %79, 0.000000e+00
  br i1 %80, label %81, label %107

81:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %82 = load float, ptr %5, align 4, !tbaa !34
  %83 = load float, ptr %11, align 4, !tbaa !34
  %84 = fmul float %82, %83
  %85 = load float, ptr %6, align 4, !tbaa !34
  %86 = fneg float %85
  %87 = load float, ptr %17, align 4, !tbaa !34
  %88 = fmul float %86, %87
  %89 = call noundef float @_Z5b2MinIfET_S0_S0_(float noundef %88, float noundef 5.000000e-01)
  %90 = call noundef float @_Z5b2MaxIfET_S0_S0_(float noundef %84, float noundef %89)
  store float %90, ptr %18, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %91 = load float, ptr %18, align 4, !tbaa !34
  %92 = load float, ptr %12, align 4, !tbaa !34
  %93 = fmul float %91, %92
  %94 = load float, ptr %17, align 4, !tbaa !34
  %95 = fmul float %93, %94
  %96 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %95, ptr noundef nonnull align 4 dereferenceable(8) %13)
  store <2 x float> %96, ptr %19, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %97 = call noundef float @_ZNK16b2ParticleSystem18GetParticleInvMassEv(ptr noundef nonnull align 8 dereferenceable(632) %32)
  %98 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %97, ptr noundef nonnull align 4 dereferenceable(8) %19)
  store <2 x float> %98, ptr %20, align 4
  %99 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 18
  %100 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !44
  %102 = load i32, ptr %9, align 4, !tbaa !35
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds %struct.b2Vec2, ptr %101, i64 %103
  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) #7
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %106 = call <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %19)
  store <2 x float> %106, ptr %21, align 4
  call void @_ZN6b2Body18ApplyLinearImpulseERK6b2Vec2S2_(ptr noundef nonnull align 8 dereferenceable(208) %105, ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %107

107:                                              ; preds = %81, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %7, align 4, !tbaa !35
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %7, align 4, !tbaa !35
  br label %39, !llvm.loop !45

111:                                              ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !35
  br label %112

112:                                              ; preds = %173, %111
  %113 = load i32, ptr %22, align 4, !tbaa !35
  %114 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 35
  %115 = call noundef i32 @_ZNK16b2GrowableBufferI17b2ParticleContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %114)
  %116 = icmp slt i32 %113, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %176

118:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %119 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 35
  %120 = load i32, ptr %22, align 4, !tbaa !35
  %121 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN16b2GrowableBufferI17b2ParticleContactEixEi(ptr noundef nonnull align 8 dereferenceable(24) %119, i32 noundef %120)
  store ptr %121, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %122 = load ptr, ptr %23, align 8, !tbaa !5
  %123 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexAEv(ptr noundef nonnull align 4 dereferenceable(24) %122)
  store i32 %123, ptr %24, align 4, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %124 = load ptr, ptr %23, align 8, !tbaa !5
  %125 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24) %124)
  store i32 %125, ptr %25, align 4, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %126 = load ptr, ptr %23, align 8, !tbaa !5
  %127 = call noundef float @_ZNK17b2ParticleContact9GetWeightEv(ptr noundef nonnull align 4 dereferenceable(24) %126)
  store float %127, ptr %26, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %128 = load ptr, ptr %23, align 8, !tbaa !5
  %129 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK17b2ParticleContact9GetNormalEv(ptr noundef nonnull align 4 dereferenceable(24) %128)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %129, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %130 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 18
  %131 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !44
  %133 = load i32, ptr %25, align 4, !tbaa !35
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %struct.b2Vec2, ptr %132, i64 %134
  %136 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 18
  %137 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !44
  %139 = load i32, ptr %24, align 4, !tbaa !35
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.b2Vec2, ptr %138, i64 %140
  %142 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %135, ptr noundef nonnull align 4 dereferenceable(8) %141)
  store <2 x float> %142, ptr %28, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %143 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(8) %27)
  store float %143, ptr %29, align 4, !tbaa !34
  %144 = load float, ptr %29, align 4, !tbaa !34
  %145 = fcmp olt float %144, 0.000000e+00
  br i1 %145, label %146, label %172

146:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %147 = load float, ptr %5, align 4, !tbaa !34
  %148 = load float, ptr %26, align 4, !tbaa !34
  %149 = fmul float %147, %148
  %150 = load float, ptr %6, align 4, !tbaa !34
  %151 = fneg float %150
  %152 = load float, ptr %29, align 4, !tbaa !34
  %153 = fmul float %151, %152
  %154 = call noundef float @_Z5b2MinIfET_S0_S0_(float noundef %153, float noundef 5.000000e-01)
  %155 = call noundef float @_Z5b2MaxIfET_S0_S0_(float noundef %149, float noundef %154)
  store float %155, ptr %30, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %156 = load float, ptr %30, align 4, !tbaa !34
  %157 = load float, ptr %29, align 4, !tbaa !34
  %158 = fmul float %156, %157
  %159 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %158, ptr noundef nonnull align 4 dereferenceable(8) %27)
  store <2 x float> %159, ptr %31, align 4
  %160 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 18
  %161 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !44
  %163 = load i32, ptr %24, align 4, !tbaa !35
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds %struct.b2Vec2, ptr %162, i64 %164
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %165, ptr noundef nonnull align 4 dereferenceable(8) %31)
  %166 = getelementptr inbounds %class.b2ParticleSystem, ptr %32, i32 0, i32 18
  %167 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !44
  %169 = load i32, ptr %25, align 4, !tbaa !35
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %struct.b2Vec2, ptr %168, i64 %170
  call void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %171, ptr noundef nonnull align 4 dereferenceable(8) %31)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %172

172:                                              ; preds = %146, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %22, align 4, !tbaa !35
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %22, align 4, !tbaa !35
  br label %112, !llvm.loop !47

176:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2MaxIfET_S0_S0_(float noundef, float noundef) #4

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

; 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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6b2Body18ApplyLinearImpulseERK6b2Vec2S2_(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK16b2ParticleSystem19GetCriticalVelocityERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef nonnull align 4 dereferenceable(28)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8)) #5 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 = { 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 = { 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 = { inlinehint 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 #7 = { 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, !13, i64 544}
!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, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !12, i64 44, !12, i64 48, !14, i64 56, !20, i64 112, !21, i64 128, !22, i64 144, !22, i64 160, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !23, i64 224, !6, 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, !6, i64 512, !33, i64 520, !6, i64 608, !6, i64 616, !6, i64 624}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !15, i64 0, !12, i64 16, !18, i64 24}
!15 = !{!"_ZTS23b2TrackedBlockAllocator", !16, i64 0}
!16 = !{!"_ZTS24b2TypedIntrusiveListNodeI14b2TrackedBlockE", !17, i64 0}
!17 = !{!"_ZTS19b2IntrusiveListNode", !6, i64 0, !6, i64 8}
!18 = !{!"_ZTS15b2TypedFreeListI16b2ParticleHandleE", !19, i64 0}
!19 = !{!"_ZTS10b2FreeList", !17, i64 0, !17, i64 16}
!20 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIP16b2ParticleHandleEE", !6, i64 0, !12, i64 8}
!21 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !6, i64 0, !12, i64 8}
!22 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !6, i64 0, !12, i64 8}
!23 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !6, i64 0, !12, i64 8}
!24 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !6, i64 0, !12, i64 8}
!25 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !6, i64 0, !12, i64 8}
!26 = !{!"_ZTS16b2GrowableBufferIiE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!27 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!28 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!29 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!30 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!31 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!32 = !{!"long long", !7, i64 0}
!33 = !{!"_ZTS19b2ParticleSystemDef", !11, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !12, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !12, i64 68, !13, i64 72, !11, i64 76, !13, i64 80}
!34 = !{!13, !13, i64 0}
!35 = !{!12, !12, i64 0}
!36 = !{!37, !12, i64 0}
!37 = !{!"_ZTS21b2ParticleBodyContact", !12, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !38, i64 28, !13, i64 36}
!38 = !{!"_ZTS6b2Vec2", !13, i64 0, !13, i64 4}
!39 = !{!37, !6, i64 8}
!40 = !{!37, !13, i64 24}
!41 = !{!37, !13, i64 36}
!42 = !{i64 0, i64 4, !34, i64 4, i64 4, !34}
!43 = !{!10, !6, i64 144}
!44 = !{!10, !6, i64 160}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = distinct !{!47, !46}


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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2MinIfET_S0_S0_(float noundef, float noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

; 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 @_ZN16b2ParticleSystem12SolveDampingERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 4 dereferenceable(28) %1) local_unnamed_addr #4 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 = alloca %struct.b2Vec2, align 8
  %10 = alloca %struct.b2Vec2, align 8
  %11 = alloca %struct.b2Vec2, align 8
  %12 = alloca %struct.b2Vec2, align 8
  %13 = getelementptr inbounds i8, ptr %0, i64 544
  %14 = load float, ptr %13, align 8, !tbaa !5
  %15 = tail call noundef float @_ZNK16b2ParticleSystem19GetCriticalVelocityERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 4 dereferenceable(28) %1)
  %16 = fdiv float 1.000000e+00, %15
  %17 = getelementptr inbounds i8, ptr %0, i64 392
  %18 = tail call noundef i32 @_ZNK16b2GrowableBufferI21b2ParticleBodyContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %2
  %20 = getelementptr inbounds i8, ptr %0, i64 144
  %21 = getelementptr inbounds i8, ptr %0, i64 160
  %22 = fneg float %16
  br label %28

.preheader:                                       ; preds = %62, %2
  %23 = getelementptr inbounds i8, ptr %0, i64 368
  %24 = call noundef i32 @_ZNK16b2GrowableBufferI17b2ParticleContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph45, label %._crit_edge

.lr.ph45:                                         ; preds = %.preheader
  %26 = getelementptr inbounds i8, ptr %0, i64 160
  %27 = fneg float %16
  br label %66

28:                                               ; preds = %.lr.ph, %62
  %.043 = phi i32 [ 0, %.lr.ph ], [ %63, %62 ]
  %29 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN16b2GrowableBufferI21b2ParticleBodyContactEixEi(ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef %.043)
  %30 = load i32, ptr %29, align 8, !tbaa !33
  %31 = getelementptr inbounds i8, ptr %29, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !36
  %33 = getelementptr inbounds i8, ptr %29, i64 24
  %34 = load float, ptr %33, align 8, !tbaa !37
  %35 = getelementptr inbounds i8, ptr %29, i64 36
  %36 = load float, ptr %35, align 4, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %37 = getelementptr inbounds i8, ptr %29, i64 28
  %38 = load i64, ptr %37, align 4
  store i64 %38, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %39 = load ptr, ptr %20, align 8, !tbaa !39
  %40 = sext i32 %30 to i64
  %41 = getelementptr inbounds %struct.b2Vec2, ptr %39, i64 %40
  %42 = load i64, ptr %41, align 4
  store i64 %42, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %43 = call <2 x float> @_ZNK6b2Body31GetLinearVelocityFromWorldPointERK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(208) %32, ptr noundef nonnull align 4 dereferenceable(8) %4)
  store <2 x float> %43, ptr %6, align 8
  %44 = load ptr, ptr %21, align 8, !tbaa !40
  %45 = getelementptr inbounds %struct.b2Vec2, ptr %44, i64 %40
  %46 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %45)
  store <2 x float> %46, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %47 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %48 = fcmp olt float %47, 0.000000e+00
  br i1 %48, label %49, label %62

49:                                               ; preds = %28
  %50 = fmul float %14, %34
  %51 = fmul float %47, %22
  %52 = call noundef float @_Z5b2MinIfET_S0_S0_(float noundef %51, float noundef 5.000000e-01)
  %53 = call noundef float @_Z5b2MaxIfET_S0_S0_(float noundef %50, float noundef %52)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %54 = fmul float %36, %53
  %55 = fmul float %47, %54
  %56 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %55, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %56, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %57 = call noundef float @_ZNK16b2ParticleSystem18GetParticleInvMassEv(ptr noundef nonnull align 8 dereferenceable(632) %0)
  %58 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %57, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %58, ptr %8, align 8
  %59 = load ptr, ptr %21, align 8, !tbaa !40
  %60 = getelementptr inbounds %struct.b2Vec2, ptr %59, i64 %40
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %60, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %61 = call <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %61, ptr %9, align 8
  call void @_ZN6b2Body18ApplyLinearImpulseERK6b2Vec2S2_(ptr noundef nonnull align 8 dereferenceable(208) %32, ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %62

62:                                               ; preds = %49, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %63 = add nuw nsw i32 %.043, 1
  %64 = call noundef i32 @_ZNK16b2GrowableBufferI21b2ParticleBodyContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %28, label %.preheader, !llvm.loop !41

._crit_edge:                                      ; preds = %92, %.preheader
  ret void

66:                                               ; preds = %.lr.ph45, %92
  %.04044 = phi i32 [ 0, %.lr.ph45 ], [ %93, %92 ]
  %67 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN16b2GrowableBufferI17b2ParticleContactEixEi(ptr noundef nonnull align 8 dereferenceable(24) %23, i32 noundef %.04044)
  %68 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexAEv(ptr noundef nonnull align 4 dereferenceable(24) %67)
  %69 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24) %67)
  %70 = call noundef float @_ZNK17b2ParticleContact9GetWeightEv(ptr noundef nonnull align 4 dereferenceable(24) %67)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %71 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK17b2ParticleContact9GetNormalEv(ptr noundef nonnull align 4 dereferenceable(24) %67)
  %72 = load i64, ptr %71, align 4
  store i64 %72, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %73 = load ptr, ptr %26, align 8, !tbaa !40
  %74 = sext i32 %69 to i64
  %75 = getelementptr inbounds %struct.b2Vec2, ptr %73, i64 %74
  %76 = sext i32 %68 to i64
  %77 = getelementptr inbounds %struct.b2Vec2, ptr %73, i64 %76
  %78 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %75, ptr noundef nonnull align 4 dereferenceable(8) %77)
  store <2 x float> %78, ptr %11, align 8
  %79 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %80 = fcmp olt float %79, 0.000000e+00
  br i1 %80, label %81, label %92

81:                                               ; preds = %66
  %82 = fmul float %14, %70
  %83 = fmul float %79, %27
  %84 = call noundef float @_Z5b2MinIfET_S0_S0_(float noundef %83, float noundef 5.000000e-01)
  %85 = call noundef float @_Z5b2MaxIfET_S0_S0_(float noundef %82, float noundef %84)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %86 = fmul float %79, %85
  %87 = call <2 x float> @_ZmlfRK6b2Vec2(float noundef %86, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %87, ptr %12, align 8
  %88 = load ptr, ptr %26, align 8, !tbaa !40
  %89 = getelementptr inbounds %struct.b2Vec2, ptr %88, i64 %76
  call void @_ZN6b2Vec2pLERKS_(ptr noundef nonnull align 4 dereferenceable(8) %89, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %90 = load ptr, ptr %26, align 8, !tbaa !40
  %91 = getelementptr inbounds %struct.b2Vec2, ptr %90, i64 %74
  call void @_ZN6b2Vec2mIERKS_(ptr noundef nonnull align 4 dereferenceable(8) %91, ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  br label %92

92:                                               ; preds = %81, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %93 = add nuw nsw i32 %.04044, 1
  %94 = call noundef i32 @_ZNK16b2GrowableBufferI17b2ParticleContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %66, label %._crit_edge, !llvm.loop !43
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2MaxIfET_S0_S0_(float noundef, float noundef) local_unnamed_addr #3

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

; 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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6b2Body18ApplyLinearImpulseERK6b2Vec2S2_(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK16b2ParticleSystem19GetCriticalVelocityERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef nonnull align 4 dereferenceable(28)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local <2 x float> @_ZNK6b2Vec2ngEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 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 = { 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"="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 #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, !11, i64 544}
!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 = !{!34, !10, i64 0}
!34 = !{!"_ZTS21b2ParticleBodyContact", !10, i64 0, !16, i64 8, !16, i64 16, !11, i64 24, !35, i64 28, !11, i64 36}
!35 = !{!"_ZTS6b2Vec2", !11, i64 0, !11, i64 4}
!36 = !{!34, !16, i64 8}
!37 = !{!34, !11, i64 24}
!38 = !{!34, !11, i64 36}
!39 = !{!6, !16, i64 144}
!40 = !{!6, !16, i64 160}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = distinct !{!43, !42}


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