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

; 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.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%"class.basisu::etc1_optimizer" = type { ptr, ptr, i32, %"class.basisu::vec", i32, i32, i32, i32, %"class.basisu::vector", %"class.basisu::vector.3", %"class.basisu::vector.3", ptr, ptr, %"class.basisu::vector.5", %"class.basisu::vector.5", %"struct.basisu::etc1_optimizer::potential_solution", %"struct.basisu::etc1_optimizer::potential_solution", %"class.basisu::vector.5", [128 x i8] }
%"class.basisu::vec" = type { [3 x float] }
%"class.basisu::vector" = type { ptr, i32, i32 }
%"class.basisu::vector.3" = type { ptr, i32, i32 }
%"struct.basisu::etc1_optimizer::potential_solution" = type <{ %"struct.basisu::etc1_solution_coordinates", [4 x i8], %"class.basisu::vector.5", i64, i8, [7 x i8] }>
%"struct.basisu::etc1_solution_coordinates" = type <{ %"class.basisu::color_rgba", i32, i8, [3 x i8] }>
%"class.basisu::vector.5" = type { ptr, i32, i32 }
%"struct.basisu::etc1_optimizer::params" = type { %"struct.basisu::basis_etc1_pack_params", i32, ptr, i8, ptr, i32, %"class.basisu::color_rgba", i8, i8, ptr }
%"struct.basisu::basis_etc1_pack_params" = type { i32, i8, i8, i8, i8, float }
%struct.anon = type { i8, i8, i8, i8 }

@.str.3 = external hidden unnamed_addr constant [110 x i8], align 1
@_ZN6basisu19g_etc1_inten_tablesE = external dso_local constant [8 x [4 x i32]], align 16
@.str.11 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu14etc1_optimizer22evaluate_solution_fastERKNS_25etc1_solution_coordinatesERNS0_18potential_solutionEPS4_ = external hidden unnamed_addr constant [131 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #0 align 2

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #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) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext, ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZNK6basisu25etc1_solution_coordinates16get_scaled_colorEv(ptr noundef nonnull align 4 dereferenceable(9)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu14etc1_optimizer28check_for_redundant_solutionERKNS_25etc1_solution_coordinatesE(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef nonnull align 4 dereferenceable(9)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_S1_(i32 noundef, i32 noundef, i32 noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_S1_(i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(41) ptr @_ZN6basisu14etc1_optimizer18potential_solutionaSERKS1_(ptr noundef nonnull align 8 dereferenceable(41), ptr noundef nonnull align 8 dereferenceable(41)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6basisu14etc1_optimizer22evaluate_solution_fastERKNS_25etc1_solution_coordinatesERNS0_18potential_solutionEPS4_(ptr noundef nonnull align 8 dereferenceable(384) %0, ptr noundef nonnull align 4 dereferenceable(9) %1, ptr noundef nonnull align 8 dereferenceable(41) %2, ptr noundef %3) #5 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.basisu::color_rgba", align 1
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca [4 x i32], align 16
  %20 = alloca [4 x %"class.basisu::color_rgba"], align 16
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"class.basisu::color_rgba", align 1
  %24 = alloca [3 x i32], align 4
  %25 = alloca i64, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = call noundef zeroext i1 @_ZN6basisu14etc1_optimizer28check_for_redundant_solutionERKNS_25etc1_solution_coordinatesE(ptr noundef nonnull align 8 dereferenceable(384) %46, ptr noundef nonnull align 4 dereferenceable(9) %47)
  br i1 %48, label %50, label %49

49:                                               ; preds = %4
  store i1 false, ptr %5, align 1
  br label %743

50:                                               ; preds = %4
  %51 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %52, i32 0, i32 7
  %54 = load i8, ptr %53, align 8, !tbaa !21, !range !26, !noundef !27
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %117

56:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds %"class.basisu::color_rgba", ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds %struct.anon, ptr %59, i32 0, i32 0
  %61 = load i8, ptr %60, align 4, !tbaa !28
  %62 = zext i8 %61 to i32
  %63 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %64, i32 0, i32 6
  %66 = getelementptr inbounds %"class.basisu::color_rgba", ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds %struct.anon, ptr %66, i32 0, i32 0
  %68 = load i8, ptr %67, align 4, !tbaa !28
  %69 = zext i8 %68 to i32
  %70 = sub nsw i32 %62, %69
  store i32 %70, ptr %10, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds %"class.basisu::color_rgba", ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds %struct.anon, ptr %73, i32 0, i32 1
  %75 = load i8, ptr %74, align 1, !tbaa !28
  %76 = zext i8 %75 to i32
  %77 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %78, i32 0, i32 6
  %80 = getelementptr inbounds %"class.basisu::color_rgba", ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds %struct.anon, ptr %80, i32 0, i32 1
  %82 = load i8, ptr %81, align 1, !tbaa !28
  %83 = zext i8 %82 to i32
  %84 = sub nsw i32 %76, %83
  store i32 %84, ptr %11, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %85, i32 0, i32 0
  %87 = getelementptr inbounds %"class.basisu::color_rgba", ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %struct.anon, ptr %87, i32 0, i32 2
  %89 = load i8, ptr %88, align 2, !tbaa !28
  %90 = zext i8 %89 to i32
  %91 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %92, i32 0, i32 6
  %94 = getelementptr inbounds %"class.basisu::color_rgba", ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds %struct.anon, ptr %94, i32 0, i32 2
  %96 = load i8, ptr %95, align 2, !tbaa !28
  %97 = zext i8 %96 to i32
  %98 = sub nsw i32 %90, %97
  store i32 %98, ptr %12, align 4, !tbaa !29
  %99 = load i32, ptr %10, align 4, !tbaa !29
  %100 = load i32, ptr %11, align 4, !tbaa !29
  %101 = load i32, ptr %12, align 4, !tbaa !29
  %102 = call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_S1_(i32 noundef %99, i32 noundef %100, i32 noundef %101)
  %103 = icmp slt i32 %102, -4
  br i1 %103, label %110, label %104

104:                                              ; preds = %56
  %105 = load i32, ptr %10, align 4, !tbaa !29
  %106 = load i32, ptr %11, align 4, !tbaa !29
  %107 = load i32, ptr %12, align 4, !tbaa !29
  %108 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_S1_(i32 noundef %105, i32 noundef %106, i32 noundef %107)
  %109 = icmp sgt i32 %108, 3
  br i1 %109, label %110, label %113

110:                                              ; preds = %104, %56
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %111, i32 0, i32 4
  store i8 0, ptr %112, align 8, !tbaa !30
  store i1 false, ptr %5, align 1
  store i32 1, ptr %13, align 4
  br label %114

113:                                              ; preds = %104
  store i32 0, ptr %13, align 4
  br label %114

114:                                              ; preds = %113, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %115 = load i32, ptr %13, align 4
  switch i32 %115, label %745 [
    i32 0, label %116
    i32 1, label %743
  ]

116:                                              ; preds = %114
  br label %117

117:                                              ; preds = %116, %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = call i32 @_ZNK6basisu25etc1_solution_coordinates16get_scaled_colorEv(ptr noundef nonnull align 4 dereferenceable(9) %118)
  %120 = getelementptr inbounds %"class.basisu::color_rgba", ptr %14, i32 0, i32 0
  %121 = getelementptr inbounds %union.anon, ptr %120, i32 0, i32 0
  store i32 %119, ptr %121, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %122 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !31
  store i32 %125, ptr %15, align 4, !tbaa !29
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %126, i32 0, i32 2
  %128 = call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %127)
  %129 = load i32, ptr %15, align 4, !tbaa !29
  %130 = icmp eq i32 %128, %129
  br i1 %130, label %131, label %132

131:                                              ; preds = %117
  br label %134

132:                                              ; preds = %117
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.3, i32 noundef 1288, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu14etc1_optimizer22evaluate_solution_fastERKNS_25etc1_solution_coordinatesERNS0_18potential_solutionEPS4_) #8
  unreachable

133:                                              ; No predecessors!
  br label %134

134:                                              ; preds = %133, %131
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %135, i32 0, i32 3
  store i64 -1, ptr %136, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #7
  %137 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = getelementptr inbounds %"struct.basisu::basis_etc1_pack_params", ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 8, !tbaa !33
  %141 = icmp eq i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %134
  br label %149

143:                                              ; preds = %134
  %144 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !9
  %146 = getelementptr inbounds %"struct.basisu::basis_etc1_pack_params", ptr %145, i32 0, i32 1
  %147 = load i8, ptr %146, align 4, !tbaa !34, !range !26, !noundef !27
  %148 = trunc i8 %147 to i1
  br label %149

149:                                              ; preds = %143, %142
  %150 = phi i1 [ false, %142 ], [ %148, %143 ]
  %151 = zext i1 %150 to i8
  store i8 %151, ptr %16, align 1, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 7, ptr %17, align 4, !tbaa !29
  br label %152

152:                                              ; preds = %706, %149
  %153 = load i32, ptr %17, align 4, !tbaa !29
  %154 = icmp sge i32 %153, 0
  br i1 %154, label %156, label %155

155:                                              ; preds = %152
  store i32 2, ptr %13, align 4
  br label %709

156:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %157 = load i32, ptr %17, align 4, !tbaa !29
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [8 x [4 x i32]], ptr @_ZN6basisu19g_etc1_inten_tablesE, i64 0, i64 %158
  %160 = getelementptr inbounds [4 x i32], ptr %159, i64 0, i64 0
  store ptr %160, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %161 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i32 0, i32 0
  %162 = getelementptr inbounds %"class.basisu::color_rgba", ptr %161, i64 4
  br label %163

163:                                              ; preds = %163, %156
  %164 = phi ptr [ %161, %156 ], [ %165, %163 ]
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %164)
  %165 = getelementptr inbounds %"class.basisu::color_rgba", ptr %164, i64 1
  %166 = icmp eq ptr %165, %162
  br i1 %166, label %167, label %163

167:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !29
  br label %168

168:                                              ; preds = %216, %167
  %169 = load i32, ptr %21, align 4, !tbaa !29
  %170 = icmp ult i32 %169, 4
  br i1 %170, label %172, label %171

171:                                              ; preds = %168
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %219

172:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %173 = load ptr, ptr %18, align 8, !tbaa !5
  %174 = load i32, ptr %21, align 4, !tbaa !29
  %175 = zext i32 %174 to i64
  %176 = getelementptr inbounds i32, ptr %173, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !29
  store i32 %177, ptr %22, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %178 = getelementptr inbounds %"class.basisu::color_rgba", ptr %14, i32 0, i32 0
  %179 = getelementptr inbounds %struct.anon, ptr %178, i32 0, i32 0
  %180 = load i8, ptr %179, align 1, !tbaa !28
  %181 = zext i8 %180 to i32
  %182 = load i32, ptr %22, align 4, !tbaa !29
  %183 = add nsw i32 %181, %182
  %184 = getelementptr inbounds %"class.basisu::color_rgba", ptr %14, i32 0, i32 0
  %185 = getelementptr inbounds %struct.anon, ptr %184, i32 0, i32 1
  %186 = load i8, ptr %185, align 1, !tbaa !28
  %187 = zext i8 %186 to i32
  %188 = load i32, ptr %22, align 4, !tbaa !29
  %189 = add nsw i32 %187, %188
  %190 = getelementptr inbounds %"class.basisu::color_rgba", ptr %14, i32 0, i32 0
  %191 = getelementptr inbounds %struct.anon, ptr %190, i32 0, i32 2
  %192 = load i8, ptr %191, align 1, !tbaa !28
  %193 = zext i8 %192 to i32
  %194 = load i32, ptr %22, align 4, !tbaa !29
  %195 = add nsw i32 %193, %194
  call void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %23, i32 noundef %183, i32 noundef %189, i32 noundef %195, i32 noundef 255)
  %196 = load i32, ptr %21, align 4, !tbaa !29
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 %197
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %198, ptr align 1 %23, i64 4, i1 false), !tbaa.struct !36
  %199 = getelementptr inbounds %"class.basisu::color_rgba", ptr %23, i32 0, i32 0
  %200 = getelementptr inbounds %struct.anon, ptr %199, i32 0, i32 0
  %201 = load i8, ptr %200, align 1, !tbaa !28
  %202 = zext i8 %201 to i32
  %203 = getelementptr inbounds %"class.basisu::color_rgba", ptr %23, i32 0, i32 0
  %204 = getelementptr inbounds %struct.anon, ptr %203, i32 0, i32 1
  %205 = load i8, ptr %204, align 1, !tbaa !28
  %206 = zext i8 %205 to i32
  %207 = add nsw i32 %202, %206
  %208 = getelementptr inbounds %"class.basisu::color_rgba", ptr %23, i32 0, i32 0
  %209 = getelementptr inbounds %struct.anon, ptr %208, i32 0, i32 2
  %210 = load i8, ptr %209, align 1, !tbaa !28
  %211 = zext i8 %210 to i32
  %212 = add nsw i32 %207, %211
  %213 = load i32, ptr %21, align 4, !tbaa !29
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 %214
  store i32 %212, ptr %215, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %216

216:                                              ; preds = %172
  %217 = load i32, ptr %21, align 4, !tbaa !29
  %218 = add i32 %217, 1
  store i32 %218, ptr %21, align 4, !tbaa !29
  br label %168, !llvm.loop !37

219:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #7
  %220 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 0
  %221 = load i32, ptr %220, align 16, !tbaa !29
  %222 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 1
  %223 = load i32, ptr %222, align 4, !tbaa !29
  %224 = add i32 %221, %223
  store i32 %224, ptr %24, align 4, !tbaa !29
  %225 = getelementptr inbounds i32, ptr %24, i64 1
  %226 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 1
  %227 = load i32, ptr %226, align 4, !tbaa !29
  %228 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 2
  %229 = load i32, ptr %228, align 8, !tbaa !29
  %230 = add i32 %227, %229
  store i32 %230, ptr %225, align 4, !tbaa !29
  %231 = getelementptr inbounds i32, ptr %24, i64 2
  %232 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 2
  %233 = load i32, ptr %232, align 8, !tbaa !29
  %234 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 3
  %235 = load i32, ptr %234, align 4, !tbaa !29
  %236 = add i32 %233, %235
  store i32 %236, ptr %231, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  store i64 0, ptr %25, align 8, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %237 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !9
  %239 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %238, i32 0, i32 2
  %240 = load ptr, ptr %239, align 8, !tbaa !40
  store ptr %240, ptr %26, align 8, !tbaa !5
  %241 = load i8, ptr %16, align 1, !tbaa !35, !range !26, !noundef !27
  %242 = trunc i8 %241 to i1
  br i1 %242, label %243, label %461

243:                                              ; preds = %219
  %244 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %245 = load ptr, ptr %244, align 8, !tbaa !41
  %246 = load i32, ptr %15, align 4, !tbaa !29
  %247 = sub i32 %246, 1
  %248 = zext i32 %247 to i64
  %249 = getelementptr inbounds i32, ptr %245, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !29
  %251 = mul i32 %250, 2
  %252 = getelementptr inbounds [3 x i32], ptr %24, i64 0, i64 0
  %253 = load i32, ptr %252, align 4, !tbaa !29
  %254 = icmp ult i32 %251, %253
  br i1 %254, label %255, label %313

255:                                              ; preds = %243
  %256 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 0
  %257 = load i32, ptr %256, align 16, !tbaa !29
  %258 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %259 = load ptr, ptr %258, align 8, !tbaa !41
  %260 = load i32, ptr %15, align 4, !tbaa !29
  %261 = sub i32 %260, 1
  %262 = zext i32 %261 to i64
  %263 = getelementptr inbounds i32, ptr %259, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !29
  %265 = icmp ugt i32 %257, %264
  br i1 %265, label %266, label %289

266:                                              ; preds = %255
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %267 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 0
  %268 = load i32, ptr %267, align 16, !tbaa !29
  %269 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %270 = load ptr, ptr %269, align 8, !tbaa !41
  %271 = load i32, ptr %15, align 4, !tbaa !29
  %272 = sub i32 %271, 1
  %273 = zext i32 %272 to i64
  %274 = getelementptr inbounds i32, ptr %270, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !29
  %276 = sub nsw i32 %268, %275
  %277 = call noundef i32 @_ZN6basisu4iabsEi(i32 noundef %276)
  store i32 %277, ptr %27, align 4, !tbaa !29
  %278 = load i32, ptr %27, align 4, !tbaa !29
  %279 = zext i32 %278 to i64
  %280 = load ptr, ptr %8, align 8, !tbaa !5
  %281 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %280, i32 0, i32 3
  %282 = load i64, ptr %281, align 8, !tbaa !32
  %283 = icmp uge i64 %279, %282
  br i1 %283, label %284, label %285

284:                                              ; preds = %266
  store i32 4, ptr %13, align 4
  br label %286

285:                                              ; preds = %266
  store i32 0, ptr %13, align 4
  br label %286

286:                                              ; preds = %285, %284
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  %287 = load i32, ptr %13, align 4
  switch i32 %287, label %703 [
    i32 0, label %288
  ]

288:                                              ; preds = %286
  br label %289

289:                                              ; preds = %288, %255
  %290 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  %291 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %290, i64 noundef 0)
  %292 = load i32, ptr %15, align 4, !tbaa !29
  %293 = zext i32 %292 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %291, i8 0, i64 %293, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !29
  br label %294

294:                                              ; preds = %309, %289
  %295 = load i32, ptr %28, align 4, !tbaa !29
  %296 = load i32, ptr %15, align 4, !tbaa !29
  %297 = icmp ult i32 %295, %296
  br i1 %297, label %299, label %298

298:                                              ; preds = %294
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %312

299:                                              ; preds = %294
  %300 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 0
  %301 = load ptr, ptr %26, align 8, !tbaa !5
  %302 = load i32, ptr %28, align 4, !tbaa !29
  %303 = zext i32 %302 to i64
  %304 = getelementptr inbounds %"class.basisu::color_rgba", ptr %301, i64 %303
  %305 = call noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext true, ptr noundef nonnull align 1 dereferenceable(4) %300, ptr noundef nonnull align 1 dereferenceable(4) %304, i1 noundef zeroext false)
  %306 = zext i32 %305 to i64
  %307 = load i64, ptr %25, align 8, !tbaa !39
  %308 = add i64 %307, %306
  store i64 %308, ptr %25, align 8, !tbaa !39
  br label %309

309:                                              ; preds = %299
  %310 = load i32, ptr %28, align 4, !tbaa !29
  %311 = add i32 %310, 1
  store i32 %311, ptr %28, align 4, !tbaa !29
  br label %294, !llvm.loop !42

312:                                              ; preds = %298
  br label %460

313:                                              ; preds = %243
  %314 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %315 = load ptr, ptr %314, align 8, !tbaa !41
  %316 = getelementptr inbounds i32, ptr %315, i64 0
  %317 = load i32, ptr %316, align 4, !tbaa !29
  %318 = mul i32 %317, 2
  %319 = getelementptr inbounds [3 x i32], ptr %24, i64 0, i64 2
  %320 = load i32, ptr %319, align 4, !tbaa !29
  %321 = icmp uge i32 %318, %320
  br i1 %321, label %322, label %374

322:                                              ; preds = %313
  %323 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %324 = load ptr, ptr %323, align 8, !tbaa !41
  %325 = getelementptr inbounds i32, ptr %324, i64 0
  %326 = load i32, ptr %325, align 4, !tbaa !29
  %327 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 3
  %328 = load i32, ptr %327, align 4, !tbaa !29
  %329 = icmp ugt i32 %326, %328
  br i1 %329, label %330, label %350

330:                                              ; preds = %322
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %331 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %332 = load ptr, ptr %331, align 8, !tbaa !41
  %333 = getelementptr inbounds i32, ptr %332, i64 0
  %334 = load i32, ptr %333, align 4, !tbaa !29
  %335 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 3
  %336 = load i32, ptr %335, align 4, !tbaa !29
  %337 = sub nsw i32 %334, %336
  %338 = call noundef i32 @_ZN6basisu4iabsEi(i32 noundef %337)
  store i32 %338, ptr %29, align 4, !tbaa !29
  %339 = load i32, ptr %29, align 4, !tbaa !29
  %340 = zext i32 %339 to i64
  %341 = load ptr, ptr %8, align 8, !tbaa !5
  %342 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %341, i32 0, i32 3
  %343 = load i64, ptr %342, align 8, !tbaa !32
  %344 = icmp uge i64 %340, %343
  br i1 %344, label %345, label %346

345:                                              ; preds = %330
  store i32 4, ptr %13, align 4
  br label %347

346:                                              ; preds = %330
  store i32 0, ptr %13, align 4
  br label %347

347:                                              ; preds = %346, %345
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  %348 = load i32, ptr %13, align 4
  switch i32 %348, label %703 [
    i32 0, label %349
  ]

349:                                              ; preds = %347
  br label %350

350:                                              ; preds = %349, %322
  %351 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  %352 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %351, i64 noundef 0)
  %353 = load i32, ptr %15, align 4, !tbaa !29
  %354 = zext i32 %353 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %352, i8 3, i64 %354, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 0, ptr %30, align 4, !tbaa !29
  br label %355

355:                                              ; preds = %370, %350
  %356 = load i32, ptr %30, align 4, !tbaa !29
  %357 = load i32, ptr %15, align 4, !tbaa !29
  %358 = icmp ult i32 %356, %357
  br i1 %358, label %360, label %359

359:                                              ; preds = %355
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %373

360:                                              ; preds = %355
  %361 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 3
  %362 = load ptr, ptr %26, align 8, !tbaa !5
  %363 = load i32, ptr %30, align 4, !tbaa !29
  %364 = zext i32 %363 to i64
  %365 = getelementptr inbounds %"class.basisu::color_rgba", ptr %362, i64 %364
  %366 = call noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext true, ptr noundef nonnull align 1 dereferenceable(4) %361, ptr noundef nonnull align 1 dereferenceable(4) %365, i1 noundef zeroext false)
  %367 = zext i32 %366 to i64
  %368 = load i64, ptr %25, align 8, !tbaa !39
  %369 = add i64 %368, %367
  store i64 %369, ptr %25, align 8, !tbaa !39
  br label %370

370:                                              ; preds = %360
  %371 = load i32, ptr %30, align 4, !tbaa !29
  %372 = add i32 %371, 1
  store i32 %372, ptr %30, align 4, !tbaa !29
  br label %355, !llvm.loop !43

373:                                              ; preds = %359
  br label %459

374:                                              ; preds = %313
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 0, ptr %31, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  store i32 0, ptr %32, align 4, !tbaa !29
  br label %375

375:                                              ; preds = %427, %374
  %376 = load i32, ptr %32, align 4, !tbaa !29
  %377 = load i32, ptr %15, align 4, !tbaa !29
  %378 = icmp ult i32 %376, %377
  br i1 %378, label %379, label %430

379:                                              ; preds = %375
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %380 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %381 = load ptr, ptr %380, align 8, !tbaa !41
  %382 = load i32, ptr %32, align 4, !tbaa !29
  %383 = zext i32 %382 to i64
  %384 = getelementptr inbounds i32, ptr %381, i64 %383
  %385 = load i32, ptr %384, align 4, !tbaa !29
  store i32 %385, ptr %33, align 4, !tbaa !29
  br label %386

386:                                              ; preds = %399, %379
  %387 = load i32, ptr %33, align 4, !tbaa !29
  %388 = mul i32 %387, 2
  %389 = load i32, ptr %31, align 4, !tbaa !29
  %390 = zext i32 %389 to i64
  %391 = getelementptr inbounds [3 x i32], ptr %24, i64 0, i64 %390
  %392 = load i32, ptr %391, align 4, !tbaa !29
  %393 = icmp uge i32 %388, %392
  br i1 %393, label %394, label %400

394:                                              ; preds = %386
  %395 = load i32, ptr %31, align 4, !tbaa !29
  %396 = add i32 %395, 1
  store i32 %396, ptr %31, align 4, !tbaa !29
  %397 = icmp ugt i32 %396, 2
  br i1 %397, label %398, label %399

398:                                              ; preds = %394
  store i32 19, ptr %13, align 4
  br label %424

399:                                              ; preds = %394
  br label %386, !llvm.loop !44

400:                                              ; preds = %386
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %401 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 11
  %402 = load ptr, ptr %401, align 8, !tbaa !45
  %403 = load i32, ptr %32, align 4, !tbaa !29
  %404 = zext i32 %403 to i64
  %405 = getelementptr inbounds i32, ptr %402, i64 %404
  %406 = load i32, ptr %405, align 4, !tbaa !29
  store i32 %406, ptr %34, align 4, !tbaa !29
  %407 = load i32, ptr %31, align 4, !tbaa !29
  %408 = trunc i32 %407 to i8
  %409 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  %410 = load i32, ptr %34, align 4, !tbaa !29
  %411 = zext i32 %410 to i64
  %412 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %409, i64 noundef %411)
  store i8 %408, ptr %412, align 1, !tbaa !28
  %413 = load i32, ptr %31, align 4, !tbaa !29
  %414 = zext i32 %413 to i64
  %415 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 %414
  %416 = load ptr, ptr %26, align 8, !tbaa !5
  %417 = load i32, ptr %34, align 4, !tbaa !29
  %418 = zext i32 %417 to i64
  %419 = getelementptr inbounds %"class.basisu::color_rgba", ptr %416, i64 %418
  %420 = call noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext true, ptr noundef nonnull align 1 dereferenceable(4) %415, ptr noundef nonnull align 1 dereferenceable(4) %419, i1 noundef zeroext false)
  %421 = zext i32 %420 to i64
  %422 = load i64, ptr %25, align 8, !tbaa !39
  %423 = add i64 %422, %421
  store i64 %423, ptr %25, align 8, !tbaa !39
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  store i32 0, ptr %13, align 4
  br label %424

424:                                              ; preds = %400, %398
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  %425 = load i32, ptr %13, align 4
  switch i32 %425, label %745 [
    i32 0, label %426
    i32 19, label %431
  ]

426:                                              ; preds = %424
  br label %427

427:                                              ; preds = %426
  %428 = load i32, ptr %32, align 4, !tbaa !29
  %429 = add i32 %428, 1
  store i32 %429, ptr %32, align 4, !tbaa !29
  br label %375, !llvm.loop !46

430:                                              ; preds = %375
  br label %431

431:                                              ; preds = %430, %424
  br label %432

432:                                              ; preds = %436, %431
  %433 = load i32, ptr %32, align 4, !tbaa !29
  %434 = load i32, ptr %15, align 4, !tbaa !29
  %435 = icmp ult i32 %433, %434
  br i1 %435, label %436, label %458

436:                                              ; preds = %432
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  %437 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 11
  %438 = load ptr, ptr %437, align 8, !tbaa !45
  %439 = load i32, ptr %32, align 4, !tbaa !29
  %440 = zext i32 %439 to i64
  %441 = getelementptr inbounds i32, ptr %438, i64 %440
  %442 = load i32, ptr %441, align 4, !tbaa !29
  store i32 %442, ptr %35, align 4, !tbaa !29
  %443 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  %444 = load i32, ptr %35, align 4, !tbaa !29
  %445 = zext i32 %444 to i64
  %446 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %443, i64 noundef %445)
  store i8 3, ptr %446, align 1, !tbaa !28
  %447 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 3
  %448 = load ptr, ptr %26, align 8, !tbaa !5
  %449 = load i32, ptr %35, align 4, !tbaa !29
  %450 = zext i32 %449 to i64
  %451 = getelementptr inbounds %"class.basisu::color_rgba", ptr %448, i64 %450
  %452 = call noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext true, ptr noundef nonnull align 1 dereferenceable(4) %447, ptr noundef nonnull align 1 dereferenceable(4) %451, i1 noundef zeroext false)
  %453 = zext i32 %452 to i64
  %454 = load i64, ptr %25, align 8, !tbaa !39
  %455 = add i64 %454, %453
  store i64 %455, ptr %25, align 8, !tbaa !39
  %456 = load i32, ptr %32, align 4, !tbaa !29
  %457 = add i32 %456, 1
  store i32 %457, ptr %32, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  br label %432, !llvm.loop !47

458:                                              ; preds = %432
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %459

459:                                              ; preds = %458, %373
  br label %460

460:                                              ; preds = %459, %312
  br label %679

461:                                              ; preds = %219
  %462 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %463 = load ptr, ptr %462, align 8, !tbaa !41
  %464 = load i32, ptr %15, align 4, !tbaa !29
  %465 = sub i32 %464, 1
  %466 = zext i32 %465 to i64
  %467 = getelementptr inbounds i32, ptr %463, i64 %466
  %468 = load i32, ptr %467, align 4, !tbaa !29
  %469 = mul i32 %468, 2
  %470 = getelementptr inbounds [3 x i32], ptr %24, i64 0, i64 0
  %471 = load i32, ptr %470, align 4, !tbaa !29
  %472 = icmp ult i32 %469, %471
  br i1 %472, label %473, label %531

473:                                              ; preds = %461
  %474 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 0
  %475 = load i32, ptr %474, align 16, !tbaa !29
  %476 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %477 = load ptr, ptr %476, align 8, !tbaa !41
  %478 = load i32, ptr %15, align 4, !tbaa !29
  %479 = sub i32 %478, 1
  %480 = zext i32 %479 to i64
  %481 = getelementptr inbounds i32, ptr %477, i64 %480
  %482 = load i32, ptr %481, align 4, !tbaa !29
  %483 = icmp ugt i32 %475, %482
  br i1 %483, label %484, label %507

484:                                              ; preds = %473
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %485 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 0
  %486 = load i32, ptr %485, align 16, !tbaa !29
  %487 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %488 = load ptr, ptr %487, align 8, !tbaa !41
  %489 = load i32, ptr %15, align 4, !tbaa !29
  %490 = sub i32 %489, 1
  %491 = zext i32 %490 to i64
  %492 = getelementptr inbounds i32, ptr %488, i64 %491
  %493 = load i32, ptr %492, align 4, !tbaa !29
  %494 = sub nsw i32 %486, %493
  %495 = call noundef i32 @_ZN6basisu4iabsEi(i32 noundef %494)
  store i32 %495, ptr %36, align 4, !tbaa !29
  %496 = load i32, ptr %36, align 4, !tbaa !29
  %497 = zext i32 %496 to i64
  %498 = load ptr, ptr %8, align 8, !tbaa !5
  %499 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %498, i32 0, i32 3
  %500 = load i64, ptr %499, align 8, !tbaa !32
  %501 = icmp uge i64 %497, %500
  br i1 %501, label %502, label %503

502:                                              ; preds = %484
  store i32 4, ptr %13, align 4
  br label %504

503:                                              ; preds = %484
  store i32 0, ptr %13, align 4
  br label %504

504:                                              ; preds = %503, %502
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  %505 = load i32, ptr %13, align 4
  switch i32 %505, label %703 [
    i32 0, label %506
  ]

506:                                              ; preds = %504
  br label %507

507:                                              ; preds = %506, %473
  %508 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  %509 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %508, i64 noundef 0)
  %510 = load i32, ptr %15, align 4, !tbaa !29
  %511 = zext i32 %510 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %509, i8 0, i64 %511, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  store i32 0, ptr %37, align 4, !tbaa !29
  br label %512

512:                                              ; preds = %527, %507
  %513 = load i32, ptr %37, align 4, !tbaa !29
  %514 = load i32, ptr %15, align 4, !tbaa !29
  %515 = icmp ult i32 %513, %514
  br i1 %515, label %517, label %516

516:                                              ; preds = %512
  store i32 22, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  br label %530

517:                                              ; preds = %512
  %518 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 0
  %519 = load ptr, ptr %26, align 8, !tbaa !5
  %520 = load i32, ptr %37, align 4, !tbaa !29
  %521 = zext i32 %520 to i64
  %522 = getelementptr inbounds %"class.basisu::color_rgba", ptr %519, i64 %521
  %523 = call noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4) %518, ptr noundef nonnull align 1 dereferenceable(4) %522, i1 noundef zeroext false)
  %524 = sext i32 %523 to i64
  %525 = load i64, ptr %25, align 8, !tbaa !39
  %526 = add i64 %525, %524
  store i64 %526, ptr %25, align 8, !tbaa !39
  br label %527

527:                                              ; preds = %517
  %528 = load i32, ptr %37, align 4, !tbaa !29
  %529 = add i32 %528, 1
  store i32 %529, ptr %37, align 4, !tbaa !29
  br label %512, !llvm.loop !48

530:                                              ; preds = %516
  br label %678

531:                                              ; preds = %461
  %532 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %533 = load ptr, ptr %532, align 8, !tbaa !41
  %534 = getelementptr inbounds i32, ptr %533, i64 0
  %535 = load i32, ptr %534, align 4, !tbaa !29
  %536 = mul i32 %535, 2
  %537 = getelementptr inbounds [3 x i32], ptr %24, i64 0, i64 2
  %538 = load i32, ptr %537, align 4, !tbaa !29
  %539 = icmp uge i32 %536, %538
  br i1 %539, label %540, label %592

540:                                              ; preds = %531
  %541 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %542 = load ptr, ptr %541, align 8, !tbaa !41
  %543 = getelementptr inbounds i32, ptr %542, i64 0
  %544 = load i32, ptr %543, align 4, !tbaa !29
  %545 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 3
  %546 = load i32, ptr %545, align 4, !tbaa !29
  %547 = icmp ugt i32 %544, %546
  br i1 %547, label %548, label %568

548:                                              ; preds = %540
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  %549 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %550 = load ptr, ptr %549, align 8, !tbaa !41
  %551 = getelementptr inbounds i32, ptr %550, i64 0
  %552 = load i32, ptr %551, align 4, !tbaa !29
  %553 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 3
  %554 = load i32, ptr %553, align 4, !tbaa !29
  %555 = sub nsw i32 %552, %554
  %556 = call noundef i32 @_ZN6basisu4iabsEi(i32 noundef %555)
  store i32 %556, ptr %38, align 4, !tbaa !29
  %557 = load i32, ptr %38, align 4, !tbaa !29
  %558 = zext i32 %557 to i64
  %559 = load ptr, ptr %8, align 8, !tbaa !5
  %560 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %559, i32 0, i32 3
  %561 = load i64, ptr %560, align 8, !tbaa !32
  %562 = icmp uge i64 %558, %561
  br i1 %562, label %563, label %564

563:                                              ; preds = %548
  store i32 4, ptr %13, align 4
  br label %565

564:                                              ; preds = %548
  store i32 0, ptr %13, align 4
  br label %565

565:                                              ; preds = %564, %563
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  %566 = load i32, ptr %13, align 4
  switch i32 %566, label %703 [
    i32 0, label %567
  ]

567:                                              ; preds = %565
  br label %568

568:                                              ; preds = %567, %540
  %569 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  %570 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %569, i64 noundef 0)
  %571 = load i32, ptr %15, align 4, !tbaa !29
  %572 = zext i32 %571 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %570, i8 3, i64 %572, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  store i32 0, ptr %39, align 4, !tbaa !29
  br label %573

573:                                              ; preds = %588, %568
  %574 = load i32, ptr %39, align 4, !tbaa !29
  %575 = load i32, ptr %15, align 4, !tbaa !29
  %576 = icmp ult i32 %574, %575
  br i1 %576, label %578, label %577

577:                                              ; preds = %573
  store i32 25, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  br label %591

578:                                              ; preds = %573
  %579 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 3
  %580 = load ptr, ptr %26, align 8, !tbaa !5
  %581 = load i32, ptr %39, align 4, !tbaa !29
  %582 = zext i32 %581 to i64
  %583 = getelementptr inbounds %"class.basisu::color_rgba", ptr %580, i64 %582
  %584 = call noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4) %579, ptr noundef nonnull align 1 dereferenceable(4) %583, i1 noundef zeroext false)
  %585 = sext i32 %584 to i64
  %586 = load i64, ptr %25, align 8, !tbaa !39
  %587 = add i64 %586, %585
  store i64 %587, ptr %25, align 8, !tbaa !39
  br label %588

588:                                              ; preds = %578
  %589 = load i32, ptr %39, align 4, !tbaa !29
  %590 = add i32 %589, 1
  store i32 %590, ptr %39, align 4, !tbaa !29
  br label %573, !llvm.loop !49

591:                                              ; preds = %577
  br label %677

592:                                              ; preds = %531
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  store i32 0, ptr %40, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #7
  store i32 0, ptr %41, align 4, !tbaa !29
  br label %593

593:                                              ; preds = %645, %592
  %594 = load i32, ptr %41, align 4, !tbaa !29
  %595 = load i32, ptr %15, align 4, !tbaa !29
  %596 = icmp ult i32 %594, %595
  br i1 %596, label %597, label %648

597:                                              ; preds = %593
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #7
  %598 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 12
  %599 = load ptr, ptr %598, align 8, !tbaa !41
  %600 = load i32, ptr %41, align 4, !tbaa !29
  %601 = zext i32 %600 to i64
  %602 = getelementptr inbounds i32, ptr %599, i64 %601
  %603 = load i32, ptr %602, align 4, !tbaa !29
  store i32 %603, ptr %42, align 4, !tbaa !29
  br label %604

604:                                              ; preds = %617, %597
  %605 = load i32, ptr %42, align 4, !tbaa !29
  %606 = mul i32 %605, 2
  %607 = load i32, ptr %40, align 4, !tbaa !29
  %608 = zext i32 %607 to i64
  %609 = getelementptr inbounds [3 x i32], ptr %24, i64 0, i64 %608
  %610 = load i32, ptr %609, align 4, !tbaa !29
  %611 = icmp uge i32 %606, %610
  br i1 %611, label %612, label %618

612:                                              ; preds = %604
  %613 = load i32, ptr %40, align 4, !tbaa !29
  %614 = add i32 %613, 1
  store i32 %614, ptr %40, align 4, !tbaa !29
  %615 = icmp ugt i32 %614, 2
  br i1 %615, label %616, label %617

616:                                              ; preds = %612
  store i32 33, ptr %13, align 4
  br label %642

617:                                              ; preds = %612
  br label %604, !llvm.loop !50

618:                                              ; preds = %604
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #7
  %619 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 11
  %620 = load ptr, ptr %619, align 8, !tbaa !45
  %621 = load i32, ptr %41, align 4, !tbaa !29
  %622 = zext i32 %621 to i64
  %623 = getelementptr inbounds i32, ptr %620, i64 %622
  %624 = load i32, ptr %623, align 4, !tbaa !29
  store i32 %624, ptr %43, align 4, !tbaa !29
  %625 = load i32, ptr %40, align 4, !tbaa !29
  %626 = trunc i32 %625 to i8
  %627 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  %628 = load i32, ptr %43, align 4, !tbaa !29
  %629 = zext i32 %628 to i64
  %630 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %627, i64 noundef %629)
  store i8 %626, ptr %630, align 1, !tbaa !28
  %631 = load i32, ptr %40, align 4, !tbaa !29
  %632 = zext i32 %631 to i64
  %633 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 %632
  %634 = load ptr, ptr %26, align 8, !tbaa !5
  %635 = load i32, ptr %43, align 4, !tbaa !29
  %636 = zext i32 %635 to i64
  %637 = getelementptr inbounds %"class.basisu::color_rgba", ptr %634, i64 %636
  %638 = call noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4) %633, ptr noundef nonnull align 1 dereferenceable(4) %637, i1 noundef zeroext false)
  %639 = sext i32 %638 to i64
  %640 = load i64, ptr %25, align 8, !tbaa !39
  %641 = add i64 %640, %639
  store i64 %641, ptr %25, align 8, !tbaa !39
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #7
  store i32 0, ptr %13, align 4
  br label %642

642:                                              ; preds = %618, %616
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #7
  %643 = load i32, ptr %13, align 4
  switch i32 %643, label %745 [
    i32 0, label %644
    i32 33, label %649
  ]

644:                                              ; preds = %642
  br label %645

645:                                              ; preds = %644
  %646 = load i32, ptr %41, align 4, !tbaa !29
  %647 = add i32 %646, 1
  store i32 %647, ptr %41, align 4, !tbaa !29
  br label %593, !llvm.loop !51

648:                                              ; preds = %593
  br label %649

649:                                              ; preds = %648, %642
  br label %650

650:                                              ; preds = %654, %649
  %651 = load i32, ptr %41, align 4, !tbaa !29
  %652 = load i32, ptr %15, align 4, !tbaa !29
  %653 = icmp ult i32 %651, %652
  br i1 %653, label %654, label %676

654:                                              ; preds = %650
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #7
  %655 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 11
  %656 = load ptr, ptr %655, align 8, !tbaa !45
  %657 = load i32, ptr %41, align 4, !tbaa !29
  %658 = zext i32 %657 to i64
  %659 = getelementptr inbounds i32, ptr %656, i64 %658
  %660 = load i32, ptr %659, align 4, !tbaa !29
  store i32 %660, ptr %44, align 4, !tbaa !29
  %661 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  %662 = load i32, ptr %44, align 4, !tbaa !29
  %663 = zext i32 %662 to i64
  %664 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %661, i64 noundef %663)
  store i8 3, ptr %664, align 1, !tbaa !28
  %665 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %20, i64 0, i64 3
  %666 = load ptr, ptr %26, align 8, !tbaa !5
  %667 = load i32, ptr %44, align 4, !tbaa !29
  %668 = zext i32 %667 to i64
  %669 = getelementptr inbounds %"class.basisu::color_rgba", ptr %666, i64 %668
  %670 = call noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4) %665, ptr noundef nonnull align 1 dereferenceable(4) %669, i1 noundef zeroext false)
  %671 = sext i32 %670 to i64
  %672 = load i64, ptr %25, align 8, !tbaa !39
  %673 = add i64 %672, %671
  store i64 %673, ptr %25, align 8, !tbaa !39
  %674 = load i32, ptr %41, align 4, !tbaa !29
  %675 = add i32 %674, 1
  store i32 %675, ptr %41, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #7
  br label %650, !llvm.loop !52

676:                                              ; preds = %650
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  br label %677

677:                                              ; preds = %676, %591
  br label %678

678:                                              ; preds = %677, %530
  br label %679

679:                                              ; preds = %678, %460
  %680 = load i64, ptr %25, align 8, !tbaa !39
  %681 = load ptr, ptr %8, align 8, !tbaa !5
  %682 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %681, i32 0, i32 3
  %683 = load i64, ptr %682, align 8, !tbaa !32
  %684 = icmp ult i64 %680, %683
  br i1 %684, label %685, label %702

685:                                              ; preds = %679
  %686 = load i64, ptr %25, align 8, !tbaa !39
  %687 = load ptr, ptr %8, align 8, !tbaa !5
  %688 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %687, i32 0, i32 3
  store i64 %686, ptr %688, align 8, !tbaa !32
  %689 = load i32, ptr %17, align 4, !tbaa !29
  %690 = load ptr, ptr %8, align 8, !tbaa !5
  %691 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %690, i32 0, i32 0
  %692 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %691, i32 0, i32 1
  store i32 %689, ptr %692, align 4, !tbaa !53
  %693 = load ptr, ptr %8, align 8, !tbaa !5
  %694 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %693, i32 0, i32 2
  %695 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 17
  call void @_ZN6basisu6vectorIhE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(16) %694, ptr noundef nonnull align 8 dereferenceable(16) %695)
  %696 = load ptr, ptr %8, align 8, !tbaa !5
  %697 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %696, i32 0, i32 4
  store i8 1, ptr %697, align 8, !tbaa !30
  %698 = load i64, ptr %25, align 8, !tbaa !39
  %699 = icmp ne i64 %698, 0
  br i1 %699, label %701, label %700

700:                                              ; preds = %685
  store i32 2, ptr %13, align 4
  br label %703

701:                                              ; preds = %685
  br label %702

702:                                              ; preds = %701, %679
  store i32 0, ptr %13, align 4
  br label %703

703:                                              ; preds = %702, %700, %565, %504, %347, %286
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %704 = load i32, ptr %13, align 4
  switch i32 %704, label %709 [
    i32 0, label %705
    i32 4, label %706
  ]

705:                                              ; preds = %703
  br label %706

706:                                              ; preds = %705, %703
  %707 = load i32, ptr %17, align 4, !tbaa !29
  %708 = add nsw i32 %707, -1
  store i32 %708, ptr %17, align 4, !tbaa !29
  br label %152, !llvm.loop !54

709:                                              ; preds = %703, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %710

710:                                              ; preds = %709
  %711 = load ptr, ptr %7, align 8, !tbaa !5
  %712 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %711, i32 0, i32 0
  %713 = load ptr, ptr %8, align 8, !tbaa !5
  %714 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %713, i32 0, i32 0
  %715 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %714, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %715, ptr align 4 %712, i64 4, i1 false), !tbaa.struct !36
  %716 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %46, i32 0, i32 0
  %717 = load ptr, ptr %716, align 8, !tbaa !9
  %718 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %717, i32 0, i32 3
  %719 = load i8, ptr %718, align 8, !tbaa !55, !range !26, !noundef !27
  %720 = trunc i8 %719 to i1
  %721 = load ptr, ptr %8, align 8, !tbaa !5
  %722 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %721, i32 0, i32 0
  %723 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %722, i32 0, i32 2
  %724 = zext i1 %720 to i8
  store i8 %724, ptr %723, align 8, !tbaa !56
  call void @llvm.lifetime.start.p0(i64 1, ptr %45) #7
  store i8 0, ptr %45, align 1, !tbaa !35
  %725 = load ptr, ptr %9, align 8, !tbaa !5
  %726 = icmp ne ptr %725, null
  br i1 %726, label %727, label %740

727:                                              ; preds = %710
  %728 = load ptr, ptr %8, align 8, !tbaa !5
  %729 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %728, i32 0, i32 3
  %730 = load i64, ptr %729, align 8, !tbaa !32
  %731 = load ptr, ptr %9, align 8, !tbaa !5
  %732 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %731, i32 0, i32 3
  %733 = load i64, ptr %732, align 8, !tbaa !32
  %734 = icmp ult i64 %730, %733
  br i1 %734, label %735, label %739

735:                                              ; preds = %727
  %736 = load ptr, ptr %8, align 8, !tbaa !5
  %737 = load ptr, ptr %9, align 8, !tbaa !5
  %738 = call noundef nonnull align 8 dereferenceable(41) ptr @_ZN6basisu14etc1_optimizer18potential_solutionaSERKS1_(ptr noundef nonnull align 8 dereferenceable(41) %737, ptr noundef nonnull align 8 dereferenceable(41) %736)
  store i8 1, ptr %45, align 1, !tbaa !35
  br label %739

739:                                              ; preds = %735, %727
  br label %740

740:                                              ; preds = %739, %710
  %741 = load i8, ptr %45, align 1, !tbaa !35, !range !26, !noundef !27
  %742 = trunc i8 %741 to i1
  store i1 %742, ptr %5, align 1
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %743

743:                                              ; preds = %740, %114, %49
  %744 = load i1, ptr %5, align 1
  ret i1 %744

745:                                              ; preds = %642, %424, %114
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu4iabsEi(i32 noundef) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext) #0

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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: write) }
attributes #7 = { nounwind }
attributes #8 = { 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, !6, i64 0}
!10 = !{!"_ZTSN6basisu14etc1_optimizerE", !6, i64 0, !6, i64 8, !11, i64 16, !12, i64 20, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !13, i64 48, !14, i64 64, !14, i64 80, !6, i64 96, !6, i64 104, !15, i64 112, !15, i64 128, !16, i64 144, !16, i64 192, !15, i64 240, !7, i64 256}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN6basisu3vecILj3EfEE", !7, i64 0}
!13 = !{!"_ZTSN6basisu6vectorItEE", !6, i64 0, !11, i64 8, !11, i64 12}
!14 = !{!"_ZTSN6basisu6vectorIjEE", !6, i64 0, !11, i64 8, !11, i64 12}
!15 = !{!"_ZTSN6basisu6vectorIhEE", !6, i64 0, !11, i64 8, !11, i64 12}
!16 = !{!"_ZTSN6basisu14etc1_optimizer18potential_solutionE", !17, i64 0, !15, i64 16, !20, i64 32, !19, i64 40}
!17 = !{!"_ZTSN6basisu25etc1_solution_coordinatesE", !18, i64 0, !11, i64 4, !19, i64 8}
!18 = !{!"_ZTSN6basisu10color_rgbaE", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!22, !19, i64 48}
!22 = !{!"_ZTSN6basisu14etc1_optimizer6paramsE", !23, i64 0, !11, i64 12, !6, i64 16, !19, i64 24, !6, i64 32, !11, i64 40, !18, i64 44, !19, i64 48, !19, i64 49, !6, i64 56}
!23 = !{!"_ZTSN6basisu22basis_etc1_pack_paramsE", !24, i64 0, !19, i64 4, !19, i64 5, !19, i64 6, !19, i64 7, !25, i64 8}
!24 = !{!"_ZTSN6basisu17basis_etc_qualityE", !7, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!7, !7, i64 0}
!29 = !{!11, !11, i64 0}
!30 = !{!16, !19, i64 40}
!31 = !{!22, !11, i64 12}
!32 = !{!16, !20, i64 32}
!33 = !{!23, !24, i64 0}
!34 = !{!23, !19, i64 4}
!35 = !{!19, !19, i64 0}
!36 = !{i64 0, i64 4, !28}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!20, !20, i64 0}
!40 = !{!22, !6, i64 16}
!41 = !{!10, !6, i64 104}
!42 = distinct !{!42, !38}
!43 = distinct !{!43, !38}
!44 = distinct !{!44, !38}
!45 = !{!10, !6, i64 96}
!46 = distinct !{!46, !38}
!47 = distinct !{!47, !38}
!48 = distinct !{!48, !38}
!49 = distinct !{!49, !38}
!50 = distinct !{!50, !38}
!51 = distinct !{!51, !38}
!52 = distinct !{!52, !38}
!53 = !{!16, !11, i64 4}
!54 = distinct !{!54, !38}
!55 = !{!22, !19, i64 24}
!56 = !{!16, !19, i64 8}


; 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.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }

@.str.3 = external hidden unnamed_addr constant [110 x i8], align 1
@_ZN6basisu19g_etc1_inten_tablesE = external dso_local local_unnamed_addr constant [8 x [4 x i32]], align 16
@.str.11 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu14etc1_optimizer22evaluate_solution_fastERKNS_25etc1_solution_coordinatesERNS0_18potential_solutionEPS4_ = external hidden unnamed_addr constant [131 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext, ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZNK6basisu25etc1_solution_coordinates16get_scaled_colorEv(ptr noundef nonnull align 4 dereferenceable(9)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu14etc1_optimizer28check_for_redundant_solutionERKNS_25etc1_solution_coordinatesE(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef nonnull align 4 dereferenceable(9)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_S1_(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_S1_(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu6vectorIhE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(41) ptr @_ZN6basisu14etc1_optimizer18potential_solutionaSERKS1_(ptr noundef nonnull align 8 dereferenceable(41), ptr noundef nonnull align 8 dereferenceable(41)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6basisu14etc1_optimizer22evaluate_solution_fastERKNS_25etc1_solution_coordinatesERNS0_18potential_solutionEPS4_(ptr noundef nonnull align 8 dereferenceable(384) %0, ptr noundef nonnull align 4 dereferenceable(9) %1, ptr noundef nonnull align 8 dereferenceable(41) %2, ptr noundef %3) local_unnamed_addr #4 align 2 {
  %5 = alloca [4 x %"class.basisu::color_rgba"], align 16
  %6 = alloca %"class.basisu::color_rgba", align 4
  %7 = alloca [3 x i32], align 4
  %8 = tail call noundef zeroext i1 @_ZN6basisu14etc1_optimizer28check_for_redundant_solutionERKNS_25etc1_solution_coordinatesE(ptr noundef nonnull align 8 dereferenceable(384) %0, ptr noundef nonnull align 4 dereferenceable(9) %1)
  br i1 %8, label %9, label %320

9:                                                ; preds = %4
  %10 = load ptr, ptr %0, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 48
  %12 = load i8, ptr %11, align 8, !tbaa !20, !range !25, !noundef !26
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %14, label %.thread

14:                                               ; preds = %9
  %15 = load i8, ptr %1, align 4, !tbaa !27
  %16 = zext i8 %15 to i32
  %17 = getelementptr inbounds i8, ptr %10, i64 44
  %18 = load i8, ptr %17, align 4, !tbaa !27
  %19 = zext i8 %18 to i32
  %20 = sub nsw i32 %16, %19
  %21 = getelementptr inbounds i8, ptr %1, i64 1
  %22 = load i8, ptr %21, align 1, !tbaa !27
  %23 = zext i8 %22 to i32
  %24 = getelementptr inbounds i8, ptr %10, i64 45
  %25 = load i8, ptr %24, align 1, !tbaa !27
  %26 = zext i8 %25 to i32
  %27 = sub nsw i32 %23, %26
  %28 = getelementptr inbounds i8, ptr %1, i64 2
  %29 = load i8, ptr %28, align 2, !tbaa !27
  %30 = zext i8 %29 to i32
  %31 = getelementptr inbounds i8, ptr %10, i64 46
  %32 = load i8, ptr %31, align 2, !tbaa !27
  %33 = zext i8 %32 to i32
  %34 = sub nsw i32 %30, %33
  %35 = tail call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_S1_(i32 noundef %20, i32 noundef %27, i32 noundef %34)
  %36 = icmp slt i32 %35, -4
  br i1 %36, label %40, label %37

37:                                               ; preds = %14
  %38 = tail call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_S1_(i32 noundef %20, i32 noundef %27, i32 noundef %34)
  %39 = icmp sgt i32 %38, 3
  br i1 %39, label %40, label %.thread

40:                                               ; preds = %14, %37
  %41 = getelementptr inbounds i8, ptr %2, i64 40
  store i8 0, ptr %41, align 8, !tbaa !28
  br label %320

.thread:                                          ; preds = %37, %9
  %42 = tail call i32 @_ZNK6basisu25etc1_solution_coordinates16get_scaled_colorEv(ptr noundef nonnull align 4 dereferenceable(9) %1)
  %.sroa.4.0.extract.shift = lshr i32 %42, 8
  %.sroa.5.0.extract.shift = lshr i32 %42, 16
  %43 = load ptr, ptr %0, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 12
  %45 = load i32, ptr %44, align 4, !tbaa !29
  %46 = getelementptr inbounds i8, ptr %2, i64 16
  %47 = tail call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %46)
  %48 = icmp eq i32 %47, %45
  br i1 %48, label %50, label %49

49:                                               ; preds = %.thread
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.3, i32 noundef 1288, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu14etc1_optimizer22evaluate_solution_fastERKNS_25etc1_solution_coordinatesERNS0_18potential_solutionEPS4_) #6
  unreachable

50:                                               ; preds = %.thread
  %51 = getelementptr inbounds i8, ptr %2, i64 32
  store i64 -1, ptr %51, align 8, !tbaa !30
  %52 = load ptr, ptr %0, align 8, !tbaa !5
  %53 = load i32, ptr %52, align 8, !tbaa !31
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %59, label %55

55:                                               ; preds = %50
  %56 = getelementptr inbounds i8, ptr %52, i64 4
  %57 = load i8, ptr %56, align 4, !tbaa !32, !range !25, !noundef !26
  %58 = trunc nuw i8 %57 to i1
  br label %59

59:                                               ; preds = %50, %55
  %60 = phi i1 [ %58, %55 ], [ false, %50 ]
  %61 = and i32 %42, 255
  %62 = and i32 %.sroa.4.0.extract.shift, 255
  %63 = and i32 %.sroa.5.0.extract.shift, 255
  %64 = getelementptr inbounds i8, ptr %7, i64 4
  %65 = getelementptr inbounds i8, ptr %7, i64 8
  %66 = getelementptr inbounds i8, ptr %0, i64 104
  %67 = add i32 %45, -1
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds i8, ptr %0, i64 240
  %70 = zext i32 %45 to i64
  %.not284 = icmp eq i32 %45, 0
  %71 = getelementptr inbounds i8, ptr %5, i64 12
  %72 = getelementptr inbounds i8, ptr %0, i64 96
  %73 = getelementptr inbounds i8, ptr %2, i64 4
  %74 = getelementptr inbounds i8, ptr %2, i64 40
  %.ptr.1 = getelementptr inbounds i8, ptr %5, i64 4
  %.ptr.2 = getelementptr inbounds i8, ptr %5, i64 8
  br label %.preheader232.preheader

.preheader232.preheader:                          ; preds = %59, %307
  %indvars.iv352 = phi i64 [ 7, %59 ], [ %indvars.iv.next353, %307 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %5)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.1)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.2)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %71)
  %75 = getelementptr inbounds [8 x [4 x i32]], ptr @_ZN6basisu19g_etc1_inten_tablesE, i64 0, i64 %indvars.iv352
  %76 = load i32, ptr %75, align 16, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %77 = add nsw i32 %76, %61
  %78 = add nsw i32 %76, %62
  %79 = add nsw i32 %76, %63
  call void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %6, i32 noundef %77, i32 noundef %78, i32 noundef %79, i32 noundef 255)
  %80 = load i32, ptr %6, align 4
  store i32 %80, ptr %5, align 16, !tbaa !27
  %81 = and i32 %80, 255
  %82 = lshr i32 %80, 8
  %83 = and i32 %82, 255
  %84 = add nuw nsw i32 %83, %81
  %85 = lshr i32 %80, 16
  %86 = and i32 %85, 255
  %87 = add nuw nsw i32 %84, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %88 = getelementptr inbounds i8, ptr %75, i64 4
  %89 = load i32, ptr %88, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %90 = add nsw i32 %89, %61
  %91 = add nsw i32 %89, %62
  %92 = add nsw i32 %89, %63
  call void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %6, i32 noundef %90, i32 noundef %91, i32 noundef %92, i32 noundef 255)
  %93 = load i32, ptr %6, align 4
  store i32 %93, ptr %.ptr.1, align 4, !tbaa !27
  %94 = and i32 %93, 255
  %95 = lshr i32 %93, 8
  %96 = and i32 %95, 255
  %97 = add nuw nsw i32 %96, %94
  %98 = lshr i32 %93, 16
  %99 = and i32 %98, 255
  %100 = add nuw nsw i32 %97, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %101 = getelementptr inbounds i8, ptr %75, i64 8
  %102 = load i32, ptr %101, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %103 = add nsw i32 %102, %61
  %104 = add nsw i32 %102, %62
  %105 = add nsw i32 %102, %63
  call void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %6, i32 noundef %103, i32 noundef %104, i32 noundef %105, i32 noundef 255)
  %106 = load i32, ptr %6, align 4
  store i32 %106, ptr %.ptr.2, align 8, !tbaa !27
  %107 = and i32 %106, 255
  %108 = lshr i32 %106, 8
  %109 = and i32 %108, 255
  %110 = add nuw nsw i32 %109, %107
  %111 = lshr i32 %106, 16
  %112 = and i32 %111, 255
  %113 = add nuw nsw i32 %110, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %114 = getelementptr inbounds i8, ptr %75, i64 12
  %115 = load i32, ptr %114, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %116 = add nsw i32 %115, %61
  %117 = add nsw i32 %115, %62
  %118 = add nsw i32 %115, %63
  call void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %6, i32 noundef %116, i32 noundef %117, i32 noundef %118, i32 noundef 255)
  %119 = load i32, ptr %6, align 4
  store i32 %119, ptr %71, align 4, !tbaa !27
  %120 = and i32 %119, 255
  %121 = lshr i32 %119, 8
  %122 = and i32 %121, 255
  %123 = add nuw nsw i32 %122, %120
  %124 = lshr i32 %119, 16
  %125 = and i32 %124, 255
  %126 = add nuw nsw i32 %123, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  %127 = add nuw nsw i32 %100, %87
  store i32 %127, ptr %7, align 4, !tbaa !33
  %128 = add nuw nsw i32 %113, %100
  store i32 %128, ptr %64, align 4, !tbaa !33
  %129 = add nuw nsw i32 %126, %113
  store i32 %129, ptr %65, align 4, !tbaa !33
  %130 = load ptr, ptr %0, align 8, !tbaa !5
  %131 = getelementptr inbounds i8, ptr %130, i64 16
  %132 = load ptr, ptr %131, align 8, !tbaa !34
  %133 = load ptr, ptr %66, align 8, !tbaa !35
  %134 = getelementptr inbounds i32, ptr %133, i64 %68
  %135 = load i32, ptr %134, align 4, !tbaa !33
  %136 = shl i32 %135, 1
  %137 = icmp ult i32 %136, %127
  br i1 %60, label %138, label %220

138:                                              ; preds = %.preheader232.preheader
  br i1 %137, label %139, label %152

139:                                              ; preds = %138
  %140 = icmp ugt i32 %87, %135
  br i1 %140, label %141, label %146

141:                                              ; preds = %139
  %142 = sub nsw i32 %87, %135
  %143 = call noundef i32 @_ZN6basisu4iabsEi(i32 noundef %142)
  %144 = zext i32 %143 to i64
  %145 = load i64, ptr %51, align 8, !tbaa !30
  %.not192 = icmp ugt i64 %145, %144
  br i1 %.not192, label %146, label %306

146:                                              ; preds = %141, %139
  %147 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef 0)
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %147, i8 0, i64 %70, i1 false)
  br i1 %.not284, label %.loopexit223, label %.lr.ph280

.lr.ph280:                                        ; preds = %146, %.lr.ph280
  %indvars.iv347 = phi i64 [ %indvars.iv.next348, %.lr.ph280 ], [ 0, %146 ]
  %.0156279 = phi i64 [ %151, %.lr.ph280 ], [ 0, %146 ]
  %148 = getelementptr inbounds %"class.basisu::color_rgba", ptr %132, i64 %indvars.iv347
  %149 = call noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext true, ptr noundef nonnull align 1 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(4) %148, i1 noundef zeroext false)
  %150 = zext i32 %149 to i64
  %151 = add i64 %.0156279, %150
  %indvars.iv.next348 = add nuw nsw i64 %indvars.iv347, 1
  %exitcond351.not = icmp eq i64 %indvars.iv.next348, %70
  br i1 %exitcond351.not, label %.loopexit223, label %.lr.ph280, !llvm.loop !36

152:                                              ; preds = %138
  %153 = load i32, ptr %133, align 4, !tbaa !33
  %154 = shl i32 %153, 1
  %.not189 = icmp ult i32 %154, %129
  br i1 %.not189, label %.preheader, label %155

.preheader:                                       ; preds = %152
  br i1 %.not284, label %.loopexit, label %.lr.ph271

155:                                              ; preds = %152
  %156 = icmp ugt i32 %153, %126
  br i1 %156, label %157, label %162

157:                                              ; preds = %155
  %158 = sub nsw i32 %153, %126
  %159 = call noundef i32 @_ZN6basisu4iabsEi(i32 noundef %158)
  %160 = zext i32 %159 to i64
  %161 = load i64, ptr %51, align 8, !tbaa !30
  %.not191 = icmp ugt i64 %161, %160
  br i1 %.not191, label %162, label %306

162:                                              ; preds = %157, %155
  %163 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef 0)
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %163, i8 3, i64 %70, i1 false)
  br i1 %.not284, label %.loopexit223, label %.lr.ph266

.lr.ph266:                                        ; preds = %162, %.lr.ph266
  %indvars.iv332 = phi i64 [ %indvars.iv.next333, %.lr.ph266 ], [ 0, %162 ]
  %.1157265 = phi i64 [ %167, %.lr.ph266 ], [ 0, %162 ]
  %164 = getelementptr inbounds %"class.basisu::color_rgba", ptr %132, i64 %indvars.iv332
  %165 = call noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext true, ptr noundef nonnull align 1 dereferenceable(4) %71, ptr noundef nonnull align 1 dereferenceable(4) %164, i1 noundef zeroext false)
  %166 = zext i32 %165 to i64
  %167 = add i64 %.1157265, %166
  %indvars.iv.next333 = add nuw nsw i64 %indvars.iv332, 1
  %exitcond336.not = icmp eq i64 %indvars.iv.next333, %70
  br i1 %exitcond336.not, label %.loopexit223, label %.lr.ph266, !llvm.loop !38

.lr.ph271:                                        ; preds = %.preheader, %196
  %indvars.iv337 = phi i64 [ %indvars.iv.next338, %196 ], [ 0, %.preheader ]
  %.2158270 = phi i64 [ %207, %196 ], [ 0, %.preheader ]
  %.0166269 = phi i32 [ %.1167.lcssa, %196 ], [ 0, %.preheader ]
  %168 = load ptr, ptr %66, align 8, !tbaa !35
  %169 = getelementptr inbounds i32, ptr %168, i64 %indvars.iv337
  %170 = load i32, ptr %169, align 4, !tbaa !33
  %171 = shl i32 %170, 1
  %172 = zext i32 %.0166269 to i64
  %173 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !33
  %.not190 = icmp ult i32 %171, %174
  br i1 %.not190, label %196, label %175

175:                                              ; preds = %.lr.ph271
  %176 = add i32 %.0166269, 1
  %177 = icmp ugt i32 %176, 2
  br i1 %177, label %.loopexit.loopexit, label %178, !llvm.loop !39

178:                                              ; preds = %175
  %179 = zext nneg i32 %176 to i64
  %180 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !33
  %.not190.1 = icmp ult i32 %171, %181
  br i1 %.not190.1, label %196, label %182

182:                                              ; preds = %178
  %183 = add i32 %.0166269, 2
  %184 = icmp ugt i32 %183, 2
  br i1 %184, label %.loopexit.loopexit, label %185, !llvm.loop !39

185:                                              ; preds = %182
  %186 = zext nneg i32 %183 to i64
  %187 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !33
  %.not190.2 = icmp ult i32 %171, %188
  br i1 %.not190.2, label %196, label %189

189:                                              ; preds = %185
  %190 = icmp ult i32 %.0166269, -3
  br i1 %190, label %.loopexit.loopexit, label %191, !llvm.loop !39

191:                                              ; preds = %189
  %192 = add i32 %.0166269, 3
  %193 = zext i32 %192 to i64
  %194 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !33
  %.not190.3 = icmp ult i32 %171, %195
  br i1 %.not190.3, label %196, label %.loopexit.loopexit

196:                                              ; preds = %191, %185, %178, %.lr.ph271
  %.1167.lcssa = phi i32 [ %.0166269, %.lr.ph271 ], [ %176, %178 ], [ %183, %185 ], [ %192, %191 ]
  %.lcssa424 = phi i64 [ %172, %.lr.ph271 ], [ %179, %178 ], [ %186, %185 ], [ %193, %191 ]
  %197 = load ptr, ptr %72, align 8, !tbaa !40
  %198 = getelementptr inbounds i32, ptr %197, i64 %indvars.iv337
  %199 = load i32, ptr %198, align 4, !tbaa !33
  %200 = trunc i32 %.1167.lcssa to i8
  %201 = zext i32 %199 to i64
  %202 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef %201)
  store i8 %200, ptr %202, align 1, !tbaa !27
  %203 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %5, i64 0, i64 %.lcssa424
  %204 = getelementptr inbounds %"class.basisu::color_rgba", ptr %132, i64 %201
  %205 = call noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext true, ptr noundef nonnull align 1 dereferenceable(4) %203, ptr noundef nonnull align 1 dereferenceable(4) %204, i1 noundef zeroext false)
  %206 = zext i32 %205 to i64
  %207 = add i64 %.2158270, %206
  %indvars.iv.next338 = add nuw nsw i64 %indvars.iv337, 1
  %exitcond341.not = icmp eq i64 %indvars.iv.next338, %70
  br i1 %exitcond341.not, label %.loopexit223, label %.lr.ph271, !llvm.loop !41

.loopexit.loopexit:                               ; preds = %189, %182, %175, %191
  %208 = trunc nuw i64 %indvars.iv337 to i32
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader
  %.0169246 = phi i32 [ 0, %.preheader ], [ %208, %.loopexit.loopexit ]
  %.2158244 = phi i64 [ 0, %.preheader ], [ %.2158270, %.loopexit.loopexit ]
  %209 = icmp ult i32 %.0169246, %45
  br i1 %209, label %.lr.ph276.preheader, label %.loopexit223

.lr.ph276.preheader:                              ; preds = %.loopexit
  %210 = zext i32 %.0169246 to i64
  br label %.lr.ph276

.lr.ph276:                                        ; preds = %.lr.ph276.preheader, %.lr.ph276
  %indvars.iv342 = phi i64 [ %210, %.lr.ph276.preheader ], [ %indvars.iv.next343, %.lr.ph276 ]
  %.5161275 = phi i64 [ %.2158244, %.lr.ph276.preheader ], [ %219, %.lr.ph276 ]
  %211 = load ptr, ptr %72, align 8, !tbaa !40
  %212 = getelementptr inbounds i32, ptr %211, i64 %indvars.iv342
  %213 = load i32, ptr %212, align 4, !tbaa !33
  %214 = zext i32 %213 to i64
  %215 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef %214)
  store i8 3, ptr %215, align 1, !tbaa !27
  %216 = getelementptr inbounds %"class.basisu::color_rgba", ptr %132, i64 %214
  %217 = call noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext true, ptr noundef nonnull align 1 dereferenceable(4) %71, ptr noundef nonnull align 1 dereferenceable(4) %216, i1 noundef zeroext false)
  %218 = zext i32 %217 to i64
  %219 = add i64 %.5161275, %218
  %indvars.iv.next343 = add nuw nsw i64 %indvars.iv342, 1
  %lftr.wideiv345 = trunc i64 %indvars.iv.next343 to i32
  %exitcond346.not = icmp eq i32 %45, %lftr.wideiv345
  br i1 %exitcond346.not, label %.loopexit223, label %.lr.ph276, !llvm.loop !42

220:                                              ; preds = %.preheader232.preheader
  br i1 %137, label %221, label %234

221:                                              ; preds = %220
  %222 = icmp ugt i32 %87, %135
  br i1 %222, label %223, label %228

223:                                              ; preds = %221
  %224 = sub nsw i32 %87, %135
  %225 = call noundef i32 @_ZN6basisu4iabsEi(i32 noundef %224)
  %226 = zext i32 %225 to i64
  %227 = load i64, ptr %51, align 8, !tbaa !30
  %.not188 = icmp ugt i64 %227, %226
  br i1 %.not188, label %228, label %306

228:                                              ; preds = %223, %221
  %229 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef 0)
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %229, i8 0, i64 %70, i1 false)
  br i1 %.not284, label %.loopexit223, label %.lr.ph262

.lr.ph262:                                        ; preds = %228, %.lr.ph262
  %indvars.iv327 = phi i64 [ %indvars.iv.next328, %.lr.ph262 ], [ 0, %228 ]
  %.6162260 = phi i64 [ %233, %.lr.ph262 ], [ 0, %228 ]
  %230 = getelementptr inbounds %"class.basisu::color_rgba", ptr %132, i64 %indvars.iv327
  %231 = call noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(4) %230, i1 noundef zeroext false)
  %232 = sext i32 %231 to i64
  %233 = add i64 %.6162260, %232
  %indvars.iv.next328 = add nuw nsw i64 %indvars.iv327, 1
  %exitcond331.not = icmp eq i64 %indvars.iv.next328, %70
  br i1 %exitcond331.not, label %.loopexit223, label %.lr.ph262, !llvm.loop !43

234:                                              ; preds = %220
  %235 = load i32, ptr %133, align 4, !tbaa !33
  %236 = shl i32 %235, 1
  %.not = icmp ult i32 %236, %129
  br i1 %.not, label %.preheader229, label %237

.preheader229:                                    ; preds = %234
  br i1 %.not284, label %.loopexit222, label %.lr.ph253

237:                                              ; preds = %234
  %238 = icmp ugt i32 %235, %126
  br i1 %238, label %239, label %244

239:                                              ; preds = %237
  %240 = sub nsw i32 %235, %126
  %241 = call noundef i32 @_ZN6basisu4iabsEi(i32 noundef %240)
  %242 = zext i32 %241 to i64
  %243 = load i64, ptr %51, align 8, !tbaa !30
  %.not187 = icmp ugt i64 %243, %242
  br i1 %.not187, label %244, label %306

244:                                              ; preds = %239, %237
  %245 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef 0)
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %245, i8 3, i64 %70, i1 false)
  br i1 %.not284, label %.loopexit223, label %.lr.ph

.lr.ph:                                           ; preds = %244, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %244 ]
  %.7163248 = phi i64 [ %249, %.lr.ph ], [ 0, %244 ]
  %246 = getelementptr inbounds %"class.basisu::color_rgba", ptr %132, i64 %indvars.iv
  %247 = call noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4) %71, ptr noundef nonnull align 1 dereferenceable(4) %246, i1 noundef zeroext false)
  %248 = sext i32 %247 to i64
  %249 = add i64 %.7163248, %248
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %70
  br i1 %exitcond.not, label %.loopexit223, label %.lr.ph, !llvm.loop !44

.lr.ph253:                                        ; preds = %.preheader229, %278
  %indvars.iv318 = phi i64 [ %indvars.iv.next319, %278 ], [ 0, %.preheader229 ]
  %.0150251 = phi i32 [ %.1151.lcssa, %278 ], [ 0, %.preheader229 ]
  %.8250 = phi i64 [ %289, %278 ], [ 0, %.preheader229 ]
  %250 = load ptr, ptr %66, align 8, !tbaa !35
  %251 = getelementptr inbounds i32, ptr %250, i64 %indvars.iv318
  %252 = load i32, ptr %251, align 4, !tbaa !33
  %253 = shl i32 %252, 1
  %254 = zext i32 %.0150251 to i64
  %255 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !33
  %.not186 = icmp ult i32 %253, %256
  br i1 %.not186, label %278, label %257

257:                                              ; preds = %.lr.ph253
  %258 = add i32 %.0150251, 1
  %259 = icmp ugt i32 %258, 2
  br i1 %259, label %.loopexit222.loopexit, label %260, !llvm.loop !45

260:                                              ; preds = %257
  %261 = zext nneg i32 %258 to i64
  %262 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %261
  %263 = load i32, ptr %262, align 4, !tbaa !33
  %.not186.1 = icmp ult i32 %253, %263
  br i1 %.not186.1, label %278, label %264

264:                                              ; preds = %260
  %265 = add i32 %.0150251, 2
  %266 = icmp ugt i32 %265, 2
  br i1 %266, label %.loopexit222.loopexit, label %267, !llvm.loop !45

267:                                              ; preds = %264
  %268 = zext nneg i32 %265 to i64
  %269 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %268
  %270 = load i32, ptr %269, align 4, !tbaa !33
  %.not186.2 = icmp ult i32 %253, %270
  br i1 %.not186.2, label %278, label %271

271:                                              ; preds = %267
  %272 = icmp ult i32 %.0150251, -3
  br i1 %272, label %.loopexit222.loopexit, label %273, !llvm.loop !45

273:                                              ; preds = %271
  %274 = add i32 %.0150251, 3
  %275 = zext i32 %274 to i64
  %276 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !33
  %.not186.3 = icmp ult i32 %253, %277
  br i1 %.not186.3, label %278, label %.loopexit222.loopexit

278:                                              ; preds = %273, %267, %260, %.lr.ph253
  %.1151.lcssa = phi i32 [ %.0150251, %.lr.ph253 ], [ %258, %260 ], [ %265, %267 ], [ %274, %273 ]
  %.lcssa415 = phi i64 [ %254, %.lr.ph253 ], [ %261, %260 ], [ %268, %267 ], [ %275, %273 ]
  %279 = load ptr, ptr %72, align 8, !tbaa !40
  %280 = getelementptr inbounds i32, ptr %279, i64 %indvars.iv318
  %281 = load i32, ptr %280, align 4, !tbaa !33
  %282 = trunc i32 %.1151.lcssa to i8
  %283 = zext i32 %281 to i64
  %284 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef %283)
  store i8 %282, ptr %284, align 1, !tbaa !27
  %285 = getelementptr inbounds [4 x %"class.basisu::color_rgba"], ptr %5, i64 0, i64 %.lcssa415
  %286 = getelementptr inbounds %"class.basisu::color_rgba", ptr %132, i64 %283
  %287 = call noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4) %285, ptr noundef nonnull align 1 dereferenceable(4) %286, i1 noundef zeroext false)
  %288 = sext i32 %287 to i64
  %289 = add i64 %.8250, %288
  %indvars.iv.next319 = add nuw nsw i64 %indvars.iv318, 1
  %exitcond322.not = icmp eq i64 %indvars.iv.next319, %70
  br i1 %exitcond322.not, label %.loopexit223, label %.lr.ph253, !llvm.loop !46

.loopexit222.loopexit:                            ; preds = %271, %264, %257, %273
  %290 = trunc nuw i64 %indvars.iv318 to i32
  br label %.loopexit222

.loopexit222:                                     ; preds = %.loopexit222.loopexit, %.preheader229
  %.8239 = phi i64 [ 0, %.preheader229 ], [ %.8250, %.loopexit222.loopexit ]
  %.0148237 = phi i32 [ 0, %.preheader229 ], [ %290, %.loopexit222.loopexit ]
  %291 = icmp ult i32 %.0148237, %45
  br i1 %291, label %.lr.ph258.preheader, label %.loopexit223

.lr.ph258.preheader:                              ; preds = %.loopexit222
  %292 = zext i32 %.0148237 to i64
  br label %.lr.ph258

.lr.ph258:                                        ; preds = %.lr.ph258.preheader, %.lr.ph258
  %indvars.iv323 = phi i64 [ %292, %.lr.ph258.preheader ], [ %indvars.iv.next324, %.lr.ph258 ]
  %.11256 = phi i64 [ %.8239, %.lr.ph258.preheader ], [ %301, %.lr.ph258 ]
  %293 = load ptr, ptr %72, align 8, !tbaa !40
  %294 = getelementptr inbounds i32, ptr %293, i64 %indvars.iv323
  %295 = load i32, ptr %294, align 4, !tbaa !33
  %296 = zext i32 %295 to i64
  %297 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef %296)
  store i8 3, ptr %297, align 1, !tbaa !27
  %298 = getelementptr inbounds %"class.basisu::color_rgba", ptr %132, i64 %296
  %299 = call noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4) %71, ptr noundef nonnull align 1 dereferenceable(4) %298, i1 noundef zeroext false)
  %300 = sext i32 %299 to i64
  %301 = add i64 %.11256, %300
  %indvars.iv.next324 = add nuw nsw i64 %indvars.iv323, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next324 to i32
  %exitcond326.not = icmp eq i32 %45, %lftr.wideiv
  br i1 %exitcond326.not, label %.loopexit223, label %.lr.ph258, !llvm.loop !47

.loopexit223:                                     ; preds = %.lr.ph, %278, %.lr.ph258, %.lr.ph262, %.lr.ph266, %196, %.lr.ph276, %.lr.ph280, %244, %.loopexit222, %228, %162, %.loopexit, %146
  %.12 = phi i64 [ 0, %146 ], [ %.2158244, %.loopexit ], [ 0, %162 ], [ 0, %228 ], [ %.8239, %.loopexit222 ], [ 0, %244 ], [ %151, %.lr.ph280 ], [ %219, %.lr.ph276 ], [ %207, %196 ], [ %167, %.lr.ph266 ], [ %233, %.lr.ph262 ], [ %301, %.lr.ph258 ], [ %289, %278 ], [ %249, %.lr.ph ]
  %302 = load i64, ptr %51, align 8, !tbaa !30
  %303 = icmp ult i64 %.12, %302
  br i1 %303, label %304, label %.thread220

304:                                              ; preds = %.loopexit223
  store i64 %.12, ptr %51, align 8, !tbaa !30
  %305 = trunc nuw nsw i64 %indvars.iv352 to i32
  store i32 %305, ptr %73, align 4, !tbaa !48
  call void @_ZN6basisu6vectorIhE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 8 dereferenceable(16) %69)
  store i8 1, ptr %74, align 8, !tbaa !28
  %.not193 = icmp eq i64 %.12, 0
  br i1 %.not193, label %.thread218, label %.thread220

.thread218:                                       ; preds = %304
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %.loopexit233

.thread220:                                       ; preds = %.loopexit223, %304
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %307

306:                                              ; preds = %141, %157, %223, %239
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br label %307

307:                                              ; preds = %306, %.thread220
  %indvars.iv.next353 = add nsw i64 %indvars.iv352, -1
  %.not355 = icmp eq i64 %indvars.iv352, 0
  br i1 %.not355, label %.loopexit233, label %.preheader232.preheader, !llvm.loop !49

.loopexit233:                                     ; preds = %307, %.thread218
  %308 = load i32, ptr %1, align 4, !tbaa !27
  store i32 %308, ptr %2, align 8, !tbaa !27
  %309 = load ptr, ptr %0, align 8, !tbaa !5
  %310 = getelementptr inbounds i8, ptr %309, i64 24
  %311 = load i8, ptr %310, align 8, !tbaa !50, !range !25, !noundef !26
  %312 = getelementptr inbounds i8, ptr %2, i64 8
  store i8 %311, ptr %312, align 8, !tbaa !51
  %.not194 = icmp eq ptr %3, null
  br i1 %.not194, label %320, label %313

313:                                              ; preds = %.loopexit233
  %314 = load i64, ptr %51, align 8, !tbaa !30
  %315 = getelementptr inbounds i8, ptr %3, i64 32
  %316 = load i64, ptr %315, align 8, !tbaa !30
  %317 = icmp ult i64 %314, %316
  br i1 %317, label %318, label %320

318:                                              ; preds = %313
  %319 = call noundef nonnull align 8 dereferenceable(41) ptr @_ZN6basisu14etc1_optimizer18potential_solutionaSERKS1_(ptr noundef nonnull align 8 dereferenceable(41) %3, ptr noundef nonnull align 8 dereferenceable(41) %2)
  br label %320

320:                                              ; preds = %40, %.loopexit233, %318, %313, %4
  %.1 = phi i1 [ false, %40 ], [ false, %4 ], [ true, %318 ], [ false, %313 ], [ false, %.loopexit233 ]
  ret i1 %.1
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu4iabsEi(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu14color_distanceERKNS_10color_rgbaES2_b(ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext) local_unnamed_addr #0

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { noreturn nounwind }
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, !7, i64 0}
!6 = !{!"_ZTSN6basisu14etc1_optimizerE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 20, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !12, i64 48, !13, i64 64, !13, i64 80, !7, i64 96, !7, i64 104, !14, i64 112, !14, i64 128, !15, i64 144, !15, i64 192, !14, i64 240, !8, i64 256}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN6basisu3vecILj3EfEE", !8, i64 0}
!12 = !{!"_ZTSN6basisu6vectorItEE", !7, i64 0, !10, i64 8, !10, i64 12}
!13 = !{!"_ZTSN6basisu6vectorIjEE", !7, i64 0, !10, i64 8, !10, i64 12}
!14 = !{!"_ZTSN6basisu6vectorIhEE", !7, i64 0, !10, i64 8, !10, i64 12}
!15 = !{!"_ZTSN6basisu14etc1_optimizer18potential_solutionE", !16, i64 0, !14, i64 16, !19, i64 32, !18, i64 40}
!16 = !{!"_ZTSN6basisu25etc1_solution_coordinatesE", !17, i64 0, !10, i64 4, !18, i64 8}
!17 = !{!"_ZTSN6basisu10color_rgbaE", !8, i64 0}
!18 = !{!"bool", !8, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!21, !18, i64 48}
!21 = !{!"_ZTSN6basisu14etc1_optimizer6paramsE", !22, i64 0, !10, i64 12, !7, i64 16, !18, i64 24, !7, i64 32, !10, i64 40, !17, i64 44, !18, i64 48, !18, i64 49, !7, i64 56}
!22 = !{!"_ZTSN6basisu22basis_etc1_pack_paramsE", !23, i64 0, !18, i64 4, !18, i64 5, !18, i64 6, !18, i64 7, !24, i64 8}
!23 = !{!"_ZTSN6basisu17basis_etc_qualityE", !8, i64 0}
!24 = !{!"float", !8, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!8, !8, i64 0}
!28 = !{!15, !18, i64 40}
!29 = !{!21, !10, i64 12}
!30 = !{!15, !19, i64 32}
!31 = !{!22, !23, i64 0}
!32 = !{!22, !18, i64 4}
!33 = !{!10, !10, i64 0}
!34 = !{!21, !7, i64 16}
!35 = !{!6, !7, i64 104}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}
!39 = distinct !{!39, !37}
!40 = !{!6, !7, i64 96}
!41 = distinct !{!41, !37}
!42 = distinct !{!42, !37}
!43 = distinct !{!43, !37}
!44 = distinct !{!44, !37}
!45 = distinct !{!45, !37}
!46 = distinct !{!46, !37}
!47 = distinct !{!47, !37}
!48 = !{!15, !10, i64 4}
!49 = distinct !{!49, !37}
!50 = !{!21, !18, i64 24}
!51 = !{!15, !18, i64 8}


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