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

; 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.b2ParticleDef = type { i32, %struct.b2Vec2, %struct.b2Vec2, %class.b2ParticleColor, float, ptr, ptr }
%class.b2ParticleColor = type { i8, i8, i8, i8 }
%"struct.b2ParticleSystem::Proxy" = type { i32, i32 }
%class.b2ParticleGroup = type { ptr, i32, i32, i32, float, ptr, ptr, i32, float, float, %struct.b2Vec2, %struct.b2Vec2, float, %struct.b2Transform, ptr }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN16b2ParticleSystem14CreateParticleERK13b2ParticleDef = external hidden unnamed_addr constant [62 x i8], align 1
@b2Vec2_zero = external global %struct.b2Vec2, align 4
@.str.6 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN16b2ParticleSystem14CreateParticleERK13b2ParticleDef(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) #3 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8
  %12 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 46
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %13)
  %15 = zext i1 %14 to i32
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %2
  br label %20

18:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 625, ptr noundef @__PRETTY_FUNCTION__._ZN16b2ParticleSystem14CreateParticleERK13b2ParticleDef) #6
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  %21 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 46
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %22)
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  store i32 0, ptr %3, align 4
  br label %305

25:                                               ; preds = %20
  %26 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 12
  %27 = load i32, ptr %26, align 4, !tbaa !34
  %28 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 13
  %29 = load i32, ptr %28, align 8, !tbaa !35
  %30 = icmp sge i32 %27, %29
  br i1 %30, label %31, label %43

31:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %32 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 12
  %33 = load i32, ptr %32, align 4, !tbaa !34
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %39

35:                                               ; preds = %31
  %36 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 12
  %37 = load i32, ptr %36, align 4, !tbaa !34
  %38 = mul nsw i32 2, %37
  br label %40

39:                                               ; preds = %31
  br label %40

40:                                               ; preds = %39, %35
  %41 = phi i32 [ %38, %35 ], [ 256, %39 ]
  store i32 %41, ptr %6, align 4, !tbaa !36
  %42 = load i32, ptr %6, align 4, !tbaa !36
  call void @_ZN16b2ParticleSystem34ReallocateInternalAllocatedBuffersEi(ptr noundef nonnull align 8 dereferenceable(632) %11, i32 noundef %42)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %43

43:                                               ; preds = %40, %25
  %44 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 12
  %45 = load i32, ptr %44, align 4, !tbaa !34
  %46 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 13
  %47 = load i32, ptr %46, align 8, !tbaa !35
  %48 = icmp sge i32 %45, %47
  br i1 %48, label %49, label %57

49:                                               ; preds = %43
  %50 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 45
  %51 = getelementptr inbounds %struct.b2ParticleSystemDef, ptr %50, i32 0, i32 19
  %52 = load i8, ptr %51, align 4, !tbaa !37, !range !38, !noundef !39
  %53 = trunc i8 %52 to i1
  br i1 %53, label %54, label %55

54:                                               ; preds = %49
  call void @_ZN16b2ParticleSystem21DestroyOldestParticleEib(ptr noundef nonnull align 8 dereferenceable(632) %11, i32 noundef 0, i1 noundef zeroext false)
  call void @_ZN16b2ParticleSystem11SolveZombieEv(ptr noundef nonnull align 8 dereferenceable(632) %11)
  br label %56

55:                                               ; preds = %49
  store i32 -1, ptr %3, align 4
  br label %305

56:                                               ; preds = %54
  br label %57

57:                                               ; preds = %56, %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %58 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 12
  %59 = load i32, ptr %58, align 4, !tbaa !34
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %58, align 4, !tbaa !34
  store i32 %59, ptr %7, align 4, !tbaa !36
  %61 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 16
  %62 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.0", ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !40
  %64 = load i32, ptr %7, align 4, !tbaa !36
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  store i32 0, ptr %66, align 4, !tbaa !36
  %67 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 30
  %68 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !41
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %78

71:                                               ; preds = %57
  %72 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 30
  %73 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !41
  %75 = load i32, ptr %7, align 4, !tbaa !36
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %74, i64 %76
  store i32 0, ptr %77, align 4, !tbaa !36
  br label %78

78:                                               ; preds = %71, %57
  %79 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 31
  %80 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !42
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %90

83:                                               ; preds = %78
  %84 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 31
  %85 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !42
  %87 = load i32, ptr %7, align 4, !tbaa !36
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %86, i64 %88
  store i32 0, ptr %89, align 4, !tbaa !36
  br label %90

90:                                               ; preds = %83, %78
  %91 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 32
  %92 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !43
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %102

95:                                               ; preds = %90
  %96 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 32
  %97 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !43
  %99 = load i32, ptr %7, align 4, !tbaa !36
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %98, i64 %100
  store i32 0, ptr %101, align 4, !tbaa !36
  br label %102

102:                                              ; preds = %95, %90
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.b2ParticleDef, ptr %103, i32 0, i32 1
  %105 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 17
  %106 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !44
  %108 = load i32, ptr %7, align 4, !tbaa !36
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds %struct.b2Vec2, ptr %107, i64 %109
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %110, ptr align 4 %104, i64 8, i1 false), !tbaa.struct !45
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.b2ParticleDef, ptr %111, i32 0, i32 2
  %113 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 18
  %114 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr %113, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !47
  %116 = load i32, ptr %7, align 4, !tbaa !36
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds %struct.b2Vec2, ptr %115, i64 %117
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %118, ptr align 4 %112, i64 8, i1 false), !tbaa.struct !45
  %119 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 20
  %120 = load ptr, ptr %119, align 8, !tbaa !48
  %121 = load i32, ptr %7, align 4, !tbaa !36
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds float, ptr %120, i64 %122
  store float 0.000000e+00, ptr %123, align 4, !tbaa !46
  %124 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 19
  %125 = load ptr, ptr %124, align 8, !tbaa !49
  %126 = load i32, ptr %7, align 4, !tbaa !36
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds %struct.b2Vec2, ptr %125, i64 %127
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %128, ptr align 4 @b2Vec2_zero, i64 8, i1 false), !tbaa.struct !45
  %129 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 21
  %130 = load ptr, ptr %129, align 8, !tbaa !50
  %131 = icmp ne ptr %130, null
  br i1 %131, label %132, label %138

132:                                              ; preds = %102
  %133 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 21
  %134 = load ptr, ptr %133, align 8, !tbaa !50
  %135 = load i32, ptr %7, align 4, !tbaa !36
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds float, ptr %134, i64 %136
  store float 0.000000e+00, ptr %137, align 4, !tbaa !46
  br label %138

138:                                              ; preds = %132, %102
  %139 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 24
  %140 = load ptr, ptr %139, align 8, !tbaa !51
  %141 = icmp ne ptr %140, null
  br i1 %141, label %142, label %148

142:                                              ; preds = %138
  %143 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 24
  %144 = load ptr, ptr %143, align 8, !tbaa !51
  %145 = load i32, ptr %7, align 4, !tbaa !36
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds float, ptr %144, i64 %146
  store float 0.000000e+00, ptr %147, align 4, !tbaa !46
  br label %148

148:                                              ; preds = %142, %138
  %149 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 25
  %150 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.4", ptr %149, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8, !tbaa !52
  %152 = icmp ne ptr %151, null
  br i1 %152, label %157, label %153

153:                                              ; preds = %148
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.b2ParticleDef, ptr %154, i32 0, i32 3
  %156 = call noundef zeroext i1 @_ZNK15b2ParticleColor6IsZeroEv(ptr noundef nonnull align 1 dereferenceable(4) %155)
  br i1 %156, label %172, label %157

157:                                              ; preds = %153, %148
  %158 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 25
  %159 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.4", ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !52
  %161 = call noundef ptr @_ZN16b2ParticleSystem13RequestBufferI15b2ParticleColorEEPT_S3_(ptr noundef nonnull align 8 dereferenceable(632) %11, ptr noundef %160)
  %162 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 25
  %163 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.4", ptr %162, i32 0, i32 0
  store ptr %161, ptr %163, align 8, !tbaa !52
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.b2ParticleDef, ptr %164, i32 0, i32 3
  %166 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 25
  %167 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.4", ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !52
  %169 = load i32, ptr %7, align 4, !tbaa !36
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %class.b2ParticleColor, ptr %168, i64 %170
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %171, ptr align 4 %165, i64 4, i1 false), !tbaa.struct !53
  br label %172

172:                                              ; preds = %157, %153
  %173 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 27
  %174 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.6", ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !55
  %176 = icmp ne ptr %175, null
  br i1 %176, label %182, label %177

177:                                              ; preds = %172
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.b2ParticleDef, ptr %178, i32 0, i32 5
  %180 = load ptr, ptr %179, align 8, !tbaa !56
  %181 = icmp ne ptr %180, null
  br i1 %181, label %182, label %198

182:                                              ; preds = %177, %172
  %183 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 27
  %184 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.6", ptr %183, i32 0, i32 0
  %185 = load ptr, ptr %184, align 8, !tbaa !55
  %186 = call noundef ptr @_ZN16b2ParticleSystem13RequestBufferIPvEEPT_S3_(ptr noundef nonnull align 8 dereferenceable(632) %11, ptr noundef %185)
  %187 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 27
  %188 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.6", ptr %187, i32 0, i32 0
  store ptr %186, ptr %188, align 8, !tbaa !55
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.b2ParticleDef, ptr %189, i32 0, i32 5
  %191 = load ptr, ptr %190, align 8, !tbaa !56
  %192 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 27
  %193 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.6", ptr %192, i32 0, i32 0
  %194 = load ptr, ptr %193, align 8, !tbaa !55
  %195 = load i32, ptr %7, align 4, !tbaa !36
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds ptr, ptr %194, i64 %196
  store ptr %191, ptr %197, align 8, !tbaa !5
  br label %198

198:                                              ; preds = %182, %177
  %199 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 15
  %200 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer", ptr %199, i32 0, i32 0
  %201 = load ptr, ptr %200, align 8, !tbaa !60
  %202 = icmp ne ptr %201, null
  br i1 %202, label %203, label %210

203:                                              ; preds = %198
  %204 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 15
  %205 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer", ptr %204, i32 0, i32 0
  %206 = load ptr, ptr %205, align 8, !tbaa !60
  %207 = load i32, ptr %7, align 4, !tbaa !36
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds ptr, ptr %206, i64 %208
  store ptr null, ptr %209, align 8, !tbaa !5
  br label %210

210:                                              ; preds = %203, %198
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %211 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 34
  %212 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN16b2GrowableBufferIN16b2ParticleSystem5ProxyEE6AppendEv(ptr noundef nonnull align 8 dereferenceable(24) %211)
  store ptr %212, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.b2ParticleDef, ptr %213, i32 0, i32 4
  %215 = load float, ptr %214, align 8, !tbaa !61
  %216 = fcmp ogt float %215, 0.000000e+00
  %217 = zext i1 %216 to i8
  store i8 %217, ptr %9, align 1, !tbaa !62
  %218 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 39
  %219 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %218, i32 0, i32 0
  %220 = load ptr, ptr %219, align 8, !tbaa !63
  %221 = icmp ne ptr %220, null
  br i1 %221, label %225, label %222

222:                                              ; preds = %210
  %223 = load i8, ptr %9, align 1, !tbaa !62, !range !38, !noundef !39
  %224 = trunc i8 %223 to i1
  br i1 %224, label %225, label %246

225:                                              ; preds = %222, %210
  %226 = load i32, ptr %7, align 4, !tbaa !36
  %227 = load i8, ptr %9, align 1, !tbaa !62, !range !38, !noundef !39
  %228 = trunc i8 %227 to i1
  br i1 %228, label %229, label %233

229:                                              ; preds = %225
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.b2ParticleDef, ptr %230, i32 0, i32 4
  %232 = load float, ptr %231, align 8, !tbaa !61
  br label %237

233:                                              ; preds = %225
  %234 = call noundef i32 @_ZNK16b2ParticleSystem23GetQuantizedTimeElapsedEv(ptr noundef nonnull align 8 dereferenceable(632) %11)
  %235 = sub nsw i32 0, %234
  %236 = call noundef float @_ZNK16b2ParticleSystem24ExpirationTimeToLifetimeEi(ptr noundef nonnull align 8 dereferenceable(632) %11, i32 noundef %235)
  br label %237

237:                                              ; preds = %233, %229
  %238 = phi float [ %232, %229 ], [ %236, %233 ]
  call void @_ZN16b2ParticleSystem19SetParticleLifetimeEif(ptr noundef nonnull align 8 dereferenceable(632) %11, i32 noundef %226, float noundef %238)
  %239 = load i32, ptr %7, align 4, !tbaa !36
  %240 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 40
  %241 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.8", ptr %240, i32 0, i32 0
  %242 = load ptr, ptr %241, align 8, !tbaa !64
  %243 = load i32, ptr %7, align 4, !tbaa !36
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds i32, ptr %242, i64 %244
  store i32 %239, ptr %245, align 4, !tbaa !36
  br label %246

246:                                              ; preds = %237, %222
  %247 = load i32, ptr %7, align 4, !tbaa !36
  %248 = load ptr, ptr %8, align 8, !tbaa !5
  %249 = getelementptr inbounds %"struct.b2ParticleSystem::Proxy", ptr %248, i32 0, i32 0
  store i32 %247, ptr %249, align 4, !tbaa !65
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %250 = load ptr, ptr %5, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.b2ParticleDef, ptr %250, i32 0, i32 6
  %252 = load ptr, ptr %251, align 8, !tbaa !67
  store ptr %252, ptr %10, align 8, !tbaa !5
  %253 = load ptr, ptr %10, align 8, !tbaa !5
  %254 = getelementptr inbounds %class.b2ParticleSystem, ptr %11, i32 0, i32 26
  %255 = load ptr, ptr %254, align 8, !tbaa !68
  %256 = load i32, ptr %7, align 4, !tbaa !36
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds ptr, ptr %255, i64 %257
  store ptr %253, ptr %258, align 8, !tbaa !5
  %259 = load ptr, ptr %10, align 8, !tbaa !5
  %260 = icmp ne ptr %259, null
  br i1 %260, label %261, label %299

261:                                              ; preds = %246
  %262 = load ptr, ptr %10, align 8, !tbaa !5
  %263 = getelementptr inbounds %class.b2ParticleGroup, ptr %262, i32 0, i32 1
  %264 = load i32, ptr %263, align 8, !tbaa !69
  %265 = load ptr, ptr %10, align 8, !tbaa !5
  %266 = getelementptr inbounds %class.b2ParticleGroup, ptr %265, i32 0, i32 2
  %267 = load i32, ptr %266, align 4, !tbaa !73
  %268 = icmp slt i32 %264, %267
  br i1 %268, label %269, label %290

269:                                              ; preds = %261
  %270 = load ptr, ptr %10, align 8, !tbaa !5
  %271 = getelementptr inbounds %class.b2ParticleGroup, ptr %270, i32 0, i32 1
  %272 = load i32, ptr %271, align 8, !tbaa !69
  %273 = load ptr, ptr %10, align 8, !tbaa !5
  %274 = getelementptr inbounds %class.b2ParticleGroup, ptr %273, i32 0, i32 2
  %275 = load i32, ptr %274, align 4, !tbaa !73
  %276 = load i32, ptr %7, align 4, !tbaa !36
  call void @_ZN16b2ParticleSystem12RotateBufferEiii(ptr noundef nonnull align 8 dereferenceable(632) %11, i32 noundef %272, i32 noundef %275, i32 noundef %276)
  %277 = load ptr, ptr %10, align 8, !tbaa !5
  %278 = getelementptr inbounds %class.b2ParticleGroup, ptr %277, i32 0, i32 2
  %279 = load i32, ptr %278, align 4, !tbaa !73
  %280 = load i32, ptr %7, align 4, !tbaa !36
  %281 = icmp eq i32 %279, %280
  br i1 %281, label %282, label %283

282:                                              ; preds = %269
  br label %285

283:                                              ; preds = %269
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 717, ptr noundef @__PRETTY_FUNCTION__._ZN16b2ParticleSystem14CreateParticleERK13b2ParticleDef) #6
  unreachable

284:                                              ; No predecessors!
  br label %285

285:                                              ; preds = %284, %282
  %286 = load i32, ptr %7, align 4, !tbaa !36
  %287 = add nsw i32 %286, 1
  %288 = load ptr, ptr %10, align 8, !tbaa !5
  %289 = getelementptr inbounds %class.b2ParticleGroup, ptr %288, i32 0, i32 2
  store i32 %287, ptr %289, align 4, !tbaa !73
  br label %298

290:                                              ; preds = %261
  %291 = load i32, ptr %7, align 4, !tbaa !36
  %292 = load ptr, ptr %10, align 8, !tbaa !5
  %293 = getelementptr inbounds %class.b2ParticleGroup, ptr %292, i32 0, i32 1
  store i32 %291, ptr %293, align 8, !tbaa !69
  %294 = load i32, ptr %7, align 4, !tbaa !36
  %295 = add nsw i32 %294, 1
  %296 = load ptr, ptr %10, align 8, !tbaa !5
  %297 = getelementptr inbounds %class.b2ParticleGroup, ptr %296, i32 0, i32 2
  store i32 %295, ptr %297, align 4, !tbaa !73
  br label %298

298:                                              ; preds = %290, %285
  br label %299

299:                                              ; preds = %298, %246
  %300 = load i32, ptr %7, align 4, !tbaa !36
  %301 = load ptr, ptr %5, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.b2ParticleDef, ptr %301, i32 0, i32 0
  %303 = load i32, ptr %302, align 8, !tbaa !74
  call void @_ZN16b2ParticleSystem16SetParticleFlagsEij(ptr noundef nonnull align 8 dereferenceable(632) %11, i32 noundef %300, i32 noundef %303)
  %304 = load i32, ptr %7, align 4, !tbaa !36
  store i32 %304, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %305

305:                                              ; preds = %299, %55, %24
  %306 = load i32, ptr %3, align 4
  ret i32 %306
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK15b2ParticleColor6IsZeroEv(ptr noundef nonnull align 1 dereferenceable(4)) #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16b2ParticleSystem19SetParticleLifetimeEif(ptr noundef nonnull align 8 dereferenceable(632), i32 noundef, float noundef) #3 align 2

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

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

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

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

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 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 #6 = { noreturn nounwind }
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 608}
!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 = !{!10, !12, i64 44}
!35 = !{!10, !12, i64 48}
!36 = !{!12, !12, i64 0}
!37 = !{!10, !11, i64 596}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = !{!10, !6, i64 128}
!41 = !{!10, !6, i64 272}
!42 = !{!10, !6, i64 288}
!43 = !{!10, !6, i64 304}
!44 = !{!10, !6, i64 144}
!45 = !{i64 0, i64 4, !46, i64 4, i64 4, !46}
!46 = !{!13, !13, i64 0}
!47 = !{!10, !6, i64 160}
!48 = !{!10, !6, i64 184}
!49 = !{!10, !6, i64 176}
!50 = !{!10, !6, i64 192}
!51 = !{!10, !6, i64 216}
!52 = !{!10, !6, i64 224}
!53 = !{i64 0, i64 1, !54, i64 1, i64 1, !54, i64 2, i64 1, !54, i64 3, i64 1, !54}
!54 = !{!7, !7, i64 0}
!55 = !{!10, !6, i64 248}
!56 = !{!57, !6, i64 32}
!57 = !{!"_ZTS13b2ParticleDef", !12, i64 0, !58, i64 4, !58, i64 12, !59, i64 20, !13, i64 24, !6, i64 32, !6, i64 40}
!58 = !{!"_ZTS6b2Vec2", !13, i64 0, !13, i64 4}
!59 = !{!"_ZTS15b2ParticleColor", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!60 = !{!10, !6, i64 112}
!61 = !{!57, !13, i64 24}
!62 = !{!11, !11, i64 0}
!63 = !{!10, !6, i64 464}
!64 = !{!10, !6, i64 480}
!65 = !{!66, !12, i64 0}
!66 = !{!"_ZTSN16b2ParticleSystem5ProxyE", !12, i64 0, !12, i64 4}
!67 = !{!57, !6, i64 40}
!68 = !{!10, !6, i64 240}
!69 = !{!70, !12, i64 8}
!70 = !{!"_ZTS15b2ParticleGroup", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !13, i64 20, !6, i64 24, !6, i64 32, !12, i64 40, !13, i64 44, !13, i64 48, !58, i64 52, !58, i64 60, !13, i64 68, !71, i64 72, !6, i64 88}
!71 = !{!"_ZTS11b2Transform", !58, i64 0, !72, i64 8}
!72 = !{!"_ZTS5b2Rot", !13, i64 0, !13, i64 4}
!73 = !{!70, !12, i64 12}
!74 = !{!57, !12, i64 0}


; 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 }
%class.b2ParticleColor = type { i8, i8, i8, i8 }

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN16b2ParticleSystem14CreateParticleERK13b2ParticleDef = external hidden unnamed_addr constant [62 x i8], align 1
@b2Vec2_zero = external local_unnamed_addr global %struct.b2Vec2, align 4
@.str.6 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN16b2ParticleSystem14CreateParticleERK13b2ParticleDef(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 608
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %4)
  br i1 %5, label %6, label %7

6:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 625, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16b2ParticleSystem14CreateParticleERK13b2ParticleDef) #4
  unreachable

7:                                                ; preds = %2
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %8)
  br i1 %9, label %136, label %10

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 44
  %12 = load i32, ptr %11, align 4, !tbaa !33
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = load i32, ptr %13, align 8, !tbaa !34
  %.not = icmp slt i32 %12, %14
  br i1 %.not, label %17, label %15

15:                                               ; preds = %10
  %.not60 = icmp eq i32 %12, 0
  %16 = shl nsw i32 %12, 1
  %spec.select = select i1 %.not60, i32 256, i32 %16
  tail call void @_ZN16b2ParticleSystem34ReallocateInternalAllocatedBuffersEi(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %spec.select)
  %.pre = load i32, ptr %11, align 4, !tbaa !33
  %.pre74 = load i32, ptr %13, align 8, !tbaa !34
  br label %17

17:                                               ; preds = %15, %10
  %18 = phi i32 [ %.pre74, %15 ], [ %14, %10 ]
  %19 = phi i32 [ %.pre, %15 ], [ %12, %10 ]
  %.not61 = icmp slt i32 %19, %18
  br i1 %.not61, label %25, label %20

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %0, i64 596
  %22 = load i8, ptr %21, align 4, !tbaa !35, !range !36, !noundef !37
  %23 = trunc nuw i8 %22 to i1
  br i1 %23, label %24, label %136

24:                                               ; preds = %20
  tail call void @_ZN16b2ParticleSystem21DestroyOldestParticleEib(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef 0, i1 noundef zeroext false)
  tail call void @_ZN16b2ParticleSystem11SolveZombieEv(ptr noundef nonnull align 8 dereferenceable(632) %0)
  %.pre75 = load i32, ptr %11, align 4, !tbaa !33
  br label %25

25:                                               ; preds = %24, %17
  %26 = phi i32 [ %.pre75, %24 ], [ %19, %17 ]
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %11, align 4, !tbaa !33
  %28 = getelementptr inbounds i8, ptr %0, i64 128
  %29 = load ptr, ptr %28, align 8, !tbaa !38
  %30 = sext i32 %26 to i64
  %31 = getelementptr inbounds i32, ptr %29, i64 %30
  store i32 0, ptr %31, align 4, !tbaa !39
  %32 = getelementptr inbounds i8, ptr %0, i64 272
  %33 = load ptr, ptr %32, align 8, !tbaa !40
  %.not62 = icmp eq ptr %33, null
  br i1 %.not62, label %36, label %34

34:                                               ; preds = %25
  %35 = getelementptr inbounds i32, ptr %33, i64 %30
  store i32 0, ptr %35, align 4, !tbaa !39
  br label %36

36:                                               ; preds = %34, %25
  %37 = getelementptr inbounds i8, ptr %0, i64 288
  %38 = load ptr, ptr %37, align 8, !tbaa !41
  %.not63 = icmp eq ptr %38, null
  br i1 %.not63, label %41, label %39

39:                                               ; preds = %36
  %40 = getelementptr inbounds i32, ptr %38, i64 %30
  store i32 0, ptr %40, align 4, !tbaa !39
  br label %41

41:                                               ; preds = %39, %36
  %42 = getelementptr inbounds i8, ptr %0, i64 304
  %43 = load ptr, ptr %42, align 8, !tbaa !42
  %.not64 = icmp eq ptr %43, null
  br i1 %.not64, label %46, label %44

44:                                               ; preds = %41
  %45 = getelementptr inbounds i32, ptr %43, i64 %30
  store i32 0, ptr %45, align 4, !tbaa !39
  br label %46

46:                                               ; preds = %44, %41
  %47 = getelementptr inbounds i8, ptr %1, i64 4
  %48 = getelementptr inbounds i8, ptr %0, i64 144
  %49 = load ptr, ptr %48, align 8, !tbaa !43
  %50 = getelementptr inbounds %struct.b2Vec2, ptr %49, i64 %30
  %51 = load i64, ptr %47, align 4
  store i64 %51, ptr %50, align 4
  %52 = getelementptr inbounds i8, ptr %1, i64 12
  %53 = getelementptr inbounds i8, ptr %0, i64 160
  %54 = load ptr, ptr %53, align 8, !tbaa !44
  %55 = getelementptr inbounds %struct.b2Vec2, ptr %54, i64 %30
  %56 = load i64, ptr %52, align 4
  store i64 %56, ptr %55, align 4
  %57 = getelementptr inbounds i8, ptr %0, i64 184
  %58 = load ptr, ptr %57, align 8, !tbaa !45
  %59 = getelementptr inbounds float, ptr %58, i64 %30
  store float 0.000000e+00, ptr %59, align 4, !tbaa !46
  %60 = getelementptr inbounds i8, ptr %0, i64 176
  %61 = load ptr, ptr %60, align 8, !tbaa !47
  %62 = getelementptr inbounds %struct.b2Vec2, ptr %61, i64 %30
  %63 = load i64, ptr @b2Vec2_zero, align 4
  store i64 %63, ptr %62, align 4
  %64 = getelementptr inbounds i8, ptr %0, i64 192
  %65 = load ptr, ptr %64, align 8, !tbaa !48
  %.not65 = icmp eq ptr %65, null
  br i1 %.not65, label %68, label %66

66:                                               ; preds = %46
  %67 = getelementptr inbounds float, ptr %65, i64 %30
  store float 0.000000e+00, ptr %67, align 4, !tbaa !46
  br label %68

68:                                               ; preds = %66, %46
  %69 = getelementptr inbounds i8, ptr %0, i64 216
  %70 = load ptr, ptr %69, align 8, !tbaa !49
  %.not66 = icmp eq ptr %70, null
  br i1 %.not66, label %73, label %71

71:                                               ; preds = %68
  %72 = getelementptr inbounds float, ptr %70, i64 %30
  store float 0.000000e+00, ptr %72, align 4, !tbaa !46
  br label %73

73:                                               ; preds = %71, %68
  %74 = getelementptr inbounds i8, ptr %0, i64 224
  %75 = load ptr, ptr %74, align 8, !tbaa !50
  %.not67 = icmp eq ptr %75, null
  br i1 %.not67, label %76, label %79

76:                                               ; preds = %73
  %77 = getelementptr inbounds i8, ptr %1, i64 20
  %78 = tail call noundef zeroext i1 @_ZNK15b2ParticleColor6IsZeroEv(ptr noundef nonnull align 1 dereferenceable(4) %77)
  br i1 %78, label %85, label %._crit_edge

._crit_edge:                                      ; preds = %76
  %.pre76 = load ptr, ptr %74, align 8, !tbaa !50
  br label %79

79:                                               ; preds = %._crit_edge, %73
  %80 = phi ptr [ %.pre76, %._crit_edge ], [ %75, %73 ]
  %81 = tail call noundef ptr @_ZN16b2ParticleSystem13RequestBufferI15b2ParticleColorEEPT_S3_(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %80)
  store ptr %81, ptr %74, align 8, !tbaa !50
  %82 = getelementptr inbounds i8, ptr %1, i64 20
  %83 = getelementptr inbounds %class.b2ParticleColor, ptr %81, i64 %30
  %84 = load i32, ptr %82, align 4
  store i32 %84, ptr %83, align 1
  br label %85

85:                                               ; preds = %79, %76
  %86 = getelementptr inbounds i8, ptr %0, i64 248
  %87 = load ptr, ptr %86, align 8, !tbaa !51
  %.not68 = icmp eq ptr %87, null
  %88 = getelementptr inbounds i8, ptr %1, i64 32
  %89 = load ptr, ptr %88, align 8
  %.not69 = icmp eq ptr %89, null
  %or.cond = select i1 %.not68, i1 %.not69, i1 false
  br i1 %or.cond, label %94, label %90

90:                                               ; preds = %85
  %91 = tail call noundef ptr @_ZN16b2ParticleSystem13RequestBufferIPvEEPT_S3_(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %87)
  store ptr %91, ptr %86, align 8, !tbaa !51
  %92 = load ptr, ptr %88, align 8, !tbaa !52
  %93 = getelementptr inbounds ptr, ptr %91, i64 %30
  store ptr %92, ptr %93, align 8, !tbaa !56
  br label %94

94:                                               ; preds = %85, %90
  %95 = getelementptr inbounds i8, ptr %0, i64 112
  %96 = load ptr, ptr %95, align 8, !tbaa !57
  %.not70 = icmp eq ptr %96, null
  br i1 %.not70, label %99, label %97

97:                                               ; preds = %94
  %98 = getelementptr inbounds ptr, ptr %96, i64 %30
  store ptr null, ptr %98, align 8, !tbaa !56
  br label %99

99:                                               ; preds = %97, %94
  %100 = getelementptr inbounds i8, ptr %0, i64 344
  %101 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZN16b2GrowableBufferIN16b2ParticleSystem5ProxyEE6AppendEv(ptr noundef nonnull align 8 dereferenceable(24) %100)
  %102 = getelementptr inbounds i8, ptr %1, i64 24
  %103 = load float, ptr %102, align 8, !tbaa !58
  %104 = fcmp ogt float %103, 0.000000e+00
  %105 = getelementptr inbounds i8, ptr %0, i64 464
  %106 = load ptr, ptr %105, align 8, !tbaa !59
  %.not71 = icmp ne ptr %106, null
  %brmerge = select i1 %.not71, i1 true, i1 %104
  br i1 %brmerge, label %107, label %117

107:                                              ; preds = %99
  br i1 %104, label %112, label %108

108:                                              ; preds = %107
  %109 = tail call noundef i32 @_ZNK16b2ParticleSystem23GetQuantizedTimeElapsedEv(ptr noundef nonnull align 8 dereferenceable(632) %0)
  %110 = sub nsw i32 0, %109
  %111 = tail call noundef float @_ZNK16b2ParticleSystem24ExpirationTimeToLifetimeEi(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %110)
  br label %112

112:                                              ; preds = %107, %108
  %113 = phi float [ %111, %108 ], [ %103, %107 ]
  tail call void @_ZN16b2ParticleSystem19SetParticleLifetimeEif(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %26, float noundef %113)
  %114 = getelementptr inbounds i8, ptr %0, i64 480
  %115 = load ptr, ptr %114, align 8, !tbaa !60
  %116 = getelementptr inbounds i32, ptr %115, i64 %30
  store i32 %26, ptr %116, align 4, !tbaa !39
  br label %117

117:                                              ; preds = %99, %112
  store i32 %26, ptr %101, align 4, !tbaa !61
  %118 = getelementptr inbounds i8, ptr %1, i64 40
  %119 = load ptr, ptr %118, align 8, !tbaa !63
  %120 = getelementptr inbounds i8, ptr %0, i64 240
  %121 = load ptr, ptr %120, align 8, !tbaa !64
  %122 = getelementptr inbounds ptr, ptr %121, i64 %30
  store ptr %119, ptr %122, align 8, !tbaa !56
  %.not72 = icmp eq ptr %119, null
  br i1 %.not72, label %134, label %123

123:                                              ; preds = %117
  %124 = getelementptr inbounds i8, ptr %119, i64 8
  %125 = load i32, ptr %124, align 8, !tbaa !65
  %126 = getelementptr inbounds i8, ptr %119, i64 12
  %127 = load i32, ptr %126, align 4, !tbaa !69
  %128 = icmp slt i32 %125, %127
  br i1 %128, label %129, label %133

129:                                              ; preds = %123
  tail call void @_ZN16b2ParticleSystem12RotateBufferEiii(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %125, i32 noundef %127, i32 noundef %26)
  %130 = load i32, ptr %126, align 4, !tbaa !69
  %131 = icmp eq i32 %130, %26
  br i1 %131, label %.sink.split, label %132

132:                                              ; preds = %129
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 717, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16b2ParticleSystem14CreateParticleERK13b2ParticleDef) #4
  unreachable

133:                                              ; preds = %123
  store i32 %26, ptr %124, align 8, !tbaa !65
  br label %.sink.split

.sink.split:                                      ; preds = %129, %133
  store i32 %27, ptr %126, align 4, !tbaa !69
  br label %134

134:                                              ; preds = %.sink.split, %117
  %135 = load i32, ptr %1, align 8, !tbaa !70
  tail call void @_ZN16b2ParticleSystem16SetParticleFlagsEij(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %26, i32 noundef %135)
  br label %136

136:                                              ; preds = %20, %7, %134
  %.0 = phi i32 [ %26, %134 ], [ 0, %7 ], [ -1, %20 ]
  ret i32 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16b2ParticleSystem21DestroyOldestParticleEib(ptr noundef nonnull align 8 dereferenceable(632), i32 noundef, i1 noundef zeroext) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK15b2ParticleColor6IsZeroEv(ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

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

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

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

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

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !16, i64 608}
!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, !10, i64 44}
!34 = !{!6, !10, i64 48}
!35 = !{!6, !7, i64 596}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = !{!6, !16, i64 128}
!39 = !{!10, !10, i64 0}
!40 = !{!6, !16, i64 272}
!41 = !{!6, !16, i64 288}
!42 = !{!6, !16, i64 304}
!43 = !{!6, !16, i64 144}
!44 = !{!6, !16, i64 160}
!45 = !{!6, !16, i64 184}
!46 = !{!11, !11, i64 0}
!47 = !{!6, !16, i64 176}
!48 = !{!6, !16, i64 192}
!49 = !{!6, !16, i64 216}
!50 = !{!6, !16, i64 224}
!51 = !{!6, !16, i64 248}
!52 = !{!53, !16, i64 32}
!53 = !{!"_ZTS13b2ParticleDef", !10, i64 0, !54, i64 4, !54, i64 12, !55, i64 20, !11, i64 24, !16, i64 32, !16, i64 40}
!54 = !{!"_ZTS6b2Vec2", !11, i64 0, !11, i64 4}
!55 = !{!"_ZTS15b2ParticleColor", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3}
!56 = !{!16, !16, i64 0}
!57 = !{!6, !16, i64 112}
!58 = !{!53, !11, i64 24}
!59 = !{!6, !16, i64 464}
!60 = !{!6, !16, i64 480}
!61 = !{!62, !10, i64 0}
!62 = !{!"_ZTSN16b2ParticleSystem5ProxyE", !10, i64 0, !10, i64 4}
!63 = !{!53, !16, i64 40}
!64 = !{!6, !16, i64 240}
!65 = !{!66, !10, i64 8}
!66 = !{!"_ZTS15b2ParticleGroup", !16, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 20, !16, i64 24, !16, i64 32, !10, i64 40, !11, i64 44, !11, i64 48, !54, i64 52, !54, i64 60, !11, i64 68, !67, i64 72, !16, i64 88}
!67 = !{!"_ZTS11b2Transform", !54, i64 0, !68, i64 8}
!68 = !{!"_ZTS5b2Rot", !11, i64 0, !11, i64 4}
!69 = !{!66, !10, i64 12}
!70 = !{!53, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass