; LLVM IR from Try/Tempest :: Engine/thirdparty/squish/clusterfit.ll (ZN6squish10ClusterFitC2EPKNS_9ColourSetEi)

; 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.squish::Vec4" = type { float, float, float, float }
%"class.squish::Sym3x3" = type { [6 x float] }
%"class.squish::Vec3" = type { float, float, float }
%"class.squish::ClusterFit" = type { %"class.squish::ColourFit.base", i32, %"class.squish::Vec3", [128 x i8], [16 x %"class.squish::Vec4"], %"class.squish::Vec4", %"class.squish::Vec4", %"class.squish::Vec4", [4 x i8] }
%"class.squish::ColourFit.base" = type <{ ptr, ptr, i32 }>
%"class.squish::ColourFit" = type <{ ptr, ptr, i32, [4 x i8] }>

@_ZTVN6squish10ClusterFitE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6squish10ClusterFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(468) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.squish::Vec4", align 4
  %8 = alloca i8, align 1
  %9 = alloca %"class.squish::Vec4", align 4
  %10 = alloca %"class.squish::Vec4", align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.squish::Sym3x3", align 4
  %14 = alloca %"class.squish::Vec3", align 4
  %15 = alloca { <2 x float>, float }, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %16 = load ptr, ptr %4, align 8
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN6squish9ColourFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(20) %16, ptr noundef %17, i32 noundef %18)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN6squish10ClusterFitE, i32 0, i32 0, i32 2), ptr %16, align 8, !tbaa !11
  %19 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 2
  call void @_ZN6squish4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %19)
  %20 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 4
  %21 = getelementptr inbounds [16 x %"class.squish::Vec4"], ptr %20, i32 0, i32 0
  %22 = getelementptr inbounds %"class.squish::Vec4", ptr %21, i64 16
  br label %23

23:                                               ; preds = %23, %3
  %24 = phi ptr [ %21, %3 ], [ %25, %23 ]
  call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %24)
  %25 = getelementptr inbounds %"class.squish::Vec4", ptr %24, i64 1
  %26 = icmp eq ptr %25, %22
  br i1 %26, label %27, label %23

27:                                               ; preds = %23
  %28 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 5
  call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %28)
  %29 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 6
  call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %29)
  %30 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 7
  call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %30)
  %31 = getelementptr inbounds %"class.squish::ColourFit", ptr %16, i32 0, i32 2
  %32 = load i32, ptr %31, align 8, !tbaa !13
  %33 = and i32 %32, 256
  %34 = icmp ne i32 %33, 0
  %35 = zext i1 %34 to i64
  %36 = select i1 %34, i32 8, i32 1
  %37 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 1
  store i32 %36, ptr %37, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  call void @_ZN6squish4Vec4C2Ef(ptr noundef nonnull align 4 dereferenceable(16) %7, float noundef 0x47EFFFFFE0000000)
  %38 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  %39 = getelementptr inbounds %"class.squish::ColourFit", ptr %16, i32 0, i32 2
  %40 = load i32, ptr %39, align 8, !tbaa !13
  %41 = and i32 %40, 32
  %42 = icmp ne i32 %41, 0
  %43 = zext i1 %42 to i8
  store i8 %43, ptr %8, align 1, !tbaa !22
  %44 = load i8, ptr %8, align 1, !tbaa !22, !range !24, !noundef !25
  %45 = trunc i8 %44 to i1
  br i1 %45, label %46, label %48

46:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  call void @_ZN6squish4Vec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %9, float noundef 0x3FCB367A00000000, float noundef 0x3FE6E2EB20000000, float noundef 0x3FB27BB300000000, float noundef 0.000000e+00)
  %47 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %47, ptr align 4 %9, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %50

48:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @_ZN6squish4Vec4C2Ef(ptr noundef nonnull align 4 dereferenceable(16) %10, float noundef 1.000000e+00)
  %49 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %49, ptr align 4 %10, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %50

50:                                               ; preds = %48, %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %51 = getelementptr inbounds %"class.squish::ColourFit", ptr %16, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !26
  %53 = call noundef i32 @_ZNK6squish9ColourSet8GetCountEv(ptr noundef nonnull align 4 dereferenceable(325) %52)
  store i32 %53, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %54 = getelementptr inbounds %"class.squish::ColourFit", ptr %16, i32 0, i32 1
  %55 = load ptr, ptr %54, align 8, !tbaa !26
  %56 = call noundef ptr @_ZNK6squish9ColourSet9GetPointsEv(ptr noundef nonnull align 4 dereferenceable(325) %55)
  store ptr %56, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = getelementptr inbounds %"class.squish::ColourFit", ptr %16, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  %61 = call noundef ptr @_ZNK6squish9ColourSet10GetWeightsEv(ptr noundef nonnull align 4 dereferenceable(325) %60)
  call void @_ZN6squish25ComputeWeightedCovarianceEiPKNS_4Vec3EPKf(ptr dead_on_unwind writable sret(%"class.squish::Sym3x3") align 4 %13, i32 noundef %57, ptr noundef %58, ptr noundef %61)
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  %62 = call { <2 x float>, float } @_ZN6squish25ComputePrincipleComponentERKNS_6Sym3x3E(ptr noundef nonnull align 4 dereferenceable(24) %13)
  store { <2 x float>, float } %62, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %15, i64 12, i1 false)
  %63 = getelementptr inbounds %"class.squish::ClusterFit", ptr %16, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %63, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  ret void
}

declare void @_ZN6squish9ColourFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef, i32 noundef) unnamed_addr #1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6squish4Vec4C2Ef(ptr noundef nonnull align 4 dereferenceable(16), float noundef) unnamed_addr #2 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) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6squish9ColourSet8GetCountEv(ptr noundef nonnull align 4 dereferenceable(325)) #2 align 2

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

declare void @_ZN6squish25ComputeWeightedCovarianceEiPKNS_4Vec3EPKf(ptr dead_on_unwind writable sret(%"class.squish::Sym3x3") align 4, i32 noundef, ptr noundef, ptr noundef) #1

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

declare { <2 x float>, float } @_ZN6squish25ComputePrincipleComponentERKNS_6Sym3x3E(ptr noundef nonnull align 4 dereferenceable(24)) #1

attributes #0 = { 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 #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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !10, i64 16}
!14 = !{!"_ZTSN6squish9ColourFitE", !6, i64 8, !10, i64 16}
!15 = !{!16, !10, i64 20}
!16 = !{!"_ZTSN6squish10ClusterFitE", !14, i64 0, !10, i64 20, !17, i64 24, !7, i64 36, !7, i64 164, !19, i64 420, !19, i64 436, !19, i64 452}
!17 = !{!"_ZTSN6squish4Vec3E", !18, i64 0, !18, i64 4, !18, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSN6squish4Vec4E", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12}
!20 = !{i64 0, i64 4, !21, i64 4, i64 4, !21, i64 8, i64 4, !21, i64 12, i64 4, !21}
!21 = !{!18, !18, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!14, !6, i64 8}
!27 = !{i64 0, i64 4, !21, i64 4, i64 4, !21, i64 8, i64 4, !21}


; 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.squish::Vec4" = type { float, float, float, float }
%"class.squish::Sym3x3" = type { [6 x float] }

@_ZTVN6squish10ClusterFitE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6squish10ClusterFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(468) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #0 align 2 {
  %4 = alloca %"class.squish::Vec4", align 4
  %5 = alloca %"class.squish::Vec4", align 4
  %6 = alloca %"class.squish::Vec4", align 4
  %7 = alloca %"class.squish::Sym3x3", align 4
  tail call void @_ZN6squish9ColourFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef %1, i32 noundef %2)
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN6squish10ClusterFitE, i64 16), ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @_ZN6squish4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8)
  %.ptr = getelementptr inbounds i8, ptr %0, i64 164
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr)
  %.ptr.1 = getelementptr inbounds i8, ptr %0, i64 180
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %0, i64 196
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %0, i64 212
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %0, i64 228
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %0, i64 244
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.5)
  %.ptr.6 = getelementptr inbounds i8, ptr %0, i64 260
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.6)
  %.ptr.7 = getelementptr inbounds i8, ptr %0, i64 276
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.7)
  %.ptr.8 = getelementptr inbounds i8, ptr %0, i64 292
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.8)
  %.ptr.9 = getelementptr inbounds i8, ptr %0, i64 308
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.9)
  %.ptr.10 = getelementptr inbounds i8, ptr %0, i64 324
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.10)
  %.ptr.11 = getelementptr inbounds i8, ptr %0, i64 340
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.11)
  %.ptr.12 = getelementptr inbounds i8, ptr %0, i64 356
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.12)
  %.ptr.13 = getelementptr inbounds i8, ptr %0, i64 372
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.13)
  %.ptr.14 = getelementptr inbounds i8, ptr %0, i64 388
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.14)
  %.ptr.15 = getelementptr inbounds i8, ptr %0, i64 404
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %.ptr.15)
  %9 = getelementptr inbounds i8, ptr %0, i64 420
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 436
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 452
  tail call void @_ZN6squish4Vec4C2Ev(ptr noundef nonnull align 4 dereferenceable(16) %11)
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = load i32, ptr %12, align 8, !tbaa !8
  %14 = and i32 %13, 256
  %.not = icmp eq i32 %14, 0
  %15 = select i1 %.not, i32 1, i32 8
  %16 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %15, ptr %16, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @_ZN6squish4Vec4C2Ef(ptr noundef nonnull align 4 dereferenceable(16) %4, float noundef 0x47EFFFFFE0000000)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(16) %4, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %17 = load i32, ptr %12, align 8, !tbaa !8
  %18 = and i32 %17, 32
  %.not8 = icmp eq i32 %18, 0
  br i1 %.not8, label %20, label %19

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN6squish4Vec4C2Effff(ptr noundef nonnull align 4 dereferenceable(16) %5, float noundef 0x3FCB367A00000000, float noundef 0x3FE6E2EB20000000, float noundef 0x3FB27BB300000000, float noundef 0.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %5, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %21

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void @_ZN6squish4Vec4C2Ef(ptr noundef nonnull align 4 dereferenceable(16) %6, float noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %6, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %21

21:                                               ; preds = %20, %19
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !20
  %24 = call noundef i32 @_ZNK6squish9ColourSet8GetCountEv(ptr noundef nonnull align 4 dereferenceable(325) %23)
  %25 = load ptr, ptr %22, align 8, !tbaa !20
  %26 = call noundef ptr @_ZNK6squish9ColourSet9GetPointsEv(ptr noundef nonnull align 4 dereferenceable(325) %25)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %27 = load ptr, ptr %22, align 8, !tbaa !20
  %28 = call noundef ptr @_ZNK6squish9ColourSet10GetWeightsEv(ptr noundef nonnull align 4 dereferenceable(325) %27)
  call void @_ZN6squish25ComputeWeightedCovarianceEiPKNS_4Vec3EPKf(ptr dead_on_unwind nonnull writable sret(%"class.squish::Sym3x3") align 4 %7, i32 noundef %24, ptr noundef %26, ptr noundef %28)
  %29 = call { <2 x float>, float } @_ZN6squish25ComputePrincipleComponentERKNS_6Sym3x3E(ptr noundef nonnull align 4 dereferenceable(24) %7)
  %.fca.0.extract = extractvalue { <2 x float>, float } %29, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %29, 1
  store <2 x float> %.fca.0.extract, ptr %8, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 32
  store float %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  ret void
}

declare void @_ZN6squish9ColourFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef, i32 noundef) unnamed_addr #1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6squish4Vec4C2Ef(ptr noundef nonnull align 4 dereferenceable(16), float noundef) unnamed_addr #2 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) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6squish9ColourSet8GetCountEv(ptr noundef nonnull align 4 dereferenceable(325)) local_unnamed_addr #2 align 2

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

declare void @_ZN6squish25ComputeWeightedCovarianceEiPKNS_4Vec3EPKf(ptr dead_on_unwind writable sret(%"class.squish::Sym3x3") align 4, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare { <2 x float>, float } @_ZN6squish25ComputePrincipleComponentERKNS_6Sym3x3E(ptr noundef nonnull align 4 dereferenceable(24)) local_unnamed_addr #1

attributes #0 = { 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 #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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !12, i64 16}
!9 = !{!"_ZTSN6squish9ColourFitE", !10, i64 8, !12, i64 16}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"int", !11, i64 0}
!13 = !{!14, !12, i64 20}
!14 = !{!"_ZTSN6squish10ClusterFitE", !9, i64 0, !12, i64 20, !15, i64 24, !11, i64 36, !11, i64 164, !17, i64 420, !17, i64 436, !17, i64 452}
!15 = !{!"_ZTSN6squish4Vec3E", !16, i64 0, !16, i64 4, !16, i64 8}
!16 = !{!"float", !11, i64 0}
!17 = !{!"_ZTSN6squish4Vec4E", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12}
!18 = !{i64 0, i64 4, !19, i64 4, i64 4, !19, i64 8, i64 4, !19, i64 12, i64 4, !19}
!19 = !{!16, !16, i64 0}
!20 = !{!9, !10, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass