; 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] }

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 i32 @JPC_ShapeSettings_GetRefCount(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

; Function Attrs: nounwind uwtable
define dso_local i32 @JoltCTest_Basic2() #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 [3 x float], align 4
  %16 = alloca i32, 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 ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i8, align 1
  call void @JPC_RegisterDefaultAllocator()
  call void @JPC_CreateFactory()
  call void @JPC_RegisterTypes()
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  %27 = call ptr @JPC_TempAllocator_Create(i32 noundef 10485760)
  store ptr %27, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %28 = call ptr @JPC_JobSystem_Create(i32 noundef 2048, i32 noundef 8, i32 noundef -1)
  store ptr %28, 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
  %29 = call { ptr, i64 } @BPLayerInterface_Init()
  %30 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  %31 = extractvalue { ptr, i64 } %29, 0
  store ptr %31, ptr %30, align 8
  %32 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  %33 = extractvalue { ptr, i64 } %29, 1
  store i64 %33, ptr %32, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %34 = call ptr @MyBroadPhaseFilter_Init()
  %35 = getelementptr inbounds %struct.MyBroadPhaseFilter, ptr %9, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %36 = call ptr @MyObjectFilter_Init()
  %37 = getelementptr inbounds %struct.MyObjectFilter, ptr %10, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %38 = 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 %38, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %39 = call ptr @MyActivationListener_Init()
  %40 = getelementptr inbounds %struct.MyActivationListener, ptr %12, i32 0, i32 0
  store ptr %39, ptr %40, align 8
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_SetBodyActivationListener(ptr noundef %41, ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %42 = call ptr @MyContactListener_Init()
  %43 = getelementptr inbounds %struct.MyContactListener, ptr %13, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_SetContactListener(ptr noundef %44, ptr noundef %13)
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_SetContactListener(ptr noundef %45, ptr noundef null)
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_SetContactListener(ptr noundef %46, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  store float 1.000000e+02, ptr %15, align 4, !tbaa !11
  %47 = getelementptr inbounds float, ptr %15, i64 1
  store float 1.000000e+00, ptr %47, align 4, !tbaa !11
  %48 = getelementptr inbounds float, ptr %15, i64 2
  store float 1.000000e+02, ptr %48, align 4, !tbaa !11
  %49 = getelementptr inbounds [3 x float], ptr %15, i64 0, i64 0
  %50 = call ptr @JPC_BoxShapeSettings_Create(ptr noundef %49)
  store ptr %50, ptr %14, align 8, !tbaa !5
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %51)
  %53 = icmp ne i32 %52, 1
  br i1 %53, label %54, label %55

54:                                               ; preds = %0
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %219

55:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %56)
  store ptr %57, ptr %17, align 8, !tbaa !5
  %58 = load ptr, ptr %17, align 8, !tbaa !5
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %61

60:                                               ; preds = %55
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %218

61:                                               ; preds = %55
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  %63 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %62)
  %64 = icmp ne i32 %63, 1
  br i1 %64, label %65, label %66

65:                                               ; preds = %61
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %218

66:                                               ; preds = %61
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  %68 = call i32 @JPC_Shape_GetRefCount(ptr noundef %67)
  %69 = icmp ne i32 %68, 2
  br i1 %69, label %70, label %71

70:                                               ; preds = %66
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %218

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 256, ptr %18) #3
  %72 = load ptr, ptr %17, align 8, !tbaa !5
  store float 0.000000e+00, ptr %19, align 4, !tbaa !11
  %73 = getelementptr inbounds float, ptr %19, i64 1
  store float -1.000000e+00, ptr %73, align 4, !tbaa !11
  %74 = getelementptr inbounds float, ptr %19, i64 2
  store float 0.000000e+00, ptr %74, align 4, !tbaa !11
  %75 = getelementptr inbounds [3 x float], ptr %19, i64 0, i64 0
  store float 0.000000e+00, ptr %20, align 4, !tbaa !11
  %76 = getelementptr inbounds float, ptr %20, i64 1
  store float 0.000000e+00, ptr %76, align 4, !tbaa !11
  %77 = getelementptr inbounds float, ptr %20, i64 2
  store float 0.000000e+00, ptr %77, align 4, !tbaa !11
  %78 = getelementptr inbounds float, ptr %20, i64 3
  store float 1.000000e+00, ptr %78, align 4, !tbaa !11
  %79 = getelementptr inbounds [4 x float], ptr %20, i64 0, i64 0
  call void @JPC_BodyCreationSettings_Set(ptr noundef %18, ptr noundef %72, ptr noundef %75, ptr noundef %79, i8 noundef zeroext 0, i16 noundef zeroext 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = call ptr @JPC_PhysicsSystem_GetBodyInterface(ptr noundef %80)
  store ptr %81, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %82 = load ptr, ptr %21, align 8, !tbaa !5
  %83 = call ptr @JPC_BodyInterface_CreateBody(ptr noundef %82, ptr noundef %18)
  store ptr %83, ptr %22, align 8, !tbaa !5
  %84 = load ptr, ptr %22, align 8, !tbaa !5
  %85 = icmp eq ptr %84, null
  br i1 %85, label %86, label %87

86:                                               ; preds = %71
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %217

87:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %88 = load ptr, ptr %22, align 8, !tbaa !5
  %89 = call i32 @JPC_Body_GetID(ptr noundef %88)
  store i32 %89, ptr %23, align 4, !tbaa !9
  %90 = load i32, ptr %23, align 4, !tbaa !9
  %91 = and i32 %90, -16777216
  %92 = lshr i32 %91, 24
  %93 = icmp ne i32 %92, 1
  br i1 %93, label %94, label %95

94:                                               ; preds = %87
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %216

95:                                               ; preds = %87
  %96 = load i32, ptr %23, align 4, !tbaa !9
  %97 = and i32 %96, 8388607
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %95
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %216

100:                                              ; preds = %95
  %101 = load ptr, ptr %22, align 8, !tbaa !5
  %102 = call zeroext i1 @JPC_Body_IsStatic(ptr noundef %101)
  %103 = zext i1 %102 to i32
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %100
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %216

106:                                              ; preds = %100
  %107 = load ptr, ptr %22, align 8, !tbaa !5
  %108 = call zeroext i1 @JPC_Body_IsDynamic(ptr noundef %107)
  %109 = zext i1 %108 to i32
  %110 = icmp eq i32 %109, 1
  br i1 %110, label %111, label %112

111:                                              ; preds = %106
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %216

112:                                              ; preds = %106
  %113 = load ptr, ptr %17, align 8, !tbaa !5
  %114 = call i32 @JPC_Shape_GetRefCount(ptr noundef %113)
  %115 = icmp ne i32 %114, 3
  br i1 %115, label %116, label %117

116:                                              ; preds = %112
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %216

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %118 = load ptr, ptr %21, align 8, !tbaa !5
  %119 = call ptr @JPC_BodyInterface_CreateBody(ptr noundef %118, ptr noundef %18)
  store ptr %119, ptr %24, align 8, !tbaa !5
  %120 = load ptr, ptr %24, align 8, !tbaa !5
  %121 = icmp eq ptr %120, null
  br i1 %121, label %122, label %123

122:                                              ; preds = %117
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %215

123:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  %124 = load ptr, ptr %24, align 8, !tbaa !5
  %125 = call i32 @JPC_Body_GetID(ptr noundef %124)
  store i32 %125, ptr %25, align 4, !tbaa !9
  %126 = load i32, ptr %25, align 4, !tbaa !9
  %127 = and i32 %126, -16777216
  %128 = lshr i32 %127, 24
  %129 = icmp ne i32 %128, 1
  br i1 %129, label %130, label %131

130:                                              ; preds = %123
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %214

131:                                              ; preds = %123
  %132 = load i32, ptr %25, align 4, !tbaa !9
  %133 = and i32 %132, 8388607
  %134 = icmp ne i32 %133, 1
  br i1 %134, label %135, label %136

135:                                              ; preds = %131
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %214

136:                                              ; preds = %131
  %137 = load ptr, ptr %21, align 8, !tbaa !5
  %138 = load i32, ptr %23, align 4, !tbaa !9
  %139 = call zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef %137, i32 noundef %138)
  %140 = zext i1 %139 to i32
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %136
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %214

143:                                              ; preds = %136
  %144 = load ptr, ptr %21, align 8, !tbaa !5
  %145 = load i32, ptr %25, align 4, !tbaa !9
  %146 = call zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef %144, i32 noundef %145)
  %147 = zext i1 %146 to i32
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %143
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %214

150:                                              ; preds = %143
  %151 = load ptr, ptr %21, align 8, !tbaa !5
  %152 = load i32, ptr %23, align 4, !tbaa !9
  call void @JPC_BodyInterface_AddBody(ptr noundef %151, i32 noundef %152, i32 noundef 0)
  %153 = load ptr, ptr %21, align 8, !tbaa !5
  %154 = load i32, ptr %23, align 4, !tbaa !9
  %155 = call zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef %153, i32 noundef %154)
  %156 = zext i1 %155 to i32
  %157 = icmp ne i32 %156, 1
  br i1 %157, label %158, label %159

158:                                              ; preds = %150
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %214

159:                                              ; preds = %150
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_OptimizeBroadPhase(ptr noundef %160)
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #3
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  %162 = load ptr, ptr %2, align 8, !tbaa !5
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = call zeroext i8 @JPC_PhysicsSystem_Update(ptr noundef %161, float noundef 0x3F91111120000000, i32 noundef 1, ptr noundef %162, ptr noundef %163)
  store i8 %164, ptr %26, align 1, !tbaa !13
  %165 = load i8, ptr %26, align 1, !tbaa !13
  %166 = zext i8 %165 to i32
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %159
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %213

169:                                              ; preds = %159
  %170 = load ptr, ptr %21, align 8, !tbaa !5
  %171 = load i32, ptr %23, align 4, !tbaa !9
  call void @JPC_BodyInterface_RemoveBody(ptr noundef %170, i32 noundef %171)
  %172 = load ptr, ptr %21, align 8, !tbaa !5
  %173 = load i32, ptr %23, align 4, !tbaa !9
  %174 = call zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef %172, i32 noundef %173)
  %175 = zext i1 %174 to i32
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %178

177:                                              ; preds = %169
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %213

178:                                              ; preds = %169
  %179 = load ptr, ptr %17, align 8, !tbaa !5
  %180 = call i32 @JPC_Shape_GetRefCount(ptr noundef %179)
  %181 = icmp ne i32 %180, 4
  br i1 %181, label %182, label %183

182:                                              ; preds = %178
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %213

183:                                              ; preds = %178
  %184 = load ptr, ptr %14, align 8, !tbaa !5
  %185 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %184)
  %186 = icmp ne i32 %185, 1
  br i1 %186, label %187, label %188

187:                                              ; preds = %183
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %213

188:                                              ; preds = %183
  %189 = load ptr, ptr %14, align 8, !tbaa !5
  call void @JPC_ShapeSettings_Release(ptr noundef %189)
  %190 = load ptr, ptr %17, align 8, !tbaa !5
  %191 = call i32 @JPC_Shape_GetRefCount(ptr noundef %190)
  %192 = icmp ne i32 %191, 3
  br i1 %192, label %193, label %194

193:                                              ; preds = %188
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %213

194:                                              ; preds = %188
  %195 = load ptr, ptr %21, align 8, !tbaa !5
  %196 = load i32, ptr %23, align 4, !tbaa !9
  call void @JPC_BodyInterface_DestroyBody(ptr noundef %195, i32 noundef %196)
  %197 = load ptr, ptr %17, align 8, !tbaa !5
  %198 = call i32 @JPC_Shape_GetRefCount(ptr noundef %197)
  %199 = icmp ne i32 %198, 2
  br i1 %199, label %200, label %201

200:                                              ; preds = %194
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %213

201:                                              ; preds = %194
  %202 = load ptr, ptr %21, align 8, !tbaa !5
  %203 = load i32, ptr %25, align 4, !tbaa !9
  call void @JPC_BodyInterface_DestroyBody(ptr noundef %202, i32 noundef %203)
  %204 = load ptr, ptr %17, align 8, !tbaa !5
  %205 = call i32 @JPC_Shape_GetRefCount(ptr noundef %204)
  %206 = icmp ne i32 %205, 1
  br i1 %206, label %207, label %208

207:                                              ; preds = %201
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %213

208:                                              ; preds = %201
  %209 = load ptr, ptr %17, align 8, !tbaa !5
  call void @JPC_Shape_Release(ptr noundef %209)
  %210 = load ptr, ptr %11, align 8, !tbaa !5
  call void @JPC_PhysicsSystem_Destroy(ptr noundef %210)
  %211 = load ptr, ptr %3, align 8, !tbaa !5
  call void @JPC_JobSystem_Destroy(ptr noundef %211)
  %212 = load ptr, ptr %2, align 8, !tbaa !5
  call void @JPC_TempAllocator_Destroy(ptr noundef %212)
  call void @JPC_DestroyFactory()
  store i32 1, ptr %1, align 4
  store i32 1, ptr %16, align 4
  br label %213

213:                                              ; preds = %208, %207, %200, %193, %187, %182, %177, %168
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #3
  br label %214

214:                                              ; preds = %213, %158, %149, %142, %135, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  br label %215

215:                                              ; preds = %214, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  br label %216

216:                                              ; preds = %215, %116, %111, %105, %99, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  br label %217

217:                                              ; preds = %216, %86
  call void @llvm.lifetime.end.p0(i64 8, 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
  br label %218

218:                                              ; preds = %217, %70, %65, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %219

219:                                              ; preds = %218, %54
  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
  %220 = load i32, ptr %1, align 4
  ret i32 %220
}

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 zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef, i32 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

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}


; 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] }

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 i32 @JPC_ShapeSettings_GetRefCount(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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @JoltCTest_Basic2() 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
  tail call void @JPC_RegisterDefaultAllocator() #3
  tail call void @JPC_CreateFactory() #3
  tail call void @JPC_RegisterTypes() #3
  %10 = tail call ptr @JPC_TempAllocator_Create(i32 noundef 10485760) #3
  %11 = 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
  %12 = tail call { ptr, i64 } @BPLayerInterface_Init()
  %13 = extractvalue { ptr, i64 } %12, 0
  store ptr %13, ptr %1, align 8
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = extractvalue { ptr, i64 } %12, 1
  store i64 %15, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %16 = tail call ptr @MyBroadPhaseFilter_Init()
  store ptr %16, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %17 = tail call ptr @MyObjectFilter_Init()
  store ptr %17, ptr %3, align 8
  %18 = 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
  %19 = call ptr @MyActivationListener_Init()
  store ptr %19, ptr %4, align 8
  call void @JPC_PhysicsSystem_SetBodyActivationListener(ptr noundef %18, ptr noundef nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %20 = call ptr @MyContactListener_Init()
  store ptr %20, ptr %5, align 8
  call void @JPC_PhysicsSystem_SetContactListener(ptr noundef %18, ptr noundef nonnull %5) #3
  call void @JPC_PhysicsSystem_SetContactListener(ptr noundef %18, ptr noundef null) #3
  call void @JPC_PhysicsSystem_SetContactListener(ptr noundef %18, ptr noundef nonnull %5) #3
  store <2 x float> <float 1.000000e+02, float 1.000000e+00>, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %6, i64 8
  store float 1.000000e+02, ptr %21, align 8, !tbaa !5
  %22 = call ptr @JPC_BoxShapeSettings_Create(ptr noundef nonnull %6) #3
  %23 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %22) #3
  %.not = icmp eq i32 %23, 1
  br i1 %.not, label %24, label %73

24:                                               ; preds = %0
  %25 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %22) #3
  %26 = icmp eq ptr %25, null
  br i1 %26, label %73, label %27

27:                                               ; preds = %24
  %28 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %22) #3
  %.not58 = icmp eq i32 %28, 1
  br i1 %.not58, label %29, label %73

29:                                               ; preds = %27
  %30 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %25) #3
  %.not59 = icmp eq i32 %30, 2
  br i1 %.not59, label %31, label %73

31:                                               ; preds = %29
  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
  %32 = getelementptr inbounds i8, ptr %8, i64 8
  store float 0.000000e+00, ptr %32, 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 nonnull %25, ptr noundef nonnull %8, ptr noundef nonnull %9, i8 noundef zeroext 0, i16 noundef zeroext 0) #3
  %33 = call ptr @JPC_PhysicsSystem_GetBodyInterface(ptr noundef %18) #3
  %34 = call ptr @JPC_BodyInterface_CreateBody(ptr noundef %33, ptr noundef nonnull %7) #3
  %35 = icmp eq ptr %34, null
  br i1 %35, label %72, label %36

36:                                               ; preds = %31
  %37 = call i32 @JPC_Body_GetID(ptr noundef nonnull %34) #3
  %38 = and i32 %37, -8388609
  %or.cond = icmp eq i32 %38, 16777216
  br i1 %or.cond, label %39, label %72

39:                                               ; preds = %36
  %40 = call zeroext i1 @JPC_Body_IsStatic(ptr noundef nonnull %34) #3
  br i1 %40, label %41, label %72

41:                                               ; preds = %39
  %42 = call zeroext i1 @JPC_Body_IsDynamic(ptr noundef nonnull %34) #3
  br i1 %42, label %72, label %43

43:                                               ; preds = %41
  %44 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %25) #3
  %.not62 = icmp eq i32 %44, 3
  br i1 %.not62, label %45, label %72

45:                                               ; preds = %43
  %46 = call ptr @JPC_BodyInterface_CreateBody(ptr noundef %33, ptr noundef nonnull %7) #3
  %47 = icmp eq ptr %46, null
  br i1 %47, label %72, label %48

48:                                               ; preds = %45
  %49 = call i32 @JPC_Body_GetID(ptr noundef nonnull %46) #3
  %50 = and i32 %49, -8388609
  %or.cond73 = icmp eq i32 %50, 16777217
  br i1 %or.cond73, label %51, label %72

51:                                               ; preds = %48
  %52 = call zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef %33, i32 noundef %37) #3
  br i1 %52, label %72, label %53

53:                                               ; preds = %51
  %54 = call zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef %33, i32 noundef %49) #3
  br i1 %54, label %72, label %55

55:                                               ; preds = %53
  call void @JPC_BodyInterface_AddBody(ptr noundef %33, i32 noundef %37, i32 noundef 0) #3
  %56 = call zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef %33, i32 noundef %37) #3
  br i1 %56, label %57, label %72

57:                                               ; preds = %55
  call void @JPC_PhysicsSystem_OptimizeBroadPhase(ptr noundef %18) #3
  %58 = call zeroext i8 @JPC_PhysicsSystem_Update(ptr noundef %18, float noundef 0x3F91111120000000, i32 noundef 1, ptr noundef %10, ptr noundef %11) #3
  %.not67 = icmp eq i8 %58, 0
  br i1 %.not67, label %59, label %72

59:                                               ; preds = %57
  call void @JPC_BodyInterface_RemoveBody(ptr noundef %33, i32 noundef %37) #3
  %60 = call zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef %33, i32 noundef %37) #3
  br i1 %60, label %72, label %61

61:                                               ; preds = %59
  %62 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %25) #3
  %.not68 = icmp eq i32 %62, 4
  br i1 %.not68, label %63, label %72

63:                                               ; preds = %61
  %64 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %22) #3
  %.not69 = icmp eq i32 %64, 1
  br i1 %.not69, label %65, label %72

65:                                               ; preds = %63
  call void @JPC_ShapeSettings_Release(ptr noundef %22) #3
  %66 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %25) #3
  %.not70 = icmp eq i32 %66, 3
  br i1 %.not70, label %67, label %72

67:                                               ; preds = %65
  call void @JPC_BodyInterface_DestroyBody(ptr noundef %33, i32 noundef %37) #3
  %68 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %25) #3
  %.not71 = icmp eq i32 %68, 2
  br i1 %.not71, label %69, label %72

69:                                               ; preds = %67
  call void @JPC_BodyInterface_DestroyBody(ptr noundef %33, i32 noundef %49) #3
  %70 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %25) #3
  %.not72 = icmp eq i32 %70, 1
  br i1 %.not72, label %71, label %72

71:                                               ; preds = %69
  call void @JPC_Shape_Release(ptr noundef nonnull %25) #3
  call void @JPC_PhysicsSystem_Destroy(ptr noundef %18) #3
  call void @JPC_JobSystem_Destroy(ptr noundef %11) #3
  call void @JPC_TempAllocator_Destroy(ptr noundef %10) #3
  call void @JPC_DestroyFactory() #3
  br label %72

72:                                               ; preds = %36, %39, %41, %43, %48, %51, %53, %55, %69, %67, %65, %63, %61, %59, %57, %71, %45, %31
  %.4 = phi i32 [ 0, %31 ], [ 0, %36 ], [ 0, %39 ], [ 0, %41 ], [ 0, %43 ], [ 0, %45 ], [ 0, %48 ], [ 0, %51 ], [ 0, %53 ], [ 0, %55 ], [ 1, %71 ], [ 0, %57 ], [ 0, %59 ], [ 0, %61 ], [ 0, %63 ], [ 0, %65 ], [ 0, %67 ], [ 0, %69 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %7) #3
  br label %73

73:                                               ; preds = %72, %24, %27, %29, %0
  %.6 = phi i32 [ 0, %0 ], [ %.4, %72 ], [ 0, %24 ], [ 0, %27 ], [ 0, %29 ]
  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 %.6
}

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 zeroext i1 @JPC_BodyInterface_IsAdded(ptr noundef, i32 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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass