; 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.b2WorldId = type { i16, i16 }
%struct.b2JointPair = type { ptr, ptr }
%struct.b2DistanceJoint = type { float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Softness, float, i8, i8, i8 }
%struct.b2Vec2 = type { float, float }
%struct.b2Softness = type { float, float, float }
%struct.b2DistanceJointDef = type { %struct.b2BodyId, %struct.b2BodyId, %struct.b2Vec2, %struct.b2Vec2, float, i8, float, float, i8, float, float, i8, float, float, i8, ptr, i32 }
%struct.b2BodyId = type { i32, i16, i16 }
%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.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.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 }

@b2_lengthUnitsPerMeter = external global float, align 4
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [52 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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.start.p0(i64 immarg, ptr nocapture) #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @b2CreateDistanceJoint(i32 %0, ptr noundef %1) #5 {
  %3 = alloca %struct.b2JointId, align 4
  %4 = alloca %struct.b2WorldId, align 2
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.b2JointPair, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.b2DistanceJoint, align 4
  store i32 %0, ptr %4, align 2
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %2
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %14, i32 0, i32 16
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = icmp eq i32 %16, 1152023
  br i1 %17, label %22, label %18

18:                                               ; preds = %13
  %19 = call i32 @b2InternalAssertFcn(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 347)
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %22

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

22:                                               ; preds = %21, %18, %13
  br label %23

23:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %24 = load i32, ptr %4, align 2
  %25 = call ptr @b2GetWorldFromId(i32 %24)
  store ptr %25, ptr %6, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.b2World, ptr %27, i32 0, i32 61
  %29 = load i8, ptr %28, align 1, !tbaa !17, !range !29, !noundef !30
  %30 = trunc i8 %29 to i1
  %31 = zext i1 %30 to i32
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %37, label %33

33:                                               ; preds = %26
  %34 = call i32 @b2InternalAssertFcn(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 350)
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  call void @llvm.trap()
  br label %37

37:                                               ; preds = %36, %33, %26
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.b2World, ptr %40, i32 0, i32 61
  %42 = load i8, ptr %41, align 1, !tbaa !17, !range !29, !noundef !30
  %43 = trunc i8 %42 to i1
  br i1 %43, label %44, label %48

44:                                               ; preds = %39
  %45 = getelementptr inbounds %struct.b2JointId, ptr %3, i32 0, i32 0
  store i32 0, ptr %45, align 4, !tbaa !31
  %46 = getelementptr inbounds %struct.b2JointId, ptr %3, i32 0, i32 1
  store i16 0, ptr %46, align 4, !tbaa !33
  %47 = getelementptr inbounds %struct.b2JointId, ptr %3, i32 0, i32 2
  store i16 0, ptr %47, align 2, !tbaa !34
  store i32 1, ptr %7, align 4
  br label %242

48:                                               ; preds = %39
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %50, i32 0, i32 0
  %52 = load i64, ptr %51, align 8
  %53 = call zeroext i1 @b2Body_IsValid(i64 %52)
  br i1 %53, label %58, label %54

54:                                               ; preds = %49
  %55 = call i32 @b2InternalAssertFcn(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 357)
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  call void @llvm.trap()
  br label %58

58:                                               ; preds = %57, %54, %49
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %62, i32 0, i32 1
  %64 = load i64, ptr %63, align 8
  %65 = call zeroext i1 @b2Body_IsValid(i64 %64)
  br i1 %65, label %70, label %66

66:                                               ; preds = %61
  %67 = call i32 @b2InternalAssertFcn(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 358)
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %70

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

70:                                               ; preds = %69, %66, %61
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %74, i32 0, i32 4
  %76 = load float, ptr %75, align 8, !tbaa !35
  %77 = call zeroext i1 @b2IsValidFloat(float noundef %76)
  br i1 %77, label %78, label %83

78:                                               ; preds = %73
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %79, i32 0, i32 4
  %81 = load float, ptr %80, align 8, !tbaa !35
  %82 = fcmp ogt float %81, 0.000000e+00
  br i1 %82, label %87, label %83

83:                                               ; preds = %78, %73
  %84 = call i32 @b2InternalAssertFcn(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 359)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %83
  call void @llvm.trap()
  br label %87

87:                                               ; preds = %86, %83, %78
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %91, i32 0, i32 0
  %93 = load i64, ptr %92, align 8
  %94 = call ptr @b2GetBodyFullId(ptr noundef %90, i64 %93)
  store ptr %94, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %96, i32 0, i32 1
  %98 = load i64, ptr %97, align 8
  %99 = call ptr @b2GetBodyFullId(ptr noundef %95, i64 %98)
  store ptr %99, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %103, i32 0, i32 15
  %105 = load ptr, ptr %104, align 8, !tbaa !36
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %106, i32 0, i32 14
  %108 = load i8, ptr %107, align 8, !tbaa !37, !range !29, !noundef !30
  %109 = trunc i8 %108 to i1
  %110 = call { ptr, ptr } @b2CreateJoint(ptr noundef %100, ptr noundef %101, ptr noundef %102, ptr noundef %105, float noundef 1.000000e+00, i32 noundef 0, i1 noundef zeroext %109)
  %111 = getelementptr inbounds { ptr, ptr }, ptr %10, i32 0, i32 0
  %112 = extractvalue { ptr, ptr } %110, 0
  store ptr %112, ptr %111, align 8
  %113 = getelementptr inbounds { ptr, ptr }, ptr %10, i32 0, i32 1
  %114 = extractvalue { ptr, ptr } %110, 1
  store ptr %114, ptr %113, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %115 = getelementptr inbounds %struct.b2JointPair, ptr %10, i32 0, i32 1
  %116 = load ptr, ptr %115, align 8, !tbaa !38
  store ptr %116, ptr %11, align 8, !tbaa !5
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.b2JointSim, ptr %117, i32 0, i32 3
  store i32 0, ptr %118, align 4, !tbaa !40
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.b2JointSim, ptr %119, i32 0, i32 4
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %121, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %120, ptr align 8 %122, i64 8, i1 false), !tbaa.struct !42
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.b2JointSim, ptr %123, i32 0, i32 5
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %125, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %124, ptr align 8 %126, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.start.p0(i64 96, ptr %12) #7
  call void @llvm.memset.p0.i64(ptr align 4 %12, i8 0, i64 96, i1 false)
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.b2JointSim, ptr %127, i32 0, i32 10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %128, ptr align 4 %12, i64 96, i1 false), !tbaa.struct !44
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %129, i32 0, i32 4
  %131 = load float, ptr %130, align 8, !tbaa !35
  %132 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !43
  %133 = fmul float 0x3F747AE140000000, %132
  %134 = call float @b2MaxFloat(float noundef %131, float noundef %133)
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.b2JointSim, ptr %135, i32 0, i32 10
  %137 = getelementptr inbounds %struct.b2DistanceJoint, ptr %136, i32 0, i32 0
  store float %134, ptr %137, align 4, !tbaa !47
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %138, i32 0, i32 6
  %140 = load float, ptr %139, align 8, !tbaa !48
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.b2JointSim, ptr %141, i32 0, i32 10
  %143 = getelementptr inbounds %struct.b2DistanceJoint, ptr %142, i32 0, i32 1
  store float %140, ptr %143, align 4, !tbaa !47
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %144, i32 0, i32 7
  %146 = load float, ptr %145, align 4, !tbaa !49
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.b2JointSim, ptr %147, i32 0, i32 10
  %149 = getelementptr inbounds %struct.b2DistanceJoint, ptr %148, i32 0, i32 2
  store float %146, ptr %149, align 4, !tbaa !47
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %150, i32 0, i32 9
  %152 = load float, ptr %151, align 4, !tbaa !50
  %153 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !43
  %154 = fmul float 0x3F747AE140000000, %153
  %155 = call float @b2MaxFloat(float noundef %152, float noundef %154)
  %156 = load ptr, ptr %11, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.b2JointSim, ptr %156, i32 0, i32 10
  %158 = getelementptr inbounds %struct.b2DistanceJoint, ptr %157, i32 0, i32 3
  store float %155, ptr %158, align 4, !tbaa !47
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %159, i32 0, i32 9
  %161 = load float, ptr %160, align 4, !tbaa !50
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %162, i32 0, i32 10
  %164 = load float, ptr %163, align 8, !tbaa !51
  %165 = call float @b2MaxFloat(float noundef %161, float noundef %164)
  %166 = load ptr, ptr %11, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.b2JointSim, ptr %166, i32 0, i32 10
  %168 = getelementptr inbounds %struct.b2DistanceJoint, ptr %167, i32 0, i32 4
  store float %165, ptr %168, align 4, !tbaa !47
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %169, i32 0, i32 12
  %171 = load float, ptr %170, align 8, !tbaa !52
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.b2JointSim, ptr %172, i32 0, i32 10
  %174 = getelementptr inbounds %struct.b2DistanceJoint, ptr %173, i32 0, i32 5
  store float %171, ptr %174, align 4, !tbaa !47
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %175, i32 0, i32 13
  %177 = load float, ptr %176, align 4, !tbaa !53
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.b2JointSim, ptr %178, i32 0, i32 10
  %180 = getelementptr inbounds %struct.b2DistanceJoint, ptr %179, i32 0, i32 6
  store float %177, ptr %180, align 4, !tbaa !47
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %181, i32 0, i32 5
  %183 = load i8, ptr %182, align 4, !tbaa !54, !range !29, !noundef !30
  %184 = trunc i8 %183 to i1
  %185 = load ptr, ptr %11, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.b2JointSim, ptr %185, i32 0, i32 10
  %187 = getelementptr inbounds %struct.b2DistanceJoint, ptr %186, i32 0, i32 18
  %188 = zext i1 %184 to i8
  store i8 %188, ptr %187, align 4, !tbaa !47
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %189, i32 0, i32 8
  %191 = load i8, ptr %190, align 8, !tbaa !55, !range !29, !noundef !30
  %192 = trunc i8 %191 to i1
  %193 = load ptr, ptr %11, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.b2JointSim, ptr %193, i32 0, i32 10
  %195 = getelementptr inbounds %struct.b2DistanceJoint, ptr %194, i32 0, i32 19
  %196 = zext i1 %192 to i8
  store i8 %196, ptr %195, align 1, !tbaa !47
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %197, i32 0, i32 11
  %199 = load i8, ptr %198, align 4, !tbaa !56, !range !29, !noundef !30
  %200 = trunc i8 %199 to i1
  %201 = load ptr, ptr %11, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.b2JointSim, ptr %201, i32 0, i32 10
  %203 = getelementptr inbounds %struct.b2DistanceJoint, ptr %202, i32 0, i32 20
  %204 = zext i1 %200 to i8
  store i8 %204, ptr %203, align 2, !tbaa !47
  %205 = load ptr, ptr %11, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.b2JointSim, ptr %205, i32 0, i32 10
  %207 = getelementptr inbounds %struct.b2DistanceJoint, ptr %206, i32 0, i32 7
  store float 0.000000e+00, ptr %207, align 4, !tbaa !47
  %208 = load ptr, ptr %11, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.b2JointSim, ptr %208, i32 0, i32 10
  %210 = getelementptr inbounds %struct.b2DistanceJoint, ptr %209, i32 0, i32 8
  store float 0.000000e+00, ptr %210, align 4, !tbaa !47
  %211 = load ptr, ptr %11, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.b2JointSim, ptr %211, i32 0, i32 10
  %213 = getelementptr inbounds %struct.b2DistanceJoint, ptr %212, i32 0, i32 9
  store float 0.000000e+00, ptr %213, align 4, !tbaa !47
  %214 = load ptr, ptr %11, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.b2JointSim, ptr %214, i32 0, i32 10
  %216 = getelementptr inbounds %struct.b2DistanceJoint, ptr %215, i32 0, i32 10
  store float 0.000000e+00, ptr %216, align 4, !tbaa !47
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.b2DistanceJointDef, ptr %217, i32 0, i32 14
  %219 = load i8, ptr %218, align 8, !tbaa !37, !range !29, !noundef !30
  %220 = trunc i8 %219 to i1
  %221 = zext i1 %220 to i32
  %222 = icmp eq i32 %221, 0
  br i1 %222, label %223, label %227

223:                                              ; preds = %89
  %224 = load ptr, ptr %6, align 8, !tbaa !5
  %225 = load ptr, ptr %8, align 8, !tbaa !5
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  call void @b2DestroyContactsBetweenBodies(ptr noundef %224, ptr noundef %225, ptr noundef %226)
  br label %227

227:                                              ; preds = %223, %89
  %228 = getelementptr inbounds %struct.b2JointId, ptr %3, i32 0, i32 0
  %229 = load ptr, ptr %11, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.b2JointSim, ptr %229, i32 0, i32 0
  %231 = load i32, ptr %230, align 4, !tbaa !57
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %228, align 4, !tbaa !31
  %233 = getelementptr inbounds %struct.b2JointId, ptr %3, i32 0, i32 1
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.b2World, ptr %234, i32 0, i32 59
  %236 = load i16, ptr %235, align 4, !tbaa !58
  store i16 %236, ptr %233, align 4, !tbaa !33
  %237 = getelementptr inbounds %struct.b2JointId, ptr %3, i32 0, i32 2
  %238 = getelementptr inbounds %struct.b2JointPair, ptr %10, i32 0, i32 0
  %239 = load ptr, ptr %238, align 8, !tbaa !59
  %240 = getelementptr inbounds %struct.b2Joint, ptr %239, i32 0, i32 11
  %241 = load i16, ptr %240, align 4, !tbaa !60
  store i16 %241, ptr %237, align 2, !tbaa !34
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 96, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %242

242:                                              ; preds = %227, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %243 = load i64, ptr %3, align 4
  ret i64 %243
}

declare ptr @b2GetWorldFromId(i32) #3

declare zeroext i1 @b2Body_IsValid(i64) #3

declare zeroext i1 @b2IsValidFloat(float noundef) #3

declare ptr @b2GetBodyFullId(ptr noundef, i64) #3

; Function Attrs: nounwind uwtable
declare hidden { ptr, ptr } @b2CreateJoint(ptr noundef, ptr noundef, ptr noundef, ptr noundef, float noundef, i32 noundef, i1 noundef zeroext) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2MaxFloat(float noundef, float noundef) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 88}
!10 = !{!"b2DistanceJointDef", !11, i64 0, !11, i64 8, !14, i64 16, !14, i64 24, !15, i64 32, !16, i64 36, !15, i64 40, !15, i64 44, !16, i64 48, !15, i64 52, !15, i64 56, !16, i64 60, !15, i64 64, !15, i64 68, !16, i64 72, !6, i64 80, !12, i64 88}
!11 = !{!"b2BodyId", !12, i64 0, !13, i64 4, !13, i64 6}
!12 = !{!"int", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"b2Vec2", !15, i64 0, !15, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!18, !16, i64 1799}
!18 = !{!"b2World", !19, i64 0, !21, i64 40, !24, i64 336, !25, i64 1008, !20, i64 1032, !25, i64 1048, !20, i64 1072, !25, i64 1088, !20, i64 1112, !25, i64 1128, !20, i64 1152, !25, i64 1168, !20, i64 1192, !25, i64 1208, !25, i64 1232, !20, i64 1256, !20, i64 1272, !20, i64 1288, !20, i64 1304, !20, i64 1320, !20, i64 1336, !20, i64 1352, !20, i64 1368, !7, i64 1384, !7, i64 1416, !12, i64 1448, !20, i64 1456, !26, i64 1472, !26, i64 1488, !26, i64 1504, !26, i64 1520, !27, i64 1536, !12, i64 1544, !14, i64 1548, !15, i64 1556, !15, i64 1560, !15, i64 1564, !15, i64 1568, !15, i64 1572, !15, i64 1576, !15, i64 1580, !15, i64 1584, !6, i64 1592, !6, i64 1600, !13, i64 1608, !28, i64 1612, !6, i64 1704, !6, i64 1712, !6, i64 1720, !6, i64 1728, !12, i64 1736, !6, i64 1744, !6, i64 1752, !6, i64 1760, !6, i64 1768, !6, i64 1776, !15, i64 1784, !12, i64 1788, !12, i64 1792, !13, i64 1796, !16, i64 1798, !16, i64 1799, !16, i64 1800, !16, i64 1801, !16, i64 1802, !16, i64 1803}
!19 = !{!"b2ArenaAllocator", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !20, i64 24}
!20 = !{!"", !6, i64 0, !12, i64 8, !12, i64 12}
!21 = !{!"b2BroadPhase", !7, i64 0, !12, i64 216, !22, i64 224, !20, i64 240, !6, i64 256, !6, i64 264, !12, i64 272, !23, i64 276, !22, i64 280}
!22 = !{!"b2HashSet", !6, i64 0, !12, i64 8, !12, i64 12}
!23 = !{!"b2AtomicInt", !12, i64 0}
!24 = !{!"b2ConstraintGraph", !7, i64 0}
!25 = !{!"b2IdPool", !20, i64 0, !12, i64 16}
!26 = !{!"b2BitSet", !6, i64 0, !12, i64 8, !12, i64 12}
!27 = !{!"long", !7, i64 0}
!28 = !{!"b2Profile", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !15, i64 48, !15, i64 52, !15, i64 56, !15, i64 60, !15, i64 64, !15, i64 68, !15, i64 72, !15, i64 76, !15, i64 80, !15, i64 84}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!32, !12, i64 0}
!32 = !{!"b2JointId", !12, i64 0, !13, i64 4, !13, i64 6}
!33 = !{!32, !13, i64 4}
!34 = !{!32, !13, i64 6}
!35 = !{!10, !15, i64 32}
!36 = !{!10, !6, i64 80}
!37 = !{!10, !16, i64 72}
!38 = !{!39, !6, i64 8}
!39 = !{!"b2JointPair", !6, i64 0, !6, i64 8}
!40 = !{!41, !12, i64 12}
!41 = !{!"b2JointSim", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !14, i64 16, !14, i64 24, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !7, i64 48}
!42 = !{i64 0, i64 4, !43, i64 4, i64 4, !43}
!43 = !{!15, !15, i64 0}
!44 = !{i64 0, i64 4, !43, i64 4, i64 4, !43, i64 8, i64 4, !43, i64 12, i64 4, !43, i64 16, i64 4, !43, i64 20, i64 4, !43, i64 24, i64 4, !43, i64 28, i64 4, !43, i64 32, i64 4, !43, i64 36, i64 4, !43, i64 40, i64 4, !43, i64 44, i64 4, !45, i64 48, i64 4, !45, i64 52, i64 4, !43, i64 56, i64 4, !43, i64 60, i64 4, !43, i64 64, i64 4, !43, i64 68, i64 4, !43, i64 72, i64 4, !43, i64 76, i64 4, !43, i64 80, i64 4, !43, i64 84, i64 4, !43, i64 88, i64 4, !43, i64 92, i64 1, !46, i64 93, i64 1, !46, i64 94, i64 1, !46}
!45 = !{!12, !12, i64 0}
!46 = !{!16, !16, i64 0}
!47 = !{!7, !7, i64 0}
!48 = !{!10, !15, i64 40}
!49 = !{!10, !15, i64 44}
!50 = !{!10, !15, i64 52}
!51 = !{!10, !15, i64 56}
!52 = !{!10, !15, i64 64}
!53 = !{!10, !15, i64 68}
!54 = !{!10, !16, i64 36}
!55 = !{!10, !16, i64 48}
!56 = !{!10, !16, i64 60}
!57 = !{!41, !12, i64 0}
!58 = !{!18, !13, i64 1796}
!59 = !{!39, !6, i64 0}
!60 = !{!61, !13, i64 68}
!61 = !{!"b2Joint", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !7, i64 20, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !15, i64 60, !12, i64 64, !13, i64 68, !16, i64 70, !16, i64 71}


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

@b2_lengthUnitsPerMeter = external local_unnamed_addr global float, align 4
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [52 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, 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: nounwind uwtable
define dso_local i64 @b2CreateDistanceJoint(i32 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = getelementptr inbounds i8, ptr %1, i64 88
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp eq i32 %4, 1152023
  br i1 %5, label %9, label %6

6:                                                ; preds = %2
  %7 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 347) #5
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %9, label %8

8:                                                ; preds = %6
  tail call void @llvm.trap()
  unreachable

9:                                                ; preds = %2, %6
  %10 = tail call ptr @b2GetWorldFromId(i32 %0) #5
  %11 = getelementptr inbounds i8, ptr %10, i64 1799
  %12 = load i8, ptr %11, align 1, !tbaa !16, !range !28, !noundef !29
  %13 = icmp eq i8 %12, 0
  br i1 %13, label %.thread, label %14

14:                                               ; preds = %9
  %15 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 350) #5
  %.not55 = icmp eq i32 %15, 0
  br i1 %.not55, label %17, label %16

16:                                               ; preds = %14
  tail call void @llvm.trap()
  unreachable

17:                                               ; preds = %14
  %.pre = load i8, ptr %11, align 1, !tbaa !16, !range !28
  %18 = trunc nuw i8 %.pre to i1
  br i1 %18, label %116, label %.thread

.thread:                                          ; preds = %9, %17
  %19 = load i64, ptr %1, align 8
  %20 = tail call zeroext i1 @b2Body_IsValid(i64 %19) #5
  br i1 %20, label %24, label %21

21:                                               ; preds = %.thread
  %22 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 357) #5
  %.not56 = icmp eq i32 %22, 0
  br i1 %.not56, label %24, label %23

23:                                               ; preds = %21
  tail call void @llvm.trap()
  unreachable

24:                                               ; preds = %.thread, %21
  %25 = getelementptr inbounds i8, ptr %1, i64 8
  %26 = load i64, ptr %25, align 8
  %27 = tail call zeroext i1 @b2Body_IsValid(i64 %26) #5
  br i1 %27, label %31, label %28

28:                                               ; preds = %24
  %29 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 358) #5
  %.not57 = icmp eq i32 %29, 0
  br i1 %.not57, label %31, label %30

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

31:                                               ; preds = %24, %28
  %32 = getelementptr inbounds i8, ptr %1, i64 32
  %33 = load float, ptr %32, align 8, !tbaa !30
  %34 = tail call zeroext i1 @b2IsValidFloat(float noundef %33) #5
  br i1 %34, label %35, label %38

35:                                               ; preds = %31
  %36 = load float, ptr %32, align 8, !tbaa !30
  %37 = fcmp ogt float %36, 0.000000e+00
  br i1 %37, label %41, label %38

38:                                               ; preds = %35, %31
  %39 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 359) #5
  %.not58 = icmp eq i32 %39, 0
  br i1 %.not58, label %41, label %40

40:                                               ; preds = %38
  tail call void @llvm.trap()
  unreachable

41:                                               ; preds = %38, %35
  %42 = load i64, ptr %1, align 8
  %43 = tail call ptr @b2GetBodyFullId(ptr noundef nonnull %10, i64 %42) #5
  %44 = load i64, ptr %25, align 8
  %45 = tail call ptr @b2GetBodyFullId(ptr noundef nonnull %10, i64 %44) #5
  %46 = getelementptr inbounds i8, ptr %1, i64 80
  %47 = load ptr, ptr %46, align 8, !tbaa !31
  %48 = getelementptr inbounds i8, ptr %1, i64 72
  %49 = load i8, ptr %48, align 8, !tbaa !32, !range !28, !noundef !29
  %50 = trunc nuw i8 %49 to i1
  %51 = tail call { ptr, ptr } @b2CreateJoint(ptr noundef nonnull %10, ptr noundef %43, ptr noundef %45, ptr noundef %47, float noundef 1.000000e+00, i32 noundef 0, i1 noundef zeroext %50)
  %52 = extractvalue { ptr, ptr } %51, 0
  %53 = extractvalue { ptr, ptr } %51, 1
  %54 = getelementptr inbounds i8, ptr %53, i64 12
  store i32 0, ptr %54, align 4, !tbaa !33
  %55 = getelementptr inbounds i8, ptr %53, i64 16
  %56 = getelementptr inbounds i8, ptr %1, i64 16
  %57 = load i64, ptr %56, align 8
  store i64 %57, ptr %55, align 4
  %58 = getelementptr inbounds i8, ptr %53, i64 24
  %59 = getelementptr inbounds i8, ptr %1, i64 24
  %60 = load i64, ptr %59, align 8
  store i64 %60, ptr %58, align 4
  %61 = getelementptr inbounds i8, ptr %53, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(96) %61, i8 0, i64 96, i1 false)
  %62 = load float, ptr %32, align 8, !tbaa !30
  %63 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !35
  %64 = fmul float %63, 0x3F747AE140000000
  %65 = tail call float @b2MaxFloat(float noundef %62, float noundef %64)
  store float %65, ptr %61, align 4, !tbaa !36
  %66 = getelementptr inbounds i8, ptr %1, i64 40
  %67 = load float, ptr %66, align 8, !tbaa !37
  %68 = getelementptr inbounds i8, ptr %53, i64 52
  store float %67, ptr %68, align 4, !tbaa !36
  %69 = getelementptr inbounds i8, ptr %1, i64 44
  %70 = load float, ptr %69, align 4, !tbaa !38
  %71 = getelementptr inbounds i8, ptr %53, i64 56
  store float %70, ptr %71, align 4, !tbaa !36
  %72 = getelementptr inbounds i8, ptr %1, i64 52
  %73 = load float, ptr %72, align 4, !tbaa !39
  %74 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !35
  %75 = fmul float %74, 0x3F747AE140000000
  %76 = tail call float @b2MaxFloat(float noundef %73, float noundef %75)
  %77 = getelementptr inbounds i8, ptr %53, i64 60
  store float %76, ptr %77, align 4, !tbaa !36
  %78 = load float, ptr %72, align 4, !tbaa !39
  %79 = getelementptr inbounds i8, ptr %1, i64 56
  %80 = load float, ptr %79, align 8, !tbaa !40
  %81 = tail call float @b2MaxFloat(float noundef %78, float noundef %80)
  %82 = getelementptr inbounds i8, ptr %53, i64 64
  store float %81, ptr %82, align 4, !tbaa !36
  %83 = getelementptr inbounds i8, ptr %1, i64 64
  %84 = load float, ptr %83, align 8, !tbaa !41
  %85 = getelementptr inbounds i8, ptr %53, i64 68
  store float %84, ptr %85, align 4, !tbaa !36
  %86 = getelementptr inbounds i8, ptr %1, i64 68
  %87 = load float, ptr %86, align 4, !tbaa !42
  %88 = getelementptr inbounds i8, ptr %53, i64 72
  store float %87, ptr %88, align 4, !tbaa !36
  %89 = getelementptr inbounds i8, ptr %1, i64 36
  %90 = load i8, ptr %89, align 4, !tbaa !43, !range !28, !noundef !29
  %91 = getelementptr inbounds i8, ptr %53, i64 140
  store i8 %90, ptr %91, align 4, !tbaa !36
  %92 = getelementptr inbounds i8, ptr %1, i64 48
  %93 = load i8, ptr %92, align 8, !tbaa !44, !range !28, !noundef !29
  %94 = getelementptr inbounds i8, ptr %53, i64 141
  store i8 %93, ptr %94, align 1, !tbaa !36
  %95 = getelementptr inbounds i8, ptr %1, i64 60
  %96 = load i8, ptr %95, align 4, !tbaa !45, !range !28, !noundef !29
  %97 = getelementptr inbounds i8, ptr %53, i64 142
  store i8 %96, ptr %97, align 2, !tbaa !36
  %98 = getelementptr inbounds i8, ptr %53, i64 76
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %98, i8 0, i64 16, i1 false)
  %99 = load i8, ptr %48, align 8, !tbaa !32, !range !28, !noundef !29
  %100 = icmp eq i8 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %41
  tail call void @b2DestroyContactsBetweenBodies(ptr noundef nonnull %10, ptr noundef %43, ptr noundef %45)
  br label %102

102:                                              ; preds = %101, %41
  %103 = load i32, ptr %53, align 4, !tbaa !46
  %104 = add nsw i32 %103, 1
  %105 = getelementptr inbounds i8, ptr %10, i64 1796
  %106 = load i16, ptr %105, align 4, !tbaa !47
  %107 = getelementptr inbounds i8, ptr %52, i64 68
  %108 = load i16, ptr %107, align 4, !tbaa !48
  %109 = zext i16 %108 to i64
  %110 = shl nuw i64 %109, 48
  %111 = zext i16 %106 to i64
  %112 = shl nuw nsw i64 %111, 32
  %113 = zext i32 %104 to i64
  %114 = or disjoint i64 %112, %113
  %115 = or disjoint i64 %114, %110
  br label %116

116:                                              ; preds = %17, %102
  %.sroa.054.0.insert.insert = phi i64 [ %115, %102 ], [ 0, %17 ]
  ret i64 %.sroa.054.0.insert.insert
}

declare ptr @b2GetWorldFromId(i32) local_unnamed_addr #1

declare zeroext i1 @b2Body_IsValid(i64) local_unnamed_addr #1

declare zeroext i1 @b2IsValidFloat(float noundef) local_unnamed_addr #1

declare ptr @b2GetBodyFullId(ptr noundef, i64) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden { ptr, ptr } @b2CreateJoint(ptr noundef, ptr noundef, ptr noundef, ptr noundef, float noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2MaxFloat(float noundef, float noundef) local_unnamed_addr #4

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = { 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, !8, i64 88}
!6 = !{!"b2DistanceJointDef", !7, i64 0, !7, i64 8, !12, i64 16, !12, i64 24, !13, i64 32, !14, i64 36, !13, i64 40, !13, i64 44, !14, i64 48, !13, i64 52, !13, i64 56, !14, i64 60, !13, i64 64, !13, i64 68, !14, i64 72, !15, i64 80, !8, i64 88}
!7 = !{!"b2BodyId", !8, i64 0, !11, i64 4, !11, i64 6}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"short", !9, i64 0}
!12 = !{!"b2Vec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !9, i64 0}
!14 = !{!"_Bool", !9, i64 0}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{!17, !14, i64 1799}
!17 = !{!"b2World", !18, i64 0, !20, i64 40, !23, i64 336, !24, i64 1008, !19, i64 1032, !24, i64 1048, !19, i64 1072, !24, i64 1088, !19, i64 1112, !24, i64 1128, !19, i64 1152, !24, i64 1168, !19, i64 1192, !24, i64 1208, !24, i64 1232, !19, i64 1256, !19, i64 1272, !19, i64 1288, !19, i64 1304, !19, i64 1320, !19, i64 1336, !19, i64 1352, !19, i64 1368, !9, i64 1384, !9, i64 1416, !8, i64 1448, !19, i64 1456, !25, i64 1472, !25, i64 1488, !25, i64 1504, !25, i64 1520, !26, i64 1536, !8, i64 1544, !12, i64 1548, !13, i64 1556, !13, i64 1560, !13, i64 1564, !13, i64 1568, !13, i64 1572, !13, i64 1576, !13, i64 1580, !13, i64 1584, !15, i64 1592, !15, i64 1600, !11, i64 1608, !27, i64 1612, !15, i64 1704, !15, i64 1712, !15, i64 1720, !15, i64 1728, !8, i64 1736, !15, i64 1744, !15, i64 1752, !15, i64 1760, !15, i64 1768, !15, i64 1776, !13, i64 1784, !8, i64 1788, !8, i64 1792, !11, i64 1796, !14, i64 1798, !14, i64 1799, !14, i64 1800, !14, i64 1801, !14, i64 1802, !14, i64 1803}
!18 = !{!"b2ArenaAllocator", !15, i64 0, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !19, i64 24}
!19 = !{!"", !15, i64 0, !8, i64 8, !8, i64 12}
!20 = !{!"b2BroadPhase", !9, i64 0, !8, i64 216, !21, i64 224, !19, i64 240, !15, i64 256, !15, i64 264, !8, i64 272, !22, i64 276, !21, i64 280}
!21 = !{!"b2HashSet", !15, i64 0, !8, i64 8, !8, i64 12}
!22 = !{!"b2AtomicInt", !8, i64 0}
!23 = !{!"b2ConstraintGraph", !9, i64 0}
!24 = !{!"b2IdPool", !19, i64 0, !8, i64 16}
!25 = !{!"b2BitSet", !15, i64 0, !8, i64 8, !8, i64 12}
!26 = !{!"long", !9, i64 0}
!27 = !{!"b2Profile", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!6, !13, i64 32}
!31 = !{!6, !15, i64 80}
!32 = !{!6, !14, i64 72}
!33 = !{!34, !8, i64 12}
!34 = !{!"b2JointSim", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !12, i64 16, !12, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !9, i64 48}
!35 = !{!13, !13, i64 0}
!36 = !{!9, !9, i64 0}
!37 = !{!6, !13, i64 40}
!38 = !{!6, !13, i64 44}
!39 = !{!6, !13, i64 52}
!40 = !{!6, !13, i64 56}
!41 = !{!6, !13, i64 64}
!42 = !{!6, !13, i64 68}
!43 = !{!6, !14, i64 36}
!44 = !{!6, !14, i64 48}
!45 = !{!6, !14, i64 60}
!46 = !{!34, !8, i64 0}
!47 = !{!17, !11, i64 1796}
!48 = !{!49, !11, i64 68}
!49 = !{!"b2Joint", !15, i64 0, !8, i64 8, !8, i64 12, !8, i64 16, !9, i64 20, !8, i64 44, !8, i64 48, !8, i64 52, !8, i64 56, !13, i64 60, !8, i64 64, !11, i64 68, !14, i64 70, !14, i64 71}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass