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

; 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.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.b2JointSimArray = type { ptr, i32, i32 }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2IslandSimArray = type { ptr, 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 }
%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.b2JointSim = type { i32, i32, i32, i32, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, %union.anon.0 }
%union.anon.0 = type { %struct.b2PrismaticJoint }
%struct.b2PrismaticJoint = type { %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, %struct.b2Softness, i8, i8, i8 }
%struct.b2Softness = type { float, float, float }

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [28 x i8], align 1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

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

declare void @b2AddJointToGraph(ptr noundef, ptr noundef, ptr noundef) #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2TransferJoint(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #5 {
  %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 i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %4
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = icmp ne ptr %19, %20
  br i1 %21, label %26, label %22

22:                                               ; preds = %18
  %23 = call i32 @b2InternalAssertFcn(ptr noundef @.str.34, ptr noundef @.str.1, i32 noundef 560)
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  call void @llvm.trap()
  br label %26

26:                                               ; preds = %25, %22, %18
  br label %27

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.b2Joint, ptr %28, i32 0, i32 3
  %30 = load i32, ptr %29, align 8, !tbaa !9
  store i32 %30, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.b2Joint, ptr %31, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !16
  store i32 %33, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.b2SolverSet, ptr %34, i32 0, i32 5
  %36 = load i32, ptr %35, align 8, !tbaa !17
  %37 = icmp eq i32 %36, 2
  br i1 %37, label %38, label %63

38:                                               ; preds = %27
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %10, align 4, !tbaa !15
  %41 = icmp sle i32 0, %40
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = load i32, ptr %10, align 4, !tbaa !15
  %44 = icmp slt i32 %43, 12
  br i1 %44, label %49, label %45

45:                                               ; preds = %42, %39
  %46 = call i32 @b2InternalAssertFcn(ptr noundef @.str.24, ptr noundef @.str.1, i32 noundef 569)
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  call void @llvm.trap()
  br label %49

49:                                               ; preds = %48, %45, %42
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2World, ptr %52, i32 0, i32 2
  %54 = getelementptr inbounds %struct.b2ConstraintGraph, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds [12 x %struct.b2GraphColor], ptr %54, i64 0, i64 0
  %56 = load i32, ptr %10, align 4, !tbaa !15
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %struct.b2GraphColor, ptr %55, i64 %57
  store ptr %58, ptr %12, align 8, !tbaa !5
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.b2GraphColor, ptr %59, i32 0, i32 2
  %61 = load i32, ptr %9, align 4, !tbaa !15
  %62 = call ptr @b2JointSimArray_Get(ptr noundef %60, i32 noundef %61)
  store ptr %62, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %78

63:                                               ; preds = %27
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %10, align 4, !tbaa !15
  %66 = icmp eq i32 %65, -1
  br i1 %66, label %71, label %67

67:                                               ; preds = %64
  %68 = call i32 @b2InternalAssertFcn(ptr noundef @.str.35, ptr noundef @.str.1, i32 noundef 576)
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  call void @llvm.trap()
  br label %71

71:                                               ; preds = %70, %67, %64
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.b2SolverSet, ptr %74, i32 0, i32 2
  %76 = load i32, ptr %9, align 4, !tbaa !15
  %77 = call ptr @b2JointSimArray_Get(ptr noundef %75, i32 noundef %76)
  store ptr %77, ptr %11, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %73, %51
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.b2SolverSet, ptr %79, i32 0, i32 5
  %81 = load i32, ptr %80, align 8, !tbaa !17
  %82 = icmp eq i32 %81, 2
  br i1 %82, label %83, label %89

83:                                               ; preds = %78
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  call void @b2AddJointToGraph(ptr noundef %84, ptr noundef %85, ptr noundef %86)
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.b2Joint, ptr %87, i32 0, i32 1
  store i32 2, ptr %88, align 8, !tbaa !20
  br label %108

89:                                               ; preds = %78
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.b2SolverSet, ptr %90, i32 0, i32 5
  %92 = load i32, ptr %91, align 8, !tbaa !17
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.b2Joint, ptr %93, i32 0, i32 1
  store i32 %92, ptr %94, align 8, !tbaa !20
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.b2SolverSet, ptr %95, i32 0, i32 2
  %97 = getelementptr inbounds %struct.b2JointSimArray, ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 8, !tbaa !21
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.b2Joint, ptr %99, i32 0, i32 3
  store i32 %98, ptr %100, align 8, !tbaa !9
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.b2Joint, ptr %101, i32 0, i32 2
  store i32 -1, ptr %102, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.b2SolverSet, ptr %103, i32 0, i32 2
  %105 = call ptr @b2JointSimArray_Add(ptr noundef %104)
  store ptr %105, ptr %13, align 8, !tbaa !5
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %106, ptr align 4 %107, i64 172, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %108

108:                                              ; preds = %89, %83
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.b2SolverSet, ptr %109, i32 0, i32 5
  %111 = load i32, ptr %110, align 8, !tbaa !17
  %112 = icmp eq i32 %111, 2
  br i1 %112, label %113, label %127

113:                                              ; preds = %108
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.b2Joint, ptr %115, i32 0, i32 4
  %117 = getelementptr inbounds [2 x %struct.b2JointEdge], ptr %116, i64 0, i64 0
  %118 = getelementptr inbounds %struct.b2JointEdge, ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 4, !tbaa !22
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.b2Joint, ptr %120, i32 0, i32 4
  %122 = getelementptr inbounds [2 x %struct.b2JointEdge], ptr %121, i64 0, i64 1
  %123 = getelementptr inbounds %struct.b2JointEdge, ptr %122, i32 0, i32 0
  %124 = load i32, ptr %123, align 4, !tbaa !22
  %125 = load i32, ptr %10, align 4, !tbaa !15
  %126 = load i32, ptr %9, align 4, !tbaa !15
  call void @b2RemoveJointFromGraph(ptr noundef %114, i32 noundef %119, i32 noundef %124, i32 noundef %125, i32 noundef %126)
  br label %153

127:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.b2SolverSet, ptr %128, i32 0, i32 2
  %130 = load i32, ptr %9, align 4, !tbaa !15
  %131 = call i32 @b2JointSimArray_RemoveSwap(ptr noundef %129, i32 noundef %130)
  store i32 %131, ptr %14, align 4, !tbaa !15
  %132 = load i32, ptr %14, align 4, !tbaa !15
  %133 = icmp ne i32 %132, -1
  br i1 %133, label %134, label %152

134:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.b2SolverSet, ptr %135, i32 0, i32 2
  %137 = getelementptr inbounds %struct.b2JointSimArray, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !24
  %139 = load i32, ptr %9, align 4, !tbaa !15
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.b2JointSim, ptr %138, i64 %140
  store ptr %141, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.b2JointSim, ptr %142, i32 0, i32 0
  %144 = load i32, ptr %143, align 4, !tbaa !25
  store i32 %144, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.b2World, ptr %145, i32 0, i32 8
  %147 = load i32, ptr %16, align 4, !tbaa !15
  %148 = call ptr @b2JointArray_Get(ptr noundef %146, i32 noundef %147)
  store ptr %148, ptr %17, align 8, !tbaa !5
  %149 = load i32, ptr %9, align 4, !tbaa !15
  %150 = load ptr, ptr %17, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.b2Joint, ptr %150, i32 0, i32 3
  store i32 %149, ptr %151, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %152

152:                                              ; preds = %134, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %153

153:                                              ; preds = %152, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret void
}

declare void @b2RemoveJointFromGraph(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
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 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 = { 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/C++ TBAA"}
!9 = !{!10, !11, i64 16}
!10 = !{!"b2Joint", !6, 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, !12, i64 60, !11, i64 64, !13, i64 68, !14, i64 70, !14, i64 71}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !11, i64 12}
!17 = !{!18, !11, i64 80}
!18 = !{!"b2SolverSet", !19, i64 0, !19, i64 16, !19, i64 32, !19, i64 48, !19, i64 64, !11, i64 80}
!19 = !{!"", !6, i64 0, !11, i64 8, !11, i64 12}
!20 = !{!10, !11, i64 8}
!21 = !{!18, !11, i64 40}
!22 = !{!23, !11, i64 0}
!23 = !{!"b2JointEdge", !11, i64 0, !11, i64 4, !11, i64 8}
!24 = !{!18, !6, i64 32}
!25 = !{!26, !11, i64 0}
!26 = !{!"b2JointSim", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !27, i64 16, !27, i64 24, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !7, i64 48}
!27 = !{!"b2Vec2", !12, i64 0, !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"

%struct.b2GraphColor = type { %struct.b2BitSet, %struct.b2ContactSimArray, %struct.b2JointSimArray, %union.anon }
%struct.b2BitSet = type { ptr, i32, i32 }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon = type { ptr }
%struct.b2JointSim = type { i32, i32, i32, i32, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, %union.anon.0 }
%struct.b2Vec2 = type { float, float }
%union.anon.0 = type { %struct.b2PrismaticJoint }
%struct.b2PrismaticJoint = type { %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, %struct.b2Softness, i8, i8, i8 }
%struct.b2Softness = type { float, float, float }

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 @b2JointArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2TransferJoint(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #4 {
  %.not = icmp eq ptr %1, %2
  br i1 %.not, label %5, label %8

5:                                                ; preds = %4
  %6 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.34, ptr noundef nonnull @.str.1, i32 noundef 560) #5
  %.not44 = icmp eq i32 %6, 0
  br i1 %.not44, label %8, label %7

7:                                                ; preds = %5
  tail call void @llvm.trap()
  unreachable

8:                                                ; preds = %4, %5
  %9 = getelementptr inbounds i8, ptr %3, i64 16
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %3, i64 12
  %12 = load i32, ptr %11, align 4, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %2, i64 80
  %14 = load i32, ptr %13, align 8, !tbaa !15
  %15 = icmp eq i32 %14, 2
  br i1 %15, label %16, label %24

16:                                               ; preds = %8
  %or.cond = icmp ult i32 %12, 12
  br i1 %or.cond, label %20, label %17

17:                                               ; preds = %16
  %18 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, i32 noundef 569) #5
  %.not46 = icmp eq i32 %18, 0
  br i1 %.not46, label %20, label %19

19:                                               ; preds = %17
  tail call void @llvm.trap()
  unreachable

20:                                               ; preds = %16, %17
  %21 = getelementptr inbounds i8, ptr %0, i64 336
  %22 = sext i32 %12 to i64
  %23 = getelementptr inbounds %struct.b2GraphColor, ptr %21, i64 %22, i32 2
  br label %31

24:                                               ; preds = %8
  %25 = icmp eq i32 %12, -1
  br i1 %25, label %29, label %26

26:                                               ; preds = %24
  %27 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.35, ptr noundef nonnull @.str.1, i32 noundef 576) #5
  %.not45 = icmp eq i32 %27, 0
  br i1 %.not45, label %29, label %28

28:                                               ; preds = %26
  tail call void @llvm.trap()
  unreachable

29:                                               ; preds = %26, %24
  %30 = getelementptr inbounds i8, ptr %2, i64 32
  br label %31

31:                                               ; preds = %29, %20
  %.sink = phi ptr [ %30, %29 ], [ %23, %20 ]
  %32 = tail call ptr @b2JointSimArray_Get(ptr noundef nonnull %.sink, i32 noundef %10)
  %33 = getelementptr inbounds i8, ptr %1, i64 80
  %34 = load i32, ptr %33, align 8, !tbaa !15
  %35 = icmp eq i32 %34, 2
  br i1 %35, label %36, label %38

36:                                               ; preds = %31
  tail call void @b2AddJointToGraph(ptr noundef %0, ptr noundef %32, ptr noundef nonnull %3) #5
  %37 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 2, ptr %37, align 8, !tbaa !18
  br label %44

38:                                               ; preds = %31
  %39 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %34, ptr %39, align 8, !tbaa !18
  %40 = getelementptr inbounds i8, ptr %1, i64 32
  %41 = getelementptr inbounds i8, ptr %1, i64 40
  %42 = load i32, ptr %41, align 8, !tbaa !19
  store i32 %42, ptr %9, align 8, !tbaa !5
  store i32 -1, ptr %11, align 4, !tbaa !14
  %43 = tail call ptr @b2JointSimArray_Add(ptr noundef nonnull %40)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(172) %43, ptr noundef nonnull align 4 dereferenceable(172) %32, i64 172, i1 false)
  br label %44

44:                                               ; preds = %38, %36
  %45 = load i32, ptr %13, align 8, !tbaa !15
  %46 = icmp eq i32 %45, 2
  br i1 %46, label %47, label %52

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %3, i64 20
  %49 = load i32, ptr %48, align 4, !tbaa !20
  %50 = getelementptr inbounds i8, ptr %3, i64 32
  %51 = load i32, ptr %50, align 4, !tbaa !20
  tail call void @b2RemoveJointFromGraph(ptr noundef %0, i32 noundef %49, i32 noundef %51, i32 noundef %12, i32 noundef %10) #5
  br label %63

52:                                               ; preds = %44
  %53 = getelementptr inbounds i8, ptr %2, i64 32
  %54 = tail call i32 @b2JointSimArray_RemoveSwap(ptr noundef nonnull %53, i32 noundef %10)
  %.not47 = icmp eq i32 %54, -1
  br i1 %.not47, label %63, label %55

55:                                               ; preds = %52
  %56 = load ptr, ptr %53, align 8, !tbaa !22
  %57 = sext i32 %10 to i64
  %58 = getelementptr inbounds %struct.b2JointSim, ptr %56, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !23
  %60 = getelementptr inbounds i8, ptr %0, i64 1112
  %61 = tail call ptr @b2JointArray_Get(ptr noundef nonnull %60, i32 noundef %59)
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  store i32 %10, ptr %62, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %52, %55, %47
  ret void
}

declare void @b2RemoveJointFromGraph(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 16}
!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 = !{!6, !10, i64 12}
!15 = !{!16, !10, i64 80}
!16 = !{!"b2SolverSet", !17, i64 0, !17, i64 16, !17, i64 32, !17, i64 48, !17, i64 64, !10, i64 80}
!17 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12}
!18 = !{!6, !10, i64 8}
!19 = !{!16, !10, i64 40}
!20 = !{!21, !10, i64 0}
!21 = !{!"b2JointEdge", !10, i64 0, !10, i64 4, !10, i64 8}
!22 = !{!16, !7, i64 32}
!23 = !{!24, !10, i64 0}
!24 = !{!"b2JointSim", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !25, i64 16, !25, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !8, i64 48}
!25 = !{!"b2Vec2", !11, i64 0, !11, i64 4}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass