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

; 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.b2BodyId = type { i32, i16, i16 }
%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.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.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.0, i16, i8, i8, i8, i8, i8 }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Filter = type { i64, i64, i32 }
%union.anon.0 = type { %struct.b2Polygon }
%struct.b2Polygon = type { [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], %struct.b2Vec2, float, i32 }
%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.b2SolverSet = type { %struct.b2BodySimArray, %struct.b2BodyStateArray, %struct.b2JointSimArray, %struct.b2ContactSimArray, %struct.b2IslandSimArray, i32 }
%struct.b2BodySimArray = type { ptr, i32, i32 }
%struct.b2BodyStateArray = type { ptr, i32, i32 }
%struct.b2IslandSimArray = type { ptr, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [66 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @b2GetBodyFullId(ptr noundef, i64) #0

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #2

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

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

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

declare void @b2ValidateSolverSets(ptr noundef) #1

declare ptr @b2GetWorldLocked(i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden void @b2DestroyBodyContacts(ptr noundef, ptr noundef, i1 noundef zeroext) #0

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

declare void @b2DestroyShapeProxy(ptr noundef, ptr noundef) #1

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

declare void @b2UnlinkJoint(ptr noundef, ptr noundef) #1

declare void @b2TransferBody(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @b2TransferJoint(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @b2Body_Disable(i64 %0) #0 {
  %2 = alloca %struct.b2BodyId, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %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 i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store i64 %0, ptr %2, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %16 = getelementptr inbounds %struct.b2BodyId, ptr %2, i32 0, i32 1
  %17 = load i16, ptr %16, align 4, !tbaa !5
  %18 = zext i16 %17 to i32
  %19 = call ptr @b2GetWorldLocked(i32 noundef %18)
  store ptr %19, ptr %3, align 8, !tbaa !11
  %20 = load ptr, ptr %3, align 8, !tbaa !11
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %1
  store i32 1, ptr %4, align 4
  br label %143

23:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %24 = load ptr, ptr %3, align 8, !tbaa !11
  %25 = load i64, ptr %2, align 4
  %26 = call ptr @b2GetBodyFullId(ptr noundef %24, i64 %25)
  store ptr %26, ptr %5, align 8, !tbaa !11
  %27 = load ptr, ptr %5, align 8, !tbaa !11
  %28 = getelementptr inbounds %struct.b2Body, ptr %27, i32 0, i32 2
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %32

31:                                               ; preds = %23
  store i32 1, ptr %4, align 4
  br label %142

32:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  store i8 1, ptr %6, align 1, !tbaa !17
  %33 = load ptr, ptr %3, align 8, !tbaa !11
  %34 = load ptr, ptr %5, align 8, !tbaa !11
  %35 = load i8, ptr %6, align 1, !tbaa !17, !range !18, !noundef !19
  %36 = trunc i8 %35 to i1
  call void @b2DestroyBodyContacts(ptr noundef %33, ptr noundef %34, i1 noundef zeroext %36)
  %37 = load ptr, ptr %3, align 8, !tbaa !11
  %38 = load ptr, ptr %5, align 8, !tbaa !11
  call void @b2RemoveBodyFromIsland(ptr noundef %37, ptr noundef %38)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %39 = load ptr, ptr %5, align 8, !tbaa !11
  %40 = getelementptr inbounds %struct.b2Body, ptr %39, i32 0, i32 6
  %41 = load i32, ptr %40, align 8, !tbaa !20
  store i32 %41, ptr %7, align 4, !tbaa !21
  br label %42

42:                                               ; preds = %45, %32
  %43 = load i32, ptr %7, align 4, !tbaa !21
  %44 = icmp ne i32 %43, -1
  br i1 %44, label %45, label %56

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %46 = load ptr, ptr %3, align 8, !tbaa !11
  %47 = getelementptr inbounds %struct.b2World, ptr %46, i32 0, i32 15
  %48 = load i32, ptr %7, align 4, !tbaa !21
  %49 = call ptr @b2ShapeArray_Get(ptr noundef %47, i32 noundef %48)
  store ptr %49, ptr %8, align 8, !tbaa !11
  %50 = load ptr, ptr %8, align 8, !tbaa !11
  %51 = getelementptr inbounds %struct.b2Shape, ptr %50, i32 0, i32 3
  %52 = load i32, ptr %51, align 4, !tbaa !22
  store i32 %52, ptr %7, align 4, !tbaa !21
  %53 = load ptr, ptr %8, align 8, !tbaa !11
  %54 = load ptr, ptr %3, align 8, !tbaa !11
  %55 = getelementptr inbounds %struct.b2World, ptr %54, i32 0, i32 1
  call void @b2DestroyShapeProxy(ptr noundef %53, ptr noundef %55)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %42, !llvm.loop !28

56:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %57 = load ptr, ptr %3, align 8, !tbaa !11
  %58 = getelementptr inbounds %struct.b2World, ptr %57, i32 0, i32 6
  %59 = load ptr, ptr %5, align 8, !tbaa !11
  %60 = getelementptr inbounds %struct.b2Body, ptr %59, i32 0, i32 2
  %61 = load i32, ptr %60, align 8, !tbaa !13
  %62 = call ptr @b2SolverSetArray_Get(ptr noundef %58, i32 noundef %61)
  store ptr %62, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %63 = load ptr, ptr %3, align 8, !tbaa !11
  %64 = getelementptr inbounds %struct.b2World, ptr %63, i32 0, i32 6
  %65 = call ptr @b2SolverSetArray_Get(ptr noundef %64, i32 noundef 1)
  store ptr %65, ptr %10, align 8, !tbaa !11
  %66 = load ptr, ptr %3, align 8, !tbaa !11
  %67 = load ptr, ptr %10, align 8, !tbaa !11
  %68 = load ptr, ptr %9, align 8, !tbaa !11
  %69 = load ptr, ptr %5, align 8, !tbaa !11
  call void @b2TransferBody(ptr noundef %66, ptr noundef %67, ptr noundef %68, ptr noundef %69)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %70 = load ptr, ptr %5, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct.b2Body, ptr %70, i32 0, i32 9
  %72 = load i32, ptr %71, align 4, !tbaa !30
  store i32 %72, ptr %11, align 4, !tbaa !21
  br label %73

73:                                               ; preds = %138, %136, %56
  %74 = load i32, ptr %11, align 4, !tbaa !21
  %75 = icmp ne i32 %74, -1
  br i1 %75, label %76, label %139

76:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %77 = load i32, ptr %11, align 4, !tbaa !21
  %78 = ashr i32 %77, 1
  store i32 %78, ptr %12, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %79 = load i32, ptr %11, align 4, !tbaa !21
  %80 = and i32 %79, 1
  store i32 %80, ptr %13, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %81 = load ptr, ptr %3, align 8, !tbaa !11
  %82 = getelementptr inbounds %struct.b2World, ptr %81, i32 0, i32 8
  %83 = load i32, ptr %12, align 4, !tbaa !21
  %84 = call ptr @b2JointArray_Get(ptr noundef %82, i32 noundef %83)
  store ptr %84, ptr %14, align 8, !tbaa !11
  %85 = load ptr, ptr %14, align 8, !tbaa !11
  %86 = getelementptr inbounds %struct.b2Joint, ptr %85, i32 0, i32 4
  %87 = load i32, ptr %13, align 4, !tbaa !21
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [2 x %struct.b2JointEdge], ptr %86, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.b2JointEdge, ptr %89, i32 0, i32 2
  %91 = load i32, ptr %90, align 4, !tbaa !31
  store i32 %91, ptr %11, align 4, !tbaa !21
  %92 = load ptr, ptr %14, align 8, !tbaa !11
  %93 = getelementptr inbounds %struct.b2Joint, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 8, !tbaa !33
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %97

96:                                               ; preds = %76
  store i32 4, ptr %4, align 4
  br label %136, !llvm.loop !35

97:                                               ; preds = %76
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %14, align 8, !tbaa !11
  %100 = getelementptr inbounds %struct.b2Joint, ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 8, !tbaa !33
  %102 = load ptr, ptr %9, align 8, !tbaa !11
  %103 = getelementptr inbounds %struct.b2SolverSet, ptr %102, i32 0, i32 5
  %104 = load i32, ptr %103, align 8, !tbaa !36
  %105 = icmp eq i32 %101, %104
  br i1 %105, label %115, label %106

106:                                              ; preds = %98
  %107 = load ptr, ptr %9, align 8, !tbaa !11
  %108 = getelementptr inbounds %struct.b2SolverSet, ptr %107, i32 0, i32 5
  %109 = load i32, ptr %108, align 8, !tbaa !36
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %115, label %111

111:                                              ; preds = %106
  %112 = call i32 @b2InternalAssertFcn(ptr noundef @.str.38, ptr noundef @.str.1, i32 noundef 1598)
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %111
  call void @llvm.trap()
  br label %115

115:                                              ; preds = %114, %111, %106, %98
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  %118 = load ptr, ptr %14, align 8, !tbaa !11
  %119 = getelementptr inbounds %struct.b2Joint, ptr %118, i32 0, i32 6
  %120 = load i32, ptr %119, align 8, !tbaa !39
  %121 = icmp ne i32 %120, -1
  br i1 %121, label %122, label %125

122:                                              ; preds = %117
  %123 = load ptr, ptr %3, align 8, !tbaa !11
  %124 = load ptr, ptr %14, align 8, !tbaa !11
  call void @b2UnlinkJoint(ptr noundef %123, ptr noundef %124)
  br label %125

125:                                              ; preds = %122, %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %126 = load ptr, ptr %3, align 8, !tbaa !11
  %127 = getelementptr inbounds %struct.b2World, ptr %126, i32 0, i32 6
  %128 = load ptr, ptr %14, align 8, !tbaa !11
  %129 = getelementptr inbounds %struct.b2Joint, ptr %128, i32 0, i32 1
  %130 = load i32, ptr %129, align 8, !tbaa !33
  %131 = call ptr @b2SolverSetArray_Get(ptr noundef %127, i32 noundef %130)
  store ptr %131, ptr %15, align 8, !tbaa !11
  %132 = load ptr, ptr %3, align 8, !tbaa !11
  %133 = load ptr, ptr %10, align 8, !tbaa !11
  %134 = load ptr, ptr %15, align 8, !tbaa !11
  %135 = load ptr, ptr %14, align 8, !tbaa !11
  call void @b2TransferJoint(ptr noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef %135)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  store i32 0, ptr %4, align 4
  br label %136

136:                                              ; preds = %125, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %137 = load i32, ptr %4, align 4
  switch i32 %137, label %146 [
    i32 0, label %138
    i32 4, label %73
  ]

138:                                              ; preds = %136
  br label %73, !llvm.loop !35

139:                                              ; preds = %73
  %140 = load ptr, ptr %3, align 8, !tbaa !11
  call void @b2ValidateConnectivity(ptr noundef %140)
  %141 = load ptr, ptr %3, align 8, !tbaa !11
  call void @b2ValidateSolverSets(ptr noundef %141)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  store i32 0, ptr %4, align 4
  br label %142

142:                                              ; preds = %139, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %143

143:                                              ; preds = %142, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  %144 = load i32, ptr %4, align 4
  switch i32 %144, label %146 [
    i32 0, label %145
    i32 1, label %145
  ]

145:                                              ; preds = %143, %143
  ret void

146:                                              ; preds = %143, %136
  unreachable
}

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


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

%struct.b2JointEdge = type { i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [66 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @b2GetBodyFullId(ptr noundef, i64) local_unnamed_addr #0

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #2

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

declare void @b2ValidateSolverSets(ptr noundef) local_unnamed_addr #1

declare ptr @b2GetWorldLocked(i32 noundef) local_unnamed_addr #1

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

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

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

declare void @b2DestroyShapeProxy(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @b2UnlinkJoint(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @b2TransferBody(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @b2TransferJoint(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

6:                                                ; preds = %1
  %7 = tail call ptr @b2GetBodyFullId(ptr noundef nonnull %4, i64 %0)
  %8 = getelementptr inbounds i8, ptr %7, i64 40
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = icmp eq i32 %9, 1
  br i1 %10, label %54, label %11

11:                                               ; preds = %6
  tail call void @b2DestroyBodyContacts(ptr noundef nonnull %4, ptr noundef nonnull %7, i1 noundef zeroext true)
  tail call void @b2RemoveBodyFromIsland(ptr noundef nonnull %4, ptr noundef nonnull %7)
  %12 = getelementptr inbounds i8, ptr %7, i64 56
  %13 = load i32, ptr %12, align 8, !tbaa !14
  %.not51 = icmp eq i32 %13, -1
  br i1 %.not51, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %11
  %14 = getelementptr inbounds i8, ptr %4, i64 1256
  %15 = getelementptr inbounds i8, ptr %4, i64 40
  br label %16

16:                                               ; preds = %.lr.ph, %16
  %.052 = phi i32 [ %13, %.lr.ph ], [ %19, %16 ]
  %17 = tail call ptr @b2ShapeArray_Get(ptr noundef nonnull %14, i32 noundef %.052)
  %18 = getelementptr inbounds i8, ptr %17, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !15
  tail call void @b2DestroyShapeProxy(ptr noundef %17, ptr noundef nonnull %15) #4
  %.not = icmp eq i32 %19, -1
  br i1 %.not, label %._crit_edge, label %16, !llvm.loop !21

._crit_edge:                                      ; preds = %16, %11
  %20 = getelementptr inbounds i8, ptr %4, i64 1072
  %21 = load i32, ptr %8, align 8, !tbaa !5
  %22 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %20, i32 noundef %21)
  %23 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %20, i32 noundef 1)
  tail call void @b2TransferBody(ptr noundef nonnull %4, ptr noundef %23, ptr noundef %22, ptr noundef %7) #4
  %24 = getelementptr inbounds i8, ptr %7, i64 68
  %25 = load i32, ptr %24, align 4, !tbaa !23
  %.not4853 = icmp eq i32 %25, -1
  br i1 %.not4853, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %._crit_edge
  %26 = getelementptr inbounds i8, ptr %4, i64 1112
  %27 = getelementptr inbounds i8, ptr %22, i64 80
  br label %28

28:                                               ; preds = %.lr.ph56, %53
  %.04454 = phi i32 [ %25, %.lr.ph56 ], [ %35, %53 ]
  %29 = ashr i32 %.04454, 1
  %30 = and i32 %.04454, 1
  %31 = tail call ptr @b2JointArray_Get(ptr noundef nonnull %26, i32 noundef %29)
  %32 = getelementptr inbounds i8, ptr %31, i64 20
  %33 = zext nneg i32 %30 to i64
  %34 = getelementptr inbounds [2 x %struct.b2JointEdge], ptr %32, i64 0, i64 %33, i32 2
  %35 = load i32, ptr %34, align 4, !tbaa !24
  %36 = getelementptr inbounds i8, ptr %31, i64 8
  %37 = load i32, ptr %36, align 8, !tbaa !26
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %53, label %39, !llvm.loop !28

39:                                               ; preds = %28
  %40 = load i32, ptr %27, align 8, !tbaa !29
  %41 = icmp eq i32 %37, %40
  %42 = icmp eq i32 %40, 0
  %or.cond = or i1 %41, %42
  br i1 %or.cond, label %46, label %43

43:                                               ; preds = %39
  %44 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.38, ptr noundef nonnull @.str.1, i32 noundef 1598) #4
  %.not49 = icmp eq i32 %44, 0
  br i1 %.not49, label %46, label %45

45:                                               ; preds = %43
  tail call void @llvm.trap()
  unreachable

46:                                               ; preds = %43, %39
  %47 = getelementptr inbounds i8, ptr %31, i64 48
  %48 = load i32, ptr %47, align 8, !tbaa !32
  %.not50 = icmp eq i32 %48, -1
  br i1 %.not50, label %50, label %49

49:                                               ; preds = %46
  tail call void @b2UnlinkJoint(ptr noundef nonnull %4, ptr noundef nonnull %31) #4
  br label %50

50:                                               ; preds = %49, %46
  %51 = load i32, ptr %36, align 8, !tbaa !26
  %52 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %20, i32 noundef %51)
  tail call void @b2TransferJoint(ptr noundef nonnull %4, ptr noundef %23, ptr noundef %52, ptr noundef nonnull %31) #4
  br label %53

53:                                               ; preds = %28, %50
  %.not48 = icmp eq i32 %35, -1
  br i1 %.not48, label %._crit_edge57, label %28

._crit_edge57:                                    ; preds = %53, %._crit_edge
  tail call void @b2ValidateConnectivity(ptr noundef nonnull %4) #4
  tail call void @b2ValidateSolverSets(ptr noundef nonnull %4) #4
  br label %54

54:                                               ; preds = %._crit_edge57, %6, %1
  ret void
}

declare void @b2ValidateConnectivity(ptr 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 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #3 = { 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 #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, !10, i64 40}
!6 = !{!"b2Body", !7, i64 0, !9, 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}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!6, !10, i64 56}
!15 = !{!16, !10, i64 12}
!16 = !{!"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, !17, i64 48, !17, i64 64, !18, i64 80, !10, i64 88, !19, i64 96, !9, i64 120, !10, i64 128, !7, i64 132, !12, i64 276, !13, i64 278, !13, i64 279, !13, i64 280, !13, i64 281, !13, i64 282}
!17 = !{!"b2AABB", !18, i64 0, !18, i64 8}
!18 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!19 = !{!"b2Filter", !20, i64 0, !20, i64 8, !10, i64 16}
!20 = !{!"long", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!6, !10, i64 68}
!24 = !{!25, !10, i64 8}
!25 = !{!"b2JointEdge", !10, i64 0, !10, i64 4, !10, i64 8}
!26 = !{!27, !10, i64 8}
!27 = !{!"b2Joint", !9, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !7, 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}
!28 = distinct !{!28, !22}
!29 = !{!30, !10, i64 80}
!30 = !{!"b2SolverSet", !31, i64 0, !31, i64 16, !31, i64 32, !31, i64 48, !31, i64 64, !10, i64 80}
!31 = !{!"", !9, i64 0, !10, i64 8, !10, i64 12}
!32 = !{!27, !10, i64 48}


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