; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (basisu_bc7enc)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.basist::astc_quant_bin" = type { i8, i8 }
%"struct.basist::color_quad_u8" = type { [4 x i8] }
%"struct.basisu::color_cell_compressor_params" = type { i32, ptr, i32, ptr, ptr, i32, ptr, i32, [4 x i32], i8, i8, i8, i8 }
%"struct.basisu::color_cell_compressor_results" = type { i64, %"struct.basist::color_quad_u8", %"struct.basist::color_quad_u8", [2 x i32], ptr, ptr, %"struct.basist::color_quad_u8", %"struct.basist::color_quad_u8" }

@_ZN6basisu27g_astc_sorted_order_unquantE = external dso_local global [21 x [256 x %"struct.basist::astc_quant_bin"]], align 16
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [113 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE = external hidden unnamed_addr constant [109 x i8], align 1
@_ZN6basist14g_astc_unquantE = external global [21 x [256 x %"struct.basist::astc_quant_bin"]], align 16
@.str.4 = external hidden unnamed_addr constant [123 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [126 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN6basisuL23astc_interpolate_linearEjjj(i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [32 x %"struct.basist::color_quad_u8"], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %15, i32 0, i32 2
  %17 = load i32, ptr %16, align 8, !tbaa !9
  store i32 %17, ptr %5, align 4, !tbaa !12
  %18 = load i32, ptr %5, align 4, !tbaa !12
  %19 = icmp ule i32 %18, 32
  br i1 %19, label %20, label %21

20:                                               ; preds = %2
  br label %23

21:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 1288, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE) #6
  unreachable

22:                                               ; No predecessors!
  br label %23

23:                                               ; preds = %22, %20
  call void @llvm.lifetime.start.p0(i64 128, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !12
  br label %24

24:                                               ; preds = %135, %23
  %25 = load i32, ptr %7, align 4, !tbaa !12
  %26 = icmp ult i32 %25, 4
  br i1 %26, label %28, label %27

27:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %138

28:                                               ; preds = %24
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %29, i32 0, i32 7
  %31 = load i32, ptr %30, align 8, !tbaa !13
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %32
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.basisu::color_cell_compressor_results", ptr %34, i32 0, i32 6
  %36 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %35, i32 0, i32 0
  %37 = load i32, ptr %7, align 4, !tbaa !12
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds [4 x i8], ptr %36, i64 0, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !14
  %41 = zext i8 %40 to i64
  %42 = getelementptr inbounds [256 x %"struct.basist::astc_quant_bin"], ptr %33, i64 0, i64 %41
  %43 = getelementptr inbounds %"struct.basist::astc_quant_bin", ptr %42, i32 0, i32 0
  %44 = load i8, ptr %43, align 2, !tbaa !15
  %45 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %6, i64 0, i64 0
  %46 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %45, i32 0, i32 0
  %47 = load i32, ptr %7, align 4, !tbaa !12
  %48 = zext i32 %47 to i64
  %49 = getelementptr inbounds [4 x i8], ptr %46, i64 0, i64 %48
  store i8 %44, ptr %49, align 1, !tbaa !14
  %50 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %6, i64 0, i64 0
  %51 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %50, i32 0, i32 0
  %52 = load i32, ptr %7, align 4, !tbaa !12
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds [4 x i8], ptr %51, i64 0, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !14
  %56 = zext i8 %55 to i32
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %57, i32 0, i32 7
  %59 = load i32, ptr %58, align 8, !tbaa !13
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %60
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.basisu::color_cell_compressor_results", ptr %62, i32 0, i32 1
  %64 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %63, i32 0, i32 0
  %65 = load i32, ptr %7, align 4, !tbaa !12
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds [4 x i8], ptr %64, i64 0, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !14
  %69 = zext i8 %68 to i64
  %70 = getelementptr inbounds [256 x %"struct.basist::astc_quant_bin"], ptr %61, i64 0, i64 %69
  %71 = getelementptr inbounds %"struct.basist::astc_quant_bin", ptr %70, i32 0, i32 0
  %72 = load i8, ptr %71, align 2, !tbaa !15
  %73 = zext i8 %72 to i32
  %74 = icmp eq i32 %56, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %28
  br label %78

76:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 1294, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE) #6
  unreachable

77:                                               ; No predecessors!
  br label %78

78:                                               ; preds = %77, %75
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %79, i32 0, i32 7
  %81 = load i32, ptr %80, align 8, !tbaa !13
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %82
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.basisu::color_cell_compressor_results", ptr %84, i32 0, i32 7
  %86 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %85, i32 0, i32 0
  %87 = load i32, ptr %7, align 4, !tbaa !12
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds [4 x i8], ptr %86, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !14
  %91 = zext i8 %90 to i64
  %92 = getelementptr inbounds [256 x %"struct.basist::astc_quant_bin"], ptr %83, i64 0, i64 %91
  %93 = getelementptr inbounds %"struct.basist::astc_quant_bin", ptr %92, i32 0, i32 0
  %94 = load i8, ptr %93, align 2, !tbaa !15
  %95 = load i32, ptr %5, align 4, !tbaa !12
  %96 = sub i32 %95, 1
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %6, i64 0, i64 %97
  %99 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %98, i32 0, i32 0
  %100 = load i32, ptr %7, align 4, !tbaa !12
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds [4 x i8], ptr %99, i64 0, i64 %101
  store i8 %94, ptr %102, align 1, !tbaa !14
  %103 = load i32, ptr %5, align 4, !tbaa !12
  %104 = sub i32 %103, 1
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %6, i64 0, i64 %105
  %107 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %106, i32 0, i32 0
  %108 = load i32, ptr %7, align 4, !tbaa !12
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [4 x i8], ptr %107, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !14
  %112 = zext i8 %111 to i32
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %113, i32 0, i32 7
  %115 = load i32, ptr %114, align 8, !tbaa !13
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %116
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %"struct.basisu::color_cell_compressor_results", ptr %118, i32 0, i32 2
  %120 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %119, i32 0, i32 0
  %121 = load i32, ptr %7, align 4, !tbaa !12
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds [4 x i8], ptr %120, i64 0, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !14
  %125 = zext i8 %124 to i64
  %126 = getelementptr inbounds [256 x %"struct.basist::astc_quant_bin"], ptr %117, i64 0, i64 %125
  %127 = getelementptr inbounds %"struct.basist::astc_quant_bin", ptr %126, i32 0, i32 0
  %128 = load i8, ptr %127, align 2, !tbaa !15
  %129 = zext i8 %128 to i32
  %130 = icmp eq i32 %112, %129
  br i1 %130, label %131, label %132

131:                                              ; preds = %78
  br label %134

132:                                              ; preds = %78
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 1297, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE) #6
  unreachable

133:                                              ; No predecessors!
  br label %134

134:                                              ; preds = %133, %131
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %7, align 4, !tbaa !12
  %137 = add i32 %136, 1
  store i32 %137, ptr %7, align 4, !tbaa !12
  br label %24, !llvm.loop !17

138:                                              ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !12
  br label %139

139:                                              ; preds = %190, %138
  %140 = load i32, ptr %8, align 4, !tbaa !12
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %141, i32 0, i32 2
  %143 = load i32, ptr %142, align 8, !tbaa !9
  %144 = sub i32 %143, 1
  %145 = icmp ult i32 %140, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %139
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %193

147:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !12
  br label %148

148:                                              ; preds = %186, %147
  %149 = load i32, ptr %10, align 4, !tbaa !12
  %150 = icmp ult i32 %149, 4
  br i1 %150, label %152, label %151

151:                                              ; preds = %148
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %189

152:                                              ; preds = %148
  %153 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %6, i64 0, i64 0
  %154 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %153, i32 0, i32 0
  %155 = load i32, ptr %10, align 4, !tbaa !12
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds [4 x i8], ptr %154, i64 0, i64 %156
  %158 = load i8, ptr %157, align 1, !tbaa !14
  %159 = zext i8 %158 to i32
  %160 = load i32, ptr %5, align 4, !tbaa !12
  %161 = sub i32 %160, 1
  %162 = zext i32 %161 to i64
  %163 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %6, i64 0, i64 %162
  %164 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %163, i32 0, i32 0
  %165 = load i32, ptr %10, align 4, !tbaa !12
  %166 = zext i32 %165 to i64
  %167 = getelementptr inbounds [4 x i8], ptr %164, i64 0, i64 %166
  %168 = load i8, ptr %167, align 1, !tbaa !14
  %169 = zext i8 %168 to i32
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %170, i32 0, i32 3
  %172 = load ptr, ptr %171, align 8, !tbaa !19
  %173 = load i32, ptr %8, align 4, !tbaa !12
  %174 = zext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %172, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !12
  %177 = call noundef i32 @_ZN6basisuL23astc_interpolate_linearEjjj(i32 noundef %159, i32 noundef %169, i32 noundef %176)
  %178 = trunc i32 %177 to i8
  %179 = load i32, ptr %8, align 4, !tbaa !12
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %6, i64 0, i64 %180
  %182 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %181, i32 0, i32 0
  %183 = load i32, ptr %10, align 4, !tbaa !12
  %184 = zext i32 %183 to i64
  %185 = getelementptr inbounds [4 x i8], ptr %182, i64 0, i64 %184
  store i8 %178, ptr %185, align 1, !tbaa !14
  br label %186

186:                                              ; preds = %152
  %187 = load i32, ptr %10, align 4, !tbaa !12
  %188 = add i32 %187, 1
  store i32 %188, ptr %10, align 4, !tbaa !12
  br label %148, !llvm.loop !20

189:                                              ; preds = %151
  br label %190

190:                                              ; preds = %189
  %191 = load i32, ptr %8, align 4, !tbaa !12
  %192 = add i32 %191, 1
  store i32 %192, ptr %8, align 4, !tbaa !12
  br label %139, !llvm.loop !21

193:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !12
  br label %194

194:                                              ; preds = %246, %193
  %195 = load i32, ptr %12, align 4, !tbaa !12
  %196 = load ptr, ptr %3, align 8, !tbaa !5
  %197 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %196, i32 0, i32 0
  %198 = load i32, ptr %197, align 8, !tbaa !24
  %199 = icmp ult i32 %195, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %194
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %249

201:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %202 = load ptr, ptr %3, align 8, !tbaa !5
  %203 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %202, i32 0, i32 1
  %204 = load ptr, ptr %203, align 8, !tbaa !25
  %205 = load i32, ptr %12, align 4, !tbaa !12
  %206 = zext i32 %205 to i64
  %207 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %204, i64 %206
  store ptr %207, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %208 = load ptr, ptr %4, align 8, !tbaa !5
  %209 = getelementptr inbounds %"struct.basisu::color_cell_compressor_results", ptr %208, i32 0, i32 4
  %210 = load ptr, ptr %209, align 8, !tbaa !26
  %211 = load i32, ptr %12, align 4, !tbaa !12
  %212 = zext i32 %211 to i64
  %213 = getelementptr inbounds i8, ptr %210, i64 %212
  %214 = load i8, ptr %213, align 1, !tbaa !14
  %215 = zext i8 %214 to i64
  %216 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %6, i64 0, i64 %215
  store ptr %216, ptr %14, align 8, !tbaa !5
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  %218 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %217, i32 0, i32 9
  %219 = load i8, ptr %218, align 4, !tbaa !29
  %220 = icmp ne i8 %219, 0
  br i1 %220, label %221, label %233

221:                                              ; preds = %201
  %222 = load ptr, ptr %13, align 8, !tbaa !5
  %223 = load ptr, ptr %14, align 8, !tbaa !5
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %224, i32 0, i32 12
  %226 = load i8, ptr %225, align 1, !tbaa !30
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %227, i32 0, i32 8
  %229 = getelementptr inbounds [4 x i32], ptr %228, i64 0, i64 0
  %230 = call noundef i64 @_ZN6basisuL27compute_color_distance_rgbaEPKN6basist13color_quad_u8ES3_hPKj(ptr noundef %222, ptr noundef %223, i8 noundef zeroext %226, ptr noundef %229)
  %231 = load i64, ptr %11, align 8, !tbaa !22
  %232 = add i64 %231, %230
  store i64 %232, ptr %11, align 8, !tbaa !22
  br label %245

233:                                              ; preds = %201
  %234 = load ptr, ptr %13, align 8, !tbaa !5
  %235 = load ptr, ptr %14, align 8, !tbaa !5
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %236, i32 0, i32 12
  %238 = load i8, ptr %237, align 1, !tbaa !30
  %239 = load ptr, ptr %3, align 8, !tbaa !5
  %240 = getelementptr inbounds %"struct.basisu::color_cell_compressor_params", ptr %239, i32 0, i32 8
  %241 = getelementptr inbounds [4 x i32], ptr %240, i64 0, i64 0
  %242 = call noundef i64 @_ZN6basisuL26compute_color_distance_rgbEPKN6basist13color_quad_u8ES3_hPKj(ptr noundef %234, ptr noundef %235, i8 noundef zeroext %238, ptr noundef %241)
  %243 = load i64, ptr %11, align 8, !tbaa !22
  %244 = add i64 %243, %242
  store i64 %244, ptr %11, align 8, !tbaa !22
  br label %245

245:                                              ; preds = %233, %221
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %12, align 4, !tbaa !12
  %248 = add i32 %247, 1
  store i32 %248, ptr %12, align 4, !tbaa !12
  br label %194, !llvm.loop !31

249:                                              ; preds = %200
  %250 = load i64, ptr %11, align 8, !tbaa !22
  %251 = load ptr, ptr %4, align 8, !tbaa !5
  %252 = getelementptr inbounds %"struct.basisu::color_cell_compressor_results", ptr %251, i32 0, i32 0
  %253 = load i64, ptr %252, align 8, !tbaa !32
  %254 = icmp eq i64 %250, %253
  br i1 %254, label %255, label %256

255:                                              ; preds = %249
  br label %258

256:                                              ; preds = %249
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 1315, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE) #6
  unreachable

257:                                              ; No predecessors!
  br label %258

258:                                              ; preds = %257, %255
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i64 @_ZN6basisuL27compute_color_distance_rgbaEPKN6basist13color_quad_u8ES3_hPKj(ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN6basisuL26compute_color_distance_rgbEPKN6basist13color_quad_u8ES3_hPKj(ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { noreturn nounwind "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 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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, !11, i64 16}
!10 = !{!"_ZTSN6basisu28color_cell_compressor_paramsE", !11, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !11, i64 56, !7, i64 60, !7, i64 76, !7, i64 77, !7, i64 78, !7, i64 79}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 56}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"_ZTSN6basist14astc_quant_binE", !7, i64 0, !7, i64 1}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !6, i64 24}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = !{!23, !23, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!10, !11, i64 0}
!25 = !{!10, !6, i64 8}
!26 = !{!27, !6, i64 24}
!27 = !{!"_ZTSN6basisu29color_cell_compressor_resultsE", !23, i64 0, !28, i64 8, !28, i64 12, !7, i64 16, !6, i64 24, !6, i64 32, !28, i64 40, !28, i64 44}
!28 = !{!"_ZTSN6basist13color_quad_u8E", !7, i64 0}
!29 = !{!10, !7, i64 76}
!30 = !{!10, !7, i64 79}
!31 = distinct !{!31, !18}
!32 = !{!27, !23, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.basist::astc_quant_bin" = type { i8, i8 }
%"struct.basist::color_quad_u8" = type { [4 x i8] }

@_ZN6basisu27g_astc_sorted_order_unquantE = external dso_local local_unnamed_addr global [21 x [256 x %"struct.basist::astc_quant_bin"]], align 16
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [113 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE = external hidden unnamed_addr constant [109 x i8], align 1
@_ZN6basist14g_astc_unquantE = external local_unnamed_addr global [21 x [256 x %"struct.basist::astc_quant_bin"]], align 16
@.str.4 = external hidden unnamed_addr constant [123 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [126 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN6basisuL23astc_interpolate_linearEjjj(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 {
  %3 = alloca [32 x %"struct.basist::color_quad_u8"], align 16
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp ult i32 %5, 33
  br i1 %6, label %8, label %7

7:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, i32 noundef 1288, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE) #5
  unreachable

8:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  %10 = load i32, ptr %9, align 8, !tbaa !11
  %11 = zext i32 %10 to i64
  %12 = getelementptr inbounds i8, ptr %1, i64 40
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = add nsw i32 %5, -1
  %15 = zext i32 %14 to i64
  %16 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %3, i64 0, i64 %15
  %17 = load i8, ptr %12, align 1, !tbaa !12
  %18 = zext i8 %17 to i64
  %19 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %11, i64 %18
  %20 = load i8, ptr %19, align 2, !tbaa !13
  store i8 %20, ptr %3, align 16, !tbaa !12
  %21 = load i8, ptr %13, align 1, !tbaa !12
  %22 = zext i8 %21 to i64
  %23 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %11, i64 %22
  %24 = load i8, ptr %23, align 2, !tbaa !13
  %25 = icmp eq i8 %20, %24
  br i1 %25, label %112, label %111

26:                                               ; preds = %112
  %27 = getelementptr inbounds i8, ptr %1, i64 41
  %28 = load i8, ptr %27, align 1, !tbaa !12
  %29 = zext i8 %28 to i64
  %30 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %11, i64 %29
  %31 = load i8, ptr %30, align 2, !tbaa !13
  %32 = getelementptr inbounds i8, ptr %3, i64 1
  store i8 %31, ptr %32, align 1, !tbaa !12
  %33 = getelementptr inbounds i8, ptr %1, i64 9
  %34 = load i8, ptr %33, align 1, !tbaa !12
  %35 = zext i8 %34 to i64
  %36 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %11, i64 %35
  %37 = load i8, ptr %36, align 2, !tbaa !13
  %38 = icmp eq i8 %31, %37
  br i1 %38, label %39, label %111

39:                                               ; preds = %26
  %40 = getelementptr inbounds i8, ptr %1, i64 45
  %41 = load i8, ptr %40, align 1, !tbaa !12
  %42 = zext i8 %41 to i64
  %43 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %11, i64 %42
  %44 = load i8, ptr %43, align 2, !tbaa !13
  %45 = getelementptr inbounds i8, ptr %16, i64 1
  store i8 %44, ptr %45, align 1, !tbaa !12
  %46 = getelementptr inbounds i8, ptr %1, i64 13
  %47 = load i8, ptr %46, align 1, !tbaa !12
  %48 = zext i8 %47 to i64
  %49 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %11, i64 %48
  %50 = load i8, ptr %49, align 2, !tbaa !13
  %51 = icmp eq i8 %44, %50
  br i1 %51, label %52, label %124

52:                                               ; preds = %39
  %53 = getelementptr inbounds i8, ptr %1, i64 42
  %54 = load i8, ptr %53, align 1, !tbaa !12
  %55 = zext i8 %54 to i64
  %56 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %11, i64 %55
  %57 = load i8, ptr %56, align 2, !tbaa !13
  %58 = getelementptr inbounds i8, ptr %3, i64 2
  store i8 %57, ptr %58, align 2, !tbaa !12
  %59 = getelementptr inbounds i8, ptr %1, i64 10
  %60 = load i8, ptr %59, align 1, !tbaa !12
  %61 = zext i8 %60 to i64
  %62 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %11, i64 %61
  %63 = load i8, ptr %62, align 2, !tbaa !13
  %64 = icmp eq i8 %57, %63
  br i1 %64, label %65, label %111

65:                                               ; preds = %52
  %66 = getelementptr inbounds i8, ptr %1, i64 46
  %67 = load i8, ptr %66, align 1, !tbaa !12
  %68 = zext i8 %67 to i64
  %69 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %11, i64 %68
  %70 = load i8, ptr %69, align 2, !tbaa !13
  %71 = getelementptr inbounds i8, ptr %16, i64 2
  store i8 %70, ptr %71, align 2, !tbaa !12
  %72 = getelementptr inbounds i8, ptr %1, i64 14
  %73 = load i8, ptr %72, align 1, !tbaa !12
  %74 = zext i8 %73 to i64
  %75 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %11, i64 %74
  %76 = load i8, ptr %75, align 2, !tbaa !13
  %77 = icmp eq i8 %70, %76
  br i1 %77, label %78, label %124

78:                                               ; preds = %65
  %79 = getelementptr inbounds i8, ptr %1, i64 43
  %80 = load i8, ptr %79, align 1, !tbaa !12
  %81 = zext i8 %80 to i64
  %82 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %11, i64 %81
  %83 = load i8, ptr %82, align 2, !tbaa !13
  %84 = getelementptr inbounds i8, ptr %3, i64 3
  store i8 %83, ptr %84, align 1, !tbaa !12
  %85 = getelementptr inbounds i8, ptr %1, i64 11
  %86 = load i8, ptr %85, align 1, !tbaa !12
  %87 = zext i8 %86 to i64
  %88 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %11, i64 %87
  %89 = load i8, ptr %88, align 2, !tbaa !13
  %90 = icmp eq i8 %83, %89
  br i1 %90, label %91, label %111

91:                                               ; preds = %78
  %92 = getelementptr inbounds i8, ptr %1, i64 47
  %93 = load i8, ptr %92, align 1, !tbaa !12
  %94 = zext i8 %93 to i64
  %95 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %11, i64 %94
  %96 = load i8, ptr %95, align 2, !tbaa !13
  %97 = getelementptr inbounds i8, ptr %16, i64 3
  store i8 %96, ptr %97, align 1, !tbaa !12
  %98 = getelementptr inbounds i8, ptr %1, i64 15
  %99 = load i8, ptr %98, align 1, !tbaa !12
  %100 = zext i8 %99 to i64
  %101 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %11, i64 %100
  %102 = load i8, ptr %101, align 2, !tbaa !13
  %103 = icmp eq i8 %96, %102
  br i1 %103, label %.preheader59, label %124

.preheader59:                                     ; preds = %91
  %104 = add nsw i32 %5, -3
  %105 = icmp ult i32 %104, -2
  br i1 %105, label %.preheader58.lr.ph, label %.preheader

.preheader58.lr.ph:                               ; preds = %.preheader59
  %106 = getelementptr inbounds i8, ptr %0, i64 24
  %.pre = load i8, ptr %3, align 16, !tbaa !12
  %.pre72 = load i8, ptr %32, align 1, !tbaa !12
  %.pre73 = load i8, ptr %58, align 2, !tbaa !12
  %.pre74 = load i8, ptr %84, align 1, !tbaa !12
  %107 = zext i8 %.pre to i32
  %108 = zext i8 %.pre72 to i32
  %109 = zext i8 %.pre73 to i32
  %110 = zext i8 %.pre74 to i32
  br label %.preheader58

111:                                              ; preds = %78, %52, %26, %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 1294, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE) #5
  unreachable

112:                                              ; preds = %8
  %113 = getelementptr inbounds i8, ptr %1, i64 12
  %114 = getelementptr inbounds i8, ptr %1, i64 44
  %115 = load i8, ptr %114, align 1, !tbaa !12
  %116 = zext i8 %115 to i64
  %117 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basist14g_astc_unquantE, i64 0, i64 %11, i64 %116
  %118 = load i8, ptr %117, align 2, !tbaa !13
  store i8 %118, ptr %16, align 4, !tbaa !12
  %119 = load i8, ptr %113, align 1, !tbaa !12
  %120 = zext i8 %119 to i64
  %121 = getelementptr inbounds [21 x [256 x %"struct.basist::astc_quant_bin"]], ptr @_ZN6basisu27g_astc_sorted_order_unquantE, i64 0, i64 %11, i64 %120
  %122 = load i8, ptr %121, align 2, !tbaa !13
  %123 = icmp eq i8 %118, %122
  br i1 %123, label %26, label %124

124:                                              ; preds = %91, %65, %39, %112
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 1297, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE) #5
  unreachable

.preheader58:                                     ; preds = %.preheader58.lr.ph, %.preheader58
  %indvars.iv = phi i64 [ 1, %.preheader58.lr.ph ], [ %indvars.iv.next, %.preheader58 ]
  %125 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %3, i64 0, i64 %indvars.iv
  %126 = load i8, ptr %16, align 4, !tbaa !12
  %127 = zext i8 %126 to i32
  %128 = load ptr, ptr %106, align 8, !tbaa !15
  %129 = getelementptr inbounds i32, ptr %128, i64 %indvars.iv
  %130 = load i32, ptr %129, align 4, !tbaa !16
  %131 = tail call noundef i32 @_ZN6basisuL23astc_interpolate_linearEjjj(i32 noundef %107, i32 noundef %127, i32 noundef %130)
  %132 = trunc i32 %131 to i8
  store i8 %132, ptr %125, align 4, !tbaa !12
  %133 = load i8, ptr %45, align 1, !tbaa !12
  %134 = zext i8 %133 to i32
  %135 = load ptr, ptr %106, align 8, !tbaa !15
  %136 = getelementptr inbounds i32, ptr %135, i64 %indvars.iv
  %137 = load i32, ptr %136, align 4, !tbaa !16
  %138 = tail call noundef i32 @_ZN6basisuL23astc_interpolate_linearEjjj(i32 noundef %108, i32 noundef %134, i32 noundef %137)
  %139 = trunc i32 %138 to i8
  %140 = getelementptr inbounds i8, ptr %125, i64 1
  store i8 %139, ptr %140, align 1, !tbaa !12
  %141 = load i8, ptr %71, align 2, !tbaa !12
  %142 = zext i8 %141 to i32
  %143 = load ptr, ptr %106, align 8, !tbaa !15
  %144 = getelementptr inbounds i32, ptr %143, i64 %indvars.iv
  %145 = load i32, ptr %144, align 4, !tbaa !16
  %146 = tail call noundef i32 @_ZN6basisuL23astc_interpolate_linearEjjj(i32 noundef %109, i32 noundef %142, i32 noundef %145)
  %147 = trunc i32 %146 to i8
  %148 = getelementptr inbounds i8, ptr %125, i64 2
  store i8 %147, ptr %148, align 2, !tbaa !12
  %149 = load i8, ptr %97, align 1, !tbaa !12
  %150 = zext i8 %149 to i32
  %151 = load ptr, ptr %106, align 8, !tbaa !15
  %152 = getelementptr inbounds i32, ptr %151, i64 %indvars.iv
  %153 = load i32, ptr %152, align 4, !tbaa !16
  %154 = tail call noundef i32 @_ZN6basisuL23astc_interpolate_linearEjjj(i32 noundef %110, i32 noundef %150, i32 noundef %153)
  %155 = trunc i32 %154 to i8
  %156 = getelementptr inbounds i8, ptr %125, i64 3
  store i8 %155, ptr %156, align 1, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %157 = load i32, ptr %4, align 8, !tbaa !5
  %158 = add i32 %157, -1
  %159 = zext i32 %158 to i64
  %160 = icmp ult i64 %indvars.iv.next, %159
  br i1 %160, label %.preheader58, label %.preheader, !llvm.loop !17

.preheader:                                       ; preds = %.preheader58, %.preheader59
  %161 = load i32, ptr %0, align 8, !tbaa !19
  %.not65 = icmp eq i32 %161, 0
  br i1 %.not65, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %162 = getelementptr inbounds i8, ptr %0, i64 8
  %163 = getelementptr inbounds i8, ptr %1, i64 24
  %164 = getelementptr inbounds i8, ptr %0, i64 76
  %165 = getelementptr inbounds i8, ptr %0, i64 79
  %166 = getelementptr inbounds i8, ptr %0, i64 60
  br label %169

._crit_edge:                                      ; preds = %183, %.preheader
  %.055.lcssa = phi i64 [ 0, %.preheader ], [ %.1, %183 ]
  %167 = load i64, ptr %1, align 8, !tbaa !20
  %168 = icmp eq i64 %.055.lcssa, %167
  br i1 %168, label %188, label %187

169:                                              ; preds = %.lr.ph, %183
  %indvars.iv69 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next70, %183 ]
  %.05563 = phi i64 [ 0, %.lr.ph ], [ %.1, %183 ]
  %170 = load ptr, ptr %162, align 8, !tbaa !24
  %171 = getelementptr inbounds %"struct.basist::color_quad_u8", ptr %170, i64 %indvars.iv69
  %172 = load ptr, ptr %163, align 8, !tbaa !25
  %173 = getelementptr inbounds i8, ptr %172, i64 %indvars.iv69
  %174 = load i8, ptr %173, align 1, !tbaa !12
  %175 = zext i8 %174 to i64
  %176 = getelementptr inbounds [32 x %"struct.basist::color_quad_u8"], ptr %3, i64 0, i64 %175
  %177 = load i8, ptr %164, align 4, !tbaa !26
  %.not = icmp eq i8 %177, 0
  %178 = load i8, ptr %165, align 1, !tbaa !27
  br i1 %.not, label %181, label %179

179:                                              ; preds = %169
  %180 = call noundef i64 @_ZN6basisuL27compute_color_distance_rgbaEPKN6basist13color_quad_u8ES3_hPKj(ptr noundef %171, ptr noundef nonnull %176, i8 noundef zeroext %178, ptr noundef nonnull %166)
  br label %183

181:                                              ; preds = %169
  %182 = call noundef i64 @_ZN6basisuL26compute_color_distance_rgbEPKN6basist13color_quad_u8ES3_hPKj(ptr noundef %171, ptr noundef nonnull %176, i8 noundef zeroext %178, ptr noundef nonnull %166)
  br label %183

183:                                              ; preds = %181, %179
  %.pn = phi i64 [ %180, %179 ], [ %182, %181 ]
  %.1 = add i64 %.pn, %.05563
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %184 = load i32, ptr %0, align 8, !tbaa !19
  %185 = zext i32 %184 to i64
  %186 = icmp ult i64 %indvars.iv.next70, %185
  br i1 %186, label %169, label %._crit_edge, !llvm.loop !28

187:                                              ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 1315, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu24check_best_overall_errorEPKNS_28color_cell_compressor_paramsEPNS_29color_cell_compressor_resultsE) #5
  unreachable

188:                                              ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #6
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i64 @_ZN6basisuL27compute_color_distance_rgbaEPKN6basist13color_quad_u8ES3_hPKj(ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN6basisuL26compute_color_distance_rgbEPKN6basist13color_quad_u8ES3_hPKj(ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 16}
!6 = !{!"_ZTSN6basisu28color_cell_compressor_paramsE", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !7, i64 56, !8, i64 60, !8, i64 76, !8, i64 77, !8, i64 78, !8, i64 79}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 56}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !8, i64 0}
!14 = !{!"_ZTSN6basist14astc_quant_binE", !8, i64 0, !8, i64 1}
!15 = !{!6, !10, i64 24}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!6, !7, i64 0}
!20 = !{!21, !22, i64 0}
!21 = !{!"_ZTSN6basisu29color_cell_compressor_resultsE", !22, i64 0, !23, i64 8, !23, i64 12, !8, i64 16, !10, i64 24, !10, i64 32, !23, i64 40, !23, i64 44}
!22 = !{!"long", !8, i64 0}
!23 = !{!"_ZTSN6basist13color_quad_u8E", !8, i64 0}
!24 = !{!6, !10, i64 8}
!25 = !{!21, !10, i64 24}
!26 = !{!6, !8, i64 76}
!27 = !{!6, !8, i64 79}
!28 = distinct !{!28, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass