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

; 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.b2Contact = type { ptr, ptr, ptr, ptr, ptr, %struct.b2Manifold, i32, i32, float, float, float, float }
%struct.b2Manifold = type { [2 x %struct.b2ManifoldPoint], %struct.b2Vec2, %struct.b2Vec2, i32, i32 }
%struct.b2ManifoldPoint = type { %struct.b2Vec2, float, float, %union.b2ContactID }
%union.b2ContactID = type { i32 }
%struct.b2Vec2 = type { float, float }
%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] }>
%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.b2BodyUserData = type { i64 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ContactManager7CollideEv(ptr noundef nonnull align 8 dereferenceable(184) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %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 ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %15 = call noundef ptr @_ZNK16b2ContactManager5StartEv(ptr noundef nonnull align 8 dereferenceable(184) %14)
  store ptr %15, ptr %3, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %110, %108, %1
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNK16b2ContactManager3EndEv(ptr noundef nonnull align 8 dereferenceable(184) %14)
  %19 = icmp ne ptr %17, %18
  br i1 %19, label %20, label %111

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128) %21)
  store ptr %22, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = call noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128) %23)
  store ptr %24, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84) %25)
  store ptr %26, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84) %27)
  store ptr %28, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.b2Contact, ptr %29, i32 0, i32 6
  %31 = load i32, ptr %30, align 8, !tbaa !9
  %32 = and i32 %31, 4
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %66

34:                                               ; preds = %20
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef zeroext i1 @_ZNK6b2Body13ShouldCollideEPKS_(ptr noundef nonnull align 8 dereferenceable(208) %35, ptr noundef %36)
  %38 = zext i1 %37 to i32
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %41, ptr %8, align 8, !tbaa !5
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = call noundef ptr @_ZN9b2Contact7GetNextEv(ptr noundef nonnull align 8 dereferenceable(128) %42)
  store ptr %43, ptr %3, align 8, !tbaa !5
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184) %14, ptr noundef %44)
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %108

45:                                               ; preds = %34
  %46 = getelementptr inbounds %class.b2ContactManager, ptr %14, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %65

49:                                               ; preds = %45
  %50 = getelementptr inbounds %class.b2ContactManager, ptr %14, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !16
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load ptr, ptr %51, align 8, !tbaa !23
  %55 = getelementptr inbounds ptr, ptr %54, i64 2
  %56 = load ptr, ptr %55, align 8
  %57 = call noundef zeroext i1 %56(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef %52, ptr noundef %53)
  %58 = zext i1 %57 to i32
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %65

60:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %61, ptr %10, align 8, !tbaa !5
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = call noundef ptr @_ZN9b2Contact7GetNextEv(ptr noundef nonnull align 8 dereferenceable(128) %62)
  store ptr %63, ptr %3, align 8, !tbaa !5
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184) %14, ptr noundef %64)
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %108

65:                                               ; preds = %49, %45
  br label %66

66:                                               ; preds = %65, %20
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %class.b2Contact, ptr %67, i32 0, i32 6
  %69 = load i32, ptr %68, align 8, !tbaa !9
  %70 = and i32 %69, -8
  store i32 %70, ptr %68, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = call noundef zeroext i1 @_ZNK6b2Body7IsAwakeEv(ptr noundef nonnull align 8 dereferenceable(208) %71)
  br i1 %72, label %73, label %78

73:                                               ; preds = %66
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.b2Body, ptr %74, i32 0, i32 0
  %76 = load i32, ptr %75, align 8, !tbaa !25
  %77 = icmp ne i32 %76, 0
  br label %78

78:                                               ; preds = %73, %66
  %79 = phi i1 [ false, %66 ], [ %77, %73 ]
  %80 = zext i1 %79 to i8
  store i8 %80, ptr %11, align 1, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #4
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call noundef zeroext i1 @_ZNK6b2Body7IsAwakeEv(ptr noundef nonnull align 8 dereferenceable(208) %81)
  br i1 %82, label %83, label %88

83:                                               ; preds = %78
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %class.b2Body, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 8, !tbaa !25
  %87 = icmp ne i32 %86, 0
  br label %88

88:                                               ; preds = %83, %78
  %89 = phi i1 [ false, %78 ], [ %87, %83 ]
  %90 = zext i1 %89 to i8
  store i8 %90, ptr %12, align 1, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  %91 = load i8, ptr %11, align 1, !tbaa !34, !range !35, !noundef !36
  %92 = trunc i8 %91 to i1
  br i1 %92, label %96, label %93

93:                                               ; preds = %88
  %94 = load i8, ptr %12, align 1, !tbaa !34, !range !35, !noundef !36
  %95 = trunc i8 %94 to i1
  br label %96

96:                                               ; preds = %93, %88
  %97 = phi i1 [ true, %88 ], [ %95, %93 ]
  %98 = zext i1 %97 to i8
  store i8 %98, ptr %13, align 1, !tbaa !34
  %99 = load i8, ptr %13, align 1, !tbaa !34, !range !35, !noundef !36
  %100 = trunc i8 %99 to i1
  br i1 %100, label %101, label %105

101:                                              ; preds = %96
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %class.b2ContactManager, ptr %14, i32 0, i32 3
  %104 = load ptr, ptr %103, align 8, !tbaa !37
  call void @_ZN9b2Contact6UpdateEP17b2ContactListener(ptr noundef nonnull align 8 dereferenceable(128) %102, ptr noundef %104)
  br label %105

105:                                              ; preds = %101, %96
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = call noundef ptr @_ZN9b2Contact7GetNextEv(ptr noundef nonnull align 8 dereferenceable(128) %106)
  store ptr %107, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  store i32 0, ptr %9, align 4
  br label %108

108:                                              ; preds = %105, %60, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %109 = load i32, ptr %9, align 4
  switch i32 %109, label %112 [
    i32 0, label %110
    i32 2, label %16
  ]

110:                                              ; preds = %108
  br label %16, !llvm.loop !38

111:                                              ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void

112:                                              ; preds = %108
  unreachable
}

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

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

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

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

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

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

declare noundef zeroext i1 @_ZNK6b2Body13ShouldCollideEPKS_(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) #3

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

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

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

declare void @_ZN9b2Contact6UpdateEP17b2ContactListener(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !15, i64 104}
!10 = !{!"_ZTS9b2Contact", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !15, i64 104, !15, i64 108, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124}
!11 = !{!"_ZTS10b2Manifold", !7, i64 0, !12, i64 40, !12, i64 48, !14, i64 56, !15, i64 60}
!12 = !{!"_ZTS6b2Vec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTSN10b2Manifold4TypeE", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !6, i64 152}
!17 = !{!"_ZTS16b2ContactManager", !18, i64 0, !15, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!18 = !{!"_ZTS12b2BroadPhase", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !19, i64 32, !6, i64 80, !6, i64 88, !6, i64 96, !15, i64 104, !15, i64 108, !21, i64 112, !15, i64 128, !15, i64 132, !22, i64 136}
!19 = !{!"_ZTS10b2TreeNode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !20, i64 32}
!20 = !{!"_ZTS6b2AABB", !12, i64 0, !12, i64 8}
!21 = !{!"_ZTS14b2IntHashTable", !6, i64 0, !15, i64 8}
!22 = !{!"bool", !7, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{!26, !27, i64 0}
!26 = !{!"_ZTS6b2Body", !27, i64 0, !28, i64 4, !15, i64 8, !29, i64 12, !29, i64 28, !31, i64 44, !12, i64 80, !13, i64 88, !12, i64 92, !13, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !15, i64 136, !6, i64 144, !6, i64 152, !15, i64 160, !15, i64 164, !13, i64 168, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !13, i64 192, !13, i64 196, !32, i64 200}
!27 = !{!"_ZTS10b2BodyType", !7, i64 0}
!28 = !{!"short", !7, i64 0}
!29 = !{!"_ZTS11b2Transform", !12, i64 0, !30, i64 8}
!30 = !{!"_ZTS5b2Rot", !13, i64 0, !13, i64 4}
!31 = !{!"_ZTS7b2Sweep", !12, i64 0, !12, i64 8, !12, i64 16, !13, i64 24, !13, i64 28, !13, i64 32}
!32 = !{!"_ZTS14b2BodyUserData", !33, i64 0}
!33 = !{!"long", !7, i64 0}
!34 = !{!22, !22, i64 0}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = !{!17, !6, i64 160}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16b2ContactManager7CollideEv(ptr noundef nonnull align 8 dereferenceable(184) %0) local_unnamed_addr #0 align 2 {
  %2 = tail call noundef ptr @_ZNK16b2ContactManager5StartEv(ptr noundef nonnull align 8 dereferenceable(184) %0)
  %3 = tail call noundef ptr @_ZNK16b2ContactManager3EndEv(ptr noundef nonnull align 8 dereferenceable(184) %0)
  %.not29 = icmp eq ptr %2, %3
  br i1 %.not29, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 152
  %5 = getelementptr inbounds i8, ptr %0, i64 160
  br label %6

6:                                                ; preds = %.lr.ph, %47
  %.030 = phi ptr [ %2, %.lr.ph ], [ %.1, %47 ]
  %7 = tail call noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128) %.030)
  %8 = tail call noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128) %.030)
  %9 = tail call noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84) %7)
  %10 = tail call noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84) %8)
  %11 = getelementptr inbounds i8, ptr %.030, i64 104
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = and i32 %12, 4
  %.not27 = icmp eq i32 %13, 0
  br i1 %.not27, label %27, label %14

14:                                               ; preds = %6
  %15 = tail call noundef zeroext i1 @_ZNK6b2Body13ShouldCollideEPKS_(ptr noundef nonnull align 8 dereferenceable(208) %10, ptr noundef %9)
  br i1 %15, label %18, label %16

16:                                               ; preds = %14
  %17 = tail call noundef ptr @_ZN9b2Contact7GetNextEv(ptr noundef nonnull align 8 dereferenceable(128) %.030)
  tail call void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef nonnull %.030)
  br label %47

18:                                               ; preds = %14
  %19 = load ptr, ptr %4, align 8, !tbaa !15
  %.not28 = icmp eq ptr %19, null
  br i1 %.not28, label %27, label %20

20:                                               ; preds = %18
  %21 = load ptr, ptr %19, align 8, !tbaa !22
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %23 = load ptr, ptr %22, align 8
  %24 = tail call noundef zeroext i1 %23(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull %7, ptr noundef nonnull %8)
  br i1 %24, label %27, label %25

25:                                               ; preds = %20
  %26 = tail call noundef ptr @_ZN9b2Contact7GetNextEv(ptr noundef nonnull align 8 dereferenceable(128) %.030)
  tail call void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef nonnull %.030)
  br label %47

27:                                               ; preds = %18, %20, %6
  %28 = load i32, ptr %11, align 8, !tbaa !5
  %29 = and i32 %28, -8
  store i32 %29, ptr %11, align 8, !tbaa !5
  %30 = tail call noundef zeroext i1 @_ZNK6b2Body7IsAwakeEv(ptr noundef nonnull align 8 dereferenceable(208) %9)
  br i1 %30, label %31, label %34

31:                                               ; preds = %27
  %32 = load i32, ptr %9, align 8, !tbaa !24
  %33 = icmp ne i32 %32, 0
  br label %34

34:                                               ; preds = %31, %27
  %35 = phi i1 [ false, %27 ], [ %33, %31 ]
  %36 = tail call noundef zeroext i1 @_ZNK6b2Body7IsAwakeEv(ptr noundef nonnull align 8 dereferenceable(208) %10)
  br i1 %36, label %37, label %40

37:                                               ; preds = %34
  %38 = load i32, ptr %10, align 8, !tbaa !24
  %39 = icmp ne i32 %38, 0
  br label %40

40:                                               ; preds = %37, %34
  %41 = phi i1 [ false, %34 ], [ %39, %37 ]
  %42 = select i1 %35, i1 true, i1 %41
  br i1 %42, label %43, label %45

43:                                               ; preds = %40
  %44 = load ptr, ptr %5, align 8, !tbaa !33
  tail call void @_ZN9b2Contact6UpdateEP17b2ContactListener(ptr noundef nonnull align 8 dereferenceable(128) %.030, ptr noundef %44)
  br label %45

45:                                               ; preds = %43, %40
  %46 = tail call noundef ptr @_ZN9b2Contact7GetNextEv(ptr noundef nonnull align 8 dereferenceable(128) %.030)
  br label %47

47:                                               ; preds = %45, %25, %16
  %.1 = phi ptr [ %17, %16 ], [ %26, %25 ], [ %46, %45 ]
  %48 = tail call noundef ptr @_ZNK16b2ContactManager3EndEv(ptr noundef nonnull align 8 dereferenceable(184) %0)
  %.not = icmp eq ptr %.1, %48
  br i1 %.not, label %._crit_edge, label %6

._crit_edge:                                      ; preds = %47, %1
  ret void
}

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

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

; 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

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

declare noundef zeroext i1 @_ZNK6b2Body13ShouldCollideEPKS_(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) local_unnamed_addr #2

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

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

declare void @_ZN9b2Contact6UpdateEP17b2ContactListener(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { "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" }

!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, !14, i64 104}
!6 = !{!"_ZTS9b2Contact", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !14, i64 104, !14, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS10b2Manifold", !8, i64 0, !11, i64 40, !11, i64 48, !13, i64 56, !14, i64 60}
!11 = !{!"_ZTS6b2Vec2", !12, i64 0, !12, i64 4}
!12 = !{!"float", !8, i64 0}
!13 = !{!"_ZTSN10b2Manifold4TypeE", !8, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!16, !7, i64 152}
!16 = !{!"_ZTS16b2ContactManager", !17, i64 0, !14, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176}
!17 = !{!"_ZTS12b2BroadPhase", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !18, i64 32, !7, i64 80, !7, i64 88, !7, i64 96, !14, i64 104, !14, i64 108, !20, i64 112, !14, i64 128, !14, i64 132, !21, i64 136}
!18 = !{!"_ZTS10b2TreeNode", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !19, i64 32}
!19 = !{!"_ZTS6b2AABB", !11, i64 0, !11, i64 8}
!20 = !{!"_ZTS14b2IntHashTable", !7, i64 0, !14, i64 8}
!21 = !{!"bool", !8, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !9, i64 0}
!24 = !{!25, !26, i64 0}
!25 = !{!"_ZTS6b2Body", !26, i64 0, !27, i64 4, !14, i64 8, !28, i64 12, !28, i64 28, !30, i64 44, !11, i64 80, !12, i64 88, !11, i64 92, !12, i64 100, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !14, i64 136, !7, i64 144, !7, i64 152, !14, i64 160, !14, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !12, i64 192, !12, i64 196, !31, i64 200}
!26 = !{!"_ZTS10b2BodyType", !8, i64 0}
!27 = !{!"short", !8, i64 0}
!28 = !{!"_ZTS11b2Transform", !11, i64 0, !29, i64 8}
!29 = !{!"_ZTS5b2Rot", !12, i64 0, !12, i64 4}
!30 = !{!"_ZTS7b2Sweep", !11, i64 0, !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 28, !12, i64 32}
!31 = !{!"_ZTS14b2BodyUserData", !32, i64 0}
!32 = !{!"long", !8, i64 0}
!33 = !{!16, !7, i64 160}


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