; LLVM IR from mtsamis/box2d-optimized :: src/dynamics/b2_body.ll (ZN6b2Body14DestroyFixtureEP9b2Fixture)

; 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.b2Body = type { i32, i16, i32, %struct.b2Transform, %struct.b2Transform, %struct.b2Sweep, %struct.b2Vec2, float, %struct.b2Vec2, float, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, float, float, float, float, float, float, float, float, %struct.b2BodyUserData }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%struct.b2Sweep = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float }
%struct.b2Vec2 = type { float, float }
%struct.b2BodyUserData = type { i64 }
%class.b2Fixture = type <{ float, [4 x i8], ptr, ptr, ptr, %struct.b2AABB, float, float, float, %struct.b2Filter, i8, [5 x i8], %struct.b2FixtureUserData, i32, [4 x i8] }>
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Filter = type { i16, i16, i16 }
%struct.b2FixtureUserData = type { i64 }
%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 }
%class.b2IntHashTable = type <{ ptr, i32, [4 x i8] }>
%struct.b2Profile = type { float, float, float, float, float }

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture = external hidden unnamed_addr constant [41 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352)) #1 align 2

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

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

declare void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Body14DestroyFixtureEP9b2Fixture(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef %1) #5 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  br label %155

17:                                               ; preds = %2
  %18 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 10
  %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 = %17
  br label %26

24:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 287, ptr noundef @__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture) #6
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  %27 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 10
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %28)
  %30 = zext i1 %29 to i32
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %33

32:                                               ; preds = %26
  br label %155

33:                                               ; preds = %26
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %class.b2Fixture, ptr %34, i32 0, i32 3
  %36 = load ptr, ptr %35, align 8, !tbaa !21
  %37 = icmp eq ptr %36, %13
  br i1 %37, label %38, label %39

38:                                               ; preds = %33
  br label %41

39:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 293, ptr noundef @__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture) #6
  unreachable

40:                                               ; No predecessors!
  br label %41

41:                                               ; preds = %40, %38
  %42 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 14
  %43 = load i32, ptr %42, align 8, !tbaa !27
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %41
  br label %48

46:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 296, ptr noundef @__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture) #6
  unreachable

47:                                               ; No predecessors!
  br label %48

48:                                               ; preds = %47, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %49 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 13
  store ptr %49, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  store i8 0, ptr %6, align 1, !tbaa !28
  br label %50

50:                                               ; preds = %64, %48
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %68

54:                                               ; preds = %50
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = icmp eq ptr %56, %57
  br i1 %58, label %59, label %64

59:                                               ; preds = %54
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %class.b2Fixture, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !29
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %62, ptr %63, align 8, !tbaa !5
  store i8 1, ptr %6, align 1, !tbaa !28
  br label %68

64:                                               ; preds = %54
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.b2Fixture, ptr %66, i32 0, i32 2
  store ptr %67, ptr %5, align 8, !tbaa !5
  br label %50, !llvm.loop !30

68:                                               ; preds = %59, %50
  %69 = load i8, ptr %6, align 1, !tbaa !28, !range !32, !noundef !33
  %70 = trunc i8 %69 to i1
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  br label %74

72:                                               ; preds = %68
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 312, ptr noundef @__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture) #6
  unreachable

73:                                               ; No predecessors!
  br label %74

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

75:                                               ; preds = %122, %74
  %76 = load i32, ptr %7, align 4, !tbaa !34
  %77 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 17
  %78 = load i32, ptr %77, align 8, !tbaa !35
  %79 = icmp slt i32 %76, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %125

81:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %82 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 16
  %83 = load ptr, ptr %82, align 8, !tbaa !36
  %84 = load i32, ptr %7, align 4, !tbaa !34
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds ptr, ptr %83, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  store ptr %87, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = call noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128) %88)
  store ptr %89, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = call noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128) %90)
  store ptr %91, ptr %10, align 8, !tbaa !5
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = icmp eq ptr %92, %93
  br i1 %94, label %99, label %95

95:                                               ; preds = %81
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = icmp eq ptr %96, %97
  br i1 %98, label %99, label %121

99:                                               ; preds = %95, %81
  %100 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 10
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  %102 = getelementptr inbounds %class.b2World, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184) %102, ptr noundef %103)
  %104 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 17
  %105 = load i32, ptr %104, align 8, !tbaa !35
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %104, align 8, !tbaa !35
  %107 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 16
  %108 = load ptr, ptr %107, align 8, !tbaa !36
  %109 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 17
  %110 = load i32, ptr %109, align 8, !tbaa !35
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds ptr, ptr %108, i64 %111
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 16
  %115 = load ptr, ptr %114, align 8, !tbaa !36
  %116 = load i32, ptr %7, align 4, !tbaa !34
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %115, i64 %117
  store ptr %113, ptr %118, align 8, !tbaa !5
  %119 = load i32, ptr %7, align 4, !tbaa !34
  %120 = add nsw i32 %119, -1
  store i32 %120, ptr %7, align 4, !tbaa !34
  br label %121

121:                                              ; preds = %99, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %7, align 4, !tbaa !34
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %7, align 4, !tbaa !34
  br label %75, !llvm.loop !37

125:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %126 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 10
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = getelementptr inbounds %class.b2World, ptr %127, i32 0, i32 0
  store ptr %128, ptr %11, align 8, !tbaa !5
  %129 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 1
  %130 = load i16, ptr %129, align 4, !tbaa !38
  %131 = zext i16 %130 to i32
  %132 = and i32 %131, 32
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %142

134:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %135 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 10
  %136 = load ptr, ptr %135, align 8, !tbaa !9
  %137 = getelementptr inbounds %class.b2World, ptr %136, i32 0, i32 2
  %138 = getelementptr inbounds %class.b2ContactManager, ptr %137, i32 0, i32 0
  store ptr %138, ptr %12, align 8, !tbaa !5
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = call noundef zeroext i1 @_ZN12b2BroadPhase6RemoveEP9b2Fixture(ptr noundef nonnull align 8 dereferenceable(137) %139, ptr noundef %140)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %142

142:                                              ; preds = %134, %125
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %class.b2Fixture, ptr %143, i32 0, i32 3
  store ptr null, ptr %144, align 8, !tbaa !21
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %class.b2Fixture, ptr %145, i32 0, i32 2
  store ptr null, ptr %146, align 8, !tbaa !29
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN9b2Fixture7DestroyEP16b2BlockAllocator(ptr noundef nonnull align 8 dereferenceable(84) %147, ptr noundef %148)
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN16b2BlockAllocator4FreeEPvi(ptr noundef nonnull align 8 dereferenceable(128) %150, ptr noundef %151, i32 noundef 88)
  %152 = getelementptr inbounds %class.b2Body, ptr %13, i32 0, i32 14
  %153 = load i32, ptr %152, align 8, !tbaa !27
  %154 = add nsw i32 %153, -1
  store i32 %154, ptr %152, align 8, !tbaa !27
  call void @_ZN6b2Body13ResetMassDataEv(ptr noundef nonnull align 8 dereferenceable(208) %13)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %155

155:                                              ; preds = %142, %32, %16
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

declare noundef zeroext i1 @_ZN12b2BroadPhase6RemoveEP9b2Fixture(ptr noundef nonnull align 8 dereferenceable(137), ptr noundef) #4

declare void @_ZN9b2Fixture7DestroyEP16b2BlockAllocator(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef) #4

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 = { 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 #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { noreturn nounwind }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 104}
!10 = !{!"_ZTS6b2Body", !11, i64 0, !12, i64 4, !13, i64 8, !14, i64 12, !14, i64 28, !18, i64 44, !15, i64 80, !16, i64 88, !15, i64 92, !16, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !13, i64 136, !6, i64 144, !6, i64 152, !13, i64 160, !13, i64 164, !16, i64 168, !16, i64 172, !16, i64 176, !16, i64 180, !16, i64 184, !16, i64 188, !16, i64 192, !16, i64 196, !19, i64 200}
!11 = !{!"_ZTS10b2BodyType", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS11b2Transform", !15, i64 0, !17, i64 8}
!15 = !{!"_ZTS6b2Vec2", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_ZTS5b2Rot", !16, i64 0, !16, i64 4}
!18 = !{!"_ZTS7b2Sweep", !15, i64 0, !15, i64 8, !15, i64 16, !16, i64 24, !16, i64 28, !16, i64 32}
!19 = !{!"_ZTS14b2BodyUserData", !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!22, !6, i64 16}
!22 = !{!"_ZTS9b2Fixture", !16, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !23, i64 32, !16, i64 48, !16, i64 52, !16, i64 56, !24, i64 60, !25, i64 66, !26, i64 72, !13, i64 80}
!23 = !{!"_ZTS6b2AABB", !15, i64 0, !15, i64 8}
!24 = !{!"_ZTS8b2Filter", !12, i64 0, !12, i64 2, !12, i64 4}
!25 = !{!"bool", !7, i64 0}
!26 = !{!"_ZTS17b2FixtureUserData", !20, i64 0}
!27 = !{!10, !13, i64 136}
!28 = !{!25, !25, i64 0}
!29 = !{!22, !6, i64 8}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!13, !13, i64 0}
!35 = !{!10, !13, i64 160}
!36 = !{!10, !6, i64 152}
!37 = distinct !{!37, !31}
!38 = !{!10, !12, i64 4}


; 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 [82 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture = external hidden unnamed_addr constant [41 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352)) local_unnamed_addr #1 align 2

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

declare void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Body14DestroyFixtureEP9b2Fixture(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef %1) local_unnamed_addr #4 align 2 {
  %3 = icmp eq ptr %1, null
  br i1 %3, label %71, label %4

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 104
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %6)
  br i1 %7, label %8, label %9

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

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

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !20
  %15 = icmp eq ptr %14, %0
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 293, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture) #6
  unreachable

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %0, i64 136
  %19 = load i32, ptr %18, align 8, !tbaa !26
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 296, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture) #6
  unreachable

22:                                               ; preds = %17
  %23 = getelementptr inbounds i8, ptr %0, i64 128
  %24 = load ptr, ptr %23, align 8, !tbaa !27
  %.not.not36 = icmp eq ptr %24, null
  br i1 %.not.not36, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %22
  %25 = icmp eq ptr %24, %1
  br i1 %25, label %.lr.ph._crit_edge, label %.lr.ph44

.lr.ph44:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %26 = phi ptr [ %28, %.lr.ph ], [ %24, %.lr.ph.preheader ]
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !27
  %.not.not = icmp eq ptr %28, null
  br i1 %.not.not, label %.critedge, label %.lr.ph, !llvm.loop !28

.lr.ph:                                           ; preds = %.lr.ph44
  %29 = icmp eq ptr %28, %1
  br i1 %29, label %.lr.ph._crit_edge.loopexit, label %.lr.ph44, !llvm.loop !28

.lr.ph._crit_edge.loopexit:                       ; preds = %.lr.ph
  %30 = getelementptr inbounds i8, ptr %26, i64 8
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph._crit_edge.loopexit, %.lr.ph.preheader
  %.037.lcssa = phi ptr [ %23, %.lr.ph.preheader ], [ %30, %.lr.ph._crit_edge.loopexit ]
  %31 = getelementptr inbounds i8, ptr %1, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !30
  store ptr %32, ptr %.037.lcssa, align 8, !tbaa !27
  %33 = getelementptr inbounds i8, ptr %0, i64 160
  %34 = load i32, ptr %33, align 8, !tbaa !31
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph39, label %._crit_edge

.lr.ph39:                                         ; preds = %.lr.ph._crit_edge
  %36 = getelementptr inbounds i8, ptr %0, i64 152
  br label %41

.critedge:                                        ; preds = %.lr.ph44, %22
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 312, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6b2Body14DestroyFixtureEP9b2Fixture) #6
  unreachable

._crit_edge:                                      ; preds = %61, %.lr.ph._crit_edge
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %0, i64 4
  %39 = load i16, ptr %38, align 4, !tbaa !32
  %40 = and i16 %39, 32
  %.not = icmp eq i16 %40, 0
  br i1 %.not, label %68, label %65

41:                                               ; preds = %.lr.ph39, %61
  %.03138 = phi i32 [ 0, %.lr.ph39 ], [ %63, %61 ]
  %42 = load ptr, ptr %36, align 8, !tbaa !33
  %43 = sext i32 %.03138 to i64
  %44 = getelementptr inbounds ptr, ptr %42, i64 %43
  %45 = load ptr, ptr %44, align 8, !tbaa !27
  %46 = tail call noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128) %45)
  %47 = tail call noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128) %45)
  %48 = icmp eq ptr %46, %1
  %49 = icmp eq ptr %47, %1
  %or.cond = or i1 %48, %49
  br i1 %or.cond, label %50, label %._crit_edge41

._crit_edge41:                                    ; preds = %41
  %.pre = load i32, ptr %33, align 8, !tbaa !31
  br label %61

50:                                               ; preds = %41
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i64 103064
  tail call void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184) %52, ptr noundef nonnull %45)
  %53 = load i32, ptr %33, align 8, !tbaa !31
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %33, align 8, !tbaa !31
  %55 = load ptr, ptr %36, align 8, !tbaa !33
  %56 = sext i32 %54 to i64
  %57 = getelementptr inbounds ptr, ptr %55, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !27
  %59 = getelementptr inbounds ptr, ptr %55, i64 %43
  store ptr %58, ptr %59, align 8, !tbaa !27
  %60 = add nsw i32 %.03138, -1
  br label %61

61:                                               ; preds = %._crit_edge41, %50
  %62 = phi i32 [ %54, %50 ], [ %.pre, %._crit_edge41 ]
  %.1 = phi i32 [ %60, %50 ], [ %.03138, %._crit_edge41 ]
  %63 = add nsw i32 %.1, 1
  %64 = icmp slt i32 %63, %62
  br i1 %64, label %41, label %._crit_edge, !llvm.loop !34

65:                                               ; preds = %._crit_edge
  %66 = getelementptr inbounds i8, ptr %37, i64 103064
  %67 = tail call noundef zeroext i1 @_ZN12b2BroadPhase6RemoveEP9b2Fixture(ptr noundef nonnull align 8 dereferenceable(137) %66, ptr noundef nonnull %1)
  br label %68

68:                                               ; preds = %65, %._crit_edge
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %31, i8 0, i64 16, i1 false)
  tail call void @_ZN9b2Fixture7DestroyEP16b2BlockAllocator(ptr noundef nonnull align 8 dereferenceable(84) %1, ptr noundef %37)
  tail call void @_ZN16b2BlockAllocator4FreeEPvi(ptr noundef nonnull align 8 dereferenceable(128) %37, ptr noundef nonnull %1, i32 noundef 88)
  %69 = load i32, ptr %18, align 8, !tbaa !26
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr %18, align 8, !tbaa !26
  tail call void @_ZN6b2Body13ResetMassDataEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  br label %71

71:                                               ; preds = %9, %2, %68
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN12b2BroadPhase6RemoveEP9b2Fixture(ptr noundef nonnull align 8 dereferenceable(137), ptr noundef) local_unnamed_addr #3

declare void @_ZN9b2Fixture7DestroyEP16b2BlockAllocator(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef) local_unnamed_addr #3

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

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

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 = { 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 #2 = { 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 #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !17, i64 104}
!6 = !{!"_ZTS6b2Body", !7, i64 0, !10, i64 4, !11, i64 8, !12, i64 12, !12, i64 28, !16, i64 44, !13, i64 80, !14, i64 88, !13, i64 92, !14, i64 100, !17, i64 104, !17, i64 112, !17, i64 120, !17, i64 128, !11, i64 136, !17, i64 144, !17, i64 152, !11, i64 160, !11, i64 164, !14, i64 168, !14, i64 172, !14, i64 176, !14, i64 180, !14, i64 184, !14, i64 188, !14, i64 192, !14, i64 196, !18, i64 200}
!7 = !{!"_ZTS10b2BodyType", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTS11b2Transform", !13, i64 0, !15, i64 8}
!13 = !{!"_ZTS6b2Vec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !8, i64 0}
!15 = !{!"_ZTS5b2Rot", !14, i64 0, !14, i64 4}
!16 = !{!"_ZTS7b2Sweep", !13, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !14, i64 28, !14, i64 32}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"_ZTS14b2BodyUserData", !19, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!21, !17, i64 16}
!21 = !{!"_ZTS9b2Fixture", !14, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !22, i64 32, !14, i64 48, !14, i64 52, !14, i64 56, !23, i64 60, !24, i64 66, !25, i64 72, !11, i64 80}
!22 = !{!"_ZTS6b2AABB", !13, i64 0, !13, i64 8}
!23 = !{!"_ZTS8b2Filter", !10, i64 0, !10, i64 2, !10, i64 4}
!24 = !{!"bool", !8, i64 0}
!25 = !{!"_ZTS17b2FixtureUserData", !19, i64 0}
!26 = !{!6, !11, i64 136}
!27 = !{!17, !17, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!21, !17, i64 8}
!31 = !{!6, !11, i64 160}
!32 = !{!6, !10, i64 4}
!33 = !{!6, !17, i64 152}
!34 = distinct !{!34, !29}


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