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

; Function Attrs: nounwind uwtable
define dso_local i32 @JoltCTest_Basic1() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %struct.BPLayerInterfaceImpl, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.MyBroadPhaseFilter, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.MyObjectFilter, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca [3 x float], align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  call void @JPC_RegisterDefaultAllocator()
  call void @JPC_CreateFactory()
  call void @JPC_RegisterTypes()
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1024, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1024, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1024, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %17 = call noalias ptr @malloc(i64 noundef 16) #6
  store ptr %17, ptr %6, align 8, !tbaa !9
  %18 = load ptr, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  %19 = call { ptr, i64 } @BPLayerInterface_Init()
  %20 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %21 = extractvalue { ptr, i64 } %19, 0
  store ptr %21, ptr %20, align 8
  %22 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %23 = extractvalue { ptr, i64 } %19, 1
  store i64 %23, ptr %22, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %24 = call noalias ptr @malloc(i64 noundef 8) #6
  store ptr %24, ptr %8, align 8, !tbaa !9
  %25 = load ptr, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %26 = call ptr @MyBroadPhaseFilter_Init()
  %27 = getelementptr inbounds %struct.MyBroadPhaseFilter, ptr %9, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %28 = call noalias ptr @malloc(i64 noundef 8) #6
  store ptr %28, ptr %10, align 8, !tbaa !9
  %29 = load ptr, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %30 = call ptr @MyObjectFilter_Init()
  %31 = getelementptr inbounds %struct.MyObjectFilter, ptr %11, i32 0, i32 0
  store ptr %30, ptr %31, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = load ptr, ptr %8, align 8, !tbaa !9
  %34 = load ptr, ptr %10, align 8, !tbaa !9
  %35 = call ptr @JPC_PhysicsSystem_Create(i32 noundef 1024, i32 noundef 0, i32 noundef 1024, i32 noundef 1024, ptr noundef %32, ptr noundef %33, ptr noundef %34)
  store ptr %35, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store float 1.000000e+01, ptr %14, align 4, !tbaa !14
  %36 = getelementptr inbounds float, ptr %14, i64 1
  store float 2.000000e+01, ptr %36, align 4, !tbaa !14
  %37 = getelementptr inbounds float, ptr %14, i64 2
  store float 3.000000e+01, ptr %37, align 4, !tbaa !14
  %38 = getelementptr inbounds [3 x float], ptr %14, i64 0, i64 0
  %39 = call ptr @JPC_BoxShapeSettings_Create(ptr noundef %38)
  store ptr %39, ptr %13, align 8, !tbaa !9
  %40 = load ptr, ptr %13, align 8, !tbaa !9
  %41 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %40)
  %42 = icmp ne i32 %41, 1
  br i1 %42, label %43, label %44

43:                                               ; preds = %0
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %116

44:                                               ; preds = %0
  %45 = load ptr, ptr %13, align 8, !tbaa !9
  call void @JPC_ShapeSettings_AddRef(ptr noundef %45)
  %46 = load ptr, ptr %13, align 8, !tbaa !9
  call void @JPC_ShapeSettings_Release(ptr noundef %46)
  %47 = load ptr, ptr %13, align 8, !tbaa !9
  %48 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %47)
  %49 = icmp ne i32 %48, 1
  br i1 %49, label %50, label %51

50:                                               ; preds = %44
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %116

51:                                               ; preds = %44
  %52 = load ptr, ptr %13, align 8, !tbaa !9
  call void @JPC_BoxShapeSettings_SetConvexRadius(ptr noundef %52, float noundef 1.000000e+00)
  %53 = load ptr, ptr %13, align 8, !tbaa !9
  %54 = call float @JPC_BoxShapeSettings_GetConvexRadius(ptr noundef %53)
  %55 = fpext float %54 to double
  %56 = fcmp une double %55, 1.000000e+00
  br i1 %56, label %57, label %58

57:                                               ; preds = %51
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %116

58:                                               ; preds = %51
  %59 = load ptr, ptr %13, align 8, !tbaa !9
  call void @JPC_ConvexShapeSettings_SetDensity(ptr noundef %59, float noundef 1.000000e+02)
  %60 = load ptr, ptr %13, align 8, !tbaa !9
  %61 = call float @JPC_ConvexShapeSettings_GetDensity(ptr noundef %60)
  %62 = fpext float %61 to double
  %63 = fcmp une double %62, 1.000000e+02
  br i1 %63, label %64, label %65

64:                                               ; preds = %58
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %116

65:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %66 = load ptr, ptr %13, align 8, !tbaa !9
  %67 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %66)
  store ptr %67, ptr %16, align 8, !tbaa !9
  %68 = load ptr, ptr %16, align 8, !tbaa !9
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %71

70:                                               ; preds = %65
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %115

71:                                               ; preds = %65
  %72 = load ptr, ptr %16, align 8, !tbaa !9
  %73 = call zeroext i8 @JPC_Shape_GetType(ptr noundef %72)
  %74 = zext i8 %73 to i32
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %71
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %115

77:                                               ; preds = %71
  %78 = load ptr, ptr %16, align 8, !tbaa !9
  %79 = call zeroext i8 @JPC_Shape_GetSubType(ptr noundef %78)
  %80 = zext i8 %79 to i32
  %81 = icmp ne i32 %80, 1
  br i1 %81, label %82, label %83

82:                                               ; preds = %77
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %115

83:                                               ; preds = %77
  %84 = load ptr, ptr %16, align 8, !tbaa !9
  %85 = call i32 @JPC_Shape_GetRefCount(ptr noundef %84)
  %86 = icmp ne i32 %85, 2
  br i1 %86, label %87, label %88

87:                                               ; preds = %83
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %115

88:                                               ; preds = %83
  %89 = load ptr, ptr %13, align 8, !tbaa !9
  %90 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %89)
  %91 = load ptr, ptr %16, align 8, !tbaa !9
  %92 = call i32 @JPC_Shape_GetRefCount(ptr noundef %91)
  %93 = icmp ne i32 %92, 3
  br i1 %93, label %94, label %95

94:                                               ; preds = %88
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %115

95:                                               ; preds = %88
  %96 = load ptr, ptr %16, align 8, !tbaa !9
  call void @JPC_Shape_Release(ptr noundef %96)
  %97 = load ptr, ptr %16, align 8, !tbaa !9
  %98 = call i32 @JPC_Shape_GetRefCount(ptr noundef %97)
  %99 = icmp ne i32 %98, 2
  br i1 %99, label %100, label %101

100:                                              ; preds = %95
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %115

101:                                              ; preds = %95
  %102 = load ptr, ptr %13, align 8, !tbaa !9
  %103 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %102)
  %104 = icmp ne i32 %103, 1
  br i1 %104, label %105, label %106

105:                                              ; preds = %101
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %115

106:                                              ; preds = %101
  %107 = load ptr, ptr %13, align 8, !tbaa !9
  call void @JPC_ShapeSettings_Release(ptr noundef %107)
  store ptr null, ptr %13, align 8, !tbaa !9
  %108 = load ptr, ptr %16, align 8, !tbaa !9
  %109 = call i32 @JPC_Shape_GetRefCount(ptr noundef %108)
  %110 = icmp ne i32 %109, 1
  br i1 %110, label %111, label %112

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

112:                                              ; preds = %106
  %113 = load ptr, ptr %16, align 8, !tbaa !9
  call void @JPC_Shape_Release(ptr noundef %113)
  store ptr null, ptr %16, align 8, !tbaa !9
  %114 = load ptr, ptr %12, align 8, !tbaa !9
  call void @JPC_PhysicsSystem_Destroy(ptr noundef %114)
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @JPC_DestroyFactory()
  store i32 1, ptr %1, align 4
  store i32 1, ptr %15, align 4
  br label %115

115:                                              ; preds = %112, %111, %105, %100, %94, %87, %82, %76, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %116

116:                                              ; preds = %115, %64, %57, %50, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %117 = load i32, ptr %1, align 4
  ret i32 %117
}

declare void @JPC_RegisterDefaultAllocator() #1

declare void @JPC_CreateFactory() #1

declare void @JPC_RegisterTypes() #1

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

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

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

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

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

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

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

declare ptr @JPC_BoxShapeSettings_Create(ptr noundef) #1

declare i32 @JPC_ShapeSettings_GetRefCount(ptr noundef) #1

declare void @JPC_ShapeSettings_AddRef(ptr noundef) #1

declare void @JPC_ShapeSettings_Release(ptr noundef) #1

declare void @JPC_BoxShapeSettings_SetConvexRadius(ptr noundef, float noundef) #1

declare float @JPC_BoxShapeSettings_GetConvexRadius(ptr noundef) #1

declare void @JPC_ConvexShapeSettings_SetDensity(ptr noundef, float noundef) #1

declare float @JPC_ConvexShapeSettings_GetDensity(ptr noundef) #1

declare ptr @JPC_ShapeSettings_CreateShape(ptr noundef) #1

declare zeroext i8 @JPC_Shape_GetType(ptr noundef) #1

declare zeroext i8 @JPC_Shape_GetSubType(ptr noundef) #1

declare i32 @JPC_Shape_GetRefCount(ptr noundef) #1

declare void @JPC_Shape_Release(ptr noundef) #1

declare void @JPC_PhysicsSystem_Destroy(ptr noundef) #1

declare void @JPC_DestroyFactory() #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i64 0, i64 8, !9, i64 8, i64 2, !12}
!12 = !{!7, !7, i64 0}
!13 = !{i64 0, i64 8, !9}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !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"

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @JoltCTest_Basic1() local_unnamed_addr #0 {
  %1 = alloca [3 x float], align 8
  tail call void @JPC_RegisterDefaultAllocator() #3
  tail call void @JPC_CreateFactory() #3
  tail call void @JPC_RegisterTypes() #3
  %2 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
  %3 = tail call { ptr, i64 } @BPLayerInterface_Init()
  %4 = extractvalue { ptr, i64 } %3, 0
  %5 = extractvalue { ptr, i64 } %3, 1
  store ptr %4, ptr %2, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  store i64 %5, ptr %.sroa.4.0..sroa_idx, align 8
  %6 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #4
  %7 = tail call ptr @MyBroadPhaseFilter_Init()
  store ptr %7, ptr %6, align 8, !tbaa !5
  %8 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #4
  %9 = tail call ptr @MyObjectFilter_Init()
  store ptr %9, ptr %8, align 8, !tbaa !5
  %10 = tail call ptr @JPC_PhysicsSystem_Create(i32 noundef 1024, i32 noundef 0, i32 noundef 1024, i32 noundef 1024, ptr noundef nonnull %2, ptr noundef nonnull %6, ptr noundef nonnull %8) #3
  store <2 x float> <float 1.000000e+01, float 2.000000e+01>, ptr %1, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  store float 3.000000e+01, ptr %11, align 8, !tbaa !9
  %12 = call ptr @JPC_BoxShapeSettings_Create(ptr noundef nonnull %1) #3
  %13 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %12) #3
  %.not = icmp eq i32 %13, 1
  br i1 %.not, label %14, label %41

14:                                               ; preds = %0
  call void @JPC_ShapeSettings_AddRef(ptr noundef %12) #3
  call void @JPC_ShapeSettings_Release(ptr noundef %12) #3
  %15 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %12) #3
  %.not31 = icmp eq i32 %15, 1
  br i1 %.not31, label %16, label %41

16:                                               ; preds = %14
  call void @JPC_BoxShapeSettings_SetConvexRadius(ptr noundef %12, float noundef 1.000000e+00) #3
  %17 = call float @JPC_BoxShapeSettings_GetConvexRadius(ptr noundef %12) #3
  %18 = fcmp une float %17, 1.000000e+00
  br i1 %18, label %41, label %19

19:                                               ; preds = %16
  call void @JPC_ConvexShapeSettings_SetDensity(ptr noundef %12, float noundef 1.000000e+02) #3
  %20 = call float @JPC_ConvexShapeSettings_GetDensity(ptr noundef %12) #3
  %21 = fcmp une float %20, 1.000000e+02
  br i1 %21, label %41, label %22

22:                                               ; preds = %19
  %23 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %12) #3
  %24 = icmp eq ptr %23, null
  br i1 %24, label %41, label %25

25:                                               ; preds = %22
  %26 = call zeroext i8 @JPC_Shape_GetType(ptr noundef nonnull %23) #3
  %.not32 = icmp eq i8 %26, 0
  br i1 %.not32, label %27, label %41

27:                                               ; preds = %25
  %28 = call zeroext i8 @JPC_Shape_GetSubType(ptr noundef nonnull %23) #3
  %.not33 = icmp eq i8 %28, 1
  br i1 %.not33, label %29, label %41

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

31:                                               ; preds = %29
  %32 = call ptr @JPC_ShapeSettings_CreateShape(ptr noundef %12) #3
  %33 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %23) #3
  %.not35 = icmp eq i32 %33, 3
  br i1 %.not35, label %34, label %41

34:                                               ; preds = %31
  call void @JPC_Shape_Release(ptr noundef nonnull %23) #3
  %35 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %23) #3
  %.not36 = icmp eq i32 %35, 2
  br i1 %.not36, label %36, label %41

36:                                               ; preds = %34
  %37 = call i32 @JPC_ShapeSettings_GetRefCount(ptr noundef %12) #3
  %.not37 = icmp eq i32 %37, 1
  br i1 %.not37, label %38, label %41

38:                                               ; preds = %36
  call void @JPC_ShapeSettings_Release(ptr noundef %12) #3
  %39 = call i32 @JPC_Shape_GetRefCount(ptr noundef nonnull %23) #3
  %.not38 = icmp eq i32 %39, 1
  br i1 %.not38, label %40, label %41

40:                                               ; preds = %38
  call void @JPC_Shape_Release(ptr noundef nonnull %23) #3
  call void @JPC_PhysicsSystem_Destroy(ptr noundef %10) #3
  call void @JPC_DestroyFactory() #3
  br label %41

41:                                               ; preds = %40, %22, %25, %27, %29, %31, %34, %36, %38, %19, %16, %14, %0
  %.1 = phi i32 [ 0, %0 ], [ 0, %14 ], [ 0, %16 ], [ 0, %19 ], [ 1, %40 ], [ 0, %22 ], [ 0, %25 ], [ 0, %27 ], [ 0, %29 ], [ 0, %31 ], [ 0, %34 ], [ 0, %36 ], [ 0, %38 ]
  ret i32 %.1
}

declare void @JPC_RegisterDefaultAllocator() local_unnamed_addr #1

declare void @JPC_CreateFactory() local_unnamed_addr #1

declare void @JPC_RegisterTypes() local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

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

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

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

declare ptr @JPC_BoxShapeSettings_Create(ptr noundef) local_unnamed_addr #1

declare i32 @JPC_ShapeSettings_GetRefCount(ptr noundef) local_unnamed_addr #1

declare void @JPC_ShapeSettings_AddRef(ptr noundef) local_unnamed_addr #1

declare void @JPC_ShapeSettings_Release(ptr noundef) local_unnamed_addr #1

declare void @JPC_BoxShapeSettings_SetConvexRadius(ptr noundef, float noundef) local_unnamed_addr #1

declare float @JPC_BoxShapeSettings_GetConvexRadius(ptr noundef) local_unnamed_addr #1

declare void @JPC_ConvexShapeSettings_SetDensity(ptr noundef, float noundef) local_unnamed_addr #1

declare float @JPC_ConvexShapeSettings_GetDensity(ptr noundef) local_unnamed_addr #1

declare ptr @JPC_ShapeSettings_CreateShape(ptr noundef) local_unnamed_addr #1

declare zeroext i8 @JPC_Shape_GetType(ptr noundef) local_unnamed_addr #1

declare zeroext i8 @JPC_Shape_GetSubType(ptr noundef) local_unnamed_addr #1

declare i32 @JPC_Shape_GetRefCount(ptr noundef) local_unnamed_addr #1

declare void @JPC_Shape_Release(ptr noundef) local_unnamed_addr #1

declare void @JPC_PhysicsSystem_Destroy(ptr noundef) local_unnamed_addr #1

declare void @JPC_DestroyFactory() local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 }
attributes #4 = { nounwind allocsize(0) }

!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 = !{!"float", !7, i64 0}


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