; LLVM IR from erincatto/box2d :: src (joint)

; 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.b2JointId = type { i32, i16, i16 }
%struct.b2Joint = type { ptr, i32, i32, i32, [2 x %struct.b2JointEdge], i32, i32, i32, i32, float, i32, i16, i8, i8 }
%struct.b2JointEdge = type { i32, i32, i32 }
%struct.b2World = type { %struct.b2ArenaAllocator, %struct.b2BroadPhase, %struct.b2ConstraintGraph, %struct.b2IdPool, %struct.b2BodyArray, %struct.b2IdPool, %struct.b2SolverSetArray, %struct.b2IdPool, %struct.b2JointArray, %struct.b2IdPool, %struct.b2ContactArray, %struct.b2IdPool, %struct.b2IslandArray, %struct.b2IdPool, %struct.b2IdPool, %struct.b2ShapeArray, %struct.b2ChainShapeArray, %struct.b2SensorArray, %struct.b2TaskContextArray, %struct.b2SensorTaskContextArray, %struct.b2BodyMoveEventArray, %struct.b2SensorBeginTouchEventArray, %struct.b2ContactBeginTouchEventArray, [2 x %struct.b2SensorEndTouchEventArray], [2 x %struct.b2ContactEndTouchEventArray], i32, %struct.b2ContactHitEventArray, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, i64, i32, %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i16, %struct.b2Profile, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, float, i32, i32, i16, i8, i8, i8, i8, i8, i8 }
%struct.b2ArenaAllocator = type { ptr, i32, i32, i32, i32, %struct.b2ArenaEntryArray }
%struct.b2ArenaEntryArray = type { ptr, i32, i32 }
%struct.b2BroadPhase = type { [3 x %struct.b2DynamicTree], i32, %struct.b2HashSet, %struct.b2IntArray, ptr, ptr, i32, %struct.b2AtomicInt, %struct.b2HashSet }
%struct.b2DynamicTree = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2IntArray = type { ptr, i32, i32 }
%struct.b2AtomicInt = type { i32 }
%struct.b2HashSet = type { ptr, i32, i32 }
%struct.b2ConstraintGraph = type { [12 x %struct.b2GraphColor] }
%struct.b2GraphColor = type { %struct.b2BitSet, %struct.b2ContactSimArray, %struct.b2JointSimArray, %union.anon }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon = type { ptr }
%struct.b2BodyArray = type { ptr, i32, i32 }
%struct.b2SolverSetArray = type { ptr, i32, i32 }
%struct.b2JointArray = type { ptr, i32, i32 }
%struct.b2ContactArray = type { ptr, i32, i32 }
%struct.b2IslandArray = type { ptr, i32, i32 }
%struct.b2IdPool = type { %struct.b2IntArray, i32 }
%struct.b2ShapeArray = type { ptr, i32, i32 }
%struct.b2ChainShapeArray = type { ptr, i32, i32 }
%struct.b2SensorArray = type { ptr, i32, i32 }
%struct.b2TaskContextArray = type { ptr, i32, i32 }
%struct.b2SensorTaskContextArray = type { ptr, i32, i32 }
%struct.b2BodyMoveEventArray = type { ptr, i32, i32 }
%struct.b2SensorBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2SensorEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactHitEventArray = type { ptr, i32, i32 }
%struct.b2BitSet = type { ptr, i32, i32 }
%struct.b2Vec2 = type { float, float }
%struct.b2Profile = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
%struct.b2Body = type { [32 x i8], ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, float, float, i32, i32, i32, i16, i8, i8, i8, i8 }
%struct.b2Shape = type { i32, i32, i32, i32, i32, i32, float, float, float, float, float, i32, %struct.b2AABB, %struct.b2AABB, %struct.b2Vec2, i32, %struct.b2Filter, ptr, i32, %union.anon.1, i16, i8, i8, i8, i8, i8 }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Filter = type { i64, i64, i32 }
%union.anon.1 = type { %struct.b2Polygon }
%struct.b2Polygon = type { [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], %struct.b2Vec2, float, i32 }

; Function Attrs: nounwind uwtable
declare dso_local ptr @b2GetJointFullId(ptr noundef, i64) #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: nounwind uwtable
declare hidden void @b2DestroyContactsBetweenBodies(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodyArray_Get(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @b2Joint_SetCollideConnected(i64 %0, i1 noundef zeroext %1) #0 {
  %3 = alloca %struct.b2JointId, align 4
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store i64 %0, ptr %3, align 4
  %14 = zext i1 %1 to i8
  store i8 %14, ptr %4, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %15 = getelementptr inbounds %struct.b2JointId, ptr %3, i32 0, i32 1
  %16 = load i16, ptr %15, align 4, !tbaa !9
  %17 = zext i16 %16 to i32
  %18 = call ptr @b2GetWorldLocked(i32 noundef %17)
  store ptr %18, ptr %5, align 8, !tbaa !13
  %19 = load ptr, ptr %5, align 8, !tbaa !13
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %2
  store i32 1, ptr %6, align 4
  br label %109

22:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %23 = load ptr, ptr %5, align 8, !tbaa !13
  %24 = load i64, ptr %3, align 4
  %25 = call ptr @b2GetJointFullId(ptr noundef %23, i64 %24)
  store ptr %25, ptr %7, align 8, !tbaa !13
  %26 = load ptr, ptr %7, align 8, !tbaa !13
  %27 = getelementptr inbounds %struct.b2Joint, ptr %26, i32 0, i32 13
  %28 = load i8, ptr %27, align 1, !tbaa !15, !range !18, !noundef !19
  %29 = trunc i8 %28 to i1
  %30 = zext i1 %29 to i32
  %31 = load i8, ptr %4, align 1, !tbaa !5, !range !18, !noundef !19
  %32 = trunc i8 %31 to i1
  %33 = zext i1 %32 to i32
  %34 = icmp eq i32 %30, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %22
  store i32 1, ptr %6, align 4
  br label %108

36:                                               ; preds = %22
  %37 = load i8, ptr %4, align 1, !tbaa !5, !range !18, !noundef !19
  %38 = trunc i8 %37 to i1
  %39 = load ptr, ptr %7, align 8, !tbaa !13
  %40 = getelementptr inbounds %struct.b2Joint, ptr %39, i32 0, i32 13
  %41 = zext i1 %38 to i8
  store i8 %41, ptr %40, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %42 = load ptr, ptr %5, align 8, !tbaa !13
  %43 = getelementptr inbounds %struct.b2World, ptr %42, i32 0, i32 4
  %44 = load ptr, ptr %7, align 8, !tbaa !13
  %45 = getelementptr inbounds %struct.b2Joint, ptr %44, i32 0, i32 4
  %46 = getelementptr inbounds [2 x %struct.b2JointEdge], ptr %45, i64 0, i64 0
  %47 = getelementptr inbounds %struct.b2JointEdge, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !20
  %49 = call ptr @b2BodyArray_Get(ptr noundef %43, i32 noundef %48)
  store ptr %49, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %50 = load ptr, ptr %5, align 8, !tbaa !13
  %51 = getelementptr inbounds %struct.b2World, ptr %50, i32 0, i32 4
  %52 = load ptr, ptr %7, align 8, !tbaa !13
  %53 = getelementptr inbounds %struct.b2Joint, ptr %52, i32 0, i32 4
  %54 = getelementptr inbounds [2 x %struct.b2JointEdge], ptr %53, i64 0, i64 1
  %55 = getelementptr inbounds %struct.b2JointEdge, ptr %54, i32 0, i32 0
  %56 = load i32, ptr %55, align 4, !tbaa !20
  %57 = call ptr @b2BodyArray_Get(ptr noundef %51, i32 noundef %56)
  store ptr %57, ptr %9, align 8, !tbaa !13
  %58 = load i8, ptr %4, align 1, !tbaa !5, !range !18, !noundef !19
  %59 = trunc i8 %58 to i1
  br i1 %59, label %60, label %103

60:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %61 = load ptr, ptr %8, align 8, !tbaa !13
  %62 = getelementptr inbounds %struct.b2Body, ptr %61, i32 0, i32 7
  %63 = load i32, ptr %62, align 4, !tbaa !22
  store i32 %63, ptr %10, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %64 = load ptr, ptr %9, align 8, !tbaa !13
  %65 = getelementptr inbounds %struct.b2Body, ptr %64, i32 0, i32 7
  %66 = load i32, ptr %65, align 4, !tbaa !22
  store i32 %66, ptr %11, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %67 = load i32, ptr %10, align 4, !tbaa !24
  %68 = load i32, ptr %11, align 4, !tbaa !24
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %70, label %74

70:                                               ; preds = %60
  %71 = load ptr, ptr %8, align 8, !tbaa !13
  %72 = getelementptr inbounds %struct.b2Body, ptr %71, i32 0, i32 6
  %73 = load i32, ptr %72, align 8, !tbaa !25
  br label %78

74:                                               ; preds = %60
  %75 = load ptr, ptr %9, align 8, !tbaa !13
  %76 = getelementptr inbounds %struct.b2Body, ptr %75, i32 0, i32 6
  %77 = load i32, ptr %76, align 8, !tbaa !25
  br label %78

78:                                               ; preds = %74, %70
  %79 = phi i32 [ %73, %70 ], [ %77, %74 ]
  store i32 %79, ptr %12, align 4, !tbaa !24
  br label %80

80:                                               ; preds = %98, %78
  %81 = load i32, ptr %12, align 4, !tbaa !24
  %82 = icmp ne i32 %81, -1
  br i1 %82, label %83, label %102

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %84 = load ptr, ptr %5, align 8, !tbaa !13
  %85 = getelementptr inbounds %struct.b2World, ptr %84, i32 0, i32 15
  %86 = load i32, ptr %12, align 4, !tbaa !24
  %87 = call ptr @b2ShapeArray_Get(ptr noundef %85, i32 noundef %86)
  store ptr %87, ptr %13, align 8, !tbaa !13
  %88 = load ptr, ptr %13, align 8, !tbaa !13
  %89 = getelementptr inbounds %struct.b2Shape, ptr %88, i32 0, i32 15
  %90 = load i32, ptr %89, align 8, !tbaa !26
  %91 = icmp ne i32 %90, -1
  br i1 %91, label %92, label %98

92:                                               ; preds = %83
  %93 = load ptr, ptr %5, align 8, !tbaa !13
  %94 = getelementptr inbounds %struct.b2World, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %13, align 8, !tbaa !13
  %96 = getelementptr inbounds %struct.b2Shape, ptr %95, i32 0, i32 15
  %97 = load i32, ptr %96, align 8, !tbaa !26
  call void @b2BufferMove(ptr noundef %94, i32 noundef %97)
  br label %98

98:                                               ; preds = %92, %83
  %99 = load ptr, ptr %13, align 8, !tbaa !13
  %100 = getelementptr inbounds %struct.b2Shape, ptr %99, i32 0, i32 3
  %101 = load i32, ptr %100, align 4, !tbaa !32
  store i32 %101, ptr %12, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %80, !llvm.loop !33

102:                                              ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %107

103:                                              ; preds = %36
  %104 = load ptr, ptr %5, align 8, !tbaa !13
  %105 = load ptr, ptr %8, align 8, !tbaa !13
  %106 = load ptr, ptr %9, align 8, !tbaa !13
  call void @b2DestroyContactsBetweenBodies(ptr noundef %104, ptr noundef %105, ptr noundef %106)
  br label %107

107:                                              ; preds = %103, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  store i32 0, ptr %6, align 4
  br label %108

108:                                              ; preds = %107, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %109

109:                                              ; preds = %108, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  %110 = load i32, ptr %6, align 4
  switch i32 %110, label %112 [
    i32 0, label %111
    i32 1, label %111
  ]

111:                                              ; preds = %109, %109
  ret void

112:                                              ; preds = %109
  unreachable
}

declare ptr @b2GetWorldLocked(i32 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2ShapeArray_Get(ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @b2BufferMove(ptr noundef, i32 noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 4}
!10 = !{!"b2JointId", !11, i64 0, !12, i64 4, !12, i64 6}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !6, i64 71}
!16 = !{!"b2Joint", !14, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !7, i64 20, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !17, i64 60, !11, i64 64, !12, i64 68, !6, i64 70, !6, i64 71}
!17 = !{!"float", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !11, i64 0}
!21 = !{!"b2JointEdge", !11, i64 0, !11, i64 4, !11, i64 8}
!22 = !{!23, !11, i64 60}
!23 = !{!"b2Body", !7, i64 0, !14, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !17, i64 88, !17, i64 92, !17, i64 96, !17, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !12, i64 116, !6, i64 118, !6, i64 119, !6, i64 120, !6, i64 121}
!24 = !{!11, !11, i64 0}
!25 = !{!23, !11, i64 56}
!26 = !{!27, !11, i64 88}
!27 = !{!"b2Shape", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !17, i64 40, !11, i64 44, !28, i64 48, !28, i64 64, !29, i64 80, !11, i64 88, !30, i64 96, !14, i64 120, !11, i64 128, !7, i64 132, !12, i64 276, !6, i64 278, !6, i64 279, !6, i64 280, !6, i64 281, !6, i64 282}
!28 = !{!"b2AABB", !29, i64 0, !29, i64 8}
!29 = !{!"b2Vec2", !17, i64 0, !17, i64 4}
!30 = !{!"b2Filter", !31, i64 0, !31, i64 8, !11, i64 16}
!31 = !{!"long", !7, i64 0}
!32 = !{!27, !11, i64 12}
!33 = distinct !{!33, !34}
!34 = !{!"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: nounwind uwtable
declare dso_local ptr @b2GetJointFullId(ptr noundef, i64) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @b2DestroyContactsBetweenBodies(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodyArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @b2Joint_SetCollideConnected(i64 %0, i1 noundef zeroext %1) local_unnamed_addr #0 {
  %.sroa.2.0.extract.shift = lshr i64 %0, 32
  %3 = zext i1 %1 to i8
  %4 = trunc nuw i64 %.sroa.2.0.extract.shift to i32
  %5 = and i32 %4, 65535
  %6 = tail call ptr @b2GetWorldLocked(i32 noundef %5) #3
  %7 = icmp eq ptr %6, null
  br i1 %7, label %.loopexit, label %8

8:                                                ; preds = %2
  %9 = tail call ptr @b2GetJointFullId(ptr noundef nonnull %6, i64 %0)
  %10 = getelementptr inbounds i8, ptr %9, i64 71
  %11 = load i8, ptr %10, align 1, !tbaa !5, !range !14, !noundef !15
  %12 = icmp eq i8 %11, %3
  br i1 %12, label %.loopexit, label %13

13:                                               ; preds = %8
  store i8 %3, ptr %10, align 1, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %6, i64 1032
  %15 = getelementptr inbounds i8, ptr %9, i64 20
  %16 = load i32, ptr %15, align 4, !tbaa !16
  %17 = tail call ptr @b2BodyArray_Get(ptr noundef nonnull %14, i32 noundef %16)
  %18 = getelementptr inbounds i8, ptr %9, i64 32
  %19 = load i32, ptr %18, align 4, !tbaa !16
  %20 = tail call ptr @b2BodyArray_Get(ptr noundef nonnull %14, i32 noundef %19)
  br i1 %1, label %21, label %36

21:                                               ; preds = %13
  %22 = getelementptr inbounds i8, ptr %17, i64 60
  %23 = load i32, ptr %22, align 4, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %20, i64 60
  %25 = load i32, ptr %24, align 4, !tbaa !18
  %26 = icmp slt i32 %23, %25
  %. = select i1 %26, ptr %17, ptr %20
  %.in = getelementptr inbounds i8, ptr %., i64 56
  %.029 = load i32, ptr %.in, align 4, !tbaa !20
  %.not30 = icmp eq i32 %.029, -1
  br i1 %.not30, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %21
  %27 = getelementptr inbounds i8, ptr %6, i64 1256
  %28 = getelementptr inbounds i8, ptr %6, i64 40
  br label %29

29:                                               ; preds = %.lr.ph, %34
  %.031 = phi i32 [ %.029, %.lr.ph ], [ %.0, %34 ]
  %30 = tail call ptr @b2ShapeArray_Get(ptr noundef nonnull %27, i32 noundef %.031)
  %31 = getelementptr inbounds i8, ptr %30, i64 88
  %32 = load i32, ptr %31, align 8, !tbaa !21
  %.not28 = icmp eq i32 %32, -1
  br i1 %.not28, label %34, label %33

33:                                               ; preds = %29
  tail call void @b2BufferMove(ptr noundef nonnull %28, i32 noundef %32)
  br label %34

34:                                               ; preds = %33, %29
  %35 = getelementptr inbounds i8, ptr %30, i64 12
  %.0 = load i32, ptr %35, align 4, !tbaa !20
  %.not = icmp eq i32 %.0, -1
  br i1 %.not, label %.loopexit, label %29, !llvm.loop !27

36:                                               ; preds = %13
  tail call void @b2DestroyContactsBetweenBodies(ptr noundef nonnull %6, ptr noundef %17, ptr noundef %20)
  br label %.loopexit

.loopexit:                                        ; preds = %34, %21, %8, %36, %2
  ret void
}

declare ptr @b2GetWorldLocked(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2ShapeArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @b2BufferMove(ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { inlinehint 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" }
attributes #3 = { 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, !13, i64 71}
!6 = !{!"b2Joint", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !8, i64 20, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !11, i64 60, !10, i64 64, !12, i64 68, !13, i64 70, !13, i64 71}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !10, i64 0}
!17 = !{!"b2JointEdge", !10, i64 0, !10, i64 4, !10, i64 8}
!18 = !{!19, !10, i64 60}
!19 = !{!"b2Body", !8, i64 0, !7, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !12, i64 116, !13, i64 118, !13, i64 119, !13, i64 120, !13, i64 121}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !10, i64 88}
!22 = !{!"b2Shape", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !10, i64 44, !23, i64 48, !23, i64 64, !24, i64 80, !10, i64 88, !25, i64 96, !7, i64 120, !10, i64 128, !8, i64 132, !12, i64 276, !13, i64 278, !13, i64 279, !13, i64 280, !13, i64 281, !13, i64 282}
!23 = !{!"b2AABB", !24, i64 0, !24, i64 8}
!24 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!25 = !{!"b2Filter", !26, i64 0, !26, i64 8, !10, i64 16}
!26 = !{!"long", !8, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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