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

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

%class.b2ParticleSystem = type { i8, i32, i32, i8, i32, i8, i8, i32, float, float, float, float, i32, i32, %class.b2SlabAllocator, %"struct.b2ParticleSystem::UserOverridableBuffer", %"struct.b2ParticleSystem::UserOverridableBuffer.0", %"struct.b2ParticleSystem::UserOverridableBuffer.2", %"struct.b2ParticleSystem::UserOverridableBuffer.2", ptr, ptr, ptr, ptr, ptr, ptr, %"struct.b2ParticleSystem::UserOverridableBuffer.4", ptr, %"struct.b2ParticleSystem::UserOverridableBuffer.6", i32, [4 x i8], %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", %class.b2GrowableBuffer, %class.b2GrowableBuffer.10, %class.b2GrowableBuffer.11, %class.b2GrowableBuffer.12, %class.b2GrowableBuffer.13, %class.b2GrowableBuffer.14, %"struct.b2ParticleSystem::UserOverridableBuffer.8", %"struct.b2ParticleSystem::UserOverridableBuffer.8", i64, i8, i32, ptr, %struct.b2ParticleSystemDef, ptr, ptr, ptr }
%class.b2SlabAllocator = type { %class.b2TrackedBlockAllocator, i32, %class.b2TypedFreeList }
%class.b2TrackedBlockAllocator = type { %class.b2TypedIntrusiveListNode }
%class.b2TypedIntrusiveListNode = type { %class.b2IntrusiveListNode }
%class.b2IntrusiveListNode = type { ptr, ptr }
%class.b2TypedFreeList = type { %class.b2FreeList }
%class.b2FreeList = type { %class.b2IntrusiveListNode, %class.b2IntrusiveListNode }
%"struct.b2ParticleSystem::UserOverridableBuffer" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.0" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.2" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.4" = type <{ ptr, i32, [4 x i8] }>
%"struct.b2ParticleSystem::UserOverridableBuffer.6" = type <{ ptr, i32, [4 x i8] }>
%class.b2GrowableBuffer = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.10 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.11 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.12 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.13 = type { ptr, i32, i32, ptr }
%class.b2GrowableBuffer.14 = type { ptr, i32, i32, ptr }
%"struct.b2ParticleSystem::UserOverridableBuffer.8" = type <{ ptr, i32, [4 x i8] }>
%struct.b2ParticleSystemDef = type { i8, float, float, float, i32, float, float, float, float, float, float, float, float, float, float, float, float, i32, float, i8, float }
%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.b2Vec2 = type { float, float }
%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 }
%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.24 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__._ZN16b2ParticleSystem20DestroyParticleGroupEP15b2ParticleGroup = external hidden unnamed_addr constant [63 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 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: mustprogress uwtable
define dso_local void @_ZN16b2ParticleSystem20DestroyParticleGroupEP15b2ParticleGroup(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %class.b2ParticleSystem, ptr %6, i32 0, i32 43
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %13

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

12:                                               ; No predecessors!
  br label %13

13:                                               ; preds = %12, %10
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %13
  br label %19

17:                                               ; preds = %13
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.1, i32 noundef 1603, ptr noundef @__PRETTY_FUNCTION__._ZN16b2ParticleSystem20DestroyParticleGroupEP15b2ParticleGroup) #5
  unreachable

18:                                               ; No predecessors!
  br label %19

19:                                               ; preds = %18, %16
  %20 = getelementptr inbounds %class.b2ParticleSystem, ptr %6, i32 0, i32 46
  %21 = load ptr, ptr %20, align 8, !tbaa !34
  %22 = getelementptr inbounds %class.b2World, ptr %21, i32 0, i32 11
  %23 = load ptr, ptr %22, align 8, !tbaa !35
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %34

25:                                               ; preds = %19
  %26 = getelementptr inbounds %class.b2ParticleSystem, ptr %6, i32 0, i32 46
  %27 = load ptr, ptr %26, align 8, !tbaa !34
  %28 = getelementptr inbounds %class.b2World, ptr %27, i32 0, i32 11
  %29 = load ptr, ptr %28, align 8, !tbaa !35
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = load ptr, ptr %29, align 8, !tbaa !46
  %32 = getelementptr inbounds ptr, ptr %31, i64 4
  %33 = load ptr, ptr %32, align 8
  call void %33(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef %30)
  br label %34

34:                                               ; preds = %25, %19
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN16b2ParticleSystem13SetGroupFlagsEP15b2ParticleGroupj(ptr noundef nonnull align 8 dereferenceable(632) %6, ptr noundef %35, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.b2ParticleGroup, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 8, !tbaa !48
  store i32 %38, ptr %5, align 4, !tbaa !52
  br label %39

39:                                               ; preds = %52, %34
  %40 = load i32, ptr %5, align 4, !tbaa !52
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %class.b2ParticleGroup, ptr %41, i32 0, i32 2
  %43 = load i32, ptr %42, align 4, !tbaa !53
  %44 = icmp slt i32 %40, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %55

46:                                               ; preds = %39
  %47 = getelementptr inbounds %class.b2ParticleSystem, ptr %6, i32 0, i32 26
  %48 = load ptr, ptr %47, align 8, !tbaa !54
  %49 = load i32, ptr %5, align 4, !tbaa !52
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  store ptr null, ptr %51, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %46
  %53 = load i32, ptr %5, align 4, !tbaa !52
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !52
  br label %39, !llvm.loop !55

55:                                               ; preds = %45
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %class.b2ParticleGroup, ptr %56, i32 0, i32 5
  %58 = load ptr, ptr %57, align 8, !tbaa !57
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %68

60:                                               ; preds = %55
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.b2ParticleGroup, ptr %61, i32 0, i32 6
  %63 = load ptr, ptr %62, align 8, !tbaa !58
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %class.b2ParticleGroup, ptr %64, i32 0, i32 5
  %66 = load ptr, ptr %65, align 8, !tbaa !57
  %67 = getelementptr inbounds %class.b2ParticleGroup, ptr %66, i32 0, i32 6
  store ptr %63, ptr %67, align 8, !tbaa !58
  br label %68

68:                                               ; preds = %60, %55
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %class.b2ParticleGroup, ptr %69, i32 0, i32 6
  %71 = load ptr, ptr %70, align 8, !tbaa !58
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %81

73:                                               ; preds = %68
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.b2ParticleGroup, ptr %74, i32 0, i32 5
  %76 = load ptr, ptr %75, align 8, !tbaa !57
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %class.b2ParticleGroup, ptr %77, i32 0, i32 6
  %79 = load ptr, ptr %78, align 8, !tbaa !58
  %80 = getelementptr inbounds %class.b2ParticleGroup, ptr %79, i32 0, i32 5
  store ptr %76, ptr %80, align 8, !tbaa !57
  br label %81

81:                                               ; preds = %73, %68
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %class.b2ParticleSystem, ptr %6, i32 0, i32 44
  %84 = load ptr, ptr %83, align 8, !tbaa !59
  %85 = icmp eq ptr %82, %84
  br i1 %85, label %86, label %91

86:                                               ; preds = %81
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %class.b2ParticleGroup, ptr %87, i32 0, i32 6
  %89 = load ptr, ptr %88, align 8, !tbaa !58
  %90 = getelementptr inbounds %class.b2ParticleSystem, ptr %6, i32 0, i32 44
  store ptr %89, ptr %90, align 8, !tbaa !59
  br label %91

91:                                               ; preds = %86, %81
  %92 = getelementptr inbounds %class.b2ParticleSystem, ptr %6, i32 0, i32 43
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %92, align 4, !tbaa !9
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN15b2ParticleGroupD2Ev(ptr noundef nonnull align 8 dereferenceable(96) %95) #6
  %96 = getelementptr inbounds %class.b2ParticleSystem, ptr %6, i32 0, i32 46
  %97 = load ptr, ptr %96, align 8, !tbaa !34
  %98 = getelementptr inbounds %class.b2World, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN16b2BlockAllocator4FreeEPvi(ptr noundef nonnull align 8 dereferenceable(128) %98, ptr noundef %99, i32 noundef 96)
  ret void
}

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

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

declare void @_ZN16b2BlockAllocator4FreeEPvi(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef, i32 noundef) #4

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 = { "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 = { noreturn nounwind }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 508}
!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, !6, i64 608}
!35 = !{!36, !6, i64 103304}
!36 = !{!"_ZTS7b2World", !37, i64 0, !38, i64 128, !39, i64 103064, !6, i64 103248, !6, i64 103256, !6, i64 103264, !6, i64 103272, !12, i64 103280, !12, i64 103284, !43, i64 103288, !11, i64 103296, !6, i64 103304, !6, i64 103312, !13, i64 103320, !11, i64 103324, !11, i64 103325, !11, i64 103326, !11, i64 103327, !11, i64 103328, !11, i64 103329, !11, i64 103330, !11, i64 103331, !45, i64 103332}
!37 = !{!"_ZTS16b2BlockAllocator", !6, i64 0, !12, i64 8, !12, i64 12, !7, i64 16}
!38 = !{!"_ZTS16b2StackAllocator", !7, i64 0, !12, i64 102400, !12, i64 102404, !12, i64 102408, !7, i64 102416, !12, i64 102928}
!39 = !{!"_ZTS16b2ContactManager", !40, i64 0, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!40 = !{!"_ZTS12b2BroadPhase", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !41, i64 32, !6, i64 80, !6, i64 88, !6, i64 96, !12, i64 104, !12, i64 108, !44, i64 112, !12, i64 128, !12, i64 132, !11, i64 136}
!41 = !{!"_ZTS10b2TreeNode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !42, i64 32}
!42 = !{!"_ZTS6b2AABB", !43, i64 0, !43, i64 8}
!43 = !{!"_ZTS6b2Vec2", !13, i64 0, !13, i64 4}
!44 = !{!"_ZTS14b2IntHashTable", !6, i64 0, !12, i64 8}
!45 = !{!"_ZTS9b2Profile", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16}
!46 = !{!47, !47, i64 0}
!47 = !{!"vtable pointer", !8, i64 0}
!48 = !{!49, !12, i64 8}
!49 = !{!"_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, !43, i64 52, !43, i64 60, !13, i64 68, !50, i64 72, !6, i64 88}
!50 = !{!"_ZTS11b2Transform", !43, i64 0, !51, i64 8}
!51 = !{!"_ZTS5b2Rot", !13, i64 0, !13, i64 4}
!52 = !{!12, !12, i64 0}
!53 = !{!49, !12, i64 12}
!54 = !{!10, !6, i64 240}
!55 = distinct !{!55, !56}
!56 = !{!"llvm.loop.mustprogress"}
!57 = !{!49, !6, i64 24}
!58 = !{!49, !6, i64 32}
!59 = !{!10, !6, i64 512}


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

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__._ZN16b2ParticleSystem20DestroyParticleGroupEP15b2ParticleGroup = external hidden unnamed_addr constant [63 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 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
define dso_local void @_ZN16b2ParticleSystem20DestroyParticleGroupEP15b2ParticleGroup(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 508
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %7, label %6

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

7:                                                ; preds = %2
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %8, label %9

8:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.1, i32 noundef 1603, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16b2ParticleSystem20DestroyParticleGroupEP15b2ParticleGroup) #4
  unreachable

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 608
  %11 = load ptr, ptr %10, align 8, !tbaa !33
  %12 = getelementptr inbounds i8, ptr %11, i64 103304
  %13 = load ptr, ptr %12, align 8, !tbaa !34
  %.not22 = icmp eq ptr %13, null
  br i1 %.not22, label %18, label %14

14:                                               ; preds = %9
  %15 = load ptr, ptr %13, align 8, !tbaa !45
  %16 = getelementptr inbounds i8, ptr %15, i64 32
  %17 = load ptr, ptr %16, align 8
  tail call void %17(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull %1)
  br label %18

18:                                               ; preds = %14, %9
  tail call void @_ZN16b2ParticleSystem13SetGroupFlagsEP15b2ParticleGroupj(ptr noundef nonnull align 8 dereferenceable(632) %0, ptr noundef nonnull %1, i32 noundef 0)
  %19 = getelementptr inbounds i8, ptr %1, i64 8
  %20 = load i32, ptr %19, align 8, !tbaa !47
  %21 = getelementptr inbounds i8, ptr %1, i64 12
  %22 = load i32, ptr %21, align 4, !tbaa !51
  %23 = icmp slt i32 %20, %22
  br i1 %23, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18
  %24 = getelementptr inbounds i8, ptr %0, i64 240
  %25 = sext i32 %20 to i64
  %wide.trip.count = sext i32 %22 to i64
  %26 = sub nsw i64 %wide.trip.count, %25
  %xtraiter = and i64 %26, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.preheader

.prol.preheader:                                  ; preds = %.lr.ph, %.prol.preheader
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.prol.preheader ], [ %25, %.lr.ph ]
  %prol.iter = phi i64 [ %prol.iter.next, %.prol.preheader ], [ 0, %.lr.ph ]
  %27 = load ptr, ptr %24, align 8, !tbaa !52
  %28 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv.prol
  store ptr null, ptr %28, align 8, !tbaa !53
  %indvars.iv.next.prol = add nsw i64 %indvars.iv.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 !54

.prol.loopexit:                                   ; preds = %.prol.preheader, %.lr.ph
  %indvars.iv.unr = phi i64 [ %25, %.lr.ph ], [ %indvars.iv.next.prol, %.prol.preheader ]
  %29 = sub nsw i64 %25, %wide.trip.count
  %30 = icmp ugt i64 %29, -4
  br i1 %30, label %._crit_edge, label %.lr.ph.new

._crit_edge:                                      ; preds = %.prol.loopexit, %.lr.ph.new, %18
  %31 = getelementptr inbounds i8, ptr %1, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !56
  %.not23 = icmp eq ptr %32, null
  %.phi.trans.insert = getelementptr inbounds i8, ptr %1, i64 32
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !57
  br i1 %.not23, label %._crit_edge._crit_edge, label %44

.lr.ph.new:                                       ; preds = %.prol.loopexit, %.lr.ph.new
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph.new ], [ %indvars.iv.unr, %.prol.loopexit ]
  %33 = load ptr, ptr %24, align 8, !tbaa !52
  %34 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv
  store ptr null, ptr %34, align 8, !tbaa !53
  %35 = load ptr, ptr %24, align 8, !tbaa !52
  %36 = getelementptr ptr, ptr %35, i64 %indvars.iv
  %37 = getelementptr i8, ptr %36, i64 8
  store ptr null, ptr %37, align 8, !tbaa !53
  %38 = load ptr, ptr %24, align 8, !tbaa !52
  %39 = getelementptr ptr, ptr %38, i64 %indvars.iv
  %40 = getelementptr i8, ptr %39, i64 16
  store ptr null, ptr %40, align 8, !tbaa !53
  %41 = load ptr, ptr %24, align 8, !tbaa !52
  %42 = getelementptr ptr, ptr %41, i64 %indvars.iv
  %43 = getelementptr i8, ptr %42, i64 24
  store ptr null, ptr %43, align 8, !tbaa !53
  %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph.new, !llvm.loop !58

44:                                               ; preds = %._crit_edge
  %45 = getelementptr inbounds i8, ptr %32, i64 32
  store ptr %.pre, ptr %45, align 8, !tbaa !57
  br label %._crit_edge._crit_edge

._crit_edge._crit_edge:                           ; preds = %._crit_edge, %44
  %.not24 = icmp eq ptr %.pre, null
  br i1 %.not24, label %48, label %46

46:                                               ; preds = %._crit_edge._crit_edge
  %47 = getelementptr inbounds i8, ptr %.pre, i64 24
  store ptr %32, ptr %47, align 8, !tbaa !56
  br label %48

48:                                               ; preds = %46, %._crit_edge._crit_edge
  %49 = getelementptr inbounds i8, ptr %0, i64 512
  %50 = load ptr, ptr %49, align 8, !tbaa !60
  %51 = icmp eq ptr %50, %1
  br i1 %51, label %52, label %53

52:                                               ; preds = %48
  store ptr %.pre, ptr %49, align 8, !tbaa !60
  br label %53

53:                                               ; preds = %52, %48
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr %3, align 4, !tbaa !5
  tail call void @_ZN15b2ParticleGroupD2Ev(ptr noundef nonnull align 8 dereferenceable(96) %1) #5
  %56 = load ptr, ptr %10, align 8, !tbaa !33
  tail call void @_ZN16b2BlockAllocator4FreeEPvi(ptr noundef nonnull align 8 dereferenceable(128) %56, ptr noundef nonnull %1, i32 noundef 96)
  ret void
}

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

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

declare void @_ZN16b2BlockAllocator4FreeEPvi(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef, i32 noundef) local_unnamed_addr #3

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 = { "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 }
attributes #5 = { 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, !10, i64 508}
!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, !16, i64 608}
!34 = !{!35, !16, i64 103304}
!35 = !{!"_ZTS7b2World", !36, i64 0, !37, i64 128, !38, i64 103064, !16, i64 103248, !16, i64 103256, !16, i64 103264, !16, i64 103272, !10, i64 103280, !10, i64 103284, !42, i64 103288, !7, i64 103296, !16, i64 103304, !16, i64 103312, !11, i64 103320, !7, i64 103324, !7, i64 103325, !7, i64 103326, !7, i64 103327, !7, i64 103328, !7, i64 103329, !7, i64 103330, !7, i64 103331, !44, i64 103332}
!36 = !{!"_ZTS16b2BlockAllocator", !16, i64 0, !10, i64 8, !10, i64 12, !8, i64 16}
!37 = !{!"_ZTS16b2StackAllocator", !8, i64 0, !10, i64 102400, !10, i64 102404, !10, i64 102408, !8, i64 102416, !10, i64 102928}
!38 = !{!"_ZTS16b2ContactManager", !39, i64 0, !10, i64 144, !16, i64 152, !16, i64 160, !16, i64 168, !16, i64 176}
!39 = !{!"_ZTS12b2BroadPhase", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !40, i64 32, !16, i64 80, !16, i64 88, !16, i64 96, !10, i64 104, !10, i64 108, !43, i64 112, !10, i64 128, !10, i64 132, !7, i64 136}
!40 = !{!"_ZTS10b2TreeNode", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !41, i64 32}
!41 = !{!"_ZTS6b2AABB", !42, i64 0, !42, i64 8}
!42 = !{!"_ZTS6b2Vec2", !11, i64 0, !11, i64 4}
!43 = !{!"_ZTS14b2IntHashTable", !16, i64 0, !10, i64 8}
!44 = !{!"_ZTS9b2Profile", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!45 = !{!46, !46, i64 0}
!46 = !{!"vtable pointer", !9, i64 0}
!47 = !{!48, !10, i64 8}
!48 = !{!"_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, !42, i64 52, !42, i64 60, !11, i64 68, !49, i64 72, !16, i64 88}
!49 = !{!"_ZTS11b2Transform", !42, i64 0, !50, i64 8}
!50 = !{!"_ZTS5b2Rot", !11, i64 0, !11, i64 4}
!51 = !{!48, !10, i64 12}
!52 = !{!6, !16, i64 240}
!53 = !{!16, !16, i64 0}
!54 = distinct !{!54, !55}
!55 = !{!"llvm.loop.unroll.disable"}
!56 = !{!48, !16, i64 24}
!57 = !{!48, !16, i64 32}
!58 = distinct !{!58, !59}
!59 = !{!"llvm.loop.mustprogress"}
!60 = !{!6, !16, i64 512}


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