; 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.b2ParticleGroupDef = type { i32, i32, %struct.b2Vec2, float, %struct.b2Vec2, float, %class.b2ParticleColor, float, ptr, ptr, i32, float, i32, ptr, float, ptr, ptr }
%struct.b2Vec2 = type { float, float }
%class.b2ParticleColor = type { i8, i8, i8, i8 }
%"struct.b2ParticleSystem::ParticleListNode" = type { ptr, ptr, i32, i32 }
%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 }

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN16b2ParticleSystem36CreateParticleGroupsFromParticleListEPK15b2ParticleGroupPNS_16ParticleListNodeEPKS3_ = external hidden unnamed_addr constant [131 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [52 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: mustprogress uwtable
declare dso_local noundef ptr @_ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef nonnull align 8 dereferenceable(104)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem36CreateParticleGroupsFromParticleListEPK15b2ParticleGroupPNS_16ParticleListNodeEPKS3_(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.b2ParticleGroupDef, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef i32 @_ZNK15b2ParticleGroup16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(96) %21)
  store i32 %22, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 104, ptr %10) #5
  call void @_ZN18b2ParticleGroupDefC2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10)
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = invoke noundef i32 @_ZNK15b2ParticleGroup13GetGroupFlagsEv(ptr noundef nonnull align 8 dereferenceable(96) %23)
          to label %25 unwind label %36

25:                                               ; preds = %4
  %26 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %10, i32 0, i32 1
  store i32 %24, ptr %26, align 4, !tbaa !11
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = invoke noundef ptr @_ZNK15b2ParticleGroup11GetUserDataEv(ptr noundef nonnull align 8 dereferenceable(96) %27)
          to label %29 unwind label %36

29:                                               ; preds = %25
  %30 = getelementptr inbounds %struct.b2ParticleGroupDef, ptr %10, i32 0, i32 15
  store ptr %28, ptr %30, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %120, %29
  %32 = load i32, ptr %13, align 4, !tbaa !9
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %40, label %35

35:                                               ; preds = %31
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %124

36:                                               ; preds = %25, %4
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %11, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %12, align 4
  br label %125

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %"struct.b2ParticleSystem::ParticleListNode", ptr %41, i64 %43
  store ptr %44, ptr %15, align 8, !tbaa !5
  %45 = load ptr, ptr %15, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.b2ParticleSystem::ParticleListNode", ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !17
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %53

49:                                               ; preds = %40
  %50 = load ptr, ptr %15, align 8, !tbaa !5
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = icmp eq ptr %50, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %49, %40
  store i32 4, ptr %14, align 4
  br label %117

54:                                               ; preds = %49
  %55 = load ptr, ptr %15, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.b2ParticleSystem::ParticleListNode", ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = load ptr, ptr %15, align 8, !tbaa !5
  %59 = icmp eq ptr %57, %58
  br i1 %59, label %60, label %61

60:                                               ; preds = %54
  br label %63

61:                                               ; preds = %54
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.1, i32 noundef 1290, ptr noundef @__PRETTY_FUNCTION__._ZN16b2ParticleSystem36CreateParticleGroupsFromParticleListEPK15b2ParticleGroupPNS_16ParticleListNodeEPKS3_) #6
  unreachable

62:                                               ; No predecessors!
  br label %63

63:                                               ; preds = %62, %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %64 = invoke noundef ptr @_ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef(ptr noundef nonnull align 8 dereferenceable(632) %20, ptr noundef nonnull align 8 dereferenceable(104) %10)
          to label %65 unwind label %71

65:                                               ; preds = %63
  store ptr %64, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %66 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %66, ptr %17, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %108, %65
  %68 = load ptr, ptr %17, align 8, !tbaa !5
  %69 = icmp ne ptr %68, null
  br i1 %69, label %75, label %70

70:                                               ; preds = %67
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %116

71:                                               ; preds = %63
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %11, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %12, align 4
  br label %123

75:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %76 = load ptr, ptr %17, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.b2ParticleSystem::ParticleListNode", ptr %76, i32 0, i32 3
  %78 = load i32, ptr %77, align 4, !tbaa !20
  store i32 %78, ptr %18, align 4, !tbaa !9
  %79 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 16
  %80 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.0", ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  %82 = load i32, ptr %18, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %81, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = and i32 %85, 2
  %87 = icmp ne i32 %86, 0
  %88 = xor i1 %87, true
  br i1 %88, label %89, label %90

89:                                               ; preds = %75
  br label %92

90:                                               ; preds = %75
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.1, i32 noundef 1295, ptr noundef @__PRETTY_FUNCTION__._ZN16b2ParticleSystem36CreateParticleGroupsFromParticleListEPK15b2ParticleGroupPNS_16ParticleListNodeEPKS3_) #6
  unreachable

91:                                               ; No predecessors!
  br label %92

92:                                               ; preds = %91, %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %93 = load i32, ptr %18, align 4, !tbaa !9
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  %95 = invoke noundef i32 @_ZN16b2ParticleSystem13CloneParticleEiP15b2ParticleGroup(ptr noundef nonnull align 8 dereferenceable(632) %20, i32 noundef %93, ptr noundef %94)
          to label %96 unwind label %112

96:                                               ; preds = %92
  store i32 %95, ptr %19, align 4, !tbaa !9
  %97 = getelementptr inbounds %class.b2ParticleSystem, ptr %20, i32 0, i32 16
  %98 = getelementptr inbounds %"struct.b2ParticleSystem::UserOverridableBuffer.0", ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !21
  %100 = load i32, ptr %18, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %99, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = or i32 %103, 2
  store i32 %104, ptr %102, align 4, !tbaa !9
  %105 = load i32, ptr %19, align 4, !tbaa !9
  %106 = load ptr, ptr %17, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.b2ParticleSystem::ParticleListNode", ptr %106, i32 0, i32 3
  store i32 %105, ptr %107, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %108

108:                                              ; preds = %96
  %109 = load ptr, ptr %17, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.b2ParticleSystem::ParticleListNode", ptr %109, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !44
  store ptr %111, ptr %17, align 8, !tbaa !5
  br label %67, !llvm.loop !45

112:                                              ; preds = %92
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %11, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %123

116:                                              ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  store i32 0, ptr %14, align 4
  br label %117

117:                                              ; preds = %116, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %118 = load i32, ptr %14, align 4
  switch i32 %118, label %131 [
    i32 0, label %119
    i32 4, label %120
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119, %117
  %121 = load i32, ptr %13, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %13, align 4, !tbaa !9
  br label %31, !llvm.loop !47

123:                                              ; preds = %112, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %125

124:                                              ; preds = %35
  call void @_ZN18b2ParticleGroupDefD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void

125:                                              ; preds = %123, %36
  call void @_ZN18b2ParticleGroupDefD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %10) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %11, align 8
  %128 = load i32, ptr %12, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130

131:                                              ; preds = %117
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18b2ParticleGroupDefC2Ev(ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN18b2ParticleGroupDefD2Ev(ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #4 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 = { 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 #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 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 = { nounwind }
attributes #6 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"_ZTS18b2ParticleGroupDef", !10, i64 0, !10, i64 4, !13, i64 8, !14, i64 16, !13, i64 20, !14, i64 28, !15, i64 32, !14, i64 36, !6, i64 40, !6, i64 48, !10, i64 56, !14, i64 60, !10, i64 64, !6, i64 72, !14, i64 80, !6, i64 88, !6, i64 96}
!13 = !{!"_ZTS6b2Vec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTS15b2ParticleColor", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!16 = !{!12, !6, i64 88}
!17 = !{!18, !10, i64 16}
!18 = !{!"_ZTSN16b2ParticleSystem16ParticleListNodeE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20}
!19 = !{!18, !6, i64 0}
!20 = !{!18, !10, i64 20}
!21 = !{!22, !6, i64 128}
!22 = !{!"_ZTS16b2ParticleSystem", !23, i64 0, !10, i64 4, !10, i64 8, !23, i64 12, !10, i64 16, !23, i64 20, !23, i64 21, !10, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !10, i64 44, !10, i64 48, !24, i64 56, !30, i64 112, !31, i64 128, !32, i64 144, !32, i64 160, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !33, i64 224, !6, i64 240, !34, i64 248, !10, i64 264, !35, i64 272, !35, i64 288, !35, i64 304, !36, i64 320, !37, i64 344, !38, i64 368, !39, i64 392, !40, i64 416, !41, i64 440, !35, i64 464, !35, i64 480, !42, i64 496, !23, i64 504, !10, i64 508, !6, i64 512, !43, i64 520, !6, i64 608, !6, i64 616, !6, i64 624}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !25, i64 0, !10, i64 16, !28, i64 24}
!25 = !{!"_ZTS23b2TrackedBlockAllocator", !26, i64 0}
!26 = !{!"_ZTS24b2TypedIntrusiveListNodeI14b2TrackedBlockE", !27, i64 0}
!27 = !{!"_ZTS19b2IntrusiveListNode", !6, i64 0, !6, i64 8}
!28 = !{!"_ZTS15b2TypedFreeListI16b2ParticleHandleE", !29, i64 0}
!29 = !{!"_ZTS10b2FreeList", !27, i64 0, !27, i64 16}
!30 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIP16b2ParticleHandleEE", !6, i64 0, !10, i64 8}
!31 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !6, i64 0, !10, i64 8}
!32 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !6, i64 0, !10, i64 8}
!33 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !6, i64 0, !10, i64 8}
!34 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !6, i64 0, !10, i64 8}
!35 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !6, i64 0, !10, i64 8}
!36 = !{!"_ZTS16b2GrowableBufferIiE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!37 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!38 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!39 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!40 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!41 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!42 = !{!"long long", !7, i64 0}
!43 = !{!"_ZTS19b2ParticleSystemDef", !23, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !10, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60, !14, i64 64, !10, i64 68, !14, i64 72, !23, i64 76, !14, i64 80}
!44 = !{!18, !6, i64 8}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = distinct !{!47, !46}


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

%struct.b2ParticleGroupDef = type { i32, i32, %struct.b2Vec2, float, %struct.b2Vec2, float, %class.b2ParticleColor, float, ptr, ptr, i32, float, i32, ptr, float, ptr, ptr }
%struct.b2Vec2 = type { float, float }
%class.b2ParticleColor = type { i8, i8, i8, i8 }
%"struct.b2ParticleSystem::ParticleListNode" = type { ptr, ptr, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN16b2ParticleSystem36CreateParticleGroupsFromParticleListEPK15b2ParticleGroupPNS_16ParticleListNodeEPKS3_ = external hidden unnamed_addr constant [131 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [52 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 uwtable
declare dso_local noundef ptr @_ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef(ptr noundef nonnull align 8 dereferenceable(632), ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem36CreateParticleGroupsFromParticleListEPK15b2ParticleGroupPNS_16ParticleListNodeEPKS3_(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef readnone %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.b2ParticleGroupDef, align 8
  %6 = tail call noundef i32 @_ZNK15b2ParticleGroup16GetParticleCountEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %5) #5
  call void @_ZN18b2ParticleGroupDefC2Ev(ptr noundef nonnull align 8 dereferenceable(104) %5)
  %7 = call noundef i32 @_ZNK15b2ParticleGroup13GetGroupFlagsEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  %8 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 %7, ptr %8, align 4, !tbaa !5
  %9 = call noundef ptr @_ZNK15b2ParticleGroup11GetUserDataEv(ptr noundef nonnull align 8 dereferenceable(96) %1)
  %10 = getelementptr inbounds i8, ptr %5, i64 88
  store ptr %9, ptr %10, align 8, !tbaa !14
  %11 = icmp sgt i32 %6, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %4
  %12 = getelementptr inbounds i8, ptr %0, i64 128
  %wide.trip.count = zext nneg i32 %6 to i64
  br label %13

._crit_edge:                                      ; preds = %.loopexit, %4
  call void @_ZN18b2ParticleGroupDefD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %5) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #5
  ret void

13:                                               ; preds = %.lr.ph, %.loopexit
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.loopexit ]
  %14 = getelementptr inbounds %"struct.b2ParticleSystem::ParticleListNode", ptr %2, i64 %indvars.iv
  %15 = getelementptr inbounds i8, ptr %14, i64 16
  %16 = load i32, ptr %15, align 8, !tbaa !15
  %.not = icmp eq i32 %16, 0
  %17 = icmp eq ptr %14, %3
  %or.cond = or i1 %17, %.not
  br i1 %or.cond, label %.loopexit, label %18

18:                                               ; preds = %13
  %19 = load ptr, ptr %14, align 8, !tbaa !17
  %20 = icmp eq ptr %19, %14
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.1, i32 noundef 1290, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16b2ParticleSystem36CreateParticleGroupsFromParticleListEPK15b2ParticleGroupPNS_16ParticleListNodeEPKS3_) #6
  unreachable

22:                                               ; preds = %18
  %23 = invoke noundef ptr @_ZN16b2ParticleSystem19CreateParticleGroupERK18b2ParticleGroupDef(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull align 8 dereferenceable(104) %5)
          to label %.preheader.preheader unwind label %24

.preheader.preheader:                             ; preds = %22
  %.pre = load ptr, ptr %12, align 8, !tbaa !18
  br label %.preheader

24:                                               ; preds = %22
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %45

.preheader:                                       ; preds = %.preheader.preheader, %36
  %26 = phi ptr [ %37, %36 ], [ %.pre, %.preheader.preheader ]
  %.02632 = phi ptr [ %42, %36 ], [ %14, %.preheader.preheader ]
  %27 = getelementptr inbounds i8, ptr %.02632, i64 20
  %28 = load i32, ptr %27, align 4, !tbaa !41
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %26, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !42
  %32 = and i32 %31, 2
  %.not30 = icmp eq i32 %32, 0
  br i1 %.not30, label %34, label %33

33:                                               ; preds = %.preheader
  call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.1, i32 noundef 1295, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16b2ParticleSystem36CreateParticleGroupsFromParticleListEPK15b2ParticleGroupPNS_16ParticleListNodeEPKS3_) #6
  unreachable

34:                                               ; preds = %.preheader
  %35 = invoke noundef i32 @_ZN16b2ParticleSystem13CloneParticleEiP15b2ParticleGroup(ptr noundef nonnull align 8 dereferenceable(632) %0, i32 noundef %28, ptr noundef %23)
          to label %36 unwind label %43

36:                                               ; preds = %34
  %37 = load ptr, ptr %12, align 8, !tbaa !18
  %38 = getelementptr inbounds i32, ptr %37, i64 %29
  %39 = load i32, ptr %38, align 4, !tbaa !42
  %40 = or i32 %39, 2
  store i32 %40, ptr %38, align 4, !tbaa !42
  store i32 %35, ptr %27, align 4, !tbaa !41
  %41 = getelementptr inbounds i8, ptr %.02632, i64 8
  %42 = load ptr, ptr %41, align 8, !tbaa !43
  %.not29 = icmp eq ptr %42, null
  br i1 %.not29, label %.loopexit, label %.preheader, !llvm.loop !44

43:                                               ; preds = %34
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %45

.loopexit:                                        ; preds = %36, %13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %13, !llvm.loop !46

45:                                               ; preds = %43, %24
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %25, %24 ]
  call void @_ZN18b2ParticleGroupDefD2Ev(ptr noundef nonnull align 8 dereferenceable(104) %5) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18b2ParticleGroupDefC2Ev(ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN18b2ParticleGroupDefD2Ev(ptr noundef nonnull align 8 dereferenceable(104)) unnamed_addr #4 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { nounwind }
attributes #6 = { 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, !7, i64 4}
!6 = !{!"_ZTS18b2ParticleGroupDef", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !10, i64 20, !11, i64 28, !12, i64 32, !11, i64 36, !13, i64 40, !13, i64 48, !7, i64 56, !11, i64 60, !7, i64 64, !13, i64 72, !11, i64 80, !13, i64 88, !13, i64 96}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS6b2Vec2", !11, i64 0, !11, i64 4}
!11 = !{!"float", !8, i64 0}
!12 = !{!"_ZTS15b2ParticleColor", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!6, !13, i64 88}
!15 = !{!16, !7, i64 16}
!16 = !{!"_ZTSN16b2ParticleSystem16ParticleListNodeE", !13, i64 0, !13, i64 8, !7, i64 16, !7, i64 20}
!17 = !{!16, !13, i64 0}
!18 = !{!19, !13, i64 128}
!19 = !{!"_ZTS16b2ParticleSystem", !20, i64 0, !7, i64 4, !7, i64 8, !20, i64 12, !7, i64 16, !20, i64 20, !20, i64 21, !7, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !7, i64 44, !7, i64 48, !21, i64 56, !27, i64 112, !28, i64 128, !29, i64 144, !29, i64 160, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !30, i64 224, !13, i64 240, !31, i64 248, !7, i64 264, !32, i64 272, !32, i64 288, !32, i64 304, !33, i64 320, !34, i64 344, !35, i64 368, !36, i64 392, !37, i64 416, !38, i64 440, !32, i64 464, !32, i64 480, !39, i64 496, !20, i64 504, !7, i64 508, !13, i64 512, !40, i64 520, !13, i64 608, !13, i64 616, !13, i64 624}
!20 = !{!"bool", !8, i64 0}
!21 = !{!"_ZTS15b2SlabAllocatorI16b2ParticleHandleE", !22, i64 0, !7, i64 16, !25, i64 24}
!22 = !{!"_ZTS23b2TrackedBlockAllocator", !23, i64 0}
!23 = !{!"_ZTS24b2TypedIntrusiveListNodeI14b2TrackedBlockE", !24, i64 0}
!24 = !{!"_ZTS19b2IntrusiveListNode", !13, i64 0, !13, i64 8}
!25 = !{!"_ZTS15b2TypedFreeListI16b2ParticleHandleE", !26, i64 0}
!26 = !{!"_ZTS10b2FreeList", !24, i64 0, !24, i64 16}
!27 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIP16b2ParticleHandleEE", !13, i64 0, !7, i64 8}
!28 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIjEE", !13, i64 0, !7, i64 8}
!29 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI6b2Vec2EE", !13, i64 0, !7, i64 8}
!30 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferI15b2ParticleColorEE", !13, i64 0, !7, i64 8}
!31 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIPvEE", !13, i64 0, !7, i64 8}
!32 = !{!"_ZTSN16b2ParticleSystem21UserOverridableBufferIiEE", !13, i64 0, !7, i64 8}
!33 = !{!"_ZTS16b2GrowableBufferIiE", !13, i64 0, !7, i64 8, !7, i64 12, !13, i64 16}
!34 = !{!"_ZTS16b2GrowableBufferIN16b2ParticleSystem5ProxyEE", !13, i64 0, !7, i64 8, !7, i64 12, !13, i64 16}
!35 = !{!"_ZTS16b2GrowableBufferI17b2ParticleContactE", !13, i64 0, !7, i64 8, !7, i64 12, !13, i64 16}
!36 = !{!"_ZTS16b2GrowableBufferI21b2ParticleBodyContactE", !13, i64 0, !7, i64 8, !7, i64 12, !13, i64 16}
!37 = !{!"_ZTS16b2GrowableBufferI14b2ParticlePairE", !13, i64 0, !7, i64 8, !7, i64 12, !13, i64 16}
!38 = !{!"_ZTS16b2GrowableBufferI15b2ParticleTriadE", !13, i64 0, !7, i64 8, !7, i64 12, !13, i64 16}
!39 = !{!"long long", !8, i64 0}
!40 = !{!"_ZTS19b2ParticleSystemDef", !20, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !7, 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, !7, i64 68, !11, i64 72, !20, i64 76, !11, i64 80}
!41 = !{!16, !7, i64 20}
!42 = !{!7, !7, i64 0}
!43 = !{!16, !13, i64 8}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}
!46 = distinct !{!46, !45}


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