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

%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%"class.b2ParticleSystem::ConnectionFilter" = type { ptr }
%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.b2ParticleGroupDef = type { i32, i32, %struct.b2Vec2, float, %struct.b2Vec2, float, %class.b2ParticleColor, float, ptr, ptr, i32, float, i32, ptr, float, ptr, ptr }
%class.b2ParticleColor = type { i8, i8, i8, i8 }
%class.b2World = type { %class.b2BlockAllocator, %class.b2StackAllocator, %class.b2ContactManager, ptr, ptr, ptr, ptr, i32, i32, %struct.b2Vec2, i8, ptr, ptr, float, i8, i8, i8, i8, i8, i8, i8, i8, %struct.b2Profile }
%class.b2BlockAllocator = type { ptr, i32, i32, [14 x ptr] }
%class.b2StackAllocator = type <{ [102400 x i8], i32, i32, i32, [4 x i8], [32 x %struct.b2StackEntry], i32, [4 x i8] }>
%struct.b2StackEntry = type { ptr, i32, i8 }
%class.b2ContactManager = type { %class.b2BroadPhase, i32, ptr, ptr, ptr, ptr }
%class.b2BroadPhase = type <{ ptr, ptr, ptr, ptr, %struct.b2TreeNode, ptr, ptr, ptr, i32, i32, %class.b2IntHashTable, i32, i32, i8, [7 x i8] }>
%struct.b2TreeNode = type { ptr, ptr, ptr, ptr, %struct.b2AABB }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%class.b2IntHashTable = type <{ ptr, i32, [4 x i8] }>
%struct.b2Profile = type { float, float, float, float, float }
%class.b2ParticleGroup = type { ptr, i32, i32, i32, float, ptr, ptr, i32, float, float, %struct.b2Vec2, %struct.b2Vec2, float, %struct.b2Transform, ptr }

@.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__._ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef = external hidden unnamed_addr constant [83 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16b2ParticleSystem22CreateParticleForGroupERK18b2ParticleGroupDefRK11b2TransformRK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11b2TransformC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16b2ParticleSystem32CreateParticlesWithShapeForGroupEPK7b2ShapeRK18b2ParticleGroupDefRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 4 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16b2ParticleSystem33CreateParticlesWithShapesForGroupEPKPK7b2ShapeiRK18b2ParticleGroupDefRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 4 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(104) %1) #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.b2Transform, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.b2Vec2, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.b2ParticleSystem::ConnectionFilter", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  %18 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 46
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %19)
  %21 = zext i1 %20 to i32
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %2
  br label %26

24:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 1016, ptr noundef @__PRETTY_FUNCTION__._ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef) #8
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  %27 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 46
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %28)
  br i1 %29, label %30, label %31

30:                                               ; preds = %26
  store ptr null, ptr %3, align 8
  br label %187

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #9
  call void @_ZN11b2TransformC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %6)
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %32, i32 0, i32 2
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %34, i32 0, i32 3
  %36 = load float, ptr %35, align 8, !tbaa !34
  call void @_ZN11b2Transform3SetERK6b2Vec2f(ptr noundef nonnull align 4 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(8) %33, float noundef %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  %37 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 12
  %38 = load i32, ptr %37, align 4, !tbaa !38
  store i32 %38, ptr %7, align 4, !tbaa !39
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %39, i32 0, i32 8
  %41 = load ptr, ptr %40, align 8, !tbaa !40
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %48

43:                                               ; preds = %31
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %44, i32 0, i32 8
  %46 = load ptr, ptr %45, align 8, !tbaa !40
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN16b2ParticleSystem32CreateParticlesWithShapeForGroupEPK7b2ShapeRK18b2ParticleGroupDefRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(632) %17, ptr noundef %46, ptr noundef nonnull align 8 dereferenceable(104) %47, ptr noundef nonnull align 4 dereferenceable(16) %6)
  br label %48

48:                                               ; preds = %43, %31
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %49, i32 0, i32 9
  %51 = load ptr, ptr %50, align 8, !tbaa !41
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %61

53:                                               ; preds = %48
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %54, i32 0, i32 9
  %56 = load ptr, ptr %55, align 8, !tbaa !41
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %57, i32 0, i32 10
  %59 = load i32, ptr %58, align 8, !tbaa !42
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN16b2ParticleSystem33CreateParticlesWithShapesForGroupEPKPK7b2ShapeiRK18b2ParticleGroupDefRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(632) %17, ptr noundef %56, i32 noundef %59, ptr noundef nonnull align 8 dereferenceable(104) %60, ptr noundef nonnull align 4 dereferenceable(16) %6)
  br label %61

61:                                               ; preds = %53, %48
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %62, i32 0, i32 12
  %64 = load i32, ptr %63, align 8, !tbaa !43
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %95

66:                                               ; preds = %61
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %67, i32 0, i32 13
  %69 = load ptr, ptr %68, align 8, !tbaa !44
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %72

71:                                               ; preds = %66
  br label %74

72:                                               ; preds = %66
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 1036, ptr noundef @__PRETTY_FUNCTION__._ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef) #8
  unreachable

73:                                               ; No predecessors!
  br label %74

74:                                               ; preds = %73, %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !39
  br label %75

75:                                               ; preds = %91, %74
  %76 = load i32, ptr %8, align 4, !tbaa !39
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %77, i32 0, i32 12
  %79 = load i32, ptr %78, align 8, !tbaa !43
  %80 = icmp slt i32 %76, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %94

82:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %83, i32 0, i32 13
  %85 = load ptr, ptr %84, align 8, !tbaa !44
  %86 = load i32, ptr %8, align 4, !tbaa !39
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.b2Vec2, ptr %85, i64 %87
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %88, i64 8, i1 false), !tbaa.struct !45
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = call noundef i32 @_ZN16b2ParticleSystem22CreateParticleForGroupERK18b2ParticleGroupDefRK11b2TransformRK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(632) %17, ptr noundef nonnull align 8 dereferenceable(104) %89, ptr noundef nonnull align 4 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %91

91:                                               ; preds = %82
  %92 = load i32, ptr %8, align 4, !tbaa !39
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %8, align 4, !tbaa !39
  br label %75, !llvm.loop !47

94:                                               ; preds = %81
  br label %95

95:                                               ; preds = %94, %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  %96 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 12
  %97 = load i32, ptr %96, align 4, !tbaa !38
  store i32 %97, ptr %10, align 4, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %98 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 46
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = getelementptr inbounds %class.b2World, ptr %99, i32 0, i32 0
  %101 = call noundef ptr @_ZN16b2BlockAllocator8AllocateEi(ptr noundef nonnull align 8 dereferenceable(128) %100, i32 noundef 96)
  store ptr %101, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN15b2ParticleGroupC1Ev(ptr noundef nonnull align 8 dereferenceable(96) %102)
  store ptr %102, ptr %12, align 8, !tbaa !5
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = getelementptr inbounds %class.b2ParticleGroup, ptr %103, i32 0, i32 0
  store ptr %17, ptr %104, align 8, !tbaa !49
  %105 = load i32, ptr %7, align 4, !tbaa !39
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.b2ParticleGroup, ptr %106, i32 0, i32 1
  store i32 %105, ptr %107, align 8, !tbaa !53
  %108 = load i32, ptr %10, align 4, !tbaa !39
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.b2ParticleGroup, ptr %109, i32 0, i32 2
  store i32 %108, ptr %110, align 4, !tbaa !54
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %111, i32 0, i32 7
  %113 = load float, ptr %112, align 4, !tbaa !55
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = getelementptr inbounds %class.b2ParticleGroup, ptr %114, i32 0, i32 4
  store float %113, ptr %115, align 4, !tbaa !56
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %116, i32 0, i32 15
  %118 = load ptr, ptr %117, align 8, !tbaa !57
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = getelementptr inbounds %class.b2ParticleGroup, ptr %119, i32 0, i32 14
  store ptr %118, ptr %120, align 8, !tbaa !58
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = getelementptr inbounds %class.b2ParticleGroup, ptr %121, i32 0, i32 13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %122, ptr align 4 %6, i64 16, i1 false), !tbaa.struct !59
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  %124 = getelementptr inbounds %class.b2ParticleGroup, ptr %123, i32 0, i32 5
  store ptr null, ptr %124, align 8, !tbaa !60
  %125 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 44
  %126 = load ptr, ptr %125, align 8, !tbaa !61
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = getelementptr inbounds %class.b2ParticleGroup, ptr %127, i32 0, i32 6
  store ptr %126, ptr %128, align 8, !tbaa !62
  %129 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 44
  %130 = load ptr, ptr %129, align 8, !tbaa !61
  %131 = icmp ne ptr %130, null
  br i1 %131, label %132, label %137

132:                                              ; preds = %95
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 44
  %135 = load ptr, ptr %134, align 8, !tbaa !61
  %136 = getelementptr inbounds %class.b2ParticleGroup, ptr %135, i32 0, i32 5
  store ptr %133, ptr %136, align 8, !tbaa !60
  br label %137

137:                                              ; preds = %132, %95
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  %139 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 44
  store ptr %138, ptr %139, align 8, !tbaa !61
  %140 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 43
  %141 = load i32, ptr %140, align 4, !tbaa !63
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %140, align 4, !tbaa !63
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %143 = load i32, ptr %7, align 4, !tbaa !39
  store i32 %143, ptr %13, align 4, !tbaa !39
  br label %144

144:                                              ; preds = %156, %137
  %145 = load i32, ptr %13, align 4, !tbaa !39
  %146 = load i32, ptr %10, align 4, !tbaa !39
  %147 = icmp slt i32 %145, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %159

149:                                              ; preds = %144
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = getelementptr inbounds %class.b2ParticleSystem, ptr %17, i32 0, i32 26
  %152 = load ptr, ptr %151, align 8, !tbaa !64
  %153 = load i32, ptr %13, align 4, !tbaa !39
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds ptr, ptr %152, i64 %154
  store ptr %150, ptr %155, align 8, !tbaa !5
  br label %156

156:                                              ; preds = %149
  %157 = load i32, ptr %13, align 4, !tbaa !39
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %13, align 4, !tbaa !39
  br label %144, !llvm.loop !65

159:                                              ; preds = %148
  %160 = load ptr, ptr %12, align 8, !tbaa !5
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %161, i32 0, i32 1
  %163 = load i32, ptr %162, align 4, !tbaa !66
  call void @_ZN16b2ParticleSystem13SetGroupFlagsEP15b2ParticleGroupj(ptr noundef nonnull align 8 dereferenceable(632) %17, ptr noundef %160, i32 noundef %163)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  call void @_ZN16b2ParticleSystem16ConnectionFilterC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  invoke void @_ZN16b2ParticleSystem14UpdateContactsEb(ptr noundef nonnull align 8 dereferenceable(632) %17, i1 noundef zeroext true)
          to label %164 unwind label %181

164:                                              ; preds = %159
  %165 = load i32, ptr %7, align 4, !tbaa !39
  %166 = load i32, ptr %10, align 4, !tbaa !39
  invoke void @_ZN16b2ParticleSystem20UpdatePairsAndTriadsEiiRKNS_16ConnectionFilterE(ptr noundef nonnull align 8 dereferenceable(632) %17, i32 noundef %165, i32 noundef %166, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %167 unwind label %181

167:                                              ; preds = %164
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %168, i32 0, i32 16
  %170 = load ptr, ptr %169, align 8, !tbaa !67
  %171 = icmp ne ptr %170, null
  br i1 %171, label %172, label %185

172:                                              ; preds = %167
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %173, i32 0, i32 16
  %175 = load ptr, ptr %174, align 8, !tbaa !67
  %176 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN16b2ParticleSystem18JoinParticleGroupsEP15b2ParticleGroupS1_(ptr noundef nonnull align 8 dereferenceable(632) %17, ptr noundef %175, ptr noundef %176)
          to label %177 unwind label %181

177:                                              ; preds = %172
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %178, i32 0, i32 16
  %180 = load ptr, ptr %179, align 8, !tbaa !67
  store ptr %180, ptr %12, align 8, !tbaa !5
  br label %185

181:                                              ; preds = %172, %164, %159
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %15, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %16, align 4
  call void @_ZN16b2ParticleSystem16ConnectionFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #9
  br label %189

185:                                              ; preds = %177, %167
  %186 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %186, ptr %3, align 8
  call void @_ZN16b2ParticleSystem16ConnectionFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #9
  br label %187

187:                                              ; preds = %185, %30
  %188 = load ptr, ptr %3, align 8
  ret ptr %188

189:                                              ; preds = %181
  %190 = load ptr, ptr %15, align 8
  %191 = load i32, ptr %16, align 4
  %192 = insertvalue { ptr, i32 } poison, ptr %190, 0
  %193 = insertvalue { ptr, i32 } %192, i32 %191, 1
  resume { ptr, i32 } %193
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11b2Transform3SetERK6b2Vec2f(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8), float noundef) #5 align 2

declare noundef ptr @_ZN16b2BlockAllocator8AllocateEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) #6

declare void @_ZN15b2ParticleGroupC1Ev(ptr noundef nonnull align 8 dereferenceable(96)) unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16b2ParticleSystem16ConnectionFilterC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16b2ParticleSystem16ConnectionFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #7 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { "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 = { 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 #8 = { noreturn nounwind }
attributes #9 = { 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 = !{!35, !13, i64 16}
!35 = !{!"_ZTS18b2ParticleGroupDef", !12, i64 0, !12, i64 4, !36, i64 8, !13, i64 16, !36, i64 20, !13, i64 28, !37, i64 32, !13, i64 36, !6, i64 40, !6, i64 48, !12, i64 56, !13, i64 60, !12, i64 64, !6, i64 72, !13, i64 80, !6, i64 88, !6, i64 96}
!36 = !{!"_ZTS6b2Vec2", !13, i64 0, !13, i64 4}
!37 = !{!"_ZTS15b2ParticleColor", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!38 = !{!10, !12, i64 44}
!39 = !{!12, !12, i64 0}
!40 = !{!35, !6, i64 40}
!41 = !{!35, !6, i64 48}
!42 = !{!35, !12, i64 56}
!43 = !{!35, !12, i64 64}
!44 = !{!35, !6, i64 72}
!45 = !{i64 0, i64 4, !46, i64 4, i64 4, !46}
!46 = !{!13, !13, i64 0}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}
!49 = !{!50, !6, i64 0}
!50 = !{!"_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, !36, i64 52, !36, i64 60, !13, i64 68, !51, i64 72, !6, i64 88}
!51 = !{!"_ZTS11b2Transform", !36, i64 0, !52, i64 8}
!52 = !{!"_ZTS5b2Rot", !13, i64 0, !13, i64 4}
!53 = !{!50, !12, i64 8}
!54 = !{!50, !12, i64 12}
!55 = !{!35, !13, i64 36}
!56 = !{!50, !13, i64 20}
!57 = !{!35, !6, i64 88}
!58 = !{!50, !6, i64 88}
!59 = !{i64 0, i64 4, !46, i64 4, i64 4, !46, i64 8, i64 4, !46, i64 12, i64 4, !46}
!60 = !{!50, !6, i64 24}
!61 = !{!10, !6, i64 512}
!62 = !{!50, !6, i64 32}
!63 = !{!10, !12, i64 508}
!64 = !{!10, !6, i64 240}
!65 = distinct !{!65, !48}
!66 = !{!35, !12, i64 4}
!67 = !{!35, !6, i64 96}


; 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.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%"class.b2ParticleSystem::ConnectionFilter" = type { ptr }

@.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__._ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef = external hidden unnamed_addr constant [83 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16b2ParticleSystem22CreateParticleForGroupERK18b2ParticleGroupDefRK11b2TransformRK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11b2TransformC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16b2ParticleSystem32CreateParticlesWithShapeForGroupEPK7b2ShapeRK18b2ParticleGroupDefRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16b2ParticleSystem33CreateParticlesWithShapesForGroupEPKPK7b2ShapeiRK18b2ParticleGroupDefRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(104) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.b2Transform, align 4
  %4 = alloca %struct.b2Vec2, align 8
  %5 = alloca %"class.b2ParticleSystem::ConnectionFilter", align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 608
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %7)
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 1016, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef) #8
  unreachable

10:                                               ; preds = %2
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %11)
  br i1 %12, label %96, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #9
  call void @_ZN11b2TransformC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %3)
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = load float, ptr %15, align 8, !tbaa !33
  call void @_ZN11b2Transform3SetERK6b2Vec2f(ptr noundef nonnull align 4 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(8) %14, float noundef %16)
  %17 = getelementptr inbounds i8, ptr %0, i64 44
  %18 = load i32, ptr %17, align 4, !tbaa !37
  %19 = getelementptr inbounds i8, ptr %1, i64 40
  %20 = load ptr, ptr %19, align 8, !tbaa !38
  %.not = icmp eq ptr %20, null
  br i1 %.not, label %22, label %21

21:                                               ; preds = %13
  call void @_ZN16b2ParticleSystem32CreateParticlesWithShapeForGroupEPK7b2ShapeRK18b2ParticleGroupDefRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull %20, ptr noundef nonnull align 8 dereferenceable(104) %1, ptr noundef nonnull align 4 dereferenceable(16) %3)
  br label %22

22:                                               ; preds = %21, %13
  %23 = getelementptr inbounds i8, ptr %1, i64 48
  %24 = load ptr, ptr %23, align 8, !tbaa !39
  %.not58 = icmp eq ptr %24, null
  br i1 %.not58, label %28, label %25

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %1, i64 56
  %27 = load i32, ptr %26, align 8, !tbaa !40
  call void @_ZN16b2ParticleSystem33CreateParticlesWithShapesForGroupEPKPK7b2ShapeiRK18b2ParticleGroupDefRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull %24, i32 noundef %27, ptr noundef nonnull align 8 dereferenceable(104) %1, ptr noundef nonnull align 4 dereferenceable(16) %3)
  br label %28

28:                                               ; preds = %25, %22
  %29 = getelementptr inbounds i8, ptr %1, i64 64
  %30 = load i32, ptr %29, align 8, !tbaa !41
  %.not59 = icmp eq i32 %30, 0
  br i1 %.not59, label %.loopexit, label %31

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %1, i64 72
  %33 = load ptr, ptr %32, align 8, !tbaa !42
  %.not60 = icmp eq ptr %33, null
  br i1 %.not60, label %35, label %.preheader

.preheader:                                       ; preds = %31
  %34 = icmp sgt i32 %30, 0
  br i1 %34, label %.lr.ph, label %.loopexit

35:                                               ; preds = %31
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 1036, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef) #8
  unreachable

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %36 = load ptr, ptr %32, align 8, !tbaa !42
  %37 = getelementptr inbounds %struct.b2Vec2, ptr %36, i64 %indvars.iv
  %38 = load i64, ptr %37, align 4
  store i64 %38, ptr %4, align 8
  %39 = call noundef i32 @_ZN16b2ParticleSystem22CreateParticleForGroupERK18b2ParticleGroupDefRK11b2TransformRK6b2Vec2(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(104) %1, ptr noundef nonnull align 4 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr %29, align 8, !tbaa !41
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next, %41
  br i1 %42, label %.lr.ph, label %.loopexit, !llvm.loop !43

.loopexit:                                        ; preds = %.lr.ph, %.preheader, %28
  %43 = load i32, ptr %17, align 4, !tbaa !37
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = call noundef ptr @_ZN16b2BlockAllocator8AllocateEi(ptr noundef nonnull align 8 dereferenceable(128) %44, i32 noundef 96)
  call void @_ZN15b2ParticleGroupC1Ev(ptr noundef nonnull align 8 dereferenceable(96) %45)
  store ptr %0, ptr %45, align 8, !tbaa !45
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  store i32 %18, ptr %46, align 8, !tbaa !49
  %47 = getelementptr inbounds i8, ptr %45, i64 12
  store i32 %43, ptr %47, align 4, !tbaa !50
  %48 = getelementptr inbounds i8, ptr %1, i64 36
  %49 = load float, ptr %48, align 4, !tbaa !51
  %50 = getelementptr inbounds i8, ptr %45, i64 20
  store float %49, ptr %50, align 4, !tbaa !52
  %51 = getelementptr inbounds i8, ptr %1, i64 88
  %52 = load ptr, ptr %51, align 8, !tbaa !53
  %53 = getelementptr inbounds i8, ptr %45, i64 88
  store ptr %52, ptr %53, align 8, !tbaa !54
  %54 = getelementptr inbounds i8, ptr %45, i64 72
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 4 dereferenceable(16) %3, i64 16, i1 false), !tbaa.struct !55
  %55 = getelementptr inbounds i8, ptr %45, i64 24
  store ptr null, ptr %55, align 8, !tbaa !57
  %56 = getelementptr inbounds i8, ptr %0, i64 512
  %57 = load ptr, ptr %56, align 8, !tbaa !58
  %58 = getelementptr inbounds i8, ptr %45, i64 32
  store ptr %57, ptr %58, align 8, !tbaa !59
  %.not61 = icmp eq ptr %57, null
  br i1 %.not61, label %61, label %59

59:                                               ; preds = %.loopexit
  %60 = getelementptr inbounds i8, ptr %57, i64 24
  store ptr %45, ptr %60, align 8, !tbaa !57
  br label %61

61:                                               ; preds = %59, %.loopexit
  store ptr %45, ptr %56, align 8, !tbaa !58
  %62 = getelementptr inbounds i8, ptr %0, i64 508
  %63 = load i32, ptr %62, align 4, !tbaa !60
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %62, align 4, !tbaa !60
  %65 = icmp slt i32 %18, %43
  br i1 %65, label %.lr.ph65, label %._crit_edge

.lr.ph65:                                         ; preds = %61
  %66 = getelementptr inbounds i8, ptr %0, i64 240
  %67 = sext i32 %18 to i64
  %wide.trip.count = sext i32 %43 to i64
  %68 = sub nsw i64 %wide.trip.count, %67
  %xtraiter = and i64 %68, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.preheader

.prol.preheader:                                  ; preds = %.lr.ph65, %.prol.preheader
  %indvars.iv67.prol = phi i64 [ %indvars.iv.next68.prol, %.prol.preheader ], [ %67, %.lr.ph65 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.prol.preheader ], [ 0, %.lr.ph65 ]
  %69 = load ptr, ptr %66, align 8, !tbaa !61
  %70 = getelementptr inbounds ptr, ptr %69, i64 %indvars.iv67.prol
  store ptr %45, ptr %70, align 8, !tbaa !62
  %indvars.iv.next68.prol = add nsw i64 %indvars.iv67.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.prol.loopexit, label %.prol.preheader, !llvm.loop !63

.prol.loopexit:                                   ; preds = %.prol.preheader, %.lr.ph65
  %indvars.iv67.unr = phi i64 [ %67, %.lr.ph65 ], [ %indvars.iv.next68.prol, %.prol.preheader ]
  %71 = sub nsw i64 %67, %wide.trip.count
  %72 = icmp ugt i64 %71, -4
  br i1 %72, label %._crit_edge, label %.lr.ph65.new

._crit_edge:                                      ; preds = %.prol.loopexit, %.lr.ph65.new, %61
  %73 = getelementptr inbounds i8, ptr %1, i64 4
  %74 = load i32, ptr %73, align 4, !tbaa !65
  call void @_ZN16b2ParticleSystem13SetGroupFlagsEP15b2ParticleGroupj(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull %45, i32 noundef %74)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  call void @_ZN16b2ParticleSystem16ConnectionFilterC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  invoke void @_ZN16b2ParticleSystem14UpdateContactsEb(ptr noundef nonnull align 8 dereferenceable(632) %0, i1 noundef zeroext true)
          to label %86 unwind label %93

.lr.ph65.new:                                     ; preds = %.prol.loopexit, %.lr.ph65.new
  %indvars.iv67 = phi i64 [ %indvars.iv.next68.3, %.lr.ph65.new ], [ %indvars.iv67.unr, %.prol.loopexit ]
  %75 = load ptr, ptr %66, align 8, !tbaa !61
  %76 = getelementptr inbounds ptr, ptr %75, i64 %indvars.iv67
  store ptr %45, ptr %76, align 8, !tbaa !62
  %77 = load ptr, ptr %66, align 8, !tbaa !61
  %78 = getelementptr ptr, ptr %77, i64 %indvars.iv67
  %79 = getelementptr i8, ptr %78, i64 8
  store ptr %45, ptr %79, align 8, !tbaa !62
  %80 = load ptr, ptr %66, align 8, !tbaa !61
  %81 = getelementptr ptr, ptr %80, i64 %indvars.iv67
  %82 = getelementptr i8, ptr %81, i64 16
  store ptr %45, ptr %82, align 8, !tbaa !62
  %83 = load ptr, ptr %66, align 8, !tbaa !61
  %84 = getelementptr ptr, ptr %83, i64 %indvars.iv67
  %85 = getelementptr i8, ptr %84, i64 24
  store ptr %45, ptr %85, align 8, !tbaa !62
  %indvars.iv.next68.3 = add nsw i64 %indvars.iv67, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next68.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph65.new, !llvm.loop !66

86:                                               ; preds = %._crit_edge
  invoke void @_ZN16b2ParticleSystem20UpdatePairsAndTriadsEiiRKNS_16ConnectionFilterE(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %18, i32 noundef %43, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %87 unwind label %93

87:                                               ; preds = %86
  %88 = getelementptr inbounds i8, ptr %1, i64 96
  %89 = load ptr, ptr %88, align 8, !tbaa !67
  %.not62 = icmp eq ptr %89, null
  br i1 %.not62, label %95, label %90

90:                                               ; preds = %87
  invoke void @_ZN16b2ParticleSystem18JoinParticleGroupsEP15b2ParticleGroupS1_(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull %89, ptr noundef nonnull %45)
          to label %91 unwind label %93

91:                                               ; preds = %90
  %92 = load ptr, ptr %88, align 8, !tbaa !67
  br label %95

93:                                               ; preds = %90, %86, %._crit_edge
  %94 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN16b2ParticleSystem16ConnectionFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #9
  resume { ptr, i32 } %94

95:                                               ; preds = %91, %87
  %.052 = phi ptr [ %92, %91 ], [ %45, %87 ]
  call void @_ZN16b2ParticleSystem16ConnectionFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #9
  br label %96

96:                                               ; preds = %10, %95
  %.0 = phi ptr [ %.052, %95 ], [ null, %10 ]
  ret ptr %.0
}

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

declare noundef ptr @_ZN16b2BlockAllocator8AllocateEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) local_unnamed_addr #6

declare void @_ZN15b2ParticleGroupC1Ev(ptr noundef nonnull align 8 dereferenceable(96)) unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16b2ParticleSystem16ConnectionFilterC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16b2ParticleSystem16ConnectionFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #7 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { "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 = { 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 #8 = { noreturn nounwind }
attributes #9 = { 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 = !{!34, !11, i64 16}
!34 = !{!"_ZTS18b2ParticleGroupDef", !10, i64 0, !10, i64 4, !35, i64 8, !11, i64 16, !35, i64 20, !11, i64 28, !36, i64 32, !11, i64 36, !16, i64 40, !16, i64 48, !10, i64 56, !11, i64 60, !10, i64 64, !16, i64 72, !11, i64 80, !16, i64 88, !16, i64 96}
!35 = !{!"_ZTS6b2Vec2", !11, i64 0, !11, i64 4}
!36 = !{!"_ZTS15b2ParticleColor", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3}
!37 = !{!6, !10, i64 44}
!38 = !{!34, !16, i64 40}
!39 = !{!34, !16, i64 48}
!40 = !{!34, !10, i64 56}
!41 = !{!34, !10, i64 64}
!42 = !{!34, !16, i64 72}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = !{!46, !16, i64 0}
!46 = !{!"_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, !35, i64 52, !35, i64 60, !11, i64 68, !47, i64 72, !16, i64 88}
!47 = !{!"_ZTS11b2Transform", !35, i64 0, !48, i64 8}
!48 = !{!"_ZTS5b2Rot", !11, i64 0, !11, i64 4}
!49 = !{!46, !10, i64 8}
!50 = !{!46, !10, i64 12}
!51 = !{!34, !11, i64 36}
!52 = !{!46, !11, i64 20}
!53 = !{!34, !16, i64 88}
!54 = !{!46, !16, i64 88}
!55 = !{i64 0, i64 4, !56, i64 4, i64 4, !56, i64 8, i64 4, !56, i64 12, i64 4, !56}
!56 = !{!11, !11, i64 0}
!57 = !{!46, !16, i64 24}
!58 = !{!6, !16, i64 512}
!59 = !{!46, !16, i64 32}
!60 = !{!6, !10, i64 508}
!61 = !{!6, !16, i64 240}
!62 = !{!16, !16, i64 0}
!63 = distinct !{!63, !64}
!64 = !{!"llvm.loop.unroll.disable"}
!65 = !{!34, !10, i64 4}
!66 = distinct !{!66, !44}
!67 = !{!34, !16, i64 96}


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