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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.b2ParticleSystem = type { i8, i32, i32, i8, i32, i8, i8, i32, float, float, float, float, i32, i32, %class.b2SlabAllocator, %"struct.b2ParticleSystem::UserOverridableBuffer", %"struct.b2ParticleSystem::UserOverridableBuffer.0", %"struct.b2ParticleSystem::UserOverridableBuffer.2", %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr, ptr, ptr, ptr, ptr, ptr, %"struct.b2ParticleSystem::UserOverridableBuffer.4", ptr, %"struct.b2ParticleSystem::UserOverridableBuffer.6", i32, [4 x i8], %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", %class.b2GrowableBuffer, %class.b2GrowableBuffer.10, %class.b2GrowableBuffer.11, %class.b2GrowableBuffer.12, %class.b2GrowableBuffer.13, %class.b2GrowableBuffer.14, %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", i64, i8, i32, ptr, %struct.b2ParticleSystemDef, ptr, ptr, ptr }
%class.b2SlabAllocator = type { %class.b2TrackedBlockAllocator, i32, %class.b2TypedFreeList }
%class.b2TrackedBlockAllocator = type { %class.b2TypedIntrusiveListNode }
%class.b2TypedIntrusiveListNode = type { %class.b2IntrusiveListNode }
%class.b2IntrusiveListNode = type { ptr, ptr }
%class.b2TypedFreeList = type { %class.b2FreeList }
%class.b2FreeList = type { %class.b2IntrusiveListNode, %class.b2IntrusiveListNode }
%"struct.b2ParticleSystem::UserOverridableBuffer" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.0" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.2" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.4" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.6" = type <{ ptr, i32, [4 x i8] }>
%class.b2GrowableBuffer = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.10 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.11 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.12 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.13 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.14 = type { ptr, i32, i32, ptr }
%"struct.b2ParticleSystem::UserOverridableBuffer.8" = type <{ ptr, i32, [4 x i8] }>
%struct.b2ParticleSystemDef = type { i8, float, float, float, i32, float, float, float, float, float, float, float, float, float, float, float, float, i32, float, i8, float }

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24)) #1 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) #1 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem19SolveStaticPressureERK10b2TimeStep(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 float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %3, align 8
  %21 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 21
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = call noundef ptr @_ZN16b2ParticleSystem13RequestBufferIfEEPT_S2_(ptr noundef nonnull align 8 dereferenceable(632) %20, ptr noundef %22)
  %24 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 21
  store ptr %23, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call noundef float @_ZNK16b2ParticleSystem19GetCriticalPressureERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %20, ptr noundef nonnull align 4 dereferenceable(28) %25)
  store float %26, ptr %5, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %27 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 45
  %28 = getelementptr inbounds %struct.b2ParticleSystemDef, ptr %27, i32 0, i32 15
  %29 = load float, ptr %28, align 4, !tbaa !35
  %30 = load float, ptr %5, align 4, !tbaa !34
  %31 = fmul float %29, %30
  store float %31, ptr %6, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %32 = load float, ptr %5, align 4, !tbaa !34
  %33 = fmul float 2.500000e-01, %32
  store float %33, ptr %7, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %34 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 45
  %35 = getelementptr inbounds %struct.b2ParticleSystemDef, ptr %34, i32 0, i32 16
  %36 = load float, ptr %35, align 8, !tbaa !36
  store float %36, ptr %8, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !37
  br label %37

37:                                               ; preds = %162, %2
  %38 = load i32, ptr %9, align 4, !tbaa !37
  %39 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 45
  %40 = getelementptr inbounds %struct.b2ParticleSystemDef, ptr %39, i32 0, i32 17
  %41 = load i32, ptr %40, align 4, !tbaa !38
  %42 = icmp slt i32 %38, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %37
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %165

44:                                               ; preds = %37
  %45 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 22
  %46 = load ptr, ptr %45, align 8, !tbaa !39
  %47 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 12
  %48 = load i32, ptr %47, align 4, !tbaa !40
  %49 = sext i32 %48 to i64
  %50 = mul i64 4, %49
  call void @llvm.memset.p0.i64(ptr align 4 %46, i8 0, i64 %50, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !37
  br label %51

51:                                               ; preds = %101, %44
  %52 = load i32, ptr %11, align 4, !tbaa !37
  %53 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 35
  %54 = call noundef i32 @_ZNK16b2GrowableBufferI17b2ParticleContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %53)
  %55 = icmp slt i32 %52, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %51
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %104

57:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %58 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 35
  %59 = load i32, ptr %11, align 4, !tbaa !37
  %60 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZN16b2GrowableBufferI17b2ParticleContactEixEi(ptr noundef nonnull align 8 dereferenceable(24) %58, i32 noundef %59)
  store ptr %60, ptr %12, align 8, !tbaa !5
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = call noundef i32 @_ZNK17b2ParticleContact8GetFlagsEv(ptr noundef nonnull align 4 dereferenceable(24) %61)
  %63 = and i32 %62, 2048
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %100

65:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexAEv(ptr noundef nonnull align 4 dereferenceable(24) %66)
  store i32 %67, ptr %13, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = call noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24) %68)
  store i32 %69, ptr %14, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = call noundef float @_ZNK17b2ParticleContact9GetWeightEv(ptr noundef nonnull align 4 dereferenceable(24) %70)
  store float %71, ptr %15, align 4, !tbaa !34
  %72 = load float, ptr %15, align 4, !tbaa !34
  %73 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 21
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = load i32, ptr %14, align 4, !tbaa !37
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds float, ptr %74, i64 %76
  %78 = load float, ptr %77, align 4, !tbaa !34
  %79 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 22
  %80 = load ptr, ptr %79, align 8, !tbaa !39
  %81 = load i32, ptr %13, align 4, !tbaa !37
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds float, ptr %80, i64 %82
  %84 = load float, ptr %83, align 4, !tbaa !34
  %85 = call float @llvm.fmuladd.f32(float %72, float %78, float %84)
  store float %85, ptr %83, align 4, !tbaa !34
  %86 = load float, ptr %15, align 4, !tbaa !34
  %87 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 21
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  %89 = load i32, ptr %13, align 4, !tbaa !37
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds float, ptr %88, i64 %90
  %92 = load float, ptr %91, align 4, !tbaa !34
  %93 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 22
  %94 = load ptr, ptr %93, align 8, !tbaa !39
  %95 = load i32, ptr %14, align 4, !tbaa !37
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds float, ptr %94, i64 %96
  %98 = load float, ptr %97, align 4, !tbaa !34
  %99 = call float @llvm.fmuladd.f32(float %86, float %92, float %98)
  store float %99, ptr %97, align 4, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %100

100:                                              ; preds = %65, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %11, align 4, !tbaa !37
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %11, align 4, !tbaa !37
  br label %51, !llvm.loop !41

104:                                              ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !37
  br label %105

105:                                              ; preds = %158, %104
  %106 = load i32, ptr %16, align 4, !tbaa !37
  %107 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 12
  %108 = load i32, ptr %107, align 4, !tbaa !40
  %109 = icmp slt i32 %106, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %105
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %161

111:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %112 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 20
  %113 = load ptr, ptr %112, align 8, !tbaa !43
  %114 = load i32, ptr %16, align 4, !tbaa !37
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds float, ptr %113, i64 %115
  %117 = load float, ptr %116, align 4, !tbaa !34
  store float %117, ptr %17, align 4, !tbaa !34
  %118 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 16
  %119 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.0", ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !44
  %121 = load i32, ptr %16, align 4, !tbaa !37
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i32, ptr %120, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !37
  %125 = and i32 %124, 2048
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %151

127:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %128 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 22
  %129 = load ptr, ptr %128, align 8, !tbaa !39
  %130 = load i32, ptr %16, align 4, !tbaa !37
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds float, ptr %129, i64 %131
  %133 = load float, ptr %132, align 4, !tbaa !34
  store float %133, ptr %18, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %134 = load float, ptr %18, align 4, !tbaa !34
  %135 = load float, ptr %6, align 4, !tbaa !34
  %136 = load float, ptr %17, align 4, !tbaa !34
  %137 = fsub float %136, 1.000000e+00
  %138 = call float @llvm.fmuladd.f32(float %135, float %137, float %134)
  %139 = load float, ptr %17, align 4, !tbaa !34
  %140 = load float, ptr %8, align 4, !tbaa !34
  %141 = fadd float %139, %140
  %142 = fdiv float %138, %141
  store float %142, ptr %19, align 4, !tbaa !34
  %143 = load float, ptr %19, align 4, !tbaa !34
  %144 = load float, ptr %7, align 4, !tbaa !34
  %145 = call noundef float @_Z7b2ClampIfET_S0_S0_S0_(float noundef %143, float noundef 0.000000e+00, float noundef %144)
  %146 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 21
  %147 = load ptr, ptr %146, align 8, !tbaa !9
  %148 = load i32, ptr %16, align 4, !tbaa !37
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds float, ptr %147, i64 %149
  store float %145, ptr %150, align 4, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %157

151:                                              ; preds = %111
  %152 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 21
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = load i32, ptr %16, align 4, !tbaa !37
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds float, ptr %153, i64 %155
  store float 0.000000e+00, ptr %156, align 4, !tbaa !34
  br label %157

157:                                              ; preds = %151, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %16, align 4, !tbaa !37
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %16, align 4, !tbaa !37
  br label %105, !llvm.loop !45

161:                                              ; preds = %110
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %9, align 4, !tbaa !37
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %9, align 4, !tbaa !37
  br label %37, !llvm.loop !46

165:                                              ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  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: mustprogress uwtable
declare dso_local noundef ptr @_ZN16b2ParticleSystem13RequestBufferIfEEPT_S2_(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef) #4 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #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 = { 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 #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, !6, i64 192}
!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 = !{!10, !13, i64 580}
!36 = !{!10, !13, i64 584}
!37 = !{!12, !12, i64 0}
!38 = !{!10, !12, i64 588}
!39 = !{!10, !6, i64 200}
!40 = !{!10, !12, i64 44}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!10, !6, i64 184}
!44 = !{!10, !6, i64 128}
!45 = distinct !{!45, !42}
!46 = distinct !{!46, !42}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #0 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 #0 align 2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem19SolveStaticPressureERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 4 dereferenceable(28) %1) local_unnamed_addr #3 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 192
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call noundef ptr @_ZN16b2ParticleSystem13RequestBufferIfEEPT_S2_(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %4)
  store ptr %5, ptr %3, align 8, !tbaa !5
  %6 = tail call noundef float @_ZNK16b2ParticleSystem19GetCriticalPressureERK10b2TimeStep(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 4 dereferenceable(28) %1)
  %7 = getelementptr inbounds i8, ptr %0, i64 580
  %8 = load float, ptr %7, align 4, !tbaa !33
  %9 = fmul float %6, %8
  %10 = fmul float %6, 2.500000e-01
  %11 = getelementptr inbounds i8, ptr %0, i64 584
  %12 = load float, ptr %11, align 8, !tbaa !34
  %13 = getelementptr inbounds i8, ptr %0, i64 588
  %14 = load i32, ptr %13, align 4, !tbaa !35
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph40, label %._crit_edge41

.lr.ph40:                                         ; preds = %2
  %16 = getelementptr inbounds i8, ptr %0, i64 200
  %17 = getelementptr inbounds i8, ptr %0, i64 44
  %18 = getelementptr inbounds i8, ptr %0, i64 368
  %19 = getelementptr inbounds i8, ptr %0, i64 128
  %20 = getelementptr inbounds i8, ptr %0, i64 184
  %.pre = load i32, ptr %17, align 4, !tbaa !36
  br label %21

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

21:                                               ; preds = %.lr.ph40, %._crit_edge
  %22 = phi i32 [ %.pre, %.lr.ph40 ], [ %55, %._crit_edge ]
  %.038 = phi i32 [ 0, %.lr.ph40 ], [ %56, %._crit_edge ]
  %23 = load ptr, ptr %16, align 8, !tbaa !37
  %24 = sext i32 %22 to i64
  %25 = shl nsw i64 %24, 2
  tail call void @llvm.memset.p0.i64(ptr align 4 %23, i8 0, i64 %25, i1 false)
  %26 = tail call noundef i32 @_ZNK16b2GrowableBufferI17b2ParticleContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %51, %21
  %28 = load i32, ptr %17, align 4, !tbaa !36
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph37, label %._crit_edge

.lr.ph:                                           ; preds = %21, %51
  %.03235 = phi i32 [ %52, %51 ], [ 0, %21 ]
  %30 = tail call noundef nonnull align 4 dereferenceable(24) ptr @_ZN16b2GrowableBufferI17b2ParticleContactEixEi(ptr noundef nonnull align 8 dereferenceable(24) %18, i32 noundef %.03235)
  %31 = tail call noundef i32 @_ZNK17b2ParticleContact8GetFlagsEv(ptr noundef nonnull align 4 dereferenceable(24) %30)
  %32 = and i32 %31, 2048
  %.not34 = icmp eq i32 %32, 0
  br i1 %.not34, label %51, label %33

33:                                               ; preds = %.lr.ph
  %34 = tail call noundef i32 @_ZNK17b2ParticleContact9GetIndexAEv(ptr noundef nonnull align 4 dereferenceable(24) %30)
  %35 = tail call noundef i32 @_ZNK17b2ParticleContact9GetIndexBEv(ptr noundef nonnull align 4 dereferenceable(24) %30)
  %36 = tail call noundef float @_ZNK17b2ParticleContact9GetWeightEv(ptr noundef nonnull align 4 dereferenceable(24) %30)
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = sext i32 %35 to i64
  %39 = getelementptr inbounds float, ptr %37, i64 %38
  %40 = load float, ptr %39, align 4, !tbaa !38
  %41 = load ptr, ptr %16, align 8, !tbaa !37
  %42 = sext i32 %34 to i64
  %43 = getelementptr inbounds float, ptr %41, i64 %42
  %44 = load float, ptr %43, align 4, !tbaa !38
  %45 = tail call float @llvm.fmuladd.f32(float %36, float %40, float %44)
  store float %45, ptr %43, align 4, !tbaa !38
  %46 = getelementptr inbounds float, ptr %37, i64 %42
  %47 = load float, ptr %46, align 4, !tbaa !38
  %48 = getelementptr inbounds float, ptr %41, i64 %38
  %49 = load float, ptr %48, align 4, !tbaa !38
  %50 = tail call float @llvm.fmuladd.f32(float %36, float %47, float %49)
  store float %50, ptr %48, align 4, !tbaa !38
  br label %51

51:                                               ; preds = %33, %.lr.ph
  %52 = add nuw nsw i32 %.03235, 1
  %53 = tail call noundef i32 @_ZNK16b2GrowableBufferI17b2ParticleContactE8GetCountEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %.lr.ph, label %.preheader, !llvm.loop !39

._crit_edge:                                      ; preds = %81, %.preheader
  %55 = phi i32 [ %28, %.preheader ], [ %82, %81 ]
  %56 = add nuw nsw i32 %.038, 1
  %57 = load i32, ptr %13, align 4, !tbaa !35
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %21, label %._crit_edge41, !llvm.loop !41

.lr.ph37:                                         ; preds = %.preheader, %81
  %59 = phi i32 [ %82, %81 ], [ %28, %.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %81 ], [ 0, %.preheader ]
  %60 = load ptr, ptr %19, align 8, !tbaa !42
  %61 = getelementptr inbounds i32, ptr %60, i64 %indvars.iv
  %62 = load i32, ptr %61, align 4, !tbaa !43
  %63 = and i32 %62, 2048
  %.not = icmp eq i32 %63, 0
  br i1 %.not, label %78, label %64

64:                                               ; preds = %.lr.ph37
  %65 = load ptr, ptr %20, align 8, !tbaa !44
  %66 = getelementptr inbounds float, ptr %65, i64 %indvars.iv
  %67 = load float, ptr %66, align 4, !tbaa !38
  %68 = load ptr, ptr %16, align 8, !tbaa !37
  %69 = getelementptr inbounds float, ptr %68, i64 %indvars.iv
  %70 = load float, ptr %69, align 4, !tbaa !38
  %71 = fadd float %67, -1.000000e+00
  %72 = tail call float @llvm.fmuladd.f32(float %9, float %71, float %70)
  %73 = fadd float %12, %67
  %74 = fdiv float %72, %73
  %75 = tail call noundef float @_Z7b2ClampIfET_S0_S0_S0_(float noundef %74, float noundef 0.000000e+00, float noundef %10)
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds float, ptr %76, i64 %indvars.iv
  store float %75, ptr %77, align 4, !tbaa !38
  %.pre43 = load i32, ptr %17, align 4, !tbaa !36
  br label %81

78:                                               ; preds = %.lr.ph37
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds float, ptr %79, i64 %indvars.iv
  store float 0.000000e+00, ptr %80, align 4, !tbaa !38
  br label %81

81:                                               ; preds = %78, %64
  %82 = phi i32 [ %59, %78 ], [ %.pre43, %64 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %83 = sext i32 %82 to i64
  %84 = icmp slt i64 %indvars.iv.next, %83
  br i1 %84, label %.lr.ph37, label %._crit_edge, !llvm.loop !45
}

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { 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 #5 = { 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" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !16, i64 192}
!6 = !{!"_ZTS16b2ParticleSystem", !7, i64 0, !10, i64 4, !10, i64 8, !7, i64 12, !10, i64 16, !7, i64 20, !7, i64 21, !10, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !10, i64 44, !10, i64 48, !12, i64 56, !19, i64 112, !20, i64 128, !21, i64 144, !21, i64 160, !16, i64 176, !16, i64 184, !16, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !22, i64 224, !16, i64 240, !23, i64 248, !10, i64 264, !24, i64 272, !24, i64 288, !24, i64 304, !25, i64 320, !26, i64 344, !27, i64 368, !28, i64 392, !29, i64 416, !30, i64 440, !24, i64 464, !24, i64 480, !31, i64 496, !7, i64 504, !10, i64 508, !16, i64 512, !32, i64 520, !16, i64 608, !16, i64 616, !16, i64 624}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !13, i64 0, !10, i64 16, !17, i64 24}
!13 = !{!"_ZTS23b2TrackedBlockAllocator", !14, i64 0}
!14 = !{!"_ZTS24b2TypedIntrusiveListNodeI14b2TrackedBlockE", !15, i64 0}
!15 = !{!"_ZTS19b2IntrusiveListNode", !16, i64 0, !16, i64 8}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"_ZTS15b2TypedFreeListI16b2ParticleHandleE", !18, i64 0}
!18 = !{!"_ZTS10b2FreeList", !15, i64 0, !15, i64 16}
!19 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIP16b2ParticleHandleEE", !16, i64 0, !10, i64 8}
!20 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !16, i64 0, !10, i64 8}
!21 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !16, i64 0, !10, i64 8}
!22 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !16, i64 0, !10, i64 8}
!23 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !16, i64 0, !10, i64 8}
!24 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !16, i64 0, !10, i64 8}
!25 = !{!"_ZTS16b2GrowableBufferIiE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!26 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!27 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!28 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!29 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!30 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !16, i64 0, !10, i64 8, !10, i64 12, !16, i64 16}
!31 = !{!"long long", !8, i64 0}
!32 = !{!"_ZTS19b2ParticleSystemDef", !7, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !10, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !10, i64 68, !11, i64 72, !7, i64 76, !11, i64 80}
!33 = !{!6, !11, i64 580}
!34 = !{!6, !11, i64 584}
!35 = !{!6, !10, i64 588}
!36 = !{!6, !10, i64 44}
!37 = !{!6, !16, i64 200}
!38 = !{!11, !11, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}
!42 = !{!6, !16, i64 128}
!43 = !{!10, !10, i64 0}
!44 = !{!6, !16, i64 184}
!45 = distinct !{!45, !40}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass