; LLVM IR from atlantis13579/Riemann :: Src/CollisionPrimitive (OrientedBox3)

; 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.Riemann::OrientedBox3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3", %"class.Maths::Matrix3" }
%"class.Maths::TVector3" = type { float, float, float }
%"class.Maths::Matrix3" = type { [3 x [3 x float]] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann12OrientedBox322ComputeBoundingOBB_PCAEPKN5Maths8TVector3IfEEi(ptr dead_on_unwind noalias writable sret(%"class.Riemann::OrientedBox3") align 4 %0, ptr noundef %1, i32 noundef %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.Maths::TVector3", align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.Maths::Matrix3", align 4
  %10 = alloca [3 x float], align 4
  %11 = alloca [3 x %"class.Maths::TVector3"], align 16
  %12 = alloca %"class.Maths::TVector3", align 4
  %13 = alloca %"class.Maths::Matrix3", align 4
  %14 = alloca %"class.Maths::TVector3", align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.Maths::TVector3", align 4
  %17 = alloca %"class.Maths::TVector3", align 4
  %18 = alloca %"class.Maths::TVector3", align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #5
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %29, %3
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %32

24:                                               ; preds = %19
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds %"class.Maths::TVector3", ptr %25, i64 %27
  call void @_ZN5Maths8TVector3IfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %28)
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %8, align 4, !tbaa !9
  br label %19, !llvm.loop !11

32:                                               ; preds = %23
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = sitofp i32 %33 to float
  %35 = fdiv float 1.000000e+00, %34
  call void @_ZN5Maths8TVector3IfEmLEf(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef %35)
  call void @llvm.lifetime.start.p0(i64 36, ptr %9) #5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN5Maths7Matrix323ComputeCovarianceMatrixEPKNS_8TVector3IfEEi(ptr dead_on_unwind writable sret(%"class.Maths::Matrix3") align 4 %9, ptr noundef %36, i32 noundef %37)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %11) #5
  %38 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i32 0, i32 0
  %39 = getelementptr inbounds %"class.Maths::TVector3", ptr %38, i64 3
  br label %40

40:                                               ; preds = %40, %32
  %41 = phi ptr [ %38, %32 ], [ %42, %40 ]
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %41)
  %42 = getelementptr inbounds %"class.Maths::TVector3", ptr %41, i64 1
  %43 = icmp eq ptr %42, %39
  br i1 %43, label %44, label %40

44:                                               ; preds = %40
  %45 = getelementptr inbounds [3 x float], ptr %10, i64 0, i64 0
  %46 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 0
  %47 = call noundef zeroext i1 @_ZNK5Maths7Matrix319SolveEigenSymmetricEPfPNS_8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(36) %9, ptr noundef %45, ptr noundef %46)
  %48 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 0
  %49 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 1
  %50 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 2
  %51 = call noundef float @_ZN5Maths11DeterminantIfEET_RKNS_8TVector3IS1_EES5_S5_(ptr noundef nonnull align 4 dereferenceable(12) %48, ptr noundef nonnull align 4 dereferenceable(12) %49, ptr noundef nonnull align 4 dereferenceable(12) %50)
  %52 = fcmp olt float %51, 0.000000e+00
  br i1 %52, label %53, label %57

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  %54 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 2
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %54)
  %55 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 2
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %55, ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  br label %57

57:                                               ; preds = %53, %44
  call void @_ZN7Riemann12OrientedBox3C2Ev(ptr noundef nonnull align 4 dereferenceable(60) %0)
  %58 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 0
  %59 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %58, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.start.p0(i64 36, ptr %13) #5
  %60 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 0
  %61 = getelementptr inbounds %"class.Maths::TVector3", ptr %60, i32 0, i32 0
  %62 = load float, ptr %61, align 16, !tbaa !13
  %63 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 1
  %64 = getelementptr inbounds %"class.Maths::TVector3", ptr %63, i32 0, i32 0
  %65 = load float, ptr %64, align 4, !tbaa !13
  %66 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 2
  %67 = getelementptr inbounds %"class.Maths::TVector3", ptr %66, i32 0, i32 0
  %68 = load float, ptr %67, align 8, !tbaa !13
  %69 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 0
  %70 = getelementptr inbounds %"class.Maths::TVector3", ptr %69, i32 0, i32 1
  %71 = load float, ptr %70, align 4, !tbaa !16
  %72 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 1
  %73 = getelementptr inbounds %"class.Maths::TVector3", ptr %72, i32 0, i32 1
  %74 = load float, ptr %73, align 4, !tbaa !16
  %75 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 2
  %76 = getelementptr inbounds %"class.Maths::TVector3", ptr %75, i32 0, i32 1
  %77 = load float, ptr %76, align 4, !tbaa !16
  %78 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 0
  %79 = getelementptr inbounds %"class.Maths::TVector3", ptr %78, i32 0, i32 2
  %80 = load float, ptr %79, align 8, !tbaa !17
  %81 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 1
  %82 = getelementptr inbounds %"class.Maths::TVector3", ptr %81, i32 0, i32 2
  %83 = load float, ptr %82, align 4, !tbaa !17
  %84 = getelementptr inbounds [3 x %"class.Maths::TVector3"], ptr %11, i64 0, i64 2
  %85 = getelementptr inbounds %"class.Maths::TVector3", ptr %84, i32 0, i32 2
  %86 = load float, ptr %85, align 8, !tbaa !17
  call void @_ZN5Maths7Matrix3C2Efffffffff(ptr noundef nonnull align 4 dereferenceable(36) %13, float noundef %62, float noundef %65, float noundef %68, float noundef %71, float noundef %74, float noundef %77, float noundef %80, float noundef %83, float noundef %86)
  %87 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 2
  %88 = call noundef nonnull align 4 dereferenceable(36) ptr @_ZN5Maths7Matrix3aSERKS0_(ptr noundef nonnull align 4 dereferenceable(36) %87, ptr noundef nonnull align 4 dereferenceable(36) %13)
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %14, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000)
  %89 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 1
  %90 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %89, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %123, %57
  %92 = load i32, ptr %15, align 4, !tbaa !9
  %93 = load i32, ptr %6, align 4, !tbaa !9
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %126

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #5
  %97 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #5
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load i32, ptr %15, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds %"class.Maths::TVector3", ptr %98, i64 %100
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %18, ptr noundef nonnull align 4 dereferenceable(12) %101, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @_ZNK5Maths7Matrix3mlERKNS_8TVector3IfEE(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %17, ptr noundef nonnull align 4 dereferenceable(36) %97, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @_ZNK5Maths8TVector3IfE3AbsEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector3") align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %17)
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #5
  %102 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 1
  %103 = getelementptr inbounds %"class.Maths::TVector3", ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds %"class.Maths::TVector3", ptr %16, i32 0, i32 0
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %103, ptr noundef nonnull align 4 dereferenceable(4) %104)
  %106 = load float, ptr %105, align 4, !tbaa !18
  %107 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 1
  %108 = getelementptr inbounds %"class.Maths::TVector3", ptr %107, i32 0, i32 0
  store float %106, ptr %108, align 4, !tbaa !19
  %109 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 1
  %110 = getelementptr inbounds %"class.Maths::TVector3", ptr %109, i32 0, i32 1
  %111 = getelementptr inbounds %"class.Maths::TVector3", ptr %16, i32 0, i32 1
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %110, ptr noundef nonnull align 4 dereferenceable(4) %111)
  %113 = load float, ptr %112, align 4, !tbaa !18
  %114 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 1
  %115 = getelementptr inbounds %"class.Maths::TVector3", ptr %114, i32 0, i32 1
  store float %113, ptr %115, align 4, !tbaa !22
  %116 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 1
  %117 = getelementptr inbounds %"class.Maths::TVector3", ptr %116, i32 0, i32 2
  %118 = getelementptr inbounds %"class.Maths::TVector3", ptr %16, i32 0, i32 2
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %117, ptr noundef nonnull align 4 dereferenceable(4) %118)
  %120 = load float, ptr %119, align 4, !tbaa !18
  %121 = getelementptr inbounds %"class.Riemann::OrientedBox3", ptr %0, i32 0, i32 1
  %122 = getelementptr inbounds %"class.Maths::TVector3", ptr %121, i32 0, i32 2
  store float %120, ptr %122, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #5
  br label %123

123:                                              ; preds = %96
  %124 = load i32, ptr %15, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %15, align 4, !tbaa !9
  br label %91, !llvm.loop !24

126:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 36, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #5
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEmLEf(ptr noundef nonnull align 4 dereferenceable(12), float noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths7Matrix323ComputeCovarianceMatrixEPKNS_8TVector3IfEEi(ptr dead_on_unwind noalias writable sret(%"class.Maths::Matrix3") align 4, ptr noundef, i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5Maths7Matrix319SolveEigenSymmetricEPfPNS_8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef, ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5Maths11DeterminantIfEET_RKNS_8TVector3IS1_EES5_S5_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann12OrientedBox3C2Ev(ptr noundef nonnull align 4 dereferenceable(60)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths7Matrix3C2Efffffffff(ptr noundef nonnull align 4 dereferenceable(36), float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths7Matrix3mlERKNS_8TVector3IfEE(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfE3AbsEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN5Maths8TVector3IfEE", !15, i64 0, !15, i64 4, !15, i64 8}
!15 = !{!"float", !7, i64 0}
!16 = !{!14, !15, i64 4}
!17 = !{!14, !15, i64 8}
!18 = !{!15, !15, i64 0}
!19 = !{!20, !15, i64 12}
!20 = !{!"_ZTSN7Riemann12OrientedBox3E", !14, i64 0, !14, i64 12, !21, i64 24}
!21 = !{!"_ZTSN5Maths7Matrix3E", !7, i64 0}
!22 = !{!20, !15, i64 16}
!23 = !{!20, !15, i64 20}
!24 = distinct !{!24, !12}


; 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.Riemann::OrientedBox3" = type { %"class.Maths::TVector3", %"class.Maths::TVector3", %"class.Maths::Matrix3" }
%"class.Maths::TVector3" = type { float, float, float }
%"class.Maths::Matrix3" = type { [3 x [3 x float]] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann12OrientedBox322ComputeBoundingOBB_PCAEPKN5Maths8TVector3IfEEi(ptr dead_on_unwind noalias writable sret(%"class.Riemann::OrientedBox3") align 4 %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 align 2 {
  %4 = alloca %"class.Maths::TVector3", align 4
  %5 = alloca %"class.Maths::Matrix3", align 4
  %6 = alloca [3 x float], align 4
  %7 = alloca [3 x %"class.Maths::TVector3"], align 16
  %8 = alloca %"class.Maths::TVector3", align 4
  %9 = alloca %"class.Maths::Matrix3", align 4
  %10 = alloca %"class.Maths::TVector3", align 4
  %11 = alloca %"class.Maths::TVector3", align 4
  %12 = alloca %"class.Maths::TVector3", align 4
  %13 = alloca %"class.Maths::TVector3", align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  call void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %4)
  %14 = icmp sgt i32 %2, 0
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %3
  %15 = sitofp i32 %2 to float
  %16 = fdiv float 1.000000e+00, %15
  call void @_ZN5Maths8TVector3IfEmLEf(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef %16)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %5) #5
  call void @_ZN5Maths7Matrix323ComputeCovarianceMatrixEPKNS_8TVector3IfEEi(ptr dead_on_unwind nonnull writable sret(%"class.Maths::Matrix3") align 4 %5, ptr noundef %1, i32 noundef %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %7) #5
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  %.ptr.1 = getelementptr inbounds i8, ptr %7, i64 12
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %7, i64 24
  call void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %17 = call noundef zeroext i1 @_ZNK5Maths7Matrix319SolveEigenSymmetricEPfPNS_8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(36) %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %18 = call noundef float @_ZN5Maths11DeterminantIfEET_RKNS_8TVector3IS1_EES5_S5_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %19 = fcmp olt float %18, 0.000000e+00
  br i1 %19, label %21, label %23

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %20 = getelementptr inbounds %"class.Maths::TVector3", ptr %1, i64 %indvars.iv
  call void @_ZN5Maths8TVector3IfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

21:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  call void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %22 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  br label %23

23:                                               ; preds = %21, %._crit_edge
  call void @_ZN7Riemann12OrientedBox3C2Ev(ptr noundef nonnull align 4 dereferenceable(60) %0)
  %24 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %9) #5
  %25 = load float, ptr %7, align 16, !tbaa !7
  %26 = load float, ptr %.ptr.1, align 4, !tbaa !7
  %27 = load float, ptr %.ptr.2, align 8, !tbaa !7
  %28 = getelementptr inbounds i8, ptr %7, i64 4
  %29 = load float, ptr %28, align 4, !tbaa !12
  %30 = getelementptr inbounds i8, ptr %7, i64 16
  %31 = load float, ptr %30, align 16, !tbaa !12
  %32 = getelementptr inbounds i8, ptr %7, i64 28
  %33 = load float, ptr %32, align 4, !tbaa !12
  %34 = getelementptr inbounds i8, ptr %7, i64 8
  %35 = load float, ptr %34, align 8, !tbaa !13
  %36 = getelementptr inbounds i8, ptr %7, i64 20
  %37 = load float, ptr %36, align 4, !tbaa !13
  %38 = getelementptr inbounds i8, ptr %7, i64 32
  %39 = load float, ptr %38, align 16, !tbaa !13
  call void @_ZN5Maths7Matrix3C2Efffffffff(ptr noundef nonnull align 4 dereferenceable(36) %9, float noundef %25, float noundef %26, float noundef %27, float noundef %29, float noundef %31, float noundef %33, float noundef %35, float noundef %37, float noundef %39)
  %40 = getelementptr inbounds i8, ptr %0, i64 24
  %41 = call noundef nonnull align 4 dereferenceable(36) ptr @_ZN5Maths7Matrix3aSERKS0_(ptr noundef nonnull align 4 dereferenceable(36) %40, ptr noundef nonnull align 4 dereferenceable(36) %9)
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #5
  call void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000, float noundef 0xC7EFFFFFE0000000)
  %42 = getelementptr inbounds i8, ptr %0, i64 12
  %43 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5Maths8TVector3IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %42, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #5
  br i1 %14, label %.lr.ph18, label %._crit_edge19

.lr.ph18:                                         ; preds = %23
  %44 = getelementptr inbounds i8, ptr %0, i64 16
  %45 = getelementptr inbounds i8, ptr %11, i64 4
  %46 = getelementptr inbounds i8, ptr %0, i64 20
  %47 = getelementptr inbounds i8, ptr %11, i64 8
  %wide.trip.count24 = zext nneg i32 %2 to i64
  br label %48

._crit_edge19:                                    ; preds = %48, %23
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  ret void

48:                                               ; preds = %.lr.ph18, %48
  %indvars.iv21 = phi i64 [ 0, %.lr.ph18 ], [ %indvars.iv.next22, %48 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #5
  %49 = getelementptr inbounds %"class.Maths::TVector3", ptr %1, i64 %indvars.iv21
  call void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %49, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @_ZNK5Maths7Matrix3mlERKNS_8TVector3IfEE(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(36) %40, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @_ZNK5Maths8TVector3IfE3AbsEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #5
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %42, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %51 = load float, ptr %50, align 4, !tbaa !14
  store float %51, ptr %42, align 4, !tbaa !15
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %45)
  %53 = load float, ptr %52, align 4, !tbaa !14
  store float %53, ptr %44, align 4, !tbaa !18
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %46, ptr noundef nonnull align 4 dereferenceable(4) %47)
  %55 = load float, ptr %54, align 4, !tbaa !14
  store float %55, ptr %46, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #5
  %indvars.iv.next22 = add nuw nsw i64 %indvars.iv21, 1
  %exitcond25.not = icmp eq i64 %indvars.iv.next22, %wide.trip.count24
  br i1 %exitcond25.not, label %._crit_edge19, label %48, !llvm.loop !20
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths8TVector3IfE4ZeroEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEmLEf(ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Maths7Matrix323ComputeCovarianceMatrixEPKNS_8TVector3IfEEi(ptr dead_on_unwind noalias writable sret(%"class.Maths::Matrix3") align 4, ptr noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5Maths7Matrix319SolveEigenSymmetricEPfPNS_8TVector3IfEE(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5Maths11DeterminantIfEET_RKNS_8TVector3IS1_EES5_S5_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEngEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann12OrientedBox3C2Ev(ptr noundef nonnull align 4 dereferenceable(60)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths7Matrix3C2Efffffffff(ptr noundef nonnull align 4 dereferenceable(36), float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Maths8TVector3IfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths7Matrix3mlERKNS_8TVector3IfEE(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector3IfE3AbsEv(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector3") align 4, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }

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

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


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