; LLVM IR from zig-gamedev/zphysics :: libs/JoltC (JoltPhysicsC_Tests)

; 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.BPLayerInterfaceImpl = type { ptr, [2 x i8] }
%struct.MyBroadPhaseFilter = type { ptr }
%struct.MyObjectFilter = type { ptr }
%struct.MyActivationListener = type { ptr }
%struct.MyContactListener = type { ptr }
%struct.JPC_BodyCreationSettings = type { [4 x float], [4 x float], [4 x float], [4 x float], i64, i16, %struct.JPC_CollisionGroup, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, float, i32, i32, i8, float, [8 x i8], %struct.JPC_MassProperties, ptr, ptr }
%struct.JPC_CollisionGroup = type { ptr, i32, i32 }
%struct.JPC_MassProperties = type { float, [12 x i8], [16 x float] }
%struct.JPC_BodyLockRead = type { ptr, ptr, ptr }
%struct.JPC_Body = type { [4 x float], [4 x float], [4 x float], [4 x float], ptr, ptr, i64, %struct.JPC_CollisionGroup, float, float, i32, i16, i8, i8, i8, i8 }

declare void @JPC_RegisterDefaultAllocator() #0

declare void @JPC_CreateFactory() #0

declare void @JPC_RegisterTypes() #0

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

; Function Attrs: nounwind uwtable
declare hidden { ptr, i64 } @BPLayerInterface_Init() #2

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

; Function Attrs: nounwind uwtable
declare hidden ptr @MyBroadPhaseFilter_Init() #2

; Function Attrs: nounwind uwtable
declare hidden ptr @MyObjectFilter_Init() #2

declare ptr @JPC_PhysicsSystem_Create(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare ptr @JPC_BoxShapeSettings_Create(ptr noundef) #0

declare void @JPC_ShapeSettings_Release(ptr noundef) #0

declare ptr @JPC_ShapeSettings_CreateShape(ptr noundef) #0

declare i32 @JPC_Shape_GetRefCount(ptr noundef) #0

declare void @JPC_Shape_Release(ptr noundef) #0

declare void @JPC_PhysicsSystem_Destroy(ptr noundef) #0

declare void @JPC_DestroyFactory() #0

declare ptr @JPC_TempAllocator_Create(i32 noundef) #0

declare ptr @JPC_JobSystem_Create(i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @MyActivationListener_Init() #2

declare void @JPC_PhysicsSystem_SetBodyActivationListener(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @MyContactListener_Init() #2

declare void @JPC_PhysicsSystem_SetContactListener(ptr noundef, ptr noundef) #0

declare void @JPC_BodyCreationSettings_Set(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i16 noundef zeroext) #0

declare ptr @JPC_PhysicsSystem_GetBodyInterface(ptr noundef) #0

declare ptr @JPC_BodyInterface_CreateBody(ptr noundef, ptr noundef) #0

declare i32 @JPC_Body_GetID(ptr noundef) #0

declare zeroext i1 @JPC_Body_IsStatic(ptr noundef) #0

declare zeroext i1 @JPC_Body_IsDynamic(ptr noundef) #0

declare void @JPC_BodyInterface_AddBody(ptr noundef, i32 noundef, i32 noundef) #0

declare void @JPC_PhysicsSystem_OptimizeBroadPhase(ptr noundef) #0

declare zeroext i8 @JPC_PhysicsSystem_Update(ptr noundef, float noundef, i32 noundef, ptr noundef, ptr noundef) #0

declare void @JPC_BodyInterface_RemoveBody(ptr noundef, i32 noundef) #0

declare void @JPC_BodyInterface_DestroyBody(ptr noundef, i32 noundef) #0

declare void @JPC_JobSystem_Destroy(ptr noundef) #0

declare void @JPC_TempAllocator_Destroy(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @JoltCTest_HelloWorld() #2 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.BPLayerInterfaceImpl, align 8
  %9 = alloca %struct.MyBroadPhaseFilter, align 8
  %10 = alloca %struct.MyObjectFilter, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.MyActivationListener, align 8
  %13 = alloca %struct.MyContactListener, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca [3 x float], align 4
  %17 = alloca ptr, align 8
  %18 = alloca %struct.JPC_BodyCreationSettings, align 16
  %19 = alloca [3 x float], align 4
  %20 = alloca [4 x float], align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca %struct.JPC_BodyCreationSettings, align 16
  %26 = alloca [3 x float], align 4
  %27 = alloca [4 x float], align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca [3 x float], align 4
  %31 = alloca [2 x i32], align 4
  %32 = alloca i32, align 4
  %33 = alloca [2 x i32], align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca [3 x float], align 4
  %37 = alloca [3 x float], align 4
  %38 = alloca float, align 4
  %39 = alloca i32, align 4
  %40 = alloca i8, align 1
  %41 = alloca [16 x i32], align 16
  %42 = alloca i32, align 4
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  %45 = alloca %struct.JPC_BodyLockRead, align 8
  %46 = alloca ptr, align 8
  %47 = alloca ptr, align 8
  %48 = alloca i32, align 4
  %49 = alloca ptr, align 8
  %50 = alloca ptr, align 8
  %51 = alloca ptr, align 8
  %52 = alloca %struct.JPC_BodyLockRead, align 8
  %53 = alloca ptr, align 8
  %54 = alloca ptr, align 8
  call void @JPC_RegisterDefaultAllocator()
  call void @JPC_CreateFactory()
  call void @JPC_RegisterTypes()
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  %55 = call ptr @JPC_TempAllocator_Create(i32 noundef 10485760)
  store ptr %55, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %56 = call ptr @JPC_JobSystem_Create(i32 noundef 2048, i32 noundef 8, i32 noundef -1)
  store ptr %56, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 1024, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1024, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1024, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #3
  %57 = call { ptr, i64 } @BPLayerInterface_Init()
  %58 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  %59 = extractvalue { ptr, i64 } %57, 0
  store ptr %59, ptr %58, align 8
  %60 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  %61 = extractvalue { ptr, i64 } %57, 1
  store i64 %61, ptr %60, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %62 = call ptr @MyBroadPhaseFilter_Init()
  %63 = getelementptr inbounds %struct.MyBroadPhaseFilter, ptr %9, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %64 = call ptr @MyObjectFilter_Init()
  %65 = getelementptr inbounds %struct.MyObjectFilter, ptr %10, i32 0, i32 0
  store ptr %64, ptr %65, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %66 = call ptr @JPC_PhysicsSystem_Create(i32 noundef 1024, i32 noundef 0, i32 noundef 1024, i32 noundef 1024, ptr noundef %8, ptr noundef %9, ptr noundef %10)
  store ptr %66, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %67 = call ptr @MyActivationListener_Init()
  %68 = getelementptr inbounds %struct.MyActivationListener, ptr %12, i32 0, i32 0
  store ptr %67, ptr %68, align 8
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_SetBodyActivationListener(ptr noundef %69, ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %70 = call ptr @MyContactListener_Init()
  %71 = getelementptr inbounds %struct.MyContactListener, ptr %13, i32 0, i32 0
  store ptr %70, ptr %71, align 8
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_SetContactListener(ptr noundef %72, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = call ptr @JPC_PhysicsSystem_GetBodyInterface(ptr noundef %73)
  store ptr %74, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store float 1.000000e+02, ptr %16, align 4, !tbaa !11
  %75 = getelementptr inbounds float, ptr %16, i64 1
  store float 1.000000e+00, ptr %75, align 4, !tbaa !11
  %76 = getelementptr inbounds float, ptr %16, i64 2
  store float 1.000000e+02, ptr %76, align 4, !tbaa !11
  %77 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 0
  %78 = call ptr @JPC_BoxShapeSettings_Create(ptr noundef %77)
  store ptr %78, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %79 = load ptr, ptr %15, align 8, !tbaa !5
  %80 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %79)
  store ptr %80, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %18) #3
  %81 = load ptr, ptr %17, align 8, !tbaa !5
  store float 0.000000e+00, ptr %19, align 4, !tbaa !11
  %82 = getelementptr inbounds float, ptr %19, i64 1
  store float -1.000000e+00, ptr %82, align 4, !tbaa !11
  %83 = getelementptr inbounds float, ptr %19, i64 2
  store float 0.000000e+00, ptr %83, align 4, !tbaa !11
  %84 = getelementptr inbounds [3 x float], ptr %19, i64 0, i64 0
  store float 0.000000e+00, ptr %20, align 4, !tbaa !11
  %85 = getelementptr inbounds float, ptr %20, i64 1
  store float 0.000000e+00, ptr %85, align 4, !tbaa !11
  %86 = getelementptr inbounds float, ptr %20, i64 2
  store float 0.000000e+00, ptr %86, align 4, !tbaa !11
  %87 = getelementptr inbounds float, ptr %20, i64 3
  store float 1.000000e+00, ptr %87, align 4, !tbaa !11
  %88 = getelementptr inbounds [4 x float], ptr %20, i64 0, i64 0
  call void @JPC_BodyCreationSettings_Set(ptr noundef %18, ptr noundef %81, ptr noundef %84, ptr noundef %88, i8 noundef zeroext 0, i16 noundef zeroext 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = call ptr @JPC_BodyInterface_CreateBody(ptr noundef %89, ptr noundef %18)
  store ptr %90, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %91 = load ptr, ptr %21, align 8, !tbaa !5
  %92 = call i32 @JPC_Body_GetID(ptr noundef %91)
  store i32 %92, ptr %22, align 4, !tbaa !9
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = load i32, ptr %22, align 4, !tbaa !9
  call void @JPC_BodyInterface_AddBody(ptr noundef %93, i32 noundef %94, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %95 = call ptr @JPC_SphereShapeSettings_Create(float noundef 5.000000e-01)
  store ptr %95, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %96 = load ptr, ptr %23, align 8, !tbaa !5
  %97 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %96)
  store ptr %97, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %25) #3
  %98 = load ptr, ptr %24, align 8, !tbaa !5
  store float 0.000000e+00, ptr %26, align 4, !tbaa !11
  %99 = getelementptr inbounds float, ptr %26, i64 1
  store float 2.000000e+00, ptr %99, align 4, !tbaa !11
  %100 = getelementptr inbounds float, ptr %26, i64 2
  store float 0.000000e+00, ptr %100, align 4, !tbaa !11
  %101 = getelementptr inbounds [3 x float], ptr %26, i64 0, i64 0
  store float 0.000000e+00, ptr %27, align 4, !tbaa !11
  %102 = getelementptr inbounds float, ptr %27, i64 1
  store float 0.000000e+00, ptr %102, align 4, !tbaa !11
  %103 = getelementptr inbounds float, ptr %27, i64 2
  store float 0.000000e+00, ptr %103, align 4, !tbaa !11
  %104 = getelementptr inbounds float, ptr %27, i64 3
  store float 1.000000e+00, ptr %104, align 4, !tbaa !11
  %105 = getelementptr inbounds [4 x float], ptr %27, i64 0, i64 0
  call void @JPC_BodyCreationSettings_Set(ptr noundef %25, ptr noundef %98, ptr noundef %101, ptr noundef %105, i8 noundef zeroext 2, i16 noundef zeroext 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = call i32 @JPC_BodyInterface_CreateAndAddBody(ptr noundef %106, ptr noundef %25, i32 noundef 0)
  store i32 %107, ptr %28, align 4, !tbaa !9
  %108 = load ptr, ptr %21, align 8, !tbaa !5
  %109 = call zeroext i1 @JPC_Body_IsStatic(ptr noundef %108)
  %110 = zext i1 %109 to i32
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %0
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %397

113:                                              ; preds = %0
  %114 = load ptr, ptr %21, align 8, !tbaa !5
  %115 = call zeroext i1 @JPC_Body_IsDynamic(ptr noundef %114)
  %116 = zext i1 %115 to i32
  %117 = icmp eq i32 %116, 1
  br i1 %117, label %118, label %119

118:                                              ; preds = %113
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %397

119:                                              ; preds = %113
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = load i32, ptr %28, align 4, !tbaa !9
  store float 0.000000e+00, ptr %30, align 4, !tbaa !11
  %122 = getelementptr inbounds float, ptr %30, i64 1
  store float -5.000000e+00, ptr %122, align 4, !tbaa !11
  %123 = getelementptr inbounds float, ptr %30, i64 2
  store float 0.000000e+00, ptr %123, align 4, !tbaa !11
  %124 = getelementptr inbounds [3 x float], ptr %30, i64 0, i64 0
  call void @JPC_BodyInterface_SetLinearVelocity(ptr noundef %120, i32 noundef %121, ptr noundef %124)
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_OptimizeBroadPhase(ptr noundef %125)
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #3
  store i32 0, ptr %32, align 4, !tbaa !9
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = getelementptr inbounds [2 x i32], ptr %31, i64 0, i64 0
  call void @JPC_PhysicsSystem_GetBodyIDs(ptr noundef %126, i32 noundef 2, ptr noundef %32, ptr noundef %127)
  %128 = load i32, ptr %32, align 4, !tbaa !9
  %129 = icmp ne i32 %128, 2
  br i1 %129, label %130, label %131

130:                                              ; preds = %119
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %144

131:                                              ; preds = %119
  %132 = getelementptr inbounds [2 x i32], ptr %31, i64 0, i64 0
  %133 = load i32, ptr %132, align 4, !tbaa !9
  %134 = load i32, ptr %22, align 4, !tbaa !9
  %135 = icmp ne i32 %133, %134
  br i1 %135, label %136, label %137

136:                                              ; preds = %131
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %144

137:                                              ; preds = %131
  %138 = getelementptr inbounds [2 x i32], ptr %31, i64 0, i64 1
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = load i32, ptr %28, align 4, !tbaa !9
  %141 = icmp ne i32 %139, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %137
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %144

143:                                              ; preds = %137
  store i32 0, ptr %29, align 4
  br label %144

144:                                              ; preds = %143, %142, %136, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #3
  %145 = load i32, ptr %29, align 4
  switch i32 %145, label %397 [
    i32 0, label %146
  ]

146:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #3
  store i32 0, ptr %34, align 4, !tbaa !9
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = getelementptr inbounds [2 x i32], ptr %33, i64 0, i64 0
  call void @JPC_PhysicsSystem_GetActiveBodyIDs(ptr noundef %147, i32 noundef 2, ptr noundef %34, ptr noundef %148)
  %149 = load i32, ptr %34, align 4, !tbaa !9
  %150 = icmp ne i32 %149, 1
  br i1 %150, label %151, label %152

151:                                              ; preds = %146
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %159

152:                                              ; preds = %146
  %153 = getelementptr inbounds [2 x i32], ptr %33, i64 0, i64 0
  %154 = load i32, ptr %153, align 4, !tbaa !9
  %155 = load i32, ptr %28, align 4, !tbaa !9
  %156 = icmp ne i32 %154, %155
  br i1 %156, label %157, label %158

157:                                              ; preds = %152
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %159

158:                                              ; preds = %152
  store i32 0, ptr %29, align 4
  br label %159

159:                                              ; preds = %158, %157, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #3
  %160 = load i32, ptr %29, align 4
  switch i32 %160, label %397 [
    i32 0, label %161
  ]

161:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #3
  store i32 0, ptr %35, align 4, !tbaa !9
  br label %162

162:                                              ; preds = %369, %161
  %163 = load ptr, ptr %14, align 8, !tbaa !5
  %164 = load i32, ptr %28, align 4, !tbaa !9
  %165 = call zeroext i1 @JPC_BodyInterface_IsActive(ptr noundef %163, i32 noundef %164)
  br i1 %165, label %166, label %370

166:                                              ; preds = %162
  %167 = load i32, ptr %35, align 4, !tbaa !9
  %168 = add i32 %167, 1
  store i32 %168, ptr %35, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %36) #3
  %169 = load ptr, ptr %14, align 8, !tbaa !5
  %170 = load i32, ptr %28, align 4, !tbaa !9
  %171 = getelementptr inbounds [3 x float], ptr %36, i64 0, i64 0
  call void @JPC_BodyInterface_GetCenterOfMassPosition(ptr noundef %169, i32 noundef %170, ptr noundef %171)
  call void @llvm.lifetime.start.p0(i64 12, ptr %37) #3
  %172 = load ptr, ptr %14, align 8, !tbaa !5
  %173 = load i32, ptr %28, align 4, !tbaa !9
  %174 = getelementptr inbounds [3 x float], ptr %37, i64 0, i64 0
  call void @JPC_BodyInterface_GetLinearVelocity(ptr noundef %172, i32 noundef %173, ptr noundef %174)
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #3
  store float 0x3F91111120000000, ptr %38, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #3
  store i32 1, ptr %39, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %40) #3
  %175 = load ptr, ptr %11, align 8, !tbaa !5
  %176 = load ptr, ptr %2, align 8, !tbaa !5
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = call zeroext i8 @JPC_PhysicsSystem_Update(ptr noundef %175, float noundef 0x3F91111120000000, i32 noundef 1, ptr noundef %176, ptr noundef %177)
  store i8 %178, ptr %40, align 1, !tbaa !13
  %179 = load i8, ptr %40, align 1, !tbaa !13
  %180 = zext i8 %179 to i32
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %183

182:                                              ; preds = %166
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %367

183:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 64, ptr %41) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #3
  store i32 0, ptr %42, align 4, !tbaa !9
  %184 = load ptr, ptr %11, align 8, !tbaa !5
  %185 = getelementptr inbounds [16 x i32], ptr %41, i64 0, i64 0
  call void @JPC_PhysicsSystem_GetBodyIDs(ptr noundef %184, i32 noundef 16, ptr noundef %42, ptr noundef %185)
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #3
  %186 = load ptr, ptr %11, align 8, !tbaa !5
  %187 = call ptr @JPC_PhysicsSystem_GetBodyLockInterface(ptr noundef %186)
  store ptr %187, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #3
  store i32 0, ptr %44, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %205, %183
  %189 = load i32, ptr %44, align 4, !tbaa !9
  %190 = load i32, ptr %42, align 4, !tbaa !9
  %191 = icmp ult i32 %189, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %188
  store i32 4, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #3
  br label %208

193:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 24, ptr %45) #3
  %194 = load ptr, ptr %43, align 8, !tbaa !5
  %195 = load i32, ptr %44, align 4, !tbaa !9
  %196 = zext i32 %195 to i64
  %197 = getelementptr inbounds [16 x i32], ptr %41, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !9
  call void @JPC_BodyLockInterface_LockRead(ptr noundef %194, i32 noundef %198, ptr noundef %45)
  %199 = getelementptr inbounds %struct.JPC_BodyLockRead, ptr %45, i32 0, i32 2
  %200 = load ptr, ptr %199, align 8, !tbaa !14
  %201 = icmp ne ptr %200, null
  br i1 %201, label %202, label %203

202:                                              ; preds = %193
  br label %203

203:                                              ; preds = %202, %193
  %204 = load ptr, ptr %43, align 8, !tbaa !5
  call void @JPC_BodyLockInterface_UnlockRead(ptr noundef %204, ptr noundef %45)
  call void @llvm.lifetime.end.p0(i64 24, ptr %45) #3
  br label %205

205:                                              ; preds = %203
  %206 = load i32, ptr %44, align 4, !tbaa !9
  %207 = add i32 %206, 1
  store i32 %207, ptr %44, align 4, !tbaa !9
  br label %188, !llvm.loop !16

208:                                              ; preds = %192
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #3
  call void @llvm.lifetime.end.p0(i64 64, ptr %41) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #3
  %209 = load ptr, ptr %11, align 8, !tbaa !5
  %210 = call ptr @JPC_PhysicsSystem_GetBodiesUnsafe(ptr noundef %209)
  store ptr %210, ptr %46, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #3
  %211 = load ptr, ptr %46, align 8, !tbaa !5
  %212 = load i32, ptr %28, align 4, !tbaa !9
  %213 = and i32 %212, 8388607
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds ptr, ptr %211, i64 %214
  %216 = load ptr, ptr %215, align 8, !tbaa !5
  %217 = ptrtoint ptr %216 to i64
  %218 = and i64 %217, 1
  %219 = icmp eq i64 %218, 0
  br i1 %219, label %220, label %238

220:                                              ; preds = %208
  %221 = load ptr, ptr %46, align 8, !tbaa !5
  %222 = load i32, ptr %28, align 4, !tbaa !9
  %223 = and i32 %222, 8388607
  %224 = zext i32 %223 to i64
  %225 = getelementptr inbounds ptr, ptr %221, i64 %224
  %226 = load ptr, ptr %225, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.JPC_Body, ptr %226, i32 0, i32 10
  %228 = load i32, ptr %227, align 16, !tbaa !18
  %229 = load i32, ptr %28, align 4, !tbaa !9
  %230 = icmp eq i32 %228, %229
  br i1 %230, label %231, label %238

231:                                              ; preds = %220
  %232 = load ptr, ptr %46, align 8, !tbaa !5
  %233 = load i32, ptr %28, align 4, !tbaa !9
  %234 = and i32 %233, 8388607
  %235 = zext i32 %234 to i64
  %236 = getelementptr inbounds ptr, ptr %232, i64 %235
  %237 = load ptr, ptr %236, align 8, !tbaa !5
  br label %239

238:                                              ; preds = %220, %208
  br label %239

239:                                              ; preds = %238, %231
  %240 = phi ptr [ %237, %231 ], [ null, %238 ]
  store ptr %240, ptr %47, align 8, !tbaa !5
  %241 = load ptr, ptr %47, align 8, !tbaa !5
  %242 = icmp ne ptr %241, null
  br i1 %242, label %243, label %246

243:                                              ; preds = %239
  %244 = load ptr, ptr %47, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.JPC_Body, ptr %244, i32 0, i32 8
  store float 0x3FC99999A0000000, ptr %245, align 8, !tbaa !23
  br label %246

246:                                              ; preds = %243, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #3
  store i32 0, ptr %48, align 4, !tbaa !9
  br label %247

247:                                              ; preds = %265, %246
  %248 = load i32, ptr %48, align 4, !tbaa !9
  %249 = load ptr, ptr %11, align 8, !tbaa !5
  %250 = call i32 @JPC_PhysicsSystem_GetNumBodies(ptr noundef %249)
  %251 = icmp ult i32 %248, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %247
  store i32 7, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #3
  br label %268

253:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #3
  %254 = load ptr, ptr %46, align 8, !tbaa !5
  %255 = load i32, ptr %48, align 4, !tbaa !9
  %256 = zext i32 %255 to i64
  %257 = getelementptr inbounds ptr, ptr %254, i64 %256
  %258 = load ptr, ptr %257, align 8, !tbaa !5
  store ptr %258, ptr %49, align 8, !tbaa !5
  %259 = load ptr, ptr %49, align 8, !tbaa !5
  %260 = ptrtoint ptr %259 to i64
  %261 = and i64 %260, 1
  %262 = icmp eq i64 %261, 0
  br i1 %262, label %263, label %264

263:                                              ; preds = %253
  br label %264

264:                                              ; preds = %263, %253
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #3
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %48, align 4, !tbaa !9
  %267 = add i32 %266, 1
  store i32 %267, ptr %48, align 4, !tbaa !9
  br label %247, !llvm.loop !24

268:                                              ; preds = %252
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #3
  %269 = load ptr, ptr %11, align 8, !tbaa !5
  %270 = call ptr @JPC_PhysicsSystem_GetBodiesUnsafe(ptr noundef %269)
  store ptr %270, ptr %50, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #3
  %271 = load ptr, ptr %11, align 8, !tbaa !5
  %272 = call ptr @JPC_PhysicsSystem_GetBodyLockInterface(ptr noundef %271)
  store ptr %272, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %52) #3
  %273 = load ptr, ptr %51, align 8, !tbaa !5
  %274 = load i32, ptr %28, align 4, !tbaa !9
  call void @JPC_BodyLockInterface_LockRead(ptr noundef %273, i32 noundef %274, ptr noundef %52)
  %275 = getelementptr inbounds %struct.JPC_BodyLockRead, ptr %52, i32 0, i32 2
  %276 = load ptr, ptr %275, align 8, !tbaa !14
  %277 = icmp ne ptr %276, null
  br i1 %277, label %278, label %362

278:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #3
  %279 = load ptr, ptr %50, align 8, !tbaa !5
  %280 = load i32, ptr %28, align 4, !tbaa !9
  %281 = and i32 %280, 8388607
  %282 = zext i32 %281 to i64
  %283 = getelementptr inbounds ptr, ptr %279, i64 %282
  %284 = load ptr, ptr %283, align 8, !tbaa !5
  store ptr %284, ptr %53, align 8, !tbaa !5
  %285 = load ptr, ptr %53, align 8, !tbaa !5
  %286 = ptrtoint ptr %285 to i64
  %287 = and i64 %286, 1
  %288 = icmp eq i64 %287, 0
  br i1 %288, label %290, label %289

289:                                              ; preds = %278
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %359

290:                                              ; preds = %278
  %291 = load ptr, ptr %53, align 8, !tbaa !5
  %292 = call zeroext i1 @JPC_Body_IsDynamic(ptr noundef %291)
  %293 = zext i1 %292 to i32
  %294 = icmp ne i32 %293, 1
  br i1 %294, label %295, label %296

295:                                              ; preds = %290
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %359

296:                                              ; preds = %290
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #3
  %297 = load ptr, ptr %50, align 8, !tbaa !5
  %298 = load i32, ptr %28, align 4, !tbaa !9
  %299 = and i32 %298, 8388607
  %300 = zext i32 %299 to i64
  %301 = getelementptr inbounds ptr, ptr %297, i64 %300
  %302 = load ptr, ptr %301, align 8, !tbaa !5
  %303 = ptrtoint ptr %302 to i64
  %304 = and i64 %303, 1
  %305 = icmp eq i64 %304, 0
  br i1 %305, label %306, label %324

306:                                              ; preds = %296
  %307 = load ptr, ptr %50, align 8, !tbaa !5
  %308 = load i32, ptr %28, align 4, !tbaa !9
  %309 = and i32 %308, 8388607
  %310 = zext i32 %309 to i64
  %311 = getelementptr inbounds ptr, ptr %307, i64 %310
  %312 = load ptr, ptr %311, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.JPC_Body, ptr %312, i32 0, i32 10
  %314 = load i32, ptr %313, align 16, !tbaa !18
  %315 = load i32, ptr %28, align 4, !tbaa !9
  %316 = icmp eq i32 %314, %315
  br i1 %316, label %317, label %324

317:                                              ; preds = %306
  %318 = load ptr, ptr %50, align 8, !tbaa !5
  %319 = load i32, ptr %28, align 4, !tbaa !9
  %320 = and i32 %319, 8388607
  %321 = zext i32 %320 to i64
  %322 = getelementptr inbounds ptr, ptr %318, i64 %321
  %323 = load ptr, ptr %322, align 8, !tbaa !5
  br label %325

324:                                              ; preds = %306, %296
  br label %325

325:                                              ; preds = %324, %317
  %326 = phi ptr [ %323, %317 ], [ null, %324 ]
  store ptr %326, ptr %54, align 8, !tbaa !5
  %327 = load ptr, ptr %54, align 8, !tbaa !5
  %328 = icmp eq ptr %327, null
  br i1 %328, label %329, label %330

329:                                              ; preds = %325
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %358

330:                                              ; preds = %325
  %331 = load ptr, ptr %54, align 8, !tbaa !5
  %332 = load ptr, ptr %53, align 8, !tbaa !5
  %333 = icmp ne ptr %331, %332
  br i1 %333, label %334, label %335

334:                                              ; preds = %330
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %358

335:                                              ; preds = %330
  %336 = load ptr, ptr %54, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.JPC_Body, ptr %336, i32 0, i32 10
  %338 = load i32, ptr %337, align 16, !tbaa !18
  %339 = load ptr, ptr %53, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct.JPC_Body, ptr %339, i32 0, i32 10
  %341 = load i32, ptr %340, align 16, !tbaa !18
  %342 = icmp ne i32 %338, %341
  br i1 %342, label %343, label %344

343:                                              ; preds = %335
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %358

344:                                              ; preds = %335
  %345 = load ptr, ptr %53, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.JPC_BodyLockRead, ptr %52, i32 0, i32 2
  %347 = load ptr, ptr %346, align 8, !tbaa !14
  %348 = icmp ne ptr %345, %347
  br i1 %348, label %349, label %350

349:                                              ; preds = %344
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %358

350:                                              ; preds = %344
  %351 = load ptr, ptr %53, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.JPC_Body, ptr %351, i32 0, i32 10
  %353 = load i32, ptr %352, align 16, !tbaa !18
  %354 = load i32, ptr %28, align 4, !tbaa !9
  %355 = icmp ne i32 %353, %354
  br i1 %355, label %356, label %357

356:                                              ; preds = %350
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %358

357:                                              ; preds = %350
  store i32 0, ptr %29, align 4
  br label %358

358:                                              ; preds = %357, %356, %349, %343, %334, %329
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #3
  br label %359

359:                                              ; preds = %358, %295, %289
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #3
  %360 = load i32, ptr %29, align 4
  switch i32 %360, label %364 [
    i32 0, label %361
  ]

361:                                              ; preds = %359
  br label %362

362:                                              ; preds = %361, %268
  %363 = load ptr, ptr %51, align 8, !tbaa !5
  call void @JPC_BodyLockInterface_UnlockRead(ptr noundef %363, ptr noundef %52)
  store i32 0, ptr %29, align 4
  br label %364

364:                                              ; preds = %362, %359
  call void @llvm.lifetime.end.p0(i64 24, ptr %52) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #3
  %365 = load i32, ptr %29, align 4
  switch i32 %365, label %367 [
    i32 0, label %366
  ]

366:                                              ; preds = %364
  store i32 0, ptr %29, align 4
  br label %367

367:                                              ; preds = %366, %364, %182
  call void @llvm.lifetime.end.p0(i64 1, ptr %40) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %37) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %36) #3
  %368 = load i32, ptr %29, align 4
  switch i32 %368, label %396 [
    i32 0, label %369
  ]

369:                                              ; preds = %367
  br label %162, !llvm.loop !25

370:                                              ; preds = %162
  %371 = load ptr, ptr %14, align 8, !tbaa !5
  %372 = load i32, ptr %28, align 4, !tbaa !9
  call void @JPC_BodyInterface_RemoveBody(ptr noundef %371, i32 noundef %372)
  %373 = load ptr, ptr %14, align 8, !tbaa !5
  %374 = load i32, ptr %28, align 4, !tbaa !9
  call void @JPC_BodyInterface_DestroyBody(ptr noundef %373, i32 noundef %374)
  %375 = load ptr, ptr %14, align 8, !tbaa !5
  %376 = load i32, ptr %22, align 4, !tbaa !9
  call void @JPC_BodyInterface_RemoveBody(ptr noundef %375, i32 noundef %376)
  %377 = load ptr, ptr %14, align 8, !tbaa !5
  %378 = load i32, ptr %22, align 4, !tbaa !9
  call void @JPC_BodyInterface_DestroyBody(ptr noundef %377, i32 noundef %378)
  %379 = load ptr, ptr %15, align 8, !tbaa !5
  call void @JPC_ShapeSettings_Release(ptr noundef %379)
  %380 = load ptr, ptr %17, align 8, !tbaa !5
  %381 = call i32 @JPC_Shape_GetRefCount(ptr noundef %380)
  %382 = icmp ne i32 %381, 1
  br i1 %382, label %383, label %384

383:                                              ; preds = %370
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %396

384:                                              ; preds = %370
  %385 = load ptr, ptr %17, align 8, !tbaa !5
  call void @JPC_Shape_Release(ptr noundef %385)
  %386 = load ptr, ptr %23, align 8, !tbaa !5
  call void @JPC_ShapeSettings_Release(ptr noundef %386)
  %387 = load ptr, ptr %24, align 8, !tbaa !5
  %388 = call i32 @JPC_Shape_GetRefCount(ptr noundef %387)
  %389 = icmp ne i32 %388, 1
  br i1 %389, label %390, label %391

390:                                              ; preds = %384
  store i32 0, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %396

391:                                              ; preds = %384
  %392 = load ptr, ptr %24, align 8, !tbaa !5
  call void @JPC_Shape_Release(ptr noundef %392)
  %393 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_Destroy(ptr noundef %393)
  %394 = load ptr, ptr %3, align 8, !tbaa !5
  call void @JPC_JobSystem_Destroy(ptr noundef %394)
  %395 = load ptr, ptr %2, align 8, !tbaa !5
  call void @JPC_TempAllocator_Destroy(ptr noundef %395)
  call void @JPC_DestroyFactory()
  store i32 1, ptr %1, align 4
  store i32 1, ptr %29, align 4
  br label %396

396:                                              ; preds = %391, %390, %383, %367
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #3
  br label %397

397:                                              ; preds = %396, %159, %144, %118, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 256, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 256, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  %398 = load i32, ptr %1, align 4
  ret i32 %398
}

declare ptr @JPC_SphereShapeSettings_Create(float noundef) #0

declare i32 @JPC_BodyInterface_CreateAndAddBody(ptr noundef, ptr noundef, i32 noundef) #0

declare void @JPC_BodyInterface_SetLinearVelocity(ptr noundef, i32 noundef, ptr noundef) #0

declare void @JPC_PhysicsSystem_GetBodyIDs(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

declare void @JPC_PhysicsSystem_GetActiveBodyIDs(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

declare zeroext i1 @JPC_BodyInterface_IsActive(ptr noundef, i32 noundef) #0

declare void @JPC_BodyInterface_GetCenterOfMassPosition(ptr noundef, i32 noundef, ptr noundef) #0

declare void @JPC_BodyInterface_GetLinearVelocity(ptr noundef, i32 noundef, ptr noundef) #0

declare ptr @JPC_PhysicsSystem_GetBodyLockInterface(ptr noundef) #0

declare void @JPC_BodyLockInterface_LockRead(ptr noundef, i32 noundef, ptr noundef) #0

declare void @JPC_BodyLockInterface_UnlockRead(ptr noundef, ptr noundef) #0

declare ptr @JPC_PhysicsSystem_GetBodiesUnsafe(ptr noundef) #0

declare i32 @JPC_PhysicsSystem_GetNumBodies(ptr noundef) #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 16}
!15 = !{!"JPC_BodyLockRead", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !10, i64 112}
!19 = !{!"JPC_Body", !7, i64 0, !7, i64 16, !7, i64 32, !7, i64 48, !6, i64 64, !6, i64 72, !20, i64 80, !21, i64 88, !12, i64 104, !12, i64 108, !10, i64 112, !22, i64 116, !7, i64 118, !7, i64 119, !7, i64 120, !7, i64 121}
!20 = !{!"long", !7, i64 0}
!21 = !{!"JPC_CollisionGroup", !6, i64 0, !10, i64 8, !10, i64 12}
!22 = !{!"short", !7, i64 0}
!23 = !{!19, !12, i64 104}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17}


; 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.BPLayerInterfaceImpl = type { ptr, [2 x i8] }
%struct.MyBroadPhaseFilter = type { ptr }
%struct.MyObjectFilter = type { ptr }
%struct.MyActivationListener = type { ptr }
%struct.MyContactListener = type { ptr }
%struct.JPC_BodyCreationSettings = type { [4 x float], [4 x float], [4 x float], [4 x float], i64, i16, %struct.JPC_CollisionGroup, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, float, i32, i32, i8, float, [8 x i8], %struct.JPC_MassProperties, ptr, ptr }
%struct.JPC_CollisionGroup = type { ptr, i32, i32 }
%struct.JPC_MassProperties = type { float, [12 x i8], [16 x float] }
%struct.JPC_BodyLockRead = type { ptr, ptr, ptr }

declare void @JPC_RegisterDefaultAllocator() local_unnamed_addr #0

declare void @JPC_CreateFactory() local_unnamed_addr #0

declare void @JPC_RegisterTypes() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden { ptr, i64 } @BPLayerInterface_Init() local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden ptr @MyBroadPhaseFilter_Init() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden ptr @MyObjectFilter_Init() local_unnamed_addr #2

declare ptr @JPC_PhysicsSystem_Create(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @JPC_BoxShapeSettings_Create(ptr noundef) local_unnamed_addr #0

declare void @JPC_ShapeSettings_Release(ptr noundef) local_unnamed_addr #0

declare ptr @JPC_ShapeSettings_CreateShape(ptr noundef) local_unnamed_addr #0

declare i32 @JPC_Shape_GetRefCount(ptr noundef) local_unnamed_addr #0

declare void @JPC_Shape_Release(ptr noundef) local_unnamed_addr #0

declare void @JPC_PhysicsSystem_Destroy(ptr noundef) local_unnamed_addr #0

declare void @JPC_DestroyFactory() local_unnamed_addr #0

declare ptr @JPC_TempAllocator_Create(i32 noundef) local_unnamed_addr #0

declare ptr @JPC_JobSystem_Create(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @MyActivationListener_Init() local_unnamed_addr #2

declare void @JPC_PhysicsSystem_SetBodyActivationListener(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @MyContactListener_Init() local_unnamed_addr #2

declare void @JPC_PhysicsSystem_SetContactListener(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @JPC_BodyCreationSettings_Set(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #0

declare ptr @JPC_PhysicsSystem_GetBodyInterface(ptr noundef) local_unnamed_addr #0

declare ptr @JPC_BodyInterface_CreateBody(ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @JPC_Body_GetID(ptr noundef) local_unnamed_addr #0

declare zeroext i1 @JPC_Body_IsStatic(ptr noundef) local_unnamed_addr #0

declare zeroext i1 @JPC_Body_IsDynamic(ptr noundef) local_unnamed_addr #0

declare void @JPC_BodyInterface_AddBody(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare void @JPC_PhysicsSystem_OptimizeBroadPhase(ptr noundef) local_unnamed_addr #0

declare zeroext i8 @JPC_PhysicsSystem_Update(ptr noundef, float noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @JPC_BodyInterface_RemoveBody(ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @JPC_BodyInterface_DestroyBody(ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @JPC_JobSystem_Destroy(ptr noundef) local_unnamed_addr #0

declare void @JPC_TempAllocator_Destroy(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @JoltCTest_HelloWorld() local_unnamed_addr #2 {
  %1 = alloca %struct.BPLayerInterfaceImpl, align 8
  %2 = alloca %struct.MyBroadPhaseFilter, align 8
  %3 = alloca %struct.MyObjectFilter, align 8
  %4 = alloca %struct.MyActivationListener, align 8
  %5 = alloca %struct.MyContactListener, align 8
  %6 = alloca [3 x float], align 8
  %7 = alloca %struct.JPC_BodyCreationSettings, align 16
  %8 = alloca [3 x float], align 8
  %9 = alloca [4 x float], align 16
  %10 = alloca %struct.JPC_BodyCreationSettings, align 16
  %11 = alloca [3 x float], align 8
  %12 = alloca [4 x float], align 16
  %13 = alloca [3 x float], align 8
  %14 = alloca [2 x i32], align 4
  %15 = alloca i32, align 4
  %16 = alloca [2 x i32], align 4
  %17 = alloca i32, align 4
  %18 = alloca [3 x float], align 4
  %19 = alloca [3 x float], align 4
  %20 = alloca [16 x i32], align 16
  %21 = alloca i32, align 4
  %22 = alloca %struct.JPC_BodyLockRead, align 8
  %23 = alloca %struct.JPC_BodyLockRead, align 8
  tail call void @JPC_RegisterDefaultAllocator() #3
  tail call void @JPC_CreateFactory() #3
  tail call void @JPC_RegisterTypes() #3
  %24 = tail call ptr @JPC_TempAllocator_Create(i32 noundef 10485760) #3
  %25 = tail call ptr @JPC_JobSystem_Create(i32 noundef 2048, i32 noundef 8, i32 noundef -1) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #3
  %26 = tail call { ptr, i64 } @BPLayerInterface_Init()
  %27 = extractvalue { ptr, i64 } %26, 0
  store ptr %27, ptr %1, align 8
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = extractvalue { ptr, i64 } %26, 1
  store i64 %29, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %30 = tail call ptr @MyBroadPhaseFilter_Init()
  store ptr %30, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %31 = tail call ptr @MyObjectFilter_Init()
  store ptr %31, ptr %3, align 8
  %32 = call ptr @JPC_PhysicsSystem_Create(i32 noundef 1024, i32 noundef 0, i32 noundef 1024, i32 noundef 1024, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %33 = call ptr @MyActivationListener_Init()
  store ptr %33, ptr %4, align 8
  call void @JPC_PhysicsSystem_SetBodyActivationListener(ptr noundef %32, ptr noundef nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %34 = call ptr @MyContactListener_Init()
  store ptr %34, ptr %5, align 8
  call void @JPC_PhysicsSystem_SetContactListener(ptr noundef %32, ptr noundef nonnull %5) #3
  %35 = call ptr @JPC_PhysicsSystem_GetBodyInterface(ptr noundef %32) #3
  store <2 x float> <float 1.000000e+02, float 1.000000e+00>, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %6, i64 8
  store float 1.000000e+02, ptr %36, align 8, !tbaa !5
  %37 = call ptr @JPC_BoxShapeSettings_Create(ptr noundef nonnull %6) #3
  %38 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %37) #3
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %7) #3
  store <2 x float> <float 0.000000e+00, float -1.000000e+00>, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %8, i64 8
  store float 0.000000e+00, ptr %39, align 8, !tbaa !5
  store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, ptr %9, align 16, !tbaa !5
  call void @JPC_BodyCreationSettings_Set(ptr noundef nonnull %7, ptr noundef %38, ptr noundef nonnull %8, ptr noundef nonnull %9, i8 noundef zeroext 0, i16 noundef zeroext 0) #3
  %40 = call ptr @JPC_BodyInterface_CreateBody(ptr noundef %35, ptr noundef nonnull %7) #3
  %41 = call i32 @JPC_Body_GetID(ptr noundef %40) #3
  call void @JPC_BodyInterface_AddBody(ptr noundef %35, i32 noundef %41, i32 noundef 1) #3
  %42 = call ptr @JPC_SphereShapeSettings_Create(float noundef 5.000000e-01) #3
  %43 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %42) #3
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %10) #3
  store <2 x float> <float 0.000000e+00, float 2.000000e+00>, ptr %11, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %11, i64 8
  store float 0.000000e+00, ptr %44, align 8, !tbaa !5
  store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, ptr %12, align 16, !tbaa !5
  call void @JPC_BodyCreationSettings_Set(ptr noundef nonnull %10, ptr noundef %43, ptr noundef nonnull %11, ptr noundef nonnull %12, i8 noundef zeroext 2, i16 noundef zeroext 1) #3
  %45 = call i32 @JPC_BodyInterface_CreateAndAddBody(ptr noundef %35, ptr noundef nonnull %10, i32 noundef 0) #3
  %46 = call zeroext i1 @JPC_Body_IsStatic(ptr noundef %40) #3
  br i1 %46, label %47, label %123

47:                                               ; preds = %0
  %48 = call zeroext i1 @JPC_Body_IsDynamic(ptr noundef %40) #3
  br i1 %48, label %123, label %49

49:                                               ; preds = %47
  store <2 x float> <float 0.000000e+00, float -5.000000e+00>, ptr %13, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %13, i64 8
  store float 0.000000e+00, ptr %50, align 8, !tbaa !5
  call void @JPC_BodyInterface_SetLinearVelocity(ptr noundef %35, i32 noundef %45, ptr noundef nonnull %13) #3
  call void @JPC_PhysicsSystem_OptimizeBroadPhase(ptr noundef %32) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #3
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @JPC_PhysicsSystem_GetBodyIDs(ptr noundef %32, i32 noundef 2, ptr noundef nonnull %15, ptr noundef nonnull %14) #3
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %.not = icmp eq i32 %51, 2
  %52 = load i32, ptr %14, align 4
  %.not118 = icmp eq i32 %52, %41
  %or.cond = select i1 %.not, i1 %.not118, i1 false
  br i1 %or.cond, label %53, label %.critedge

53:                                               ; preds = %49
  %54 = getelementptr inbounds i8, ptr %14, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %.not119 = icmp eq i32 %55, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  br i1 %.not119, label %56, label %123

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #3
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @JPC_PhysicsSystem_GetActiveBodyIDs(ptr noundef %32, i32 noundef 2, ptr noundef nonnull %17, ptr noundef nonnull %16) #3
  %57 = load i32, ptr %17, align 4, !tbaa !9
  %.not120 = icmp eq i32 %57, 1
  br i1 %.not120, label %58, label %.critedge134

58:                                               ; preds = %56
  %59 = load i32, ptr %16, align 4, !tbaa !9
  %.not121 = icmp eq i32 %59, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #3
  br i1 %.not121, label %.preheader, label %123

.preheader:                                       ; preds = %58
  %60 = call zeroext i1 @JPC_BodyInterface_IsActive(ptr noundef %35, i32 noundef %45) #3
  br i1 %60, label %.lr.ph156, label %._crit_edge157

.lr.ph156:                                        ; preds = %.preheader
  %61 = and i32 %45, 8388607
  %62 = zext nneg i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %23, i64 16
  br label %64

64:                                               ; preds = %.lr.ph156, %117
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #3
  call void @JPC_BodyInterface_GetCenterOfMassPosition(ptr noundef %35, i32 noundef %45, ptr noundef nonnull %18) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #3
  call void @JPC_BodyInterface_GetLinearVelocity(ptr noundef %35, i32 noundef %45, ptr noundef nonnull %19) #3
  %65 = call zeroext i8 @JPC_PhysicsSystem_Update(ptr noundef %32, float noundef 0x3F91111120000000, i32 noundef 1, ptr noundef %24, ptr noundef %25) #3
  %.not124 = icmp eq i8 %65, 0
  br i1 %.not124, label %66, label %.thread148

.thread148:                                       ; preds = %64
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #3
  br label %123

66:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #3
  store i32 0, ptr %21, align 4, !tbaa !9
  call void @JPC_PhysicsSystem_GetBodyIDs(ptr noundef %32, i32 noundef 16, ptr noundef nonnull %21, ptr noundef nonnull %20) #3
  %67 = call ptr @JPC_PhysicsSystem_GetBodyLockInterface(ptr noundef %32) #3
  %68 = load i32, ptr %21, align 4, !tbaa !9
  %.not158 = icmp eq i32 %68, 0
  br i1 %.not158, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #3
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %20) #3
  %69 = call ptr @JPC_PhysicsSystem_GetBodiesUnsafe(ptr noundef %32) #3
  %70 = getelementptr inbounds ptr, ptr %69, i64 %62
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = ptrtoint ptr %71 to i64
  %73 = and i64 %72, 1
  %74 = icmp eq i64 %73, 0
  br i1 %74, label %80, label %.thread.preheader

.lr.ph:                                           ; preds = %66, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %66 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %22) #3
  %75 = getelementptr inbounds [16 x i32], ptr %20, i64 0, i64 %indvars.iv
  %76 = load i32, ptr %75, align 4, !tbaa !9
  call void @JPC_BodyLockInterface_LockRead(ptr noundef %67, i32 noundef %76, ptr noundef nonnull %22) #3
  call void @JPC_BodyLockInterface_UnlockRead(ptr noundef %67, ptr noundef nonnull %22) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %77 = load i32, ptr %21, align 4, !tbaa !9
  %78 = zext i32 %77 to i64
  %79 = icmp ult i64 %indvars.iv.next, %78
  br i1 %79, label %.lr.ph, label %._crit_edge, !llvm.loop !13

80:                                               ; preds = %._crit_edge
  %81 = getelementptr inbounds i8, ptr %71, i64 112
  %82 = load i32, ptr %81, align 16, !tbaa !15
  %83 = icmp eq i32 %82, %45
  br i1 %83, label %84, label %.thread.preheader

84:                                               ; preds = %80
  %85 = getelementptr inbounds i8, ptr %71, i64 104
  store float 0x3FC99999A0000000, ptr %85, align 8, !tbaa !20
  br label %.thread.preheader

.thread.preheader:                                ; preds = %80, %._crit_edge, %84
  br label %.thread

.thread:                                          ; preds = %.thread.preheader, %.thread
  %.0114 = phi i32 [ %88, %.thread ], [ 0, %.thread.preheader ]
  %86 = call i32 @JPC_PhysicsSystem_GetNumBodies(ptr noundef %32) #3
  %87 = icmp ult i32 %.0114, %86
  %88 = add nuw i32 %.0114, 1
  br i1 %87, label %.thread, label %89, !llvm.loop !21

89:                                               ; preds = %.thread
  %90 = call ptr @JPC_PhysicsSystem_GetBodiesUnsafe(ptr noundef %32) #3
  %91 = call ptr @JPC_PhysicsSystem_GetBodyLockInterface(ptr noundef %32) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %23) #3
  call void @JPC_BodyLockInterface_LockRead(ptr noundef %91, i32 noundef %45, ptr noundef nonnull %23) #3
  %92 = load ptr, ptr %63, align 8, !tbaa !22
  %.not126 = icmp eq ptr %92, null
  br i1 %.not126, label %117, label %93

93:                                               ; preds = %89
  %94 = getelementptr inbounds ptr, ptr %90, i64 %62
  %95 = load ptr, ptr %94, align 8, !tbaa !11
  %96 = ptrtoint ptr %95 to i64
  %97 = and i64 %96, 1
  %98 = icmp eq i64 %97, 0
  br i1 %98, label %99, label %.thread151

99:                                               ; preds = %93
  %100 = call zeroext i1 @JPC_Body_IsDynamic(ptr noundef %95) #3
  br i1 %100, label %101, label %.thread151

101:                                              ; preds = %99
  %102 = load ptr, ptr %94, align 8, !tbaa !11
  %103 = ptrtoint ptr %102 to i64
  %104 = and i64 %103, 1
  %105 = icmp eq i64 %104, 0
  br i1 %105, label %106, label %.thread151

106:                                              ; preds = %101
  %107 = getelementptr inbounds i8, ptr %102, i64 112
  %108 = load i32, ptr %107, align 16, !tbaa !15
  %109 = icmp eq i32 %108, %45
  %spec.select135 = select i1 %109, ptr %102, ptr null
  %110 = icmp ne ptr %spec.select135, null
  %.not128 = icmp eq ptr %spec.select135, %95
  %or.cond137 = and i1 %110, %.not128
  br i1 %or.cond137, label %111, label %.thread151

111:                                              ; preds = %106
  %112 = getelementptr inbounds i8, ptr %spec.select135, i64 112
  %113 = load i32, ptr %112, align 16, !tbaa !15
  %114 = getelementptr inbounds i8, ptr %95, i64 112
  %115 = load i32, ptr %114, align 16, !tbaa !15
  %.not129 = icmp eq i32 %113, %115
  %116 = load ptr, ptr %63, align 8
  %.not130 = icmp eq ptr %95, %116
  %or.cond138 = select i1 %.not129, i1 %.not130, i1 false
  %.not131 = icmp eq i32 %115, %45
  %or.cond154 = select i1 %or.cond138, i1 %.not131, i1 false
  br i1 %or.cond154, label %117, label %.thread151

.thread151:                                       ; preds = %101, %111, %106, %99, %93
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #3
  br label %123

117:                                              ; preds = %111, %89
  call void @JPC_BodyLockInterface_UnlockRead(ptr noundef %91, ptr noundef nonnull %23) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #3
  %118 = call zeroext i1 @JPC_BodyInterface_IsActive(ptr noundef %35, i32 noundef %45) #3
  br i1 %118, label %64, label %._crit_edge157, !llvm.loop !24

._crit_edge157:                                   ; preds = %117, %.preheader
  call void @JPC_BodyInterface_RemoveBody(ptr noundef %35, i32 noundef %45) #3
  call void @JPC_BodyInterface_DestroyBody(ptr noundef %35, i32 noundef %45) #3
  call void @JPC_BodyInterface_RemoveBody(ptr noundef %35, i32 noundef %41) #3
  call void @JPC_BodyInterface_DestroyBody(ptr noundef %35, i32 noundef %41) #3
  call void @JPC_ShapeSettings_Release(ptr noundef %37) #3
  %119 = call i32 @JPC_Shape_GetRefCount(ptr noundef %38) #3
  %.not122 = icmp eq i32 %119, 1
  br i1 %.not122, label %120, label %123

120:                                              ; preds = %._crit_edge157
  call void @JPC_Shape_Release(ptr noundef %38) #3
  call void @JPC_ShapeSettings_Release(ptr noundef %42) #3
  %121 = call i32 @JPC_Shape_GetRefCount(ptr noundef %43) #3
  %.not123 = icmp eq i32 %121, 1
  br i1 %.not123, label %122, label %123

122:                                              ; preds = %120
  call void @JPC_Shape_Release(ptr noundef %43) #3
  call void @JPC_PhysicsSystem_Destroy(ptr noundef %32) #3
  call void @JPC_JobSystem_Destroy(ptr noundef %25) #3
  call void @JPC_TempAllocator_Destroy(ptr noundef %24) #3
  call void @JPC_DestroyFactory() #3
  br label %123

.critedge:                                        ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  br label %123

.critedge134:                                     ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #3
  br label %123

123:                                              ; preds = %.thread151, %.thread148, %122, %._crit_edge157, %120, %.critedge134, %.critedge, %47, %0, %58, %53
  %.9 = phi i32 [ 0, %58 ], [ 0, %53 ], [ 0, %0 ], [ 0, %47 ], [ 0, %.critedge ], [ 0, %.critedge134 ], [ 1, %122 ], [ 0, %._crit_edge157 ], [ 0, %120 ], [ 0, %.thread148 ], [ 0, %.thread151 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #3
  ret i32 %.9
}

declare ptr @JPC_SphereShapeSettings_Create(float noundef) local_unnamed_addr #0

declare i32 @JPC_BodyInterface_CreateAndAddBody(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @JPC_BodyInterface_SetLinearVelocity(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @JPC_PhysicsSystem_GetBodyIDs(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @JPC_PhysicsSystem_GetActiveBodyIDs(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare zeroext i1 @JPC_BodyInterface_IsActive(ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @JPC_BodyInterface_GetCenterOfMassPosition(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @JPC_BodyInterface_GetLinearVelocity(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare ptr @JPC_PhysicsSystem_GetBodyLockInterface(ptr noundef) local_unnamed_addr #0

declare void @JPC_BodyLockInterface_LockRead(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @JPC_BodyLockInterface_UnlockRead(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @JPC_PhysicsSystem_GetBodiesUnsafe(ptr noundef) local_unnamed_addr #0

declare i32 @JPC_PhysicsSystem_GetNumBodies(ptr noundef) local_unnamed_addr #0

attributes #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !10, i64 112}
!16 = !{!"JPC_Body", !7, i64 0, !7, i64 16, !7, i64 32, !7, i64 48, !12, i64 64, !12, i64 72, !17, i64 80, !18, i64 88, !6, i64 104, !6, i64 108, !10, i64 112, !19, i64 116, !7, i64 118, !7, i64 119, !7, i64 120, !7, i64 121}
!17 = !{!"long", !7, i64 0}
!18 = !{!"JPC_CollisionGroup", !12, i64 0, !10, i64 8, !10, i64 12}
!19 = !{!"short", !7, i64 0}
!20 = !{!16, !6, i64 104}
!21 = distinct !{!21, !14}
!22 = !{!23, !12, i64 16}
!23 = !{!"JPC_BodyLockRead", !12, i64 0, !12, i64 8, !12, i64 16}
!24 = distinct !{!24, !14}


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