; LLVM IR from ClementineAccount/Albuquerque :: lib/bullet/include/Bullet3Collision/NarrowPhaseCollision (b3CpuNarrowPhase)

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

%class.b3Vector3 = type { %union.anon.18 }
%union.anon.18 = type { [4 x float] }
%struct.b3Aabb = type { %union.anon.28, %union.anon.29 }
%union.anon.28 = type { [4 x float] }
%union.anon.29 = type { [4 x float] }
%class.b3CpuNarrowPhase = type <{ ptr, ptr, i32, i32, i32, [4 x i8] }>
%struct.b3CpuNarrowPhaseInternalData = type { %class.b3AlignedObjectArray, %class.b3AlignedObjectArray.0, %class.b3AlignedObjectArray.2, %struct.b3Config, %class.b3AlignedObjectArray.4, %class.b3AlignedObjectArray.6, %class.b3AlignedObjectArray.6, %class.b3AlignedObjectArray.8, %class.b3AlignedObjectArray.10, %class.b3AlignedObjectArray.12, i32, [4 x i8] }
%class.b3AlignedObjectArray = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.b3AlignedObjectArray.0 = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.b3AlignedObjectArray.2 = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%struct.b3Config = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%class.b3AlignedObjectArray.4 = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.b3AlignedObjectArray.6 = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.b3AlignedObjectArray.8 = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.b3AlignedObjectArray.10 = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.b3AlignedObjectArray.12 = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%struct.b3Collidable = type { %union.anon, %union.anon.14, i32, %union.anon.15 }
%union.anon = type { i32 }
%union.anon.14 = type { float }
%union.anon.15 = type { i32 }
%class.b3ConvexUtility = type { ptr, [8 x i8], %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, %class.b3Vector3, float, [4 x i8], %class.b3AlignedObjectArray.6, %class.b3AlignedObjectArray.26, %class.b3AlignedObjectArray.6, [8 x i8] }
%class.b3AlignedObjectArray.26 = type <{ [4 x i8], i32, i32, [4 x i8], ptr, i8, [7 x i8] }>

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI12b3CollidableEixEi(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef) #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN16b3CpuNarrowPhase23registerConvexHullShapeEP15b3ConvexUtility(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %class.b3Vector3, align 16
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca %struct.b3Aabb, align 16
  %13 = alloca %class.b3Vector3, align 16
  %14 = alloca %class.b3Vector3, align 16
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %17 = call noundef i32 @_ZN16b3CpuNarrowPhase18allocateCollidableEv(ptr noundef nonnull align 8 dereferenceable(28) %16)
  store i32 %17, ptr %6, align 4, !tbaa !9
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = icmp slt i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %2
  %21 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %21, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %147

22:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %23 = getelementptr inbounds %class.b3CpuNarrowPhase, ptr %16, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds %struct.b3CpuNarrowPhaseInternalData, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI12b3CollidableEixEi(ptr noundef nonnull align 8 dereferenceable(25) %25, i32 noundef %26)
  store ptr %27, ptr %8, align 8, !tbaa !5
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.b3Collidable, ptr %28, i32 0, i32 2
  store i32 3, ptr %29, align 4, !tbaa !13
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.b3Collidable, ptr %30, i32 0, i32 3
  store i32 -1, ptr %31, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %32 = call { <2 x float>, <2 x float> } @_Z13b3MakeVector3fff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %33 = getelementptr inbounds %class.b3Vector3, ptr %9, i32 0, i32 0
  %34 = getelementptr inbounds %union.anon.18, ptr %33, i32 0, i32 0
  %35 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %34, i32 0, i32 0
  %36 = extractvalue { <2 x float>, <2 x float> } %32, 0
  store <2 x float> %36, ptr %35, align 16
  %37 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %34, i32 0, i32 1
  %38 = extractvalue { <2 x float>, <2 x float> } %32, 1
  store <2 x float> %38, ptr %37, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %52, %22
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %class.b3ConvexUtility, ptr %41, i32 0, i32 8
  %43 = call noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %42)
  %44 = icmp slt i32 %40, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %39
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %55

46:                                               ; preds = %39
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %class.b3ConvexUtility, ptr %47, i32 0, i32 8
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI9b3Vector3EixEi(ptr noundef nonnull align 8 dereferenceable(25) %48, i32 noundef %49)
  %51 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN9b3Vector3pLERKS_(ptr noundef nonnull align 16 dereferenceable(16) %9, ptr noundef nonnull align 16 dereferenceable(16) %50)
  br label %52

52:                                               ; preds = %46
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %10, align 4, !tbaa !9
  br label %39, !llvm.loop !16

55:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %class.b3ConvexUtility, ptr %56, i32 0, i32 8
  %58 = call noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %57)
  %59 = sitofp i32 %58 to float
  %60 = fdiv float 1.000000e+00, %59
  store float %60, ptr %11, align 4, !tbaa !18
  %61 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN9b3Vector3mLERKf(ptr noundef nonnull align 16 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %class.b3ConvexUtility, ptr %62, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %63, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !20
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = call noundef i32 @_ZN16b3CpuNarrowPhase31registerConvexHullShapeInternalEP15b3ConvexUtilityR12b3Collidable(ptr noundef nonnull align 8 dereferenceable(28) %16, ptr noundef %64, ptr noundef nonnull align 4 dereferenceable(16) %65)
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.b3Collidable, ptr %67, i32 0, i32 3
  store i32 %66, ptr %68, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.b3Collidable, ptr %69, i32 0, i32 3
  %71 = load i32, ptr %70, align 4, !tbaa !15
  %72 = icmp sge i32 %71, 0
  br i1 %72, label %73, label %145

73:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %74 = call { <2 x float>, <2 x float> } @_Z13b3MakeVector3fff(float noundef 0x46293E5940000000, float noundef 0x46293E5940000000, float noundef 0x46293E5940000000)
  %75 = getelementptr inbounds %class.b3Vector3, ptr %13, i32 0, i32 0
  %76 = getelementptr inbounds %union.anon.18, ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %76, i32 0, i32 0
  %78 = extractvalue { <2 x float>, <2 x float> } %74, 0
  store <2 x float> %78, ptr %77, align 16
  %79 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %76, i32 0, i32 1
  %80 = extractvalue { <2 x float>, <2 x float> } %74, 1
  store <2 x float> %80, ptr %79, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %81 = call { <2 x float>, <2 x float> } @_Z13b3MakeVector3fff(float noundef 0xC6293E5940000000, float noundef 0xC6293E5940000000, float noundef 0xC6293E5940000000)
  %82 = getelementptr inbounds %class.b3Vector3, ptr %14, i32 0, i32 0
  %83 = getelementptr inbounds %union.anon.18, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %83, i32 0, i32 0
  %85 = extractvalue { <2 x float>, <2 x float> } %81, 0
  store <2 x float> %85, ptr %84, align 16
  %86 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %83, i32 0, i32 1
  %87 = extractvalue { <2 x float>, <2 x float> } %81, 1
  store <2 x float> %87, ptr %86, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %104, %73
  %89 = load i32, ptr %15, align 4, !tbaa !9
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %class.b3ConvexUtility, ptr %90, i32 0, i32 8
  %92 = call noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %91)
  %93 = icmp slt i32 %89, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %88
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %107

95:                                               ; preds = %88
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %class.b3ConvexUtility, ptr %96, i32 0, i32 8
  %98 = load i32, ptr %15, align 4, !tbaa !9
  %99 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI9b3Vector3EixEi(ptr noundef nonnull align 8 dereferenceable(25) %97, i32 noundef %98)
  call void @_ZN9b3Vector36setMinERKS_(ptr noundef nonnull align 16 dereferenceable(16) %13, ptr noundef nonnull align 16 dereferenceable(16) %99)
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %class.b3ConvexUtility, ptr %100, i32 0, i32 8
  %102 = load i32, ptr %15, align 4, !tbaa !9
  %103 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI9b3Vector3EixEi(ptr noundef nonnull align 8 dereferenceable(25) %101, i32 noundef %102)
  call void @_ZN9b3Vector36setMaxERKS_(ptr noundef nonnull align 16 dereferenceable(16) %14, ptr noundef nonnull align 16 dereferenceable(16) %103)
  br label %104

104:                                              ; preds = %95
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %15, align 4, !tbaa !9
  br label %88, !llvm.loop !21

107:                                              ; preds = %94
  %108 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %13)
  %109 = getelementptr inbounds float, ptr %108, i64 0
  %110 = load float, ptr %109, align 4, !tbaa !18
  %111 = getelementptr inbounds %struct.b3Aabb, ptr %12, i32 0, i32 0
  %112 = getelementptr inbounds [4 x float], ptr %111, i64 0, i64 0
  store float %110, ptr %112, align 16, !tbaa !15
  %113 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %13)
  %114 = getelementptr inbounds float, ptr %113, i64 1
  %115 = load float, ptr %114, align 4, !tbaa !18
  %116 = getelementptr inbounds %struct.b3Aabb, ptr %12, i32 0, i32 0
  %117 = getelementptr inbounds [4 x float], ptr %116, i64 0, i64 1
  store float %115, ptr %117, align 4, !tbaa !15
  %118 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %13)
  %119 = getelementptr inbounds float, ptr %118, i64 2
  %120 = load float, ptr %119, align 4, !tbaa !18
  %121 = getelementptr inbounds %struct.b3Aabb, ptr %12, i32 0, i32 0
  %122 = getelementptr inbounds [4 x float], ptr %121, i64 0, i64 2
  store float %120, ptr %122, align 8, !tbaa !15
  %123 = getelementptr inbounds %struct.b3Aabb, ptr %12, i32 0, i32 0
  %124 = getelementptr inbounds [4 x i32], ptr %123, i64 0, i64 3
  store i32 0, ptr %124, align 4, !tbaa !15
  %125 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %14)
  %126 = getelementptr inbounds float, ptr %125, i64 0
  %127 = load float, ptr %126, align 4, !tbaa !18
  %128 = getelementptr inbounds %struct.b3Aabb, ptr %12, i32 0, i32 1
  %129 = getelementptr inbounds [4 x float], ptr %128, i64 0, i64 0
  store float %127, ptr %129, align 16, !tbaa !15
  %130 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %14)
  %131 = getelementptr inbounds float, ptr %130, i64 1
  %132 = load float, ptr %131, align 4, !tbaa !18
  %133 = getelementptr inbounds %struct.b3Aabb, ptr %12, i32 0, i32 1
  %134 = getelementptr inbounds [4 x float], ptr %133, i64 0, i64 1
  store float %132, ptr %134, align 4, !tbaa !15
  %135 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %14)
  %136 = getelementptr inbounds float, ptr %135, i64 2
  %137 = load float, ptr %136, align 4, !tbaa !18
  %138 = getelementptr inbounds %struct.b3Aabb, ptr %12, i32 0, i32 1
  %139 = getelementptr inbounds [4 x float], ptr %138, i64 0, i64 2
  store float %137, ptr %139, align 8, !tbaa !15
  %140 = getelementptr inbounds %struct.b3Aabb, ptr %12, i32 0, i32 1
  %141 = getelementptr inbounds [4 x i32], ptr %140, i64 0, i64 3
  store i32 0, ptr %141, align 4, !tbaa !15
  %142 = getelementptr inbounds %class.b3CpuNarrowPhase, ptr %16, i32 0, i32 1
  %143 = load ptr, ptr %142, align 8, !tbaa !11
  %144 = getelementptr inbounds %struct.b3CpuNarrowPhaseInternalData, ptr %143, i32 0, i32 0
  call void @_ZN20b3AlignedObjectArrayI6b3AabbE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(25) %144, ptr noundef nonnull align 16 dereferenceable(32) %12)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  br label %145

145:                                              ; preds = %107, %55
  %146 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %146, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %147

147:                                              ; preds = %145, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %148 = load i32, ptr %3, align 4
  ret i32 %148
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16b3CpuNarrowPhase18allocateCollidableEv(ptr noundef nonnull align 8 dereferenceable(28)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @_Z13b3MakeVector3fff(float noundef, float noundef, float noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI9b3Vector3EixEi(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN9b3Vector3pLERKS_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN9b3Vector3mLERKf(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16b3CpuNarrowPhase31registerConvexHullShapeInternalEP15b3ConvexUtilityR12b3Collidable(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN9b3Vector36setMinERKS_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN9b3Vector36setMaxERKS_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN20b3AlignedObjectArrayI6b3AabbE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 16 dereferenceable(32)) #5 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS16b3CpuNarrowPhase", !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTS12b3Collidable", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 12}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = !{i64 0, i64 16, !15}
!21 = distinct !{!21, !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"

%class.b3Vector3 = type { %union.anon.18 }
%union.anon.18 = type { [4 x float] }
%struct.b3Aabb = type { %union.anon.28, %union.anon.29 }
%union.anon.28 = type { [4 x float] }
%union.anon.29 = type { [4 x float] }

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI12b3CollidableEixEi(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN16b3CpuNarrowPhase23registerConvexHullShapeEP15b3ConvexUtility(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %class.b3Vector3, align 16
  %4 = alloca float, align 4
  %5 = alloca %struct.b3Aabb, align 16
  %6 = alloca %class.b3Vector3, align 16
  %7 = alloca %class.b3Vector3, align 16
  %8 = tail call noundef i32 @_ZN16b3CpuNarrowPhase18allocateCollidableEv(ptr noundef nonnull align 8 dereferenceable(28) %0)
  %9 = icmp slt i32 %8, 0
  br i1 %9, label %76, label %10

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 32
  %14 = tail call noundef nonnull align 4 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI12b3CollidableEixEi(ptr noundef nonnull align 8 dereferenceable(25) %13, i32 noundef %8)
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  store i32 3, ptr %15, align 4, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %14, i64 12
  store i32 -1, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %17 = tail call { <2 x float>, <2 x float> } @_Z13b3MakeVector3fff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %18 = extractvalue { <2 x float>, <2 x float> } %17, 0
  store <2 x float> %18, ptr %3, align 16
  %19 = getelementptr inbounds i8, ptr %3, i64 8
  %20 = extractvalue { <2 x float>, <2 x float> } %17, 1
  store <2 x float> %20, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr %1, i64 88
  %22 = tail call noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %24 = call noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
  %25 = sitofp i32 %24 to float
  %26 = fdiv float 1.000000e+00, %25
  store float %26, ptr %4, align 4, !tbaa !14
  %27 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN9b3Vector3mLERKf(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %28 = getelementptr inbounds i8, ptr %1, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %28, ptr noundef nonnull align 16 dereferenceable(16) %3, i64 16, i1 false), !tbaa.struct !16
  %29 = call noundef i32 @_ZN16b3CpuNarrowPhase31registerConvexHullShapeInternalEP15b3ConvexUtilityR12b3Collidable(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(16) %14)
  store i32 %29, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  %30 = icmp sgt i32 %29, -1
  br i1 %30, label %36, label %76

.lr.ph:                                           ; preds = %10, %.lr.ph
  %.02528 = phi i32 [ %33, %.lr.ph ], [ 0, %10 ]
  %31 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI9b3Vector3EixEi(ptr noundef nonnull align 8 dereferenceable(25) %21, i32 noundef %.02528)
  %32 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN9b3Vector3pLERKS_(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 16 dereferenceable(16) %31)
  %33 = add nuw nsw i32 %.02528, 1
  %34 = call noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !17

36:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %37 = call { <2 x float>, <2 x float> } @_Z13b3MakeVector3fff(float noundef 0x46293E5940000000, float noundef 0x46293E5940000000, float noundef 0x46293E5940000000)
  %38 = extractvalue { <2 x float>, <2 x float> } %37, 0
  store <2 x float> %38, ptr %6, align 16
  %39 = getelementptr inbounds i8, ptr %6, i64 8
  %40 = extractvalue { <2 x float>, <2 x float> } %37, 1
  store <2 x float> %40, ptr %39, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %41 = call { <2 x float>, <2 x float> } @_Z13b3MakeVector3fff(float noundef 0xC6293E5940000000, float noundef 0xC6293E5940000000, float noundef 0xC6293E5940000000)
  %42 = extractvalue { <2 x float>, <2 x float> } %41, 0
  store <2 x float> %42, ptr %7, align 16
  %43 = getelementptr inbounds i8, ptr %7, i64 8
  %44 = extractvalue { <2 x float>, <2 x float> } %41, 1
  store <2 x float> %44, ptr %43, align 8
  %45 = call noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph31, label %._crit_edge32

._crit_edge32:                                    ; preds = %.lr.ph31, %36
  %47 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %6)
  %48 = load float, ptr %47, align 4, !tbaa !14
  store float %48, ptr %5, align 16, !tbaa !13
  %49 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %6)
  %50 = getelementptr inbounds i8, ptr %49, i64 4
  %51 = load float, ptr %50, align 4, !tbaa !14
  %52 = getelementptr inbounds i8, ptr %5, i64 4
  store float %51, ptr %52, align 4, !tbaa !13
  %53 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %6)
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load float, ptr %54, align 4, !tbaa !14
  %56 = getelementptr inbounds i8, ptr %5, i64 8
  store float %55, ptr %56, align 8, !tbaa !13
  %57 = getelementptr inbounds i8, ptr %5, i64 12
  store i32 0, ptr %57, align 4, !tbaa !13
  %58 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %59 = load float, ptr %58, align 4, !tbaa !14
  %60 = getelementptr inbounds i8, ptr %5, i64 16
  store float %59, ptr %60, align 16, !tbaa !13
  %61 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  %63 = load float, ptr %62, align 4, !tbaa !14
  %64 = getelementptr inbounds i8, ptr %5, i64 20
  store float %63, ptr %64, align 4, !tbaa !13
  %65 = call noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %66 = getelementptr inbounds i8, ptr %65, i64 8
  %67 = load float, ptr %66, align 4, !tbaa !14
  %68 = getelementptr inbounds i8, ptr %5, i64 24
  store float %67, ptr %68, align 8, !tbaa !13
  %69 = getelementptr inbounds i8, ptr %5, i64 28
  store i32 0, ptr %69, align 4, !tbaa !13
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN20b3AlignedObjectArrayI6b3AabbE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(25) %70, ptr noundef nonnull align 16 dereferenceable(32) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %76

.lr.ph31:                                         ; preds = %36, %.lr.ph31
  %.029 = phi i32 [ %73, %.lr.ph31 ], [ 0, %36 ]
  %71 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI9b3Vector3EixEi(ptr noundef nonnull align 8 dereferenceable(25) %21, i32 noundef %.029)
  call void @_ZN9b3Vector36setMinERKS_(ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) %71)
  %72 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI9b3Vector3EixEi(ptr noundef nonnull align 8 dereferenceable(25) %21, i32 noundef %.029)
  call void @_ZN9b3Vector36setMaxERKS_(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %72)
  %73 = add nuw nsw i32 %.029, 1
  %74 = call noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %21)
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %.lr.ph31, label %._crit_edge32, !llvm.loop !19

76:                                               ; preds = %._crit_edge, %._crit_edge32, %2
  ret i32 %8
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16b3CpuNarrowPhase18allocateCollidableEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, <2 x float> } @_Z13b3MakeVector3fff(float noundef, float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK20b3AlignedObjectArrayI9b3Vector3E4sizeEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN20b3AlignedObjectArrayI9b3Vector3EixEi(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN9b3Vector3pLERKS_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN9b3Vector3mLERKf(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN16b3CpuNarrowPhase31registerConvexHullShapeInternalEP15b3ConvexUtilityR12b3Collidable(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN9b3Vector36setMinERKS_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN9b3Vector36setMaxERKS_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b3Vector3cvPfEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN20b3AlignedObjectArrayI6b3AabbE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #5 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTS16b3CpuNarrowPhase", !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTS12b3Collidable", !8, i64 0, !8, i64 4, !10, i64 8, !8, i64 12}
!13 = !{!8, !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !8, i64 0}
!16 = !{i64 0, i64 16, !13}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass