; LLVM IR from Try/Tempest :: Engine/thirdparty/squish/rangefit.ll (ZN6squish8RangeFitC2EPKNS_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::Vec3" = type { float, float, float }
%"class.squish::Sym3x3" = type { [6 x float] }
%"class.squish::RangeFit" = type { %"class.squish::ColourFit.base", %"class.squish::Vec3", %"class.squish::Vec3", %"class.squish::Vec3", float, [4 x i8] }
%"class.squish::ColourFit.base" = type <{ ptr, ptr, i32 }>
%"class.squish::ColourFit" = type <{ ptr, ptr, i32, [4 x i8] }>

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6squish8RangeFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(60) %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 i8, align 1
  %8 = alloca %"class.squish::Vec3", align 4
  %9 = alloca %"class.squish::Vec3", align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %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
  %16 = alloca %"class.squish::Vec3", align 4
  %17 = alloca %"class.squish::Vec3", align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca i32, align 4
  %21 = alloca float, align 4
  %22 = alloca %"class.squish::Vec3", align 4
  %23 = alloca %"class.squish::Vec3", align 4
  %24 = alloca %"class.squish::Vec3", align 4
  %25 = alloca %"class.squish::Vec3", align 4
  %26 = alloca { <2 x float>, float }, align 8
  %27 = alloca { <2 x float>, float }, align 8
  %28 = alloca %"class.squish::Vec3", align 4
  %29 = alloca %"class.squish::Vec3", align 4
  %30 = alloca { <2 x float>, float }, align 8
  %31 = alloca { <2 x float>, float }, align 8
  %32 = alloca %"class.squish::Vec3", align 4
  %33 = alloca %"class.squish::Vec3", align 4
  %34 = alloca %"class.squish::Vec3", align 4
  %35 = alloca %"class.squish::Vec3", align 4
  %36 = alloca %"class.squish::Vec3", align 4
  %37 = alloca %"class.squish::Vec3", align 4
  %38 = alloca %"class.squish::Vec3", align 4
  %39 = alloca { <2 x float>, float }, align 8
  %40 = alloca { <2 x float>, float }, align 8
  %41 = alloca { <2 x float>, float }, align 8
  %42 = alloca { <2 x float>, float }, align 8
  %43 = alloca %"class.squish::Vec3", align 4
  %44 = alloca %"class.squish::Vec3", align 4
  %45 = alloca %"class.squish::Vec3", align 4
  %46 = alloca %"class.squish::Vec3", align 4
  %47 = alloca { <2 x float>, float }, align 8
  %48 = alloca { <2 x float>, float }, align 8
  %49 = alloca { <2 x float>, float }, align 8
  %50 = 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
  %51 = load ptr, ptr %4, align 8
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN6squish9ColourFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(20) %51, ptr noundef %52, i32 noundef %53)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN6squish8RangeFitE, i32 0, i32 0, i32 2), ptr %51, align 8, !tbaa !11
  %54 = getelementptr inbounds %"class.squish::RangeFit", ptr %51, i32 0, i32 1
  call void @_ZN6squish4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %54)
  %55 = getelementptr inbounds %"class.squish::RangeFit", ptr %51, i32 0, i32 2
  call void @_ZN6squish4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %55)
  %56 = getelementptr inbounds %"class.squish::RangeFit", ptr %51, i32 0, i32 3
  call void @_ZN6squish4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %56)
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  %57 = getelementptr inbounds %"class.squish::ColourFit", ptr %51, i32 0, i32 2
  %58 = load i32, ptr %57, align 8, !tbaa !13
  %59 = and i32 %58, 32
  %60 = icmp ne i32 %59, 0
  %61 = zext i1 %60 to i8
  store i8 %61, ptr %7, align 1, !tbaa !15
  %62 = load i8, ptr %7, align 1, !tbaa !15, !range !17, !noundef !18
  %63 = trunc i8 %62 to i1
  br i1 %63, label %64, label %66

64:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #6
  call void @_ZN6squish4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef 0x3FCB367A00000000, float noundef 0x3FE6E2EB20000000, float noundef 0x3FB27BB300000000)
  %65 = getelementptr inbounds %"class.squish::RangeFit", ptr %51, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %65, ptr align 4 %8, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #6
  br label %68

66:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #6
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 1.000000e+00)
  %67 = getelementptr inbounds %"class.squish::RangeFit", ptr %51, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %67, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #6
  br label %68

68:                                               ; preds = %66, %64
  %69 = getelementptr inbounds %"class.squish::RangeFit", ptr %51, i32 0, i32 4
  store float 0x47EFFFFFE0000000, ptr %69, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %70 = getelementptr inbounds %"class.squish::ColourFit", ptr %51, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !25
  %72 = call noundef i32 @_ZNK6squish9ColourSet8GetCountEv(ptr noundef nonnull align 4 dereferenceable(325) %71)
  store i32 %72, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %73 = getelementptr inbounds %"class.squish::ColourFit", ptr %51, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !25
  %75 = call noundef ptr @_ZNK6squish9ColourSet9GetPointsEv(ptr noundef nonnull align 4 dereferenceable(325) %74)
  store ptr %75, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %76 = getelementptr inbounds %"class.squish::ColourFit", ptr %51, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !25
  %78 = call noundef ptr @_ZNK6squish9ColourSet10GetWeightsEv(ptr noundef nonnull align 4 dereferenceable(325) %77)
  store ptr %78, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  %79 = load i32, ptr %10, align 4, !tbaa !9
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN6squish25ComputeWeightedCovarianceEiPKNS_4Vec3EPKf(ptr dead_on_unwind writable sret(%"class.squish::Sym3x3") align 4 %13, i32 noundef %79, ptr noundef %80, ptr noundef %81)
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #6
  %82 = call { <2 x float>, float } @_ZN6squish25ComputePrincipleComponentERKNS_6Sym3x3E(ptr noundef nonnull align 4 dereferenceable(24) %13)
  store { <2 x float>, float } %82, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %15, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #6
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #6
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef 0.000000e+00)
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %85, label %127

85:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = getelementptr inbounds %"class.squish::Vec3", ptr %86, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %87, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !19
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.squish::Vec3", ptr %88, i64 0
  %90 = call noundef float @_ZN6squish3DotERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %89, ptr noundef nonnull align 4 dereferenceable(12) %14)
  store float %90, ptr %19, align 4, !tbaa !20
  store float %90, ptr %18, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 1, ptr %20, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %123, %85
  %92 = load i32, ptr %20, align 4, !tbaa !9
  %93 = load i32, ptr %10, 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 %20) #6
  br label %126

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = load i32, ptr %20, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds %"class.squish::Vec3", ptr %97, i64 %99
  %101 = call noundef float @_ZN6squish3DotERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %100, ptr noundef nonnull align 4 dereferenceable(12) %14)
  store float %101, ptr %21, align 4, !tbaa !20
  %102 = load float, ptr %21, align 4, !tbaa !20
  %103 = load float, ptr %18, align 4, !tbaa !20
  %104 = fcmp olt float %102, %103
  br i1 %104, label %105, label %111

105:                                              ; preds = %96
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load i32, ptr %20, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %"class.squish::Vec3", ptr %106, i64 %108
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %109, i64 12, i1 false), !tbaa.struct !19
  %110 = load float, ptr %21, align 4, !tbaa !20
  store float %110, ptr %18, align 4, !tbaa !20
  br label %122

111:                                              ; preds = %96
  %112 = load float, ptr %21, align 4, !tbaa !20
  %113 = load float, ptr %19, align 4, !tbaa !20
  %114 = fcmp ogt float %112, %113
  br i1 %114, label %115, label %121

115:                                              ; preds = %111
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = load i32, ptr %20, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds %"class.squish::Vec3", ptr %116, i64 %118
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %119, i64 12, i1 false), !tbaa.struct !19
  %120 = load float, ptr %21, align 4, !tbaa !20
  store float %120, ptr %19, align 4, !tbaa !20
  br label %121

121:                                              ; preds = %115, %111
  br label %122

122:                                              ; preds = %121, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %123

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

126:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %127

127:                                              ; preds = %126, %68
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #6
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %22, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #6
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %23, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #6
  %128 = call { <2 x float>, float } @_ZN6squish3MaxERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %16)
  store { <2 x float>, float } %128, ptr %26, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 8 %26, i64 12, i1 false)
  %129 = call { <2 x float>, float } @_ZN6squish3MinERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %25)
  store { <2 x float>, float } %129, ptr %27, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 8 %27, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #6
  %130 = call { <2 x float>, float } @_ZN6squish3MaxERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %17)
  store { <2 x float>, float } %130, ptr %30, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 8 %30, i64 12, i1 false)
  %131 = call { <2 x float>, float } @_ZN6squish3MinERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %29)
  store { <2 x float>, float } %131, ptr %31, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 8 %31, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %28, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %32) #6
  call void @_ZN6squish4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %32, float noundef 3.100000e+01, float noundef 6.300000e+01, float noundef 3.100000e+01)
  call void @llvm.lifetime.start.p0(i64 12, ptr %33) #6
  call void @_ZN6squish4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %33, float noundef 0x3FA0842100000000, float noundef 0x3F90410420000000, float noundef 0x3FA0842100000000)
  call void @llvm.lifetime.start.p0(i64 12, ptr %34) #6
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %34, float noundef 5.000000e-01)
  call void @llvm.lifetime.start.p0(i64 12, ptr %35) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %36) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %37) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %38) #6
  %132 = call { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %32, ptr noundef nonnull align 4 dereferenceable(12) %16)
  store { <2 x float>, float } %132, ptr %39, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 8 %39, i64 12, i1 false)
  %133 = call { <2 x float>, float } @_ZN6squishplERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %38, ptr noundef nonnull align 4 dereferenceable(12) %34)
  store { <2 x float>, float } %133, ptr %40, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 8 %40, i64 12, i1 false)
  %134 = call { <2 x float>, float } @_ZN6squish8TruncateERKNS_4Vec3E(ptr noundef nonnull align 4 dereferenceable(12) %37)
  store { <2 x float>, float } %134, ptr %41, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 8 %41, i64 12, i1 false)
  %135 = call { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 4 dereferenceable(12) %33)
  store { <2 x float>, float } %135, ptr %42, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 8 %42, i64 12, i1 false)
  %136 = getelementptr inbounds %"class.squish::RangeFit", ptr %51, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %136, ptr align 4 %35, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %35) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %43) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %44) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %45) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %46) #6
  %137 = call { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %32, ptr noundef nonnull align 4 dereferenceable(12) %17)
  store { <2 x float>, float } %137, ptr %47, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 8 %47, i64 12, i1 false)
  %138 = call { <2 x float>, float } @_ZN6squishplERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %46, ptr noundef nonnull align 4 dereferenceable(12) %34)
  store { <2 x float>, float } %138, ptr %48, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 8 %48, i64 12, i1 false)
  %139 = call { <2 x float>, float } @_ZN6squish8TruncateERKNS_4Vec3E(ptr noundef nonnull align 4 dereferenceable(12) %45)
  store { <2 x float>, float } %139, ptr %49, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 8 %49, i64 12, i1 false)
  %140 = call { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %44, ptr noundef nonnull align 4 dereferenceable(12) %33)
  store { <2 x float>, float } %140, ptr %50, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %43, ptr align 8 %50, i64 12, i1 false)
  %141 = getelementptr inbounds %"class.squish::RangeFit", ptr %51, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %141, ptr align 4 %43, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %46) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  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: 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 @_ZN6squish4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, 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 @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12), 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK6squish9ColourSet10GetWeightsEv(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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squish3MinERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #5

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squish3MaxERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #5

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #5

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squish8TruncateERKNS_4Vec3E(ptr noundef nonnull align 4 dereferenceable(12)) #5

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squishplERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #5

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 = { 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, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !10, i64 16}
!14 = !{!"_ZTSN6squish9ColourFitE", !6, i64 8, !10, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{i64 0, i64 4, !20, i64 4, i64 4, !20, i64 8, i64 4, !20}
!20 = !{!21, !21, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!23, !21, i64 56}
!23 = !{!"_ZTSN6squish8RangeFitE", !14, i64 0, !24, i64 20, !24, i64 32, !24, i64 44, !21, i64 56}
!24 = !{!"_ZTSN6squish4Vec3E", !21, i64 0, !21, i64 4, !21, i64 8}
!25 = !{!14, !6, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6squish8RangeFitC2EPKNS_9ColourSetEi(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %1, i32 noundef %2) unnamed_addr #0 align 2 {
  %4 = alloca %"class.squish::Vec3", align 4
  %5 = alloca %"class.squish::Vec3", align 4
  %6 = alloca %"class.squish::Sym3x3", align 4
  %7 = alloca %"class.squish::Vec3", align 8
  %8 = alloca %"class.squish::Vec3", align 8
  %9 = alloca %"class.squish::Vec3", align 8
  %10 = alloca %"class.squish::Vec3", align 4
  %11 = alloca %"class.squish::Vec3", align 4
  %12 = alloca %"class.squish::Vec3", align 8
  %13 = alloca %"class.squish::Vec3", align 8
  %14 = alloca %"class.squish::Vec3", align 4
  %15 = alloca %"class.squish::Vec3", align 4
  %16 = alloca %"class.squish::Vec3", align 4
  %17 = alloca %"class.squish::Vec3", align 8
  %18 = alloca %"class.squish::Vec3", align 8
  %19 = alloca %"class.squish::Vec3", align 8
  %20 = alloca %"class.squish::Vec3", align 8
  %21 = alloca %"class.squish::Vec3", align 8
  %22 = alloca %"class.squish::Vec3", align 8
  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 @_ZTVN6squish8RangeFitE, i64 16), ptr %0, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 20
  tail call void @_ZN6squish4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %23)
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @_ZN6squish4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %24)
  %25 = getelementptr inbounds i8, ptr %0, i64 44
  tail call void @_ZN6squish4Vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %25)
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = load i32, ptr %26, align 8, !tbaa !8
  %28 = and i32 %27, 32
  %.not = icmp eq i32 %28, 0
  br i1 %.not, label %30, label %29

29:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  call void @_ZN6squish4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef 0x3FCB367A00000000, float noundef 0x3FE6E2EB20000000, float noundef 0x3FB27BB300000000)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %4, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  br label %31

30:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %5, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  br label %31

31:                                               ; preds = %30, %29
  %32 = getelementptr inbounds i8, ptr %0, i64 56
  store float 0x47EFFFFFE0000000, ptr %32, align 8, !tbaa !16
  %33 = getelementptr inbounds i8, ptr %0, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !19
  %35 = call noundef i32 @_ZNK6squish9ColourSet8GetCountEv(ptr noundef nonnull align 4 dereferenceable(325) %34)
  %36 = load ptr, ptr %33, align 8, !tbaa !19
  %37 = call noundef ptr @_ZNK6squish9ColourSet9GetPointsEv(ptr noundef nonnull align 4 dereferenceable(325) %36)
  %38 = load ptr, ptr %33, align 8, !tbaa !19
  %39 = call noundef ptr @_ZNK6squish9ColourSet10GetWeightsEv(ptr noundef nonnull align 4 dereferenceable(325) %38)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  call void @_ZN6squish25ComputeWeightedCovarianceEiPKNS_4Vec3EPKf(ptr dead_on_unwind nonnull writable sret(%"class.squish::Sym3x3") align 4 %6, i32 noundef %35, ptr noundef %37, ptr noundef %39)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  %40 = call { <2 x float>, float } @_ZN6squish25ComputePrincipleComponentERKNS_6Sym3x3E(ptr noundef nonnull align 4 dereferenceable(24) %6)
  %.fca.0.extract61 = extractvalue { <2 x float>, float } %40, 0
  %.fca.1.extract62 = extractvalue { <2 x float>, float } %40, 1
  store <2 x float> %.fca.0.extract61, ptr %7, align 8
  %.sroa.264.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store float %.fca.1.extract62, ptr %.sroa.264.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #7
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #7
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 0.000000e+00)
  %41 = icmp sgt i32 %35, 0
  br i1 %41, label %42, label %.loopexit

42:                                               ; preds = %31
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %37, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %37, i64 12, i1 false)
  %43 = call noundef float @_ZN6squish3DotERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %37, ptr noundef nonnull align 4 dereferenceable(12) %7)
  %.not88 = icmp eq i32 %35, 1
  br i1 %.not88, label %.loopexit, label %.lr.ph.preheader

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %49
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %49 ]
  %.087 = phi float [ %43, %.lr.ph.preheader ], [ %.1, %49 ]
  %.07986 = phi float [ %43, %.lr.ph.preheader ], [ %.180, %49 ]
  %44 = getelementptr inbounds %"class.squish::Vec3", ptr %37, i64 %indvars.iv
  %45 = call noundef float @_ZN6squish3DotERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %44, ptr noundef nonnull align 4 dereferenceable(12) %7)
  %46 = fcmp olt float %45, %.087
  br i1 %46, label %.sink.split, label %47

47:                                               ; preds = %.lr.ph
  %48 = fcmp ogt float %45, %.07986
  br i1 %48, label %.sink.split, label %49

.sink.split:                                      ; preds = %47, %.lr.ph
  %.sink = phi ptr [ %8, %.lr.ph ], [ %9, %47 ]
  %.180.ph = phi float [ %.07986, %.lr.ph ], [ %45, %47 ]
  %.1.ph = phi float [ %45, %.lr.ph ], [ %.087, %47 ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %.sink, ptr noundef nonnull align 4 dereferenceable(12) %44, i64 12, i1 false)
  br label %49

49:                                               ; preds = %.sink.split, %47
  %.180 = phi float [ %.07986, %47 ], [ %.180.ph, %.sink.split ]
  %.1 = phi float [ %.087, %47 ], [ %.1.ph, %.sink.split ]
  %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 %.loopexit, label %.lr.ph, !llvm.loop !20

.loopexit:                                        ; preds = %49, %42, %31
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #7
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #7
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %11, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #7
  %50 = call { <2 x float>, float } @_ZN6squish3MaxERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %8)
  %.fca.0.extract46 = extractvalue { <2 x float>, float } %50, 0
  %.fca.1.extract47 = extractvalue { <2 x float>, float } %50, 1
  store <2 x float> %.fca.0.extract46, ptr %12, align 8
  %.sroa.249.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  store float %.fca.1.extract47, ptr %.sroa.249.0..sroa_idx, align 8
  %51 = call { <2 x float>, float } @_ZN6squish3MinERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %12)
  %.fca.0.extract42 = extractvalue { <2 x float>, float } %51, 0
  %.fca.1.extract43 = extractvalue { <2 x float>, float } %51, 1
  store <2 x float> %.fca.0.extract42, ptr %8, align 8
  %.sroa.451.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  store float %.fca.1.extract43, ptr %.sroa.451.0..sroa_idx, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #7
  %52 = call { <2 x float>, float } @_ZN6squish3MaxERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %.fca.0.extract36 = extractvalue { <2 x float>, float } %52, 0
  %.fca.1.extract37 = extractvalue { <2 x float>, float } %52, 1
  store <2 x float> %.fca.0.extract36, ptr %13, align 8
  %.sroa.239.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  store float %.fca.1.extract37, ptr %.sroa.239.0..sroa_idx, align 8
  %53 = call { <2 x float>, float } @_ZN6squish3MinERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %13)
  %.fca.0.extract32 = extractvalue { <2 x float>, float } %53, 0
  %.fca.1.extract33 = extractvalue { <2 x float>, float } %53, 1
  store <2 x float> %.fca.0.extract32, ptr %9, align 8
  %.sroa.441.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  store float %.fca.1.extract33, ptr %.sroa.441.0..sroa_idx, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #7
  call void @_ZN6squish4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %14, float noundef 3.100000e+01, float noundef 6.300000e+01, float noundef 3.100000e+01)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #7
  call void @_ZN6squish4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %15, float noundef 0x3FA0842100000000, float noundef 0x3F90410420000000, float noundef 0x3FA0842100000000)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #7
  call void @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef 5.000000e-01)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #7
  %54 = call { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %8)
  %.fca.0.extract26 = extractvalue { <2 x float>, float } %54, 0
  %.fca.1.extract27 = extractvalue { <2 x float>, float } %54, 1
  store <2 x float> %.fca.0.extract26, ptr %19, align 8
  %.sroa.229.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 8
  store float %.fca.1.extract27, ptr %.sroa.229.0..sroa_idx, align 8
  %55 = call { <2 x float>, float } @_ZN6squishplERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %16)
  %.fca.0.extract22 = extractvalue { <2 x float>, float } %55, 0
  %.fca.1.extract23 = extractvalue { <2 x float>, float } %55, 1
  store <2 x float> %.fca.0.extract22, ptr %18, align 8
  %.sroa.225.0..sroa_idx = getelementptr inbounds i8, ptr %18, i64 8
  store float %.fca.1.extract23, ptr %.sroa.225.0..sroa_idx, align 8
  %56 = call { <2 x float>, float } @_ZN6squish8TruncateERKNS_4Vec3E(ptr noundef nonnull align 4 dereferenceable(12) %18)
  %.fca.0.extract18 = extractvalue { <2 x float>, float } %56, 0
  %.fca.1.extract19 = extractvalue { <2 x float>, float } %56, 1
  store <2 x float> %.fca.0.extract18, ptr %17, align 8
  %.sroa.221.0..sroa_idx = getelementptr inbounds i8, ptr %17, i64 8
  store float %.fca.1.extract19, ptr %.sroa.221.0..sroa_idx, align 8
  %57 = call { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %15)
  %.fca.0.extract14 = extractvalue { <2 x float>, float } %57, 0
  %.fca.1.extract15 = extractvalue { <2 x float>, float } %57, 1
  store <2 x float> %.fca.0.extract14, ptr %24, align 8
  %.sroa.431.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 40
  store float %.fca.1.extract15, ptr %.sroa.431.0..sroa_idx, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %20) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %21) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %22) #7
  %58 = call { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %.fca.0.extract9 = extractvalue { <2 x float>, float } %58, 0
  %.fca.1.extract10 = extractvalue { <2 x float>, float } %58, 1
  store <2 x float> %.fca.0.extract9, ptr %22, align 8
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  store float %.fca.1.extract10, ptr %.sroa.212.0..sroa_idx, align 8
  %59 = call { <2 x float>, float } @_ZN6squishplERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %16)
  %.fca.0.extract5 = extractvalue { <2 x float>, float } %59, 0
  %.fca.1.extract6 = extractvalue { <2 x float>, float } %59, 1
  store <2 x float> %.fca.0.extract5, ptr %21, align 8
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %21, i64 8
  store float %.fca.1.extract6, ptr %.sroa.28.0..sroa_idx, align 8
  %60 = call { <2 x float>, float } @_ZN6squish8TruncateERKNS_4Vec3E(ptr noundef nonnull align 4 dereferenceable(12) %21)
  %.fca.0.extract1 = extractvalue { <2 x float>, float } %60, 0
  %.fca.1.extract2 = extractvalue { <2 x float>, float } %60, 1
  store <2 x float> %.fca.0.extract1, ptr %20, align 8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %20, i64 8
  store float %.fca.1.extract2, ptr %.sroa.24.0..sroa_idx, align 8
  %61 = call { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %20, ptr noundef nonnull align 4 dereferenceable(12) %15)
  %.fca.0.extract = extractvalue { <2 x float>, float } %61, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %61, 1
  store <2 x float> %.fca.0.extract, ptr %25, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 52
  store float %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  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 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 @_ZN6squish4Vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, 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 @_ZN6squish4Vec3C2Ef(ptr noundef nonnull align 4 dereferenceable(12), 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

; 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 void @_ZN6squish25ComputeWeightedCovarianceEiPKNS_4Vec3EPKf(ptr dead_on_unwind writable sret(%"class.squish::Sym3x3") align 4, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squish3MinERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squish3MaxERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squishmlERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squish8TruncateERKNS_4Vec3E(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN6squishplERKNS_4Vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

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

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 = !{i64 0, i64 4, !14, i64 4, i64 4, !14, i64 8, i64 4, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !11, i64 0}
!16 = !{!17, !15, i64 56}
!17 = !{!"_ZTSN6squish8RangeFitE", !9, i64 0, !18, i64 20, !18, i64 32, !18, i64 44, !15, i64 56}
!18 = !{!"_ZTSN6squish4Vec3E", !15, i64 0, !15, i64 4, !15, i64 8}
!19 = !{!9, !10, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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