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

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

%"struct.basisu::etc_coord2" = type { i8, i8 }
%"class.basisu::vector.87" = type { ptr, i32, i32 }
%"class.basisu::vector.8" = type { ptr, i32, i32 }
%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%"struct.basisu::etc1_optimizer::results" = type <{ i64, %"class.basisu::color_rgba", i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%"class.basisu::etc1_optimizer" = type { ptr, ptr, i32, %"class.basisu::vec.90", i32, i32, i32, i32, %"class.basisu::vector.91", %"class.basisu::vector.18", %"class.basisu::vector.18", ptr, ptr, %"class.basisu::vector.8", %"class.basisu::vector.8", %"struct.basisu::etc1_optimizer::potential_solution", %"struct.basisu::etc1_optimizer::potential_solution", %"class.basisu::vector.8", [128 x i8] }
%"class.basisu::vec.90" = type { [3 x float] }
%"class.basisu::vector.91" = type { ptr, i32, i32 }
%"class.basisu::vector.18" = type { ptr, i32, i32 }
%"struct.basisu::etc1_optimizer::potential_solution" = type <{ %"struct.basisu::etc1_solution_coordinates", [4 x i8], %"class.basisu::vector.8", i64, i8, [7 x i8] }>
%"struct.basisu::etc1_solution_coordinates" = type <{ %"class.basisu::color_rgba", i32, i8, [3 x i8] }>
%"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 }
%"class.basisu::basisu_frontend" = type { %"struct.basisu::basisu_frontend::params", i32, i32, i8, i8, i8, i32, i32, %"class.basisu::vector", %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::tree_vector_quant", %"class.basisu::vector.6", %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.6", %"class.basisu::vector.10", %"class.basisu::vector.12", %"class.basisu::vector.6", %"class.basisu::vector.0", %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.6", %"class.basisu::vector.14", %"class.basisu::vector.16", %"class.basisu::vector.18", %"class.basisu::vector.20", %"class.std::mutex" }
%"struct.basisu::basisu_frontend::params" = type { i32, ptr, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, ptr, i32, i32, i8, float, i32, ptr, ptr }
%"class.basisu::vector" = type { ptr, i32, i32 }
%"class.basisu::tree_vector_quant" = type <{ %"class.basisu::vector.2", %"class.basisu::vector.4", i32, [4 x i8] }>
%"class.basisu::vector.2" = type { ptr, i32, i32 }
%"class.basisu::vector.4" = type { ptr, i32, i32 }
%"class.basisu::vector.10" = type { ptr, i32, i32 }
%"class.basisu::vector.12" = type { ptr, i32, i32 }
%"class.basisu::vector.0" = type { ptr, i32, i32 }
%"class.basisu::vector.6" = type { ptr, i32, i32 }
%"class.basisu::vector.14" = type { ptr, i32, i32 }
%"class.basisu::vector.16" = type { ptr, i32, i32 }
%"class.basisu::vector.20" = type { ptr, i32, i32 }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"struct.basisu::basisu_frontend::endpoint_cluster_etc_params" = type <{ [2 x %"class.basisu::color_rgba"], [2 x i32], [2 x i64], %"class.basisu::vector.18", [2 x i8], i8, [5 x i8] }>
%struct.anon = type { i8, i8, i8, i8 }

@.str.4 = external hidden unnamed_addr constant [115 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [40 x i8], align 1
@_ZN6basisu20g_etc1_pixel_indicesE = external constant [2 x [2 x [8 x i32]]], align 16
@_ZN6basisu19g_etc1_pixel_coordsE = external global [2 x [2 x [8 x %"struct.basisu::etc_coord2"]]], align 16
@.str.45 = external hidden unnamed_addr constant [8 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu15basisu_frontend38refine_block_endpoints_given_selectorsEv = external hidden unnamed_addr constant [75 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [48 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

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) #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 noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6basisu15basisu_frontend38refine_block_endpoints_given_selectorsEv(ptr noundef nonnull align 8 dereferenceable(496) %0) #7 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [2 x %"class.basisu::vector.87"], align 16
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca [2 x %"class.basisu::vector.8"], align 16
  %17 = alloca [2 x i64], align 16
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i8, align 1
  %23 = alloca ptr, align 8
  %24 = alloca i8, align 1
  %25 = alloca ptr, align 8
  %26 = alloca [16 x %"class.basisu::color_rgba"], align 16
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i8, align 1
  %31 = alloca [2 x %"struct.basisu::etc1_optimizer::results"], align 16
  %32 = alloca [2 x i8], align 1
  %33 = alloca [2 x %"class.basisu::vector.8"], align 16
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca %"class.basisu::etc1_optimizer", align 8
  %37 = alloca [2 x %"struct.basisu::etc1_solution_coordinates"], align 16
  %38 = alloca %"struct.basisu::etc1_optimizer::params", align 8
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i8, align 1
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca ptr, align 8
  %48 = alloca i16, align 2
  %49 = alloca i16, align 2
  %50 = alloca [2 x i32], align 4
  %51 = alloca [2 x i32], align 4
  %52 = alloca [2 x i32], align 4
  %53 = alloca i8, align 1
  %54 = alloca [2 x %"class.basisu::color_rgba"], align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %55 = load ptr, ptr %2, align 8
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.44)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %86, %1
  %57 = load i32, ptr %3, align 4, !tbaa !9
  %58 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 1
  %59 = load i32, ptr %58, align 8, !tbaa !11
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %89

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  %63 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 18
  %64 = load i32, ptr %3, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %63, i64 noundef %65)
  store ptr %66, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 17
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %68, i32 noundef 0)
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = call noundef nonnull align 8 dereferenceable(51) ptr @_ZN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %67, i64 noundef %71)
  %73 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %72, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  %74 = load i32, ptr %3, align 4, !tbaa !9
  %75 = mul nsw i32 %74, 2
  store i32 %75, ptr %5, align 4, !tbaa !9
  call void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  %76 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 17
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %77, i32 noundef 1)
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = zext i32 %79 to i64
  %81 = call noundef nonnull align 8 dereferenceable(51) ptr @_ZN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %76, i64 noundef %80)
  %82 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %81, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %83 = load i32, ptr %3, align 4, !tbaa !9
  %84 = mul nsw i32 %83, 2
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !9
  call void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %82, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  br label %86

86:                                               ; preds = %62
  %87 = load i32, ptr %3, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %3, align 4, !tbaa !9
  br label %56, !llvm.loop !32

89:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %733, %89
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 17
  %93 = call noundef i32 @_ZNK6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %92)
  %94 = icmp ult i32 %91, %93
  br i1 %94, label %96, label %95

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

96:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %97 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 17
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = call noundef nonnull align 8 dereferenceable(51) ptr @_ZN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %97, i64 noundef %99)
  store ptr %100, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %101, i32 0, i32 3
  store ptr %102, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #9
  %103 = getelementptr inbounds [2 x %"class.basisu::vector.87"], ptr %13, i32 0, i32 0
  %104 = getelementptr inbounds %"class.basisu::vector.87", ptr %103, i64 2
  br label %105

105:                                              ; preds = %107, %96
  %106 = phi ptr [ %103, %96 ], [ %108, %107 ]
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %106)
          to label %107 unwind label %126

107:                                              ; preds = %105
  %108 = getelementptr inbounds %"class.basisu::vector.87", ptr %106, i64 1
  %109 = icmp eq ptr %108, %104
  br i1 %109, label %110, label %105

110:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #9
  %111 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %16, i32 0, i32 0
  %112 = getelementptr inbounds %"class.basisu::vector.8", ptr %111, i64 2
  br label %113

113:                                              ; preds = %115, %110
  %114 = phi ptr [ %111, %110 ], [ %116, %115 ]
  invoke void @_ZN6basisu6vectorIhEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %114)
          to label %115 unwind label %136

115:                                              ; preds = %113
  %116 = getelementptr inbounds %"class.basisu::vector.8", ptr %114, i64 1
  %117 = icmp eq ptr %116, %112
  br i1 %117, label %118, label %113

118:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #9
  call void @llvm.memset.p0.i64(ptr align 16 %17, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %285, %118
  %120 = load i32, ptr %18, align 4, !tbaa !9
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = invoke noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %121)
          to label %123 unwind label %146

123:                                              ; preds = %119
  %124 = icmp ult i32 %120, %122
  br i1 %124, label %150, label %125

125:                                              ; preds = %123
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %294

126:                                              ; preds = %105
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %14, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %15, align 4
  %130 = icmp eq ptr %103, %106
  br i1 %130, label %135, label %131

131:                                              ; preds = %131, %126
  %132 = phi ptr [ %106, %126 ], [ %133, %131 ]
  %133 = getelementptr inbounds %"class.basisu::vector.87", ptr %132, i64 -1
  call void @_ZN6basisu6vectorINS_10color_rgbaEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %133) #9
  %134 = icmp eq ptr %133, %103
  br i1 %134, label %135, label %131

135:                                              ; preds = %131, %126
  br label %763

136:                                              ; preds = %113
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %14, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %15, align 4
  %140 = icmp eq ptr %111, %114
  br i1 %140, label %145, label %141

141:                                              ; preds = %141, %136
  %142 = phi ptr [ %114, %136 ], [ %143, %141 ]
  %143 = getelementptr inbounds %"class.basisu::vector.8", ptr %142, i64 -1
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %143) #9
  %144 = icmp eq ptr %143, %111
  br i1 %144, label %145, label %141

145:                                              ; preds = %141, %136
  br label %755

146:                                              ; preds = %119
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %14, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %15, align 4
  br label %293

150:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = load i32, ptr %18, align 4, !tbaa !9
  %153 = zext i32 %152 to i64
  %154 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %151, i64 noundef %153)
          to label %155 unwind label %192

155:                                              ; preds = %150
  %156 = load i32, ptr %154, align 4, !tbaa !9
  store i32 %156, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  %157 = load i32, ptr %19, align 4, !tbaa !9
  %158 = lshr i32 %157, 1
  store i32 %158, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  %159 = load i32, ptr %19, align 4, !tbaa !9
  %160 = and i32 %159, 1
  store i32 %160, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #9
  store i8 1, ptr %22, align 1, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  %161 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 9
  %162 = load i32, ptr %20, align 4, !tbaa !9
  %163 = zext i32 %162 to i64
  %164 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %161, i64 noundef %163)
          to label %165 unwind label %196

165:                                              ; preds = %155
  store ptr %164, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #9
  %166 = load ptr, ptr %23, align 8, !tbaa !5
  %167 = invoke noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %166)
          to label %168 unwind label %200

168:                                              ; preds = %165
  %169 = xor i1 %167, true
  %170 = zext i1 %169 to i8
  store i8 %170, ptr %24, align 1, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %171 = load i32, ptr %20, align 4, !tbaa !9
  %172 = invoke noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %55, i32 noundef %171)
          to label %173 unwind label %204

173:                                              ; preds = %168
  %174 = invoke noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %172)
          to label %175 unwind label %204

175:                                              ; preds = %173
  store ptr %174, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %26) #9
  %176 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %26, i32 0, i32 0
  %177 = getelementptr inbounds %"class.basisu::color_rgba", ptr %176, i64 16
  br label %178

178:                                              ; preds = %180, %175
  %179 = phi ptr [ %176, %175 ], [ %181, %180 ]
  invoke void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %179)
          to label %180 unwind label %208

180:                                              ; preds = %178
  %181 = getelementptr inbounds %"class.basisu::color_rgba", ptr %179, i64 1
  %182 = icmp eq ptr %181, %177
  br i1 %182, label %183, label %178

183:                                              ; preds = %180
  %184 = load ptr, ptr %23, align 8, !tbaa !5
  %185 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %26, i64 0, i64 0
  %186 = invoke noundef zeroext i1 @_ZN6basisu11unpack_etc1ERKNS_9etc_blockEPNS_10color_rgbaEb(ptr noundef nonnull align 8 dereferenceable(8) %184, ptr noundef %185, i1 noundef zeroext false)
          to label %187 unwind label %208

187:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %272, %187
  %189 = load i32, ptr %27, align 4, !tbaa !9
  %190 = icmp ult i32 %189, 8
  br i1 %190, label %212, label %191

191:                                              ; preds = %188
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %284

192:                                              ; preds = %150
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %14, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %15, align 4
  br label %292

196:                                              ; preds = %155
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %14, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %15, align 4
  br label %291

200:                                              ; preds = %165
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %14, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %15, align 4
  br label %290

204:                                              ; preds = %173, %168
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %14, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %15, align 4
  br label %289

208:                                              ; preds = %183, %178
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %14, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %15, align 4
  br label %288

212:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  %213 = load i32, ptr %21, align 4, !tbaa !9
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds ([2 x [2 x [8 x i32]]], ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 0, i64 1), i64 0, i64 %214
  %216 = load i32, ptr %27, align 4, !tbaa !9
  %217 = zext i32 %216 to i64
  %218 = getelementptr inbounds [8 x i32], ptr %215, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !9
  store i32 %219, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %220 = load i32, ptr %21, align 4, !tbaa !9
  %221 = zext i32 %220 to i64
  %222 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds ([2 x [2 x [8 x %"struct.basisu::etc_coord2"]]], ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 0, i64 1), i64 0, i64 %221
  %223 = load i32, ptr %27, align 4, !tbaa !9
  %224 = zext i32 %223 to i64
  %225 = getelementptr inbounds [8 x %"struct.basisu::etc_coord2"], ptr %222, i64 0, i64 %224
  store ptr %225, ptr %29, align 8, !tbaa !5
  %226 = load i8, ptr %24, align 1, !tbaa !34, !range !35, !noundef !36
  %227 = trunc i8 %226 to i1
  %228 = zext i1 %227 to i64
  %229 = getelementptr inbounds [2 x %"class.basisu::vector.87"], ptr %13, i64 0, i64 %228
  %230 = load ptr, ptr %25, align 8, !tbaa !5
  %231 = load i32, ptr %28, align 4, !tbaa !9
  %232 = zext i32 %231 to i64
  %233 = getelementptr inbounds %"class.basisu::color_rgba", ptr %230, i64 %232
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %229, ptr noundef nonnull align 1 dereferenceable(4) %233)
          to label %234 unwind label %275

234:                                              ; preds = %212
  %235 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 0
  %236 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %235, i32 0, i32 5
  %237 = load i8, ptr %236, align 4, !tbaa !37, !range !35, !noundef !36
  %238 = trunc i8 %237 to i1
  %239 = load ptr, ptr %25, align 8, !tbaa !5
  %240 = load i32, ptr %28, align 4, !tbaa !9
  %241 = zext i32 %240 to i64
  %242 = getelementptr inbounds %"class.basisu::color_rgba", ptr %239, i64 %241
  %243 = load i32, ptr %28, align 4, !tbaa !9
  %244 = zext i32 %243 to i64
  %245 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %26, i64 0, i64 %244
  %246 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %238, ptr noundef nonnull align 1 dereferenceable(4) %242, ptr noundef nonnull align 1 dereferenceable(4) %245, i1 noundef zeroext false)
          to label %247 unwind label %275

247:                                              ; preds = %234
  %248 = zext i32 %246 to i64
  %249 = load i8, ptr %24, align 1, !tbaa !34, !range !35, !noundef !36
  %250 = trunc i8 %249 to i1
  %251 = zext i1 %250 to i64
  %252 = getelementptr inbounds [2 x i64], ptr %17, i64 0, i64 %251
  %253 = load i64, ptr %252, align 8, !tbaa !38
  %254 = add i64 %253, %248
  store i64 %254, ptr %252, align 8, !tbaa !38
  %255 = load i8, ptr %24, align 1, !tbaa !34, !range !35, !noundef !36
  %256 = trunc i8 %255 to i1
  %257 = zext i1 %256 to i64
  %258 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %16, i64 0, i64 %257
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #9
  %259 = load ptr, ptr %23, align 8, !tbaa !5
  %260 = load ptr, ptr %29, align 8, !tbaa !5
  %261 = getelementptr inbounds %"struct.basisu::etc_coord2", ptr %260, i32 0, i32 0
  %262 = load i8, ptr %261, align 1, !tbaa !40
  %263 = zext i8 %262 to i32
  %264 = load ptr, ptr %29, align 8, !tbaa !5
  %265 = getelementptr inbounds %"struct.basisu::etc_coord2", ptr %264, i32 0, i32 1
  %266 = load i8, ptr %265, align 1, !tbaa !42
  %267 = zext i8 %266 to i32
  %268 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %259, i32 noundef %263, i32 noundef %267)
          to label %269 unwind label %279

269:                                              ; preds = %247
  %270 = trunc i32 %268 to i8
  store i8 %270, ptr %30, align 1, !tbaa !43
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %258, ptr noundef nonnull align 1 dereferenceable(1) %30)
          to label %271 unwind label %279

271:                                              ; preds = %269
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %272

272:                                              ; preds = %271
  %273 = load i32, ptr %27, align 4, !tbaa !9
  %274 = add i32 %273, 1
  store i32 %274, ptr %27, align 4, !tbaa !9
  br label %188, !llvm.loop !44

275:                                              ; preds = %234, %212
  %276 = landingpad { ptr, i32 }
          cleanup
  %277 = extractvalue { ptr, i32 } %276, 0
  store ptr %277, ptr %14, align 8
  %278 = extractvalue { ptr, i32 } %276, 1
  store i32 %278, ptr %15, align 4
  br label %283

279:                                              ; preds = %269, %247
  %280 = landingpad { ptr, i32 }
          cleanup
  %281 = extractvalue { ptr, i32 } %280, 0
  store ptr %281, ptr %14, align 8
  %282 = extractvalue { ptr, i32 } %280, 1
  store i32 %282, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #9
  br label %283

283:                                              ; preds = %279, %275
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %288

284:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 64, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %285

285:                                              ; preds = %284
  %286 = load i32, ptr %18, align 4, !tbaa !9
  %287 = add i32 %286, 1
  store i32 %287, ptr %18, align 4, !tbaa !9
  br label %119, !llvm.loop !45

288:                                              ; preds = %283, %208
  call void @llvm.lifetime.end.p0(i64 64, ptr %26) #9
  br label %289

289:                                              ; preds = %288, %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %290

290:                                              ; preds = %289, %200
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #9
  br label %291

291:                                              ; preds = %290, %196
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %292

292:                                              ; preds = %291, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %293

293:                                              ; preds = %292, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %747

294:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 80, ptr %31) #9
  %295 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i32 0, i32 0
  %296 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %295, i64 2
  br label %297

297:                                              ; preds = %299, %294
  %298 = phi ptr [ %295, %294 ], [ %300, %299 ]
  invoke void @_ZN6basisu14etc1_optimizer7resultsC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %298)
          to label %299 unwind label %316

299:                                              ; preds = %297
  %300 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %298, i64 1
  %301 = icmp eq ptr %300, %296
  br i1 %301, label %302, label %297

302:                                              ; preds = %299
  call void @llvm.lifetime.start.p0(i64 2, ptr %32) #9
  call void @llvm.memset.p0.i64(ptr align 1 %32, i8 0, i64 2, i1 false)
  invoke void @_ZN6basisu9clear_objIA2_NS_14etc1_optimizer7resultsEEEvRT_(ptr noundef nonnull align 8 dereferenceable(80) %31)
          to label %303 unwind label %320

303:                                              ; preds = %302
  call void @llvm.lifetime.start.p0(i64 32, ptr %33) #9
  %304 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %33, i32 0, i32 0
  %305 = getelementptr inbounds %"class.basisu::vector.8", ptr %304, i64 2
  br label %306

306:                                              ; preds = %308, %303
  %307 = phi ptr [ %304, %303 ], [ %309, %308 ]
  invoke void @_ZN6basisu6vectorIhEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %307)
          to label %308 unwind label %324

308:                                              ; preds = %306
  %309 = getelementptr inbounds %"class.basisu::vector.8", ptr %307, i64 1
  %310 = icmp eq ptr %309, %305
  br i1 %310, label %311, label %306

311:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  store i32 0, ptr %34, align 4, !tbaa !9
  br label %312

312:                                              ; preds = %446, %311
  %313 = load i32, ptr %34, align 4, !tbaa !9
  %314 = icmp ult i32 %313, 2
  br i1 %314, label %334, label %315

315:                                              ; preds = %312
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  br label %452

316:                                              ; preds = %297
  %317 = landingpad { ptr, i32 }
          cleanup
  %318 = extractvalue { ptr, i32 } %317, 0
  store ptr %318, ptr %14, align 8
  %319 = extractvalue { ptr, i32 } %317, 1
  store i32 %319, ptr %15, align 4
  br label %746

320:                                              ; preds = %302
  %321 = landingpad { ptr, i32 }
          cleanup
  %322 = extractvalue { ptr, i32 } %321, 0
  store ptr %322, ptr %14, align 8
  %323 = extractvalue { ptr, i32 } %321, 1
  store i32 %323, ptr %15, align 4
  br label %745

324:                                              ; preds = %306
  %325 = landingpad { ptr, i32 }
          cleanup
  %326 = extractvalue { ptr, i32 } %325, 0
  store ptr %326, ptr %14, align 8
  %327 = extractvalue { ptr, i32 } %325, 1
  store i32 %327, ptr %15, align 4
  %328 = icmp eq ptr %304, %307
  br i1 %328, label %333, label %329

329:                                              ; preds = %329, %324
  %330 = phi ptr [ %307, %324 ], [ %331, %329 ]
  %331 = getelementptr inbounds %"class.basisu::vector.8", ptr %330, i64 -1
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %331) #9
  %332 = icmp eq ptr %331, %304
  br i1 %332, label %333, label %329

333:                                              ; preds = %329, %324
  br label %744

334:                                              ; preds = %312
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  %335 = load i32, ptr %34, align 4, !tbaa !9
  %336 = zext i32 %335 to i64
  %337 = getelementptr inbounds [2 x %"class.basisu::vector.87"], ptr %13, i64 0, i64 %336
  %338 = invoke noundef i32 @_ZNK6basisu6vectorINS_10color_rgbaEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %337)
          to label %339 unwind label %343

339:                                              ; preds = %334
  store i32 %338, ptr %35, align 4, !tbaa !9
  %340 = load i32, ptr %35, align 4, !tbaa !9
  %341 = icmp ne i32 %340, 0
  br i1 %341, label %347, label %342

342:                                              ; preds = %339
  store i32 16, ptr %10, align 4
  br label %443

343:                                              ; preds = %334
  %344 = landingpad { ptr, i32 }
          cleanup
  %345 = extractvalue { ptr, i32 } %344, 0
  store ptr %345, ptr %14, align 8
  %346 = extractvalue { ptr, i32 } %344, 1
  store i32 %346, ptr %15, align 4
  br label %451

347:                                              ; preds = %339
  %348 = load i32, ptr %35, align 4, !tbaa !9
  %349 = udiv i32 %348, 8
  %350 = load i32, ptr %8, align 4, !tbaa !9
  %351 = add i32 %350, %349
  store i32 %351, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 384, ptr %36) #9
  invoke void @_ZN6basisu14etc1_optimizerC2Ev(ptr noundef nonnull align 8 dereferenceable(384) %36)
          to label %352 unwind label %414

352:                                              ; preds = %347
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #9
  %353 = getelementptr inbounds [2 x %"struct.basisu::etc1_solution_coordinates"], ptr %37, i32 0, i32 0
  %354 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %353, i64 2
  br label %355

355:                                              ; preds = %357, %352
  %356 = phi ptr [ %353, %352 ], [ %358, %357 ]
  invoke void @_ZN6basisu25etc1_solution_coordinatesC2Ev(ptr noundef nonnull align 4 dereferenceable(9) %356)
          to label %357 unwind label %418

357:                                              ; preds = %355
  %358 = getelementptr inbounds %"struct.basisu::etc1_solution_coordinates", ptr %356, i64 1
  %359 = icmp eq ptr %358, %354
  br i1 %359, label %360, label %355

360:                                              ; preds = %357
  call void @llvm.lifetime.start.p0(i64 64, ptr %38) #9
  invoke void @_ZN6basisu14etc1_optimizer6paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(64) %38)
          to label %361 unwind label %422

361:                                              ; preds = %360
  %362 = load i32, ptr %35, align 4, !tbaa !9
  %363 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %38, i32 0, i32 1
  store i32 %362, ptr %363, align 4, !tbaa !46
  %364 = load i32, ptr %34, align 4, !tbaa !9
  %365 = zext i32 %364 to i64
  %366 = getelementptr inbounds [2 x %"class.basisu::vector.87"], ptr %13, i64 0, i64 %365
  %367 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu6vectorINS_10color_rgbaEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %366, i64 noundef 0)
          to label %368 unwind label %422

368:                                              ; preds = %361
  %369 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %38, i32 0, i32 2
  store ptr %367, ptr %369, align 8, !tbaa !51
  %370 = load i32, ptr %34, align 4, !tbaa !9
  %371 = icmp ne i32 %370, 0
  %372 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %38, i32 0, i32 3
  %373 = zext i1 %371 to i8
  store i8 %373, ptr %372, align 8, !tbaa !52
  %374 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 0
  %375 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %374, i32 0, i32 5
  %376 = load i8, ptr %375, align 4, !tbaa !37, !range !35, !noundef !36
  %377 = trunc i8 %376 to i1
  %378 = getelementptr inbounds %"struct.basisu::basis_etc1_pack_params", ptr %38, i32 0, i32 1
  %379 = zext i1 %377 to i8
  store i8 %379, ptr %378, align 4, !tbaa !53
  %380 = load i32, ptr %34, align 4, !tbaa !9
  %381 = zext i32 %380 to i64
  %382 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %16, i64 0, i64 %381
  %383 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %382, i64 noundef 0)
          to label %384 unwind label %422

384:                                              ; preds = %368
  %385 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %38, i32 0, i32 9
  store ptr %383, ptr %385, align 8, !tbaa !54
  %386 = getelementptr inbounds %"struct.basisu::basis_etc1_pack_params", ptr %38, i32 0, i32 0
  store i32 3, ptr %386, align 8, !tbaa !55
  %387 = load i32, ptr %34, align 4, !tbaa !9
  %388 = zext i32 %387 to i64
  %389 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %33, i64 0, i64 %388
  %390 = load i32, ptr %35, align 4, !tbaa !9
  %391 = zext i32 %390 to i64
  invoke void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %389, i64 noundef %391, i1 noundef zeroext false)
          to label %392 unwind label %422

392:                                              ; preds = %384
  %393 = load i32, ptr %35, align 4, !tbaa !9
  %394 = load i32, ptr %34, align 4, !tbaa !9
  %395 = zext i32 %394 to i64
  %396 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 %395
  %397 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %396, i32 0, i32 3
  store i32 %393, ptr %397, align 8, !tbaa !56
  %398 = load i32, ptr %34, align 4, !tbaa !9
  %399 = zext i32 %398 to i64
  %400 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %33, i64 0, i64 %399
  %401 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %400, i64 noundef 0)
          to label %402 unwind label %422

402:                                              ; preds = %392
  %403 = load i32, ptr %34, align 4, !tbaa !9
  %404 = zext i32 %403 to i64
  %405 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 %404
  %406 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %405, i32 0, i32 5
  store ptr %401, ptr %406, align 8, !tbaa !58
  %407 = load i32, ptr %34, align 4, !tbaa !9
  %408 = zext i32 %407 to i64
  %409 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 %408
  invoke void @_ZN6basisu14etc1_optimizer4initERKNS0_6paramsERNS0_7resultsE(ptr noundef nonnull align 8 dereferenceable(384) %36, ptr noundef nonnull align 8 dereferenceable(64) %38, ptr noundef nonnull align 8 dereferenceable(33) %409)
          to label %410 unwind label %422

410:                                              ; preds = %402
  %411 = invoke noundef zeroext i1 @_ZN6basisu14etc1_optimizer7computeEv(ptr noundef nonnull align 8 dereferenceable(384) %36)
          to label %412 unwind label %422

412:                                              ; preds = %410
  br i1 %411, label %426, label %413

413:                                              ; preds = %412
  store i32 16, ptr %10, align 4
  br label %442

414:                                              ; preds = %347
  %415 = landingpad { ptr, i32 }
          cleanup
  %416 = extractvalue { ptr, i32 } %415, 0
  store ptr %416, ptr %14, align 8
  %417 = extractvalue { ptr, i32 } %415, 1
  store i32 %417, ptr %15, align 4
  br label %450

418:                                              ; preds = %355
  %419 = landingpad { ptr, i32 }
          cleanup
  %420 = extractvalue { ptr, i32 } %419, 0
  store ptr %420, ptr %14, align 8
  %421 = extractvalue { ptr, i32 } %419, 1
  store i32 %421, ptr %15, align 4
  br label %449

422:                                              ; preds = %410, %402, %392, %384, %368, %361, %360
  %423 = landingpad { ptr, i32 }
          cleanup
  %424 = extractvalue { ptr, i32 } %423, 0
  store ptr %424, ptr %14, align 8
  %425 = extractvalue { ptr, i32 } %423, 1
  store i32 %425, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %38) #9
  br label %449

426:                                              ; preds = %412
  %427 = load i32, ptr %34, align 4, !tbaa !9
  %428 = zext i32 %427 to i64
  %429 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 %428
  %430 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %429, i32 0, i32 0
  %431 = load i64, ptr %430, align 8, !tbaa !59
  %432 = load i32, ptr %34, align 4, !tbaa !9
  %433 = zext i32 %432 to i64
  %434 = getelementptr inbounds [2 x i64], ptr %17, i64 0, i64 %433
  %435 = load i64, ptr %434, align 8, !tbaa !38
  %436 = icmp ult i64 %431, %435
  br i1 %436, label %437, label %441

437:                                              ; preds = %426
  %438 = load i32, ptr %34, align 4, !tbaa !9
  %439 = zext i32 %438 to i64
  %440 = getelementptr inbounds [2 x i8], ptr %32, i64 0, i64 %439
  store i8 1, ptr %440, align 1, !tbaa !34
  br label %441

441:                                              ; preds = %437, %426
  store i32 0, ptr %10, align 4
  br label %442

442:                                              ; preds = %441, %413
  call void @llvm.lifetime.end.p0(i64 64, ptr %38) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #9
  call void @_ZN6basisu14etc1_optimizerD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %36) #9
  call void @llvm.lifetime.end.p0(i64 384, ptr %36) #9
  br label %443

443:                                              ; preds = %442, %342
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  %444 = load i32, ptr %10, align 4
  switch i32 %444, label %785 [
    i32 0, label %445
    i32 16, label %446
  ]

445:                                              ; preds = %443
  br label %446

446:                                              ; preds = %445, %443
  %447 = load i32, ptr %34, align 4, !tbaa !9
  %448 = add i32 %447, 1
  store i32 %448, ptr %34, align 4, !tbaa !9
  br label %312, !llvm.loop !60

449:                                              ; preds = %422, %418
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #9
  call void @_ZN6basisu14etc1_optimizerD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %36) #9
  br label %450

450:                                              ; preds = %449, %414
  call void @llvm.lifetime.end.p0(i64 384, ptr %36) #9
  br label %451

451:                                              ; preds = %450, %343
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  br label %736

452:                                              ; preds = %315
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #9
  store i32 0, ptr %39, align 4, !tbaa !9
  br label %453

453:                                              ; preds = %708, %452
  %454 = load i32, ptr %39, align 4, !tbaa !9
  %455 = icmp ult i32 %454, 2
  br i1 %455, label %457, label %456

456:                                              ; preds = %453
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %711

457:                                              ; preds = %453
  %458 = load i32, ptr %39, align 4, !tbaa !9
  %459 = zext i32 %458 to i64
  %460 = getelementptr inbounds [2 x i8], ptr %32, i64 0, i64 %459
  %461 = load i8, ptr %460, align 1, !tbaa !34, !range !35, !noundef !36
  %462 = trunc i8 %461 to i1
  br i1 %462, label %464, label %463

463:                                              ; preds = %457
  br label %708

464:                                              ; preds = %457
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  %465 = load i32, ptr %39, align 4, !tbaa !9
  %466 = icmp ne i32 %465, 0
  %467 = zext i1 %466 to i64
  %468 = select i1 %466, i32 1, i32 2
  store i32 %468, ptr %40, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %41) #9
  store i8 1, ptr %41, align 1, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  store i32 0, ptr %42, align 4, !tbaa !9
  br label %469

469:                                              ; preds = %704, %464
  %470 = load i32, ptr %42, align 4, !tbaa !9
  %471 = load i32, ptr %40, align 4, !tbaa !9
  %472 = icmp ult i32 %470, %471
  br i1 %472, label %474, label %473

473:                                              ; preds = %469
  store i32 20, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  br label %707

474:                                              ; preds = %469
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #9
  store i32 0, ptr %43, align 4, !tbaa !9
  br label %475

475:                                              ; preds = %696, %474
  %476 = load i32, ptr %43, align 4, !tbaa !9
  %477 = load ptr, ptr %12, align 8, !tbaa !5
  %478 = invoke noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %477)
          to label %479 unwind label %482

479:                                              ; preds = %475
  %480 = icmp ult i32 %476, %478
  br i1 %480, label %486, label %481

481:                                              ; preds = %479
  store i32 23, ptr %10, align 4
  br label %701

482:                                              ; preds = %475
  %483 = landingpad { ptr, i32 }
          cleanup
  %484 = extractvalue { ptr, i32 } %483, 0
  store ptr %484, ptr %14, align 8
  %485 = extractvalue { ptr, i32 } %483, 1
  store i32 %485, ptr %15, align 4
  br label %702

486:                                              ; preds = %479
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #9
  %487 = load ptr, ptr %12, align 8, !tbaa !5
  %488 = load i32, ptr %43, align 4, !tbaa !9
  %489 = zext i32 %488 to i64
  %490 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %487, i64 noundef %489)
          to label %491 unwind label %512

491:                                              ; preds = %486
  %492 = load i32, ptr %490, align 4, !tbaa !9
  store i32 %492, ptr %44, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #9
  %493 = load i32, ptr %44, align 4, !tbaa !9
  %494 = lshr i32 %493, 1
  store i32 %494, ptr %45, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #9
  %495 = load i32, ptr %44, align 4, !tbaa !9
  %496 = and i32 %495, 1
  store i32 %496, ptr %46, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #9
  %497 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 9
  %498 = load i32, ptr %45, align 4, !tbaa !9
  %499 = zext i32 %498 to i64
  %500 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %497, i64 noundef %499)
          to label %501 unwind label %516

501:                                              ; preds = %491
  store ptr %500, ptr %47, align 8, !tbaa !5
  %502 = load ptr, ptr %47, align 8, !tbaa !5
  %503 = invoke noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %502)
          to label %504 unwind label %516

504:                                              ; preds = %501
  %505 = xor i1 %503, true
  %506 = zext i1 %505 to i32
  %507 = load i32, ptr %39, align 4, !tbaa !9
  %508 = icmp ne i32 %507, 0
  %509 = zext i1 %508 to i32
  %510 = icmp ne i32 %506, %509
  br i1 %510, label %511, label %520

511:                                              ; preds = %504
  store i32 25, ptr %10, align 4
  br label %693

512:                                              ; preds = %486
  %513 = landingpad { ptr, i32 }
          cleanup
  %514 = extractvalue { ptr, i32 } %513, 0
  store ptr %514, ptr %14, align 8
  %515 = extractvalue { ptr, i32 } %513, 1
  store i32 %515, ptr %15, align 4
  br label %700

516:                                              ; preds = %530, %529, %523, %501, %491
  %517 = landingpad { ptr, i32 }
          cleanup
  %518 = extractvalue { ptr, i32 } %517, 0
  store ptr %518, ptr %14, align 8
  %519 = extractvalue { ptr, i32 } %517, 1
  store i32 %519, ptr %15, align 4
  br label %699

520:                                              ; preds = %504
  %521 = load i32, ptr %39, align 4, !tbaa !9
  %522 = icmp ne i32 %521, 0
  br i1 %522, label %523, label %556

523:                                              ; preds = %520
  %524 = load ptr, ptr %47, align 8, !tbaa !5
  %525 = load i32, ptr %46, align 4, !tbaa !9
  %526 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 1
  %527 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %526, i32 0, i32 1
  %528 = invoke noundef zeroext i16 @_ZN6basisu9etc_block11pack_color4ERKNS_10color_rgbaEbj(ptr noundef nonnull align 1 dereferenceable(4) %527, i1 noundef zeroext false, i32 noundef 127)
          to label %529 unwind label %516

529:                                              ; preds = %523
  invoke void @_ZN6basisu9etc_block15set_base4_colorEjt(ptr noundef nonnull align 8 dereferenceable(8) %524, i32 noundef %525, i16 noundef zeroext %528)
          to label %530 unwind label %516

530:                                              ; preds = %529
  %531 = load ptr, ptr %47, align 8, !tbaa !5
  %532 = load i32, ptr %46, align 4, !tbaa !9
  %533 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 1
  %534 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %533, i32 0, i32 2
  %535 = load i32, ptr %534, align 4, !tbaa !61
  invoke void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %531, i32 noundef %532, i32 noundef %535)
          to label %536 unwind label %516

536:                                              ; preds = %530
  %537 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 1
  %538 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %537, i32 0, i32 0
  %539 = load i64, ptr %538, align 8, !tbaa !59
  %540 = load ptr, ptr %11, align 8, !tbaa !5
  %541 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %540, i32 0, i32 2
  %542 = getelementptr inbounds [2 x i64], ptr %541, i64 0, i64 1
  store i64 %539, ptr %542, align 8, !tbaa !38
  %543 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 1
  %544 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %543, i32 0, i32 2
  %545 = load i32, ptr %544, align 4, !tbaa !61
  %546 = load ptr, ptr %11, align 8, !tbaa !5
  %547 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %546, i32 0, i32 1
  %548 = getelementptr inbounds [2 x i32], ptr %547, i64 0, i64 1
  store i32 %545, ptr %548, align 4, !tbaa !9
  %549 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 1
  %550 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %549, i32 0, i32 1
  %551 = load ptr, ptr %11, align 8, !tbaa !5
  %552 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %551, i32 0, i32 0
  %553 = getelementptr inbounds [2 x %"class.basisu::color_rgba"], ptr %552, i64 0, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %553, ptr align 8 %550, i64 4, i1 false), !tbaa.struct !62
  %554 = load i32, ptr %7, align 4, !tbaa !9
  %555 = add i32 %554, 1
  store i32 %555, ptr %7, align 4, !tbaa !9
  br label %692

556:                                              ; preds = %520
  call void @llvm.lifetime.start.p0(i64 2, ptr %48) #9
  %557 = load ptr, ptr %47, align 8, !tbaa !5
  %558 = invoke noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %557)
          to label %559 unwind label %580

559:                                              ; preds = %556
  store i16 %558, ptr %48, align 2, !tbaa !63
  call void @llvm.lifetime.start.p0(i64 2, ptr %49) #9
  %560 = load ptr, ptr %47, align 8, !tbaa !5
  %561 = invoke noundef zeroext i16 @_ZNK6basisu9etc_block16get_delta3_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %560)
          to label %562 unwind label %584

562:                                              ; preds = %559
  store i16 %561, ptr %49, align 2, !tbaa !63
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #9
  %563 = getelementptr inbounds [2 x i32], ptr %50, i64 0, i64 0
  %564 = getelementptr inbounds [2 x i32], ptr %51, i64 0, i64 0
  %565 = getelementptr inbounds [2 x i32], ptr %52, i64 0, i64 0
  %566 = load i16, ptr %48, align 2, !tbaa !63
  invoke void @_ZN6basisu9etc_block13unpack_color5ERjS1_S1_tb(ptr noundef nonnull align 4 dereferenceable(4) %563, ptr noundef nonnull align 4 dereferenceable(4) %564, ptr noundef nonnull align 4 dereferenceable(4) %565, i16 noundef zeroext %566, i1 noundef zeroext false)
          to label %567 unwind label %588

567:                                              ; preds = %562
  call void @llvm.lifetime.start.p0(i64 1, ptr %53) #9
  %568 = getelementptr inbounds [2 x i32], ptr %50, i64 0, i64 1
  %569 = getelementptr inbounds [2 x i32], ptr %51, i64 0, i64 1
  %570 = getelementptr inbounds [2 x i32], ptr %52, i64 0, i64 1
  %571 = load i16, ptr %48, align 2, !tbaa !63
  %572 = load i16, ptr %49, align 2, !tbaa !63
  %573 = invoke noundef zeroext i1 @_ZN6basisu9etc_block13unpack_color5ERjS1_S1_ttbj(ptr noundef nonnull align 4 dereferenceable(4) %568, ptr noundef nonnull align 4 dereferenceable(4) %569, ptr noundef nonnull align 4 dereferenceable(4) %570, i16 noundef zeroext %571, i16 noundef zeroext %572, i1 noundef zeroext false, i32 noundef 255)
          to label %574 unwind label %592

574:                                              ; preds = %567
  %575 = zext i1 %573 to i8
  store i8 %575, ptr %53, align 1, !tbaa !34
  %576 = load i8, ptr %53, align 1, !tbaa !34, !range !35, !noundef !36
  %577 = trunc i8 %576 to i1
  br i1 %577, label %578, label %579

578:                                              ; preds = %574
  br label %597

579:                                              ; preds = %574
  call void @__assert_fail(ptr noundef @.str.45, ptr noundef @.str.4, i32 noundef 2491, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu15basisu_frontend38refine_block_endpoints_given_selectorsEv) #10
  unreachable

580:                                              ; preds = %556
  %581 = landingpad { ptr, i32 }
          cleanup
  %582 = extractvalue { ptr, i32 } %581, 0
  store ptr %582, ptr %14, align 8
  %583 = extractvalue { ptr, i32 } %581, 1
  store i32 %583, ptr %15, align 4
  br label %691

584:                                              ; preds = %559
  %585 = landingpad { ptr, i32 }
          cleanup
  %586 = extractvalue { ptr, i32 } %585, 0
  store ptr %586, ptr %14, align 8
  %587 = extractvalue { ptr, i32 } %585, 1
  store i32 %587, ptr %15, align 4
  br label %690

588:                                              ; preds = %562
  %589 = landingpad { ptr, i32 }
          cleanup
  %590 = extractvalue { ptr, i32 } %589, 0
  store ptr %590, ptr %14, align 8
  %591 = extractvalue { ptr, i32 } %589, 1
  store i32 %591, ptr %15, align 4
  br label %689

592:                                              ; preds = %567
  %593 = landingpad { ptr, i32 }
          cleanup
  %594 = extractvalue { ptr, i32 } %593, 0
  store ptr %594, ptr %14, align 8
  %595 = extractvalue { ptr, i32 } %593, 1
  store i32 %595, ptr %15, align 4
  br label %688

596:                                              ; No predecessors!
  br label %597

597:                                              ; preds = %596, %578
  %598 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 0
  %599 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %598, i32 0, i32 1
  %600 = getelementptr inbounds %"class.basisu::color_rgba", ptr %599, i32 0, i32 0
  %601 = getelementptr inbounds %struct.anon, ptr %600, i32 0, i32 0
  %602 = load i8, ptr %601, align 8, !tbaa !43
  %603 = zext i8 %602 to i32
  %604 = load i32, ptr %46, align 4, !tbaa !9
  %605 = zext i32 %604 to i64
  %606 = getelementptr inbounds [2 x i32], ptr %50, i64 0, i64 %605
  store i32 %603, ptr %606, align 4, !tbaa !9
  %607 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 0
  %608 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %607, i32 0, i32 1
  %609 = getelementptr inbounds %"class.basisu::color_rgba", ptr %608, i32 0, i32 0
  %610 = getelementptr inbounds %struct.anon, ptr %609, i32 0, i32 1
  %611 = load i8, ptr %610, align 1, !tbaa !43
  %612 = zext i8 %611 to i32
  %613 = load i32, ptr %46, align 4, !tbaa !9
  %614 = zext i32 %613 to i64
  %615 = getelementptr inbounds [2 x i32], ptr %51, i64 0, i64 %614
  store i32 %612, ptr %615, align 4, !tbaa !9
  %616 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 0
  %617 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %616, i32 0, i32 1
  %618 = getelementptr inbounds %"class.basisu::color_rgba", ptr %617, i32 0, i32 0
  %619 = getelementptr inbounds %struct.anon, ptr %618, i32 0, i32 2
  %620 = load i8, ptr %619, align 2, !tbaa !43
  %621 = zext i8 %620 to i32
  %622 = load i32, ptr %46, align 4, !tbaa !9
  %623 = zext i32 %622 to i64
  %624 = getelementptr inbounds [2 x i32], ptr %52, i64 0, i64 %623
  store i32 %621, ptr %624, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #9
  %625 = getelementptr inbounds [2 x i32], ptr %50, i64 0, i64 0
  %626 = load i32, ptr %625, align 4, !tbaa !9
  %627 = getelementptr inbounds [2 x i32], ptr %51, i64 0, i64 0
  %628 = load i32, ptr %627, align 4, !tbaa !9
  %629 = getelementptr inbounds [2 x i32], ptr %52, i64 0, i64 0
  %630 = load i32, ptr %629, align 4, !tbaa !9
  invoke void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %54, i32 noundef %626, i32 noundef %628, i32 noundef %630, i32 noundef 255)
          to label %631 unwind label %644

631:                                              ; preds = %597
  %632 = getelementptr inbounds %"class.basisu::color_rgba", ptr %54, i64 1
  %633 = getelementptr inbounds [2 x i32], ptr %50, i64 0, i64 1
  %634 = load i32, ptr %633, align 4, !tbaa !9
  %635 = getelementptr inbounds [2 x i32], ptr %51, i64 0, i64 1
  %636 = load i32, ptr %635, align 4, !tbaa !9
  %637 = getelementptr inbounds [2 x i32], ptr %52, i64 0, i64 1
  %638 = load i32, ptr %637, align 4, !tbaa !9
  invoke void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %632, i32 noundef %634, i32 noundef %636, i32 noundef %638, i32 noundef 255)
          to label %639 unwind label %644

639:                                              ; preds = %631
  %640 = getelementptr inbounds [2 x %"class.basisu::color_rgba"], ptr %54, i64 0, i64 0
  %641 = invoke noundef zeroext i1 @_ZN6basisu9etc_block22try_pack_color5_delta3EPKNS_10color_rgbaE(ptr noundef %640)
          to label %642 unwind label %644

642:                                              ; preds = %639
  br i1 %641, label %648, label %643

643:                                              ; preds = %642
  store i8 0, ptr %41, align 1, !tbaa !34
  store i32 23, ptr %10, align 4
  br label %685

644:                                              ; preds = %658, %654, %639, %631, %597
  %645 = landingpad { ptr, i32 }
          cleanup
  %646 = extractvalue { ptr, i32 } %645, 0
  store ptr %646, ptr %14, align 8
  %647 = extractvalue { ptr, i32 } %645, 1
  store i32 %647, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #9
  br label %688

648:                                              ; preds = %642
  %649 = load i32, ptr %42, align 4, !tbaa !9
  %650 = icmp eq i32 %649, 1
  br i1 %650, label %651, label %684

651:                                              ; preds = %648
  %652 = load i8, ptr %41, align 1, !tbaa !34, !range !35, !noundef !36
  %653 = trunc i8 %652 to i1
  br i1 %653, label %654, label %684

654:                                              ; preds = %651
  %655 = load ptr, ptr %47, align 8, !tbaa !5
  %656 = getelementptr inbounds [2 x %"class.basisu::color_rgba"], ptr %54, i64 0, i64 0
  %657 = getelementptr inbounds [2 x %"class.basisu::color_rgba"], ptr %54, i64 0, i64 1
  invoke void @_ZN6basisu9etc_block16set_block_color5ERKNS_10color_rgbaES3_(ptr noundef nonnull align 8 dereferenceable(8) %655, ptr noundef nonnull align 1 dereferenceable(4) %656, ptr noundef nonnull align 1 dereferenceable(4) %657)
          to label %658 unwind label %644

658:                                              ; preds = %654
  %659 = load ptr, ptr %47, align 8, !tbaa !5
  %660 = load i32, ptr %46, align 4, !tbaa !9
  %661 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 0
  %662 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %661, i32 0, i32 2
  %663 = load i32, ptr %662, align 4, !tbaa !61
  invoke void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %659, i32 noundef %660, i32 noundef %663)
          to label %664 unwind label %644

664:                                              ; preds = %658
  %665 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 0
  %666 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %665, i32 0, i32 0
  %667 = load i64, ptr %666, align 16, !tbaa !59
  %668 = load ptr, ptr %11, align 8, !tbaa !5
  %669 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %668, i32 0, i32 2
  %670 = getelementptr inbounds [2 x i64], ptr %669, i64 0, i64 0
  store i64 %667, ptr %670, align 8, !tbaa !38
  %671 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 0
  %672 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %671, i32 0, i32 2
  %673 = load i32, ptr %672, align 4, !tbaa !61
  %674 = load ptr, ptr %11, align 8, !tbaa !5
  %675 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %674, i32 0, i32 1
  %676 = getelementptr inbounds [2 x i32], ptr %675, i64 0, i64 0
  store i32 %673, ptr %676, align 8, !tbaa !9
  %677 = getelementptr inbounds [2 x %"struct.basisu::etc1_optimizer::results"], ptr %31, i64 0, i64 0
  %678 = getelementptr inbounds %"struct.basisu::etc1_optimizer::results", ptr %677, i32 0, i32 1
  %679 = load ptr, ptr %11, align 8, !tbaa !5
  %680 = getelementptr inbounds %"struct.basisu::basisu_frontend::endpoint_cluster_etc_params", ptr %679, i32 0, i32 0
  %681 = getelementptr inbounds [2 x %"class.basisu::color_rgba"], ptr %680, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %681, ptr align 8 %678, i64 4, i1 false), !tbaa.struct !62
  %682 = load i32, ptr %7, align 4, !tbaa !9
  %683 = add i32 %682, 1
  store i32 %683, ptr %7, align 4, !tbaa !9
  br label %684

684:                                              ; preds = %664, %651, %648
  store i32 0, ptr %10, align 4
  br label %685

685:                                              ; preds = %684, %643
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %53) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #9
  call void @llvm.lifetime.end.p0(i64 2, ptr %49) #9
  call void @llvm.lifetime.end.p0(i64 2, ptr %48) #9
  %686 = load i32, ptr %10, align 4
  switch i32 %686, label %693 [
    i32 0, label %687
  ]

687:                                              ; preds = %685
  br label %692

688:                                              ; preds = %644, %592
  call void @llvm.lifetime.end.p0(i64 1, ptr %53) #9
  br label %689

689:                                              ; preds = %688, %588
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #9
  br label %690

690:                                              ; preds = %689, %584
  call void @llvm.lifetime.end.p0(i64 2, ptr %49) #9
  br label %691

691:                                              ; preds = %690, %580
  call void @llvm.lifetime.end.p0(i64 2, ptr %48) #9
  br label %699

692:                                              ; preds = %687, %536
  store i32 0, ptr %10, align 4
  br label %693

693:                                              ; preds = %692, %685, %511
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  %694 = load i32, ptr %10, align 4
  switch i32 %694, label %701 [
    i32 0, label %695
    i32 25, label %696
  ]

695:                                              ; preds = %693
  br label %696

696:                                              ; preds = %695, %693
  %697 = load i32, ptr %43, align 4, !tbaa !9
  %698 = add i32 %697, 1
  store i32 %698, ptr %43, align 4, !tbaa !9
  br label %475, !llvm.loop !65

699:                                              ; preds = %691, %516
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #9
  br label %700

700:                                              ; preds = %699, %512
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  br label %702

701:                                              ; preds = %693, %481
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  br label %703

702:                                              ; preds = %700, %482
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %41) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %736

703:                                              ; preds = %701
  br label %704

704:                                              ; preds = %703
  %705 = load i32, ptr %42, align 4, !tbaa !9
  %706 = add i32 %705, 1
  store i32 %706, ptr %42, align 4, !tbaa !9
  br label %469, !llvm.loop !66

707:                                              ; preds = %473
  call void @llvm.lifetime.end.p0(i64 1, ptr %41) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  br label %708

708:                                              ; preds = %707, %463
  %709 = load i32, ptr %39, align 4, !tbaa !9
  %710 = add i32 %709, 1
  store i32 %710, ptr %39, align 4, !tbaa !9
  br label %453, !llvm.loop !67

711:                                              ; preds = %456
  %712 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %33, i32 0, i32 0
  %713 = getelementptr inbounds %"class.basisu::vector.8", ptr %712, i64 2
  br label %714

714:                                              ; preds = %714, %711
  %715 = phi ptr [ %713, %711 ], [ %716, %714 ]
  %716 = getelementptr inbounds %"class.basisu::vector.8", ptr %715, i64 -1
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %716) #9
  %717 = icmp eq ptr %716, %712
  br i1 %717, label %718, label %714

718:                                              ; preds = %714
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 2, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #9
  %719 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %16, i32 0, i32 0
  %720 = getelementptr inbounds %"class.basisu::vector.8", ptr %719, i64 2
  br label %721

721:                                              ; preds = %721, %718
  %722 = phi ptr [ %720, %718 ], [ %723, %721 ]
  %723 = getelementptr inbounds %"class.basisu::vector.8", ptr %722, i64 -1
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %723) #9
  %724 = icmp eq ptr %723, %719
  br i1 %724, label %725, label %721

725:                                              ; preds = %721
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #9
  %726 = getelementptr inbounds [2 x %"class.basisu::vector.87"], ptr %13, i32 0, i32 0
  %727 = getelementptr inbounds %"class.basisu::vector.87", ptr %726, i64 2
  br label %728

728:                                              ; preds = %728, %725
  %729 = phi ptr [ %727, %725 ], [ %730, %728 ]
  %730 = getelementptr inbounds %"class.basisu::vector.87", ptr %729, i64 -1
  call void @_ZN6basisu6vectorINS_10color_rgbaEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %730) #9
  %731 = icmp eq ptr %730, %726
  br i1 %731, label %732, label %728

732:                                              ; preds = %728
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %733

733:                                              ; preds = %732
  %734 = load i32, ptr %9, align 4, !tbaa !9
  %735 = add i32 %734, 1
  store i32 %735, ptr %9, align 4, !tbaa !9
  br label %90, !llvm.loop !68

736:                                              ; preds = %702, %451
  %737 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %33, i32 0, i32 0
  %738 = getelementptr inbounds %"class.basisu::vector.8", ptr %737, i64 2
  br label %739

739:                                              ; preds = %739, %736
  %740 = phi ptr [ %738, %736 ], [ %741, %739 ]
  %741 = getelementptr inbounds %"class.basisu::vector.8", ptr %740, i64 -1
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %741) #9
  %742 = icmp eq ptr %741, %737
  br i1 %742, label %743, label %739

743:                                              ; preds = %739
  br label %744

744:                                              ; preds = %743, %333
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #9
  br label %745

745:                                              ; preds = %744, %320
  call void @llvm.lifetime.end.p0(i64 2, ptr %32) #9
  br label %746

746:                                              ; preds = %745, %316
  call void @llvm.lifetime.end.p0(i64 80, ptr %31) #9
  br label %747

747:                                              ; preds = %746, %293
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #9
  %748 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %16, i32 0, i32 0
  %749 = getelementptr inbounds %"class.basisu::vector.8", ptr %748, i64 2
  br label %750

750:                                              ; preds = %750, %747
  %751 = phi ptr [ %749, %747 ], [ %752, %750 ]
  %752 = getelementptr inbounds %"class.basisu::vector.8", ptr %751, i64 -1
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %752) #9
  %753 = icmp eq ptr %752, %748
  br i1 %753, label %754, label %750

754:                                              ; preds = %750
  br label %755

755:                                              ; preds = %754, %145
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #9
  %756 = getelementptr inbounds [2 x %"class.basisu::vector.87"], ptr %13, i32 0, i32 0
  %757 = getelementptr inbounds %"class.basisu::vector.87", ptr %756, i64 2
  br label %758

758:                                              ; preds = %758, %755
  %759 = phi ptr [ %757, %755 ], [ %760, %758 ]
  %760 = getelementptr inbounds %"class.basisu::vector.87", ptr %759, i64 -1
  call void @_ZN6basisu6vectorINS_10color_rgbaEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %760) #9
  %761 = icmp eq ptr %760, %756
  br i1 %761, label %762, label %758

762:                                              ; preds = %758
  br label %763

763:                                              ; preds = %762, %135
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %780

764:                                              ; preds = %95
  %765 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %55, i32 0, i32 0
  %766 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %765, i32 0, i32 6
  %767 = load i8, ptr %766, align 1, !tbaa !69, !range !35, !noundef !36
  %768 = trunc i8 %767 to i1
  br i1 %768, label %769, label %778

769:                                              ; preds = %764
  %770 = load i32, ptr %7, align 4, !tbaa !9
  %771 = load i32, ptr %7, align 4, !tbaa !9
  %772 = uitofp i32 %771 to float
  %773 = fmul float %772, 1.000000e+02
  %774 = load i32, ptr %8, align 4, !tbaa !9
  %775 = uitofp i32 %774 to float
  %776 = fdiv float %773, %775
  %777 = fpext float %776 to double
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.46, i32 noundef %770, double noundef %777)
  br label %778

778:                                              ; preds = %769, %764
  %779 = load i32, ptr %7, align 4, !tbaa !9
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  ret i32 %779

780:                                              ; preds = %763
  %781 = load ptr, ptr %14, align 8
  %782 = load i32, ptr %15, align 4
  %783 = insertvalue { ptr, i32 } poison, ptr %781, 0
  %784 = insertvalue { ptr, i32 } %783, i32 %782, 1
  resume { ptr, i32 } %784

785:                                              ; preds = %443
  unreachable
}

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef) #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64)) #8 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext) #0 align 2

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

; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

declare noundef zeroext i1 @_ZN6basisu11unpack_etc1ERKNS_9etc_blockEPNS_10color_rgbaEb(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i1 noundef zeroext) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(4)) #0 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 uwtable
declare dso_local void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu14etc1_optimizer7resultsC2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu9clear_objIA2_NS_14etc1_optimizer7resultsEEEvRT_(ptr noundef nonnull align 8 dereferenceable(80)) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14etc1_optimizerC2Ev(ptr noundef nonnull align 8 dereferenceable(384)) unnamed_addr #7 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14etc1_optimizer6paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #7 align 2

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

declare void @_ZN6basisu14etc1_optimizer4initERKNS0_6paramsERNS0_7resultsE(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(33)) #1

declare noundef zeroext i1 @_ZN6basisu14etc1_optimizer7computeEv(ptr noundef nonnull align 8 dereferenceable(384)) #1

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

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

declare noundef zeroext i16 @_ZN6basisu9etc_block11pack_color4ERKNS_10color_rgbaEbj(ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext, i32 noundef) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK6basisu9etc_block16get_delta3_colorEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

declare void @_ZN6basisu9etc_block13unpack_color5ERjS1_S1_tb(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i16 noundef zeroext, i1 noundef zeroext) #1

declare noundef zeroext i1 @_ZN6basisu9etc_block13unpack_color5ERjS1_S1_ttbj(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i16 noundef zeroext, i16 noundef zeroext, i1 noundef zeroext, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu9etc_block22try_pack_color5_delta3EPKNS_10color_rgbaE(ptr noundef) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu9etc_block16set_block_color5ERKNS_10color_rgbaES3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4)) #7 align 2

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 88}
!12 = !{!"_ZTSN6basisu15basisu_frontendE", !13, i64 0, !10, i64 88, !10, i64 92, !14, i64 96, !14, i64 97, !14, i64 98, !10, i64 100, !10, i64 104, !17, i64 112, !18, i64 128, !18, i64 144, !18, i64 160, !19, i64 176, !22, i64 216, !22, i64 232, !23, i64 248, !22, i64 264, !24, i64 280, !25, i64 296, !22, i64 312, !18, i64 328, !22, i64 344, !23, i64 360, !22, i64 376, !26, i64 392, !27, i64 408, !28, i64 424, !29, i64 440, !30, i64 456}
!13 = !{!"_ZTSN6basisu15basisu_frontend6paramsE", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !14, i64 28, !14, i64 29, !14, i64 30, !14, i64 31, !14, i64 32, !14, i64 33, !14, i64 34, !6, i64 40, !10, i64 48, !10, i64 52, !14, i64 56, !15, i64 60, !16, i64 64, !6, i64 72, !6, i64 80}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTSN6basist18basis_texture_typeE", !7, i64 0}
!17 = !{!"_ZTSN6basisu6vectorINS_11pixel_blockEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!18 = !{!"_ZTSN6basisu6vectorINS_9etc_blockEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!19 = !{!"_ZTSN6basisu17tree_vector_quantINS_3vecILj6EfEEEE", !20, i64 0, !21, i64 16, !10, i64 32}
!20 = !{!"_ZTSN6basisu6vectorINS_17tree_vector_quantINS_3vecILj6EfEEE9tsvq_nodeEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!21 = !{!"_ZTSN6basisu6vectorISt4pairINS_3vecILj6EfEEmEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!22 = !{!"_ZTSN6basisu6vectorINS0_IjEEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!23 = !{!"_ZTSN6basisu6vectorIhEE", !6, i64 0, !10, i64 8, !10, i64 12}
!24 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!25 = !{!"_ZTSN6basisu6vectorINS_5vec2UEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!26 = !{!"_ZTSN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!27 = !{!"_ZTSN6basisu6vectorIbEE", !6, i64 0, !10, i64 8, !10, i64 12}
!28 = !{!"_ZTSN6basisu6vectorIjEE", !6, i64 0, !10, i64 8, !10, i64 12}
!29 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27subblock_endpoint_quant_errEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!30 = !{!"_ZTSSt5mutex", !31, i64 0}
!31 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!14, !14, i64 0}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = !{!12, !14, i64 28}
!38 = !{!39, !39, i64 0}
!39 = !{!"long", !7, i64 0}
!40 = !{!41, !7, i64 0}
!41 = !{!"_ZTSN6basisu10etc_coord2E", !7, i64 0, !7, i64 1}
!42 = !{!41, !7, i64 1}
!43 = !{!7, !7, i64 0}
!44 = distinct !{!44, !33}
!45 = distinct !{!45, !33}
!46 = !{!47, !10, i64 12}
!47 = !{!"_ZTSN6basisu14etc1_optimizer6paramsE", !48, i64 0, !10, i64 12, !6, i64 16, !14, i64 24, !6, i64 32, !10, i64 40, !50, i64 44, !14, i64 48, !14, i64 49, !6, i64 56}
!48 = !{!"_ZTSN6basisu22basis_etc1_pack_paramsE", !49, i64 0, !14, i64 4, !14, i64 5, !14, i64 6, !14, i64 7, !15, i64 8}
!49 = !{!"_ZTSN6basisu17basis_etc_qualityE", !7, i64 0}
!50 = !{!"_ZTSN6basisu10color_rgbaE", !7, i64 0}
!51 = !{!47, !6, i64 16}
!52 = !{!47, !14, i64 24}
!53 = !{!48, !14, i64 4}
!54 = !{!47, !6, i64 56}
!55 = !{!48, !49, i64 0}
!56 = !{!57, !10, i64 16}
!57 = !{!"_ZTSN6basisu14etc1_optimizer7resultsE", !39, i64 0, !50, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !14, i64 32}
!58 = !{!57, !6, i64 24}
!59 = !{!57, !39, i64 0}
!60 = distinct !{!60, !33}
!61 = !{!57, !10, i64 12}
!62 = !{i64 0, i64 4, !43}
!63 = !{!64, !64, i64 0}
!64 = !{!"short", !7, i64 0}
!65 = distinct !{!65, !33}
!66 = distinct !{!66, !33}
!67 = distinct !{!67, !33}
!68 = distinct !{!68, !33}
!69 = !{!12, !14, i64 29}


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

%"struct.basisu::etc_coord2" = type { i8, i8 }
%"class.basisu::vector.87" = type { ptr, i32, i32 }
%"class.basisu::vector.8" = type { ptr, i32, i32 }
%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%"struct.basisu::etc1_optimizer::results" = type <{ i64, %"class.basisu::color_rgba", i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%"class.basisu::etc1_optimizer" = type { ptr, ptr, i32, %"class.basisu::vec.90", i32, i32, i32, i32, %"class.basisu::vector.91", %"class.basisu::vector.18", %"class.basisu::vector.18", ptr, ptr, %"class.basisu::vector.8", %"class.basisu::vector.8", %"struct.basisu::etc1_optimizer::potential_solution", %"struct.basisu::etc1_optimizer::potential_solution", %"class.basisu::vector.8", [128 x i8] }
%"class.basisu::vec.90" = type { [3 x float] }
%"class.basisu::vector.91" = type { ptr, i32, i32 }
%"class.basisu::vector.18" = type { ptr, i32, i32 }
%"struct.basisu::etc1_optimizer::potential_solution" = type <{ %"struct.basisu::etc1_solution_coordinates", [4 x i8], %"class.basisu::vector.8", i64, i8, [7 x i8] }>
%"struct.basisu::etc1_solution_coordinates" = type <{ %"class.basisu::color_rgba", i32, i8, [3 x i8] }>
%"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 }

@.str.4 = external hidden unnamed_addr constant [115 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [40 x i8], align 1
@_ZN6basisu20g_etc1_pixel_indicesE = external local_unnamed_addr constant [2 x [2 x [8 x i32]]], align 16
@_ZN6basisu19g_etc1_pixel_coordsE = external local_unnamed_addr global [2 x [2 x [8 x %"struct.basisu::etc_coord2"]]], align 16
@.str.45 = external hidden unnamed_addr constant [8 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu15basisu_frontend38refine_block_endpoints_given_selectorsEv = external hidden unnamed_addr constant [75 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [48 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

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) local_unnamed_addr #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 noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6basisu15basisu_frontend38refine_block_endpoints_given_selectorsEv(ptr noundef nonnull align 8 dereferenceable(496) %0) local_unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [2 x %"class.basisu::vector.87"], align 16
  %5 = alloca [2 x %"class.basisu::vector.8"], align 16
  %6 = alloca [2 x i64], align 16
  %7 = alloca [16 x %"class.basisu::color_rgba"], align 16
  %8 = alloca i8, align 1
  %9 = alloca [2 x %"struct.basisu::etc1_optimizer::results"], align 16
  %10 = alloca [2 x i8], align 2
  %11 = alloca [2 x %"class.basisu::vector.8"], align 16
  %12 = alloca %"class.basisu::etc1_optimizer", align 8
  %13 = alloca [2 x %"struct.basisu::etc1_solution_coordinates"], align 16
  %14 = alloca %"struct.basisu::etc1_optimizer::params", align 8
  %15 = alloca [2 x i32], align 4
  %16 = alloca [2 x i32], align 4
  %17 = alloca [2 x i32], align 4
  %18 = alloca [2 x %"class.basisu::color_rgba"], align 1
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.44)
  %19 = getelementptr inbounds i8, ptr %0, i64 88
  %20 = load i32, ptr %19, align 8, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %.preheader220

.lr.ph:                                           ; preds = %1
  %22 = getelementptr inbounds i8, ptr %0, i64 296
  %23 = getelementptr inbounds i8, ptr %0, i64 280
  br label %53

.preheader220:                                    ; preds = %53, %1
  %24 = getelementptr inbounds i8, ptr %0, i64 280
  %25 = call noundef i32 @_ZNK6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
  %.not375 = icmp eq i32 %25, 0
  br i1 %.not375, label %._crit_edge372, label %.lr.ph371

.lr.ph371:                                        ; preds = %.preheader220
  %26 = getelementptr inbounds i8, ptr %0, i64 128
  %27 = getelementptr inbounds i8, ptr %0, i64 28
  %28 = getelementptr inbounds i8, ptr %14, i64 12
  %29 = getelementptr inbounds i8, ptr %14, i64 16
  %30 = getelementptr inbounds i8, ptr %14, i64 24
  %31 = getelementptr inbounds i8, ptr %14, i64 4
  %32 = getelementptr inbounds i8, ptr %14, i64 56
  %33 = getelementptr inbounds i8, ptr %9, i64 48
  %34 = getelementptr inbounds i8, ptr %9, i64 40
  %35 = getelementptr inbounds i8, ptr %9, i64 52
  %36 = getelementptr inbounds i8, ptr %15, i64 4
  %37 = getelementptr inbounds i8, ptr %16, i64 4
  %38 = getelementptr inbounds i8, ptr %17, i64 4
  %39 = getelementptr inbounds i8, ptr %9, i64 8
  %40 = getelementptr inbounds i8, ptr %9, i64 9
  %41 = getelementptr inbounds i8, ptr %9, i64 10
  %42 = getelementptr inbounds i8, ptr %18, i64 4
  %43 = getelementptr inbounds i8, ptr %9, i64 12
  %.ptr.1 = getelementptr inbounds i8, ptr %4, i64 16
  %.ptr167.1 = getelementptr inbounds i8, ptr %5, i64 16
  %.ptr195.1 = getelementptr inbounds i8, ptr %7, i64 4
  %.ptr195.2 = getelementptr inbounds i8, ptr %7, i64 8
  %.ptr195.3 = getelementptr inbounds i8, ptr %7, i64 12
  %.ptr195.4 = getelementptr inbounds i8, ptr %7, i64 16
  %.ptr195.5 = getelementptr inbounds i8, ptr %7, i64 20
  %.ptr195.6 = getelementptr inbounds i8, ptr %7, i64 24
  %.ptr195.7 = getelementptr inbounds i8, ptr %7, i64 28
  %.ptr195.8 = getelementptr inbounds i8, ptr %7, i64 32
  %.ptr195.9 = getelementptr inbounds i8, ptr %7, i64 36
  %.ptr195.10 = getelementptr inbounds i8, ptr %7, i64 40
  %.ptr195.11 = getelementptr inbounds i8, ptr %7, i64 44
  %.ptr195.12 = getelementptr inbounds i8, ptr %7, i64 48
  %.ptr195.13 = getelementptr inbounds i8, ptr %7, i64 52
  %.ptr195.14 = getelementptr inbounds i8, ptr %7, i64 56
  %.ptr195.15 = getelementptr inbounds i8, ptr %7, i64 60
  %.ptr175.1 = getelementptr inbounds i8, ptr %11, i64 16
  %.ptr186.1 = getelementptr inbounds i8, ptr %13, i64 12
  %44 = getelementptr inbounds i8, ptr %9, i64 16
  %45 = getelementptr inbounds i8, ptr %9, i64 24
  %.ptr186.1.1 = getelementptr inbounds i8, ptr %13, i64 12
  %46 = getelementptr inbounds i8, ptr %9, i64 56
  %47 = getelementptr inbounds i8, ptr %9, i64 64
  %48 = getelementptr inbounds i8, ptr %6, i64 8
  %49 = getelementptr inbounds i8, ptr %10, i64 1
  %50 = getelementptr inbounds i8, ptr %11, i64 16
  %51 = getelementptr inbounds i8, ptr %5, i64 16
  %52 = getelementptr inbounds i8, ptr %4, i64 16
  br label %76

53:                                               ; preds = %.lr.ph, %53
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %53 ]
  %54 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %22, i64 noundef %indvars.iv)
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %54, i32 noundef 0)
  %56 = load i32, ptr %55, align 4, !tbaa !30
  %57 = zext i32 %56 to i64
  %58 = call noundef nonnull align 8 dereferenceable(51) ptr @_ZN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %23, i64 noundef %57)
  %59 = getelementptr inbounds i8, ptr %58, i64 32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %60 = shl nuw nsw i64 %indvars.iv, 1
  %61 = trunc nuw i64 %60 to i32
  store i32 %61, ptr %2, align 4, !tbaa !30
  call void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %54, i32 noundef 1)
  %63 = load i32, ptr %62, align 4, !tbaa !30
  %64 = zext i32 %63 to i64
  %65 = call noundef nonnull align 8 dereferenceable(51) ptr @_ZN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %23, i64 noundef %64)
  %66 = getelementptr inbounds i8, ptr %65, i64 32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %67 = trunc i64 %60 to i32
  %68 = or disjoint i32 %67, 1
  store i32 %68, ptr %3, align 4, !tbaa !30
  call void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %69 = load i32, ptr %19, align 8, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvars.iv.next, %70
  br i1 %71, label %53, label %.preheader220, !llvm.loop !31

._crit_edge372.loopexit:                          ; preds = %.preheader217
  %72 = uitofp i32 %.2114.1 to float
  br label %._crit_edge372

._crit_edge372:                                   ; preds = %._crit_edge372.loopexit, %.preheader220
  %.0112.lcssa = phi float [ 0.000000e+00, %.preheader220 ], [ %72, %._crit_edge372.loopexit ]
  %.0111.lcssa = phi i32 [ 0, %.preheader220 ], [ %.9, %._crit_edge372.loopexit ]
  %73 = getelementptr inbounds i8, ptr %0, i64 29
  %74 = load i8, ptr %73, align 1, !tbaa !33, !range !34, !noundef !35
  %75 = trunc nuw i8 %74 to i1
  br i1 %75, label %442, label %447

76:                                               ; preds = %.lr.ph371, %.preheader217
  %indvars.iv415 = phi i64 [ 0, %.lr.ph371 ], [ %indvars.iv.next416, %.preheader217 ]
  %.0111370 = phi i32 [ 0, %.lr.ph371 ], [ %.9, %.preheader217 ]
  %.0112369 = phi i32 [ 0, %.lr.ph371 ], [ %.2114.1, %.preheader217 ]
  %77 = call noundef nonnull align 8 dereferenceable(51) ptr @_ZN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %24, i64 noundef %indvars.iv415)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @_ZN6basisu6vectorINS_10color_rgbaEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @_ZN6basisu6vectorINS_10color_rgbaEEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  call void @_ZN6basisu6vectorIhEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @_ZN6basisu6vectorIhEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr167.1)
  %78 = getelementptr inbounds i8, ptr %77, i64 32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  %79 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
  %.not376 = icmp eq i32 %79, 0
  br i1 %.not376, label %._crit_edge, label %.lr.ph311

._crit_edge:                                      ; preds = %277, %76
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %9) #8
  invoke void @_ZN6basisu14etc1_optimizer7resultsC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %9)
          to label %286 unwind label %288

.lr.ph311:                                        ; preds = %76, %277
  %indvars.iv397 = phi i64 [ %indvars.iv.next398, %277 ], [ 0, %76 ]
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %78, i64 noundef %indvars.iv397)
  %81 = load i32, ptr %80, align 4, !tbaa !30
  %82 = lshr i32 %81, 1
  %83 = and i32 %81, 1
  %84 = zext nneg i32 %82 to i64
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %26, i64 noundef %84)
  %86 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %85)
  %87 = xor i1 %86, true
  %88 = invoke noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %82)
          to label %89 unwind label %102

89:                                               ; preds = %.lr.ph311
  %90 = call noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %88)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #8
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %7)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.1)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.2)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.3)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.4)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.5)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.6)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.7)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.8)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.9)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.10)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.11)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.12)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.13)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.14)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr195.15)
  %91 = invoke noundef zeroext i1 @_ZN6basisu11unpack_etc1ERKNS_9etc_blockEPNS_10color_rgbaEb(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef nonnull %7, i1 noundef zeroext false)
          to label %.preheader216 unwind label %104

.preheader216:                                    ; preds = %89
  %92 = zext nneg i32 %83 to i64
  %93 = zext i1 %87 to i64
  %94 = getelementptr inbounds [2 x %"class.basisu::vector.87"], ptr %4, i64 0, i64 %93
  %95 = getelementptr inbounds [2 x i64], ptr %6, i64 0, i64 %93
  %96 = getelementptr inbounds [2 x %"class.basisu::vector.8"], ptr %5, i64 0, i64 %93
  %97 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 64), i64 0, i64 %92, i64 0
  %98 = load i32, ptr %97, align 16, !tbaa !30
  %99 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 32), i64 0, i64 %92, i64 0
  %100 = zext i32 %98 to i64
  %101 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i64 %100
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 1 dereferenceable(4) %101)
          to label %106 unwind label %281

102:                                              ; preds = %.lr.ph311
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %439

104:                                              ; preds = %89
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %285

106:                                              ; preds = %.preheader216
  %107 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  %108 = trunc nuw i8 %107 to i1
  %109 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %7, i64 0, i64 %100
  %110 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %108, ptr noundef nonnull align 1 dereferenceable(4) %101, ptr noundef nonnull align 1 dereferenceable(4) %109, i1 noundef zeroext false)
          to label %111 unwind label %281

111:                                              ; preds = %106
  %112 = zext i32 %110 to i64
  %113 = load i64, ptr %95, align 8, !tbaa !37
  %114 = add i64 %113, %112
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  %115 = load i8, ptr %99, align 16, !tbaa !39
  %116 = zext i8 %115 to i32
  %117 = getelementptr inbounds i8, ptr %99, i64 1
  %118 = load i8, ptr %117, align 1, !tbaa !41
  %119 = zext i8 %118 to i32
  %120 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %116, i32 noundef %119)
          to label %121 unwind label %283

121:                                              ; preds = %111
  %122 = trunc i32 %120 to i8
  store i8 %122, ptr %8, align 1, !tbaa !42
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %123 unwind label %283

123:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %124 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 64), i64 0, i64 %92, i64 1
  %125 = load i32, ptr %124, align 4, !tbaa !30
  %126 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 32), i64 0, i64 %92, i64 1
  %127 = zext i32 %125 to i64
  %128 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i64 %127
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 1 dereferenceable(4) %128)
          to label %129 unwind label %281

129:                                              ; preds = %123
  %130 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  %131 = trunc nuw i8 %130 to i1
  %132 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %7, i64 0, i64 %127
  %133 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %131, ptr noundef nonnull align 1 dereferenceable(4) %128, ptr noundef nonnull align 1 dereferenceable(4) %132, i1 noundef zeroext false)
          to label %134 unwind label %281

134:                                              ; preds = %129
  %135 = zext i32 %133 to i64
  %136 = add i64 %114, %135
  store i64 %136, ptr %95, align 8, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  %137 = load i8, ptr %126, align 2, !tbaa !39
  %138 = zext i8 %137 to i32
  %139 = getelementptr inbounds i8, ptr %126, i64 1
  %140 = load i8, ptr %139, align 1, !tbaa !41
  %141 = zext i8 %140 to i32
  %142 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %138, i32 noundef %141)
          to label %143 unwind label %283

143:                                              ; preds = %134
  %144 = trunc i32 %142 to i8
  store i8 %144, ptr %8, align 1, !tbaa !42
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %145 unwind label %283

145:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %146 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 64), i64 0, i64 %92, i64 2
  %147 = load i32, ptr %146, align 8, !tbaa !30
  %148 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 32), i64 0, i64 %92, i64 2
  %149 = zext i32 %147 to i64
  %150 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i64 %149
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 1 dereferenceable(4) %150)
          to label %151 unwind label %281

151:                                              ; preds = %145
  %152 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  %153 = trunc nuw i8 %152 to i1
  %154 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %7, i64 0, i64 %149
  %155 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %153, ptr noundef nonnull align 1 dereferenceable(4) %150, ptr noundef nonnull align 1 dereferenceable(4) %154, i1 noundef zeroext false)
          to label %156 unwind label %281

156:                                              ; preds = %151
  %157 = zext i32 %155 to i64
  %158 = add i64 %136, %157
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  %159 = load i8, ptr %148, align 4, !tbaa !39
  %160 = zext i8 %159 to i32
  %161 = getelementptr inbounds i8, ptr %148, i64 1
  %162 = load i8, ptr %161, align 1, !tbaa !41
  %163 = zext i8 %162 to i32
  %164 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %160, i32 noundef %163)
          to label %165 unwind label %283

165:                                              ; preds = %156
  %166 = trunc i32 %164 to i8
  store i8 %166, ptr %8, align 1, !tbaa !42
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %167 unwind label %283

167:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %168 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 64), i64 0, i64 %92, i64 3
  %169 = load i32, ptr %168, align 4, !tbaa !30
  %170 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 32), i64 0, i64 %92, i64 3
  %171 = zext i32 %169 to i64
  %172 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i64 %171
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 1 dereferenceable(4) %172)
          to label %173 unwind label %281

173:                                              ; preds = %167
  %174 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  %175 = trunc nuw i8 %174 to i1
  %176 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %7, i64 0, i64 %171
  %177 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %175, ptr noundef nonnull align 1 dereferenceable(4) %172, ptr noundef nonnull align 1 dereferenceable(4) %176, i1 noundef zeroext false)
          to label %178 unwind label %281

178:                                              ; preds = %173
  %179 = zext i32 %177 to i64
  %180 = add i64 %158, %179
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  %181 = load i8, ptr %170, align 2, !tbaa !39
  %182 = zext i8 %181 to i32
  %183 = getelementptr inbounds i8, ptr %170, i64 1
  %184 = load i8, ptr %183, align 1, !tbaa !41
  %185 = zext i8 %184 to i32
  %186 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %182, i32 noundef %185)
          to label %187 unwind label %283

187:                                              ; preds = %178
  %188 = trunc i32 %186 to i8
  store i8 %188, ptr %8, align 1, !tbaa !42
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %189 unwind label %283

189:                                              ; preds = %187
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %190 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 64), i64 0, i64 %92, i64 4
  %191 = load i32, ptr %190, align 16, !tbaa !30
  %192 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 32), i64 0, i64 %92, i64 4
  %193 = zext i32 %191 to i64
  %194 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i64 %193
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 1 dereferenceable(4) %194)
          to label %195 unwind label %281

195:                                              ; preds = %189
  %196 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  %197 = trunc nuw i8 %196 to i1
  %198 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %7, i64 0, i64 %193
  %199 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %197, ptr noundef nonnull align 1 dereferenceable(4) %194, ptr noundef nonnull align 1 dereferenceable(4) %198, i1 noundef zeroext false)
          to label %200 unwind label %281

200:                                              ; preds = %195
  %201 = zext i32 %199 to i64
  %202 = add i64 %180, %201
  store i64 %202, ptr %95, align 8, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  %203 = load i8, ptr %192, align 8, !tbaa !39
  %204 = zext i8 %203 to i32
  %205 = getelementptr inbounds i8, ptr %192, i64 1
  %206 = load i8, ptr %205, align 1, !tbaa !41
  %207 = zext i8 %206 to i32
  %208 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %204, i32 noundef %207)
          to label %209 unwind label %283

209:                                              ; preds = %200
  %210 = trunc i32 %208 to i8
  store i8 %210, ptr %8, align 1, !tbaa !42
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %211 unwind label %283

211:                                              ; preds = %209
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %212 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 64), i64 0, i64 %92, i64 5
  %213 = load i32, ptr %212, align 4, !tbaa !30
  %214 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 32), i64 0, i64 %92, i64 5
  %215 = zext i32 %213 to i64
  %216 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i64 %215
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 1 dereferenceable(4) %216)
          to label %217 unwind label %281

217:                                              ; preds = %211
  %218 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  %219 = trunc nuw i8 %218 to i1
  %220 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %7, i64 0, i64 %215
  %221 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %219, ptr noundef nonnull align 1 dereferenceable(4) %216, ptr noundef nonnull align 1 dereferenceable(4) %220, i1 noundef zeroext false)
          to label %222 unwind label %281

222:                                              ; preds = %217
  %223 = zext i32 %221 to i64
  %224 = add i64 %202, %223
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  %225 = load i8, ptr %214, align 2, !tbaa !39
  %226 = zext i8 %225 to i32
  %227 = getelementptr inbounds i8, ptr %214, i64 1
  %228 = load i8, ptr %227, align 1, !tbaa !41
  %229 = zext i8 %228 to i32
  %230 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %226, i32 noundef %229)
          to label %231 unwind label %283

231:                                              ; preds = %222
  %232 = trunc i32 %230 to i8
  store i8 %232, ptr %8, align 1, !tbaa !42
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %233 unwind label %283

233:                                              ; preds = %231
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %234 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 64), i64 0, i64 %92, i64 6
  %235 = load i32, ptr %234, align 8, !tbaa !30
  %236 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 32), i64 0, i64 %92, i64 6
  %237 = zext i32 %235 to i64
  %238 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i64 %237
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 1 dereferenceable(4) %238)
          to label %239 unwind label %281

239:                                              ; preds = %233
  %240 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  %241 = trunc nuw i8 %240 to i1
  %242 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %7, i64 0, i64 %237
  %243 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %241, ptr noundef nonnull align 1 dereferenceable(4) %238, ptr noundef nonnull align 1 dereferenceable(4) %242, i1 noundef zeroext false)
          to label %244 unwind label %281

244:                                              ; preds = %239
  %245 = zext i32 %243 to i64
  %246 = add i64 %224, %245
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  %247 = load i8, ptr %236, align 4, !tbaa !39
  %248 = zext i8 %247 to i32
  %249 = getelementptr inbounds i8, ptr %236, i64 1
  %250 = load i8, ptr %249, align 1, !tbaa !41
  %251 = zext i8 %250 to i32
  %252 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %248, i32 noundef %251)
          to label %253 unwind label %283

253:                                              ; preds = %244
  %254 = trunc i32 %252 to i8
  store i8 %254, ptr %8, align 1, !tbaa !42
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %255 unwind label %283

255:                                              ; preds = %253
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %256 = getelementptr inbounds [2 x [8 x i32]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu20g_etc1_pixel_indicesE, i64 64), i64 0, i64 %92, i64 7
  %257 = load i32, ptr %256, align 4, !tbaa !30
  %258 = getelementptr inbounds [2 x [8 x %"struct.basisu::etc_coord2"]], ptr getelementptr inbounds (i8, ptr @_ZN6basisu19g_etc1_pixel_coordsE, i64 32), i64 0, i64 %92, i64 7
  %259 = zext i32 %257 to i64
  %260 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i64 %259
  invoke void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 1 dereferenceable(4) %260)
          to label %261 unwind label %281

261:                                              ; preds = %255
  %262 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  %263 = trunc nuw i8 %262 to i1
  %264 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %7, i64 0, i64 %259
  %265 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %263, ptr noundef nonnull align 1 dereferenceable(4) %260, ptr noundef nonnull align 1 dereferenceable(4) %264, i1 noundef zeroext false)
          to label %266 unwind label %281

266:                                              ; preds = %261
  %267 = zext i32 %265 to i64
  %268 = add i64 %246, %267
  store i64 %268, ptr %95, align 8, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  %269 = load i8, ptr %258, align 2, !tbaa !39
  %270 = zext i8 %269 to i32
  %271 = getelementptr inbounds i8, ptr %258, i64 1
  %272 = load i8, ptr %271, align 1, !tbaa !41
  %273 = zext i8 %272 to i32
  %274 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %85, i32 noundef %270, i32 noundef %273)
          to label %275 unwind label %283

275:                                              ; preds = %266
  %276 = trunc i32 %274 to i8
  store i8 %276, ptr %8, align 1, !tbaa !42
  invoke void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %277 unwind label %283

277:                                              ; preds = %275
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #8
  %indvars.iv.next398 = add nuw nsw i64 %indvars.iv397, 1
  %278 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
  %279 = zext i32 %278 to i64
  %280 = icmp ult i64 %indvars.iv.next398, %279
  br i1 %280, label %.lr.ph311, label %._crit_edge, !llvm.loop !43

281:                                              ; preds = %261, %255, %239, %233, %217, %211, %195, %189, %173, %167, %151, %145, %129, %123, %106, %.preheader216
  %282 = landingpad { ptr, i32 }
          cleanup
  br label %285

283:                                              ; preds = %275, %266, %253, %244, %231, %222, %209, %200, %187, %178, %165, %156, %143, %134, %121, %111
  %284 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  br label %285

285:                                              ; preds = %281, %283, %104
  %.pn197.pn = phi { ptr, i32 } [ %105, %104 ], [ %284, %283 ], [ %282, %281 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #8
  br label %439

286:                                              ; preds = %._crit_edge
  invoke void @_ZN6basisu14etc1_optimizer7resultsC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %34)
          to label %.preheader219.preheader unwind label %288

.preheader219.preheader:                          ; preds = %286
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %10) #8
  store i16 0, ptr %10, align 2
  call void @_ZN6basisu9clear_objIA2_NS_14etc1_optimizer7resultsEEEvRT_(ptr noundef nonnull align 8 dereferenceable(80) %9)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #8
  call void @_ZN6basisu6vectorIhEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @_ZN6basisu6vectorIhEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr175.1)
  %287 = call noundef i32 @_ZNK6basisu6vectorINS_10color_rgbaEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %.not183 = icmp eq i32 %287, 0
  br i1 %.not183, label %.preheader219.1, label %290

288:                                              ; preds = %286, %._crit_edge
  %289 = landingpad { ptr, i32 }
          cleanup
  br label %438

290:                                              ; preds = %.preheader219.preheader
  %291 = lshr i32 %287, 3
  %292 = add i32 %291, %.0112369
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %12) #8
  invoke void @_ZN6basisu14etc1_optimizerC2Ev(ptr noundef nonnull align 8 dereferenceable(384) %12)
          to label %293 unwind label %306

293:                                              ; preds = %290
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #8
  invoke void @_ZN6basisu25etc1_solution_coordinatesC2Ev(ptr noundef nonnull align 4 dereferenceable(9) %13)
          to label %294 unwind label %308

294:                                              ; preds = %293
  invoke void @_ZN6basisu25etc1_solution_coordinatesC2Ev(ptr noundef nonnull align 4 dereferenceable(9) %.ptr186.1)
          to label %295 unwind label %308

295:                                              ; preds = %294
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %14) #8
  invoke void @_ZN6basisu14etc1_optimizer6paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(64) %14)
          to label %296 unwind label %310

296:                                              ; preds = %295
  store i32 %287, ptr %28, align 4, !tbaa !44
  %297 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu6vectorINS_10color_rgbaEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef 0)
  store ptr %297, ptr %29, align 8, !tbaa !49
  store i8 0, ptr %30, align 8, !tbaa !50
  %298 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  store i8 %298, ptr %31, align 4, !tbaa !51
  %299 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef 0)
  store ptr %299, ptr %32, align 8, !tbaa !52
  store i32 3, ptr %14, align 8, !tbaa !53
  %300 = zext i32 %287 to i64
  invoke void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %300, i1 noundef zeroext false)
          to label %301 unwind label %310

301:                                              ; preds = %296
  store i32 %287, ptr %44, align 16, !tbaa !54
  %302 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef 0)
  store ptr %302, ptr %45, align 8, !tbaa !56
  invoke void @_ZN6basisu14etc1_optimizer4initERKNS0_6paramsERNS0_7resultsE(ptr noundef nonnull align 8 dereferenceable(384) %12, ptr noundef nonnull align 8 dereferenceable(64) %14, ptr noundef nonnull align 8 dereferenceable(33) %9)
          to label %303 unwind label %310

303:                                              ; preds = %301
  %304 = invoke noundef zeroext i1 @_ZN6basisu14etc1_optimizer7computeEv(ptr noundef nonnull align 8 dereferenceable(384) %12)
          to label %305 unwind label %310

305:                                              ; preds = %303
  br i1 %304, label %312, label %317

306:                                              ; preds = %319, %290
  %307 = landingpad { ptr, i32 }
          cleanup
  br label %347

308:                                              ; preds = %323, %322, %294, %293
  %309 = landingpad { ptr, i32 }
          cleanup
  br label %346

310:                                              ; preds = %332, %330, %325, %324, %303, %301, %296, %295
  %311 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %14) #8
  br label %346

312:                                              ; preds = %305
  %313 = load i64, ptr %9, align 16, !tbaa !57
  %314 = load i64, ptr %6, align 16, !tbaa !37
  %315 = icmp ult i64 %313, %314
  br i1 %315, label %316, label %317

316:                                              ; preds = %312
  store i8 1, ptr %10, align 2, !tbaa !58
  br label %317

317:                                              ; preds = %312, %316, %305
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  call void @_ZN6basisu14etc1_optimizerD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %12) #8
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %12) #8
  br label %.preheader219.1

.preheader219.1:                                  ; preds = %.preheader219.preheader, %317
  %.2114 = phi i32 [ %292, %317 ], [ %.0112369, %.preheader219.preheader ]
  %318 = call noundef i32 @_ZNK6basisu6vectorINS_10color_rgbaEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  %.not183.1 = icmp eq i32 %318, 0
  br i1 %.not183.1, label %.preheader218, label %319

319:                                              ; preds = %.preheader219.1
  %320 = lshr i32 %318, 3
  %321 = add i32 %320, %.2114
  call void @llvm.lifetime.start.p0(i64 384, ptr nonnull %12) #8
  invoke void @_ZN6basisu14etc1_optimizerC2Ev(ptr noundef nonnull align 8 dereferenceable(384) %12)
          to label %322 unwind label %306

322:                                              ; preds = %319
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #8
  invoke void @_ZN6basisu25etc1_solution_coordinatesC2Ev(ptr noundef nonnull align 4 dereferenceable(9) %13)
          to label %323 unwind label %308

323:                                              ; preds = %322
  invoke void @_ZN6basisu25etc1_solution_coordinatesC2Ev(ptr noundef nonnull align 4 dereferenceable(9) %.ptr186.1.1)
          to label %324 unwind label %308

324:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %14) #8
  invoke void @_ZN6basisu14etc1_optimizer6paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(64) %14)
          to label %325 unwind label %310

325:                                              ; preds = %324
  store i32 %318, ptr %28, align 4, !tbaa !44
  %326 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu6vectorINS_10color_rgbaEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, i64 noundef 0)
  store ptr %326, ptr %29, align 8, !tbaa !49
  store i8 1, ptr %30, align 8, !tbaa !50
  %327 = load i8, ptr %27, align 4, !tbaa !36, !range !34, !noundef !35
  store i8 %327, ptr %31, align 4, !tbaa !51
  %328 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %.ptr167.1, i64 noundef 0)
  store ptr %328, ptr %32, align 8, !tbaa !52
  store i32 3, ptr %14, align 8, !tbaa !53
  %329 = zext i32 %318 to i64
  invoke void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %.ptr175.1, i64 noundef %329, i1 noundef zeroext false)
          to label %330 unwind label %310

330:                                              ; preds = %325
  store i32 %318, ptr %46, align 8, !tbaa !54
  %331 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %.ptr175.1, i64 noundef 0)
  store ptr %331, ptr %47, align 16, !tbaa !56
  invoke void @_ZN6basisu14etc1_optimizer4initERKNS0_6paramsERNS0_7resultsE(ptr noundef nonnull align 8 dereferenceable(384) %12, ptr noundef nonnull align 8 dereferenceable(64) %14, ptr noundef nonnull align 8 dereferenceable(33) %34)
          to label %332 unwind label %310

332:                                              ; preds = %330
  %333 = invoke noundef zeroext i1 @_ZN6basisu14etc1_optimizer7computeEv(ptr noundef nonnull align 8 dereferenceable(384) %12)
          to label %334 unwind label %310

334:                                              ; preds = %332
  br i1 %333, label %335, label %340

335:                                              ; preds = %334
  %336 = load i64, ptr %34, align 8, !tbaa !57
  %337 = load i64, ptr %48, align 8, !tbaa !37
  %338 = icmp ult i64 %336, %337
  br i1 %338, label %339, label %340

339:                                              ; preds = %335
  store i8 1, ptr %49, align 1, !tbaa !58
  br label %340

340:                                              ; preds = %339, %335, %334
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  call void @_ZN6basisu14etc1_optimizerD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %12) #8
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %12) #8
  br label %.preheader218

.preheader218:                                    ; preds = %340, %.preheader219.1
  %.2114.1 = phi i32 [ %321, %340 ], [ %.2114, %.preheader219.1 ]
  %341 = getelementptr inbounds i8, ptr %77, i64 24
  %342 = getelementptr inbounds i8, ptr %77, i64 12
  %343 = getelementptr inbounds i8, ptr %77, i64 4
  %344 = getelementptr inbounds i8, ptr %77, i64 16
  %345 = getelementptr inbounds i8, ptr %77, i64 8
  br label %351

346:                                              ; preds = %310, %308
  %.pn188 = phi { ptr, i32 } [ %311, %310 ], [ %309, %308 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  call void @_ZN6basisu14etc1_optimizerD2Ev(ptr noundef nonnull align 8 dereferenceable(384) %12) #8
  br label %347

347:                                              ; preds = %346, %306
  %.pn188.pn = phi { ptr, i32 } [ %.pn188, %346 ], [ %307, %306 ]
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %12) #8
  br label %436

.preheader217:                                    ; preds = %.loopexit215
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %50) #8
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %51) #8
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  call void @_ZN6basisu6vectorINS_10color_rgbaEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %52) #8
  call void @_ZN6basisu6vectorINS_10color_rgbaEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  %indvars.iv.next416 = add nuw nsw i64 %indvars.iv415, 1
  %348 = call noundef i32 @_ZNK6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
  %349 = zext i32 %348 to i64
  %350 = icmp ult i64 %indvars.iv.next416, %349
  br i1 %350, label %76, label %._crit_edge372.loopexit, !llvm.loop !59

351:                                              ; preds = %.preheader218, %.loopexit215
  %indvars.iv411 = phi i64 [ 0, %.preheader218 ], [ %indvars.iv.next412, %.loopexit215 ]
  %.1367 = phi i32 [ %.0111370, %.preheader218 ], [ %.9, %.loopexit215 ]
  %352 = getelementptr inbounds [2 x i8], ptr %10, i64 0, i64 %indvars.iv411
  %353 = load i8, ptr %352, align 1, !tbaa !58, !range !34, !noundef !35
  %354 = trunc nuw i8 %353 to i1
  br i1 %354, label %355, label %.loopexit215

355:                                              ; preds = %351
  %.not = icmp eq i64 %indvars.iv411, 0
  %356 = select i1 %.not, i32 2, i32 1
  br i1 %.not, label %.preheader.us, label %.preheader

.preheader.us:                                    ; preds = %355, %.loopexit.us
  %.2347.us = phi i32 [ %.3231.us, %.loopexit.us ], [ %.1367, %355 ]
  %.0141345.us = phi i32 [ %358, %.loopexit.us ], [ 0, %355 ]
  %.0142344.us = phi i1 [ %.5147.us, %.loopexit.us ], [ true, %355 ]
  %357 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
  %.not378 = icmp eq i32 %357, 0
  br i1 %.not378, label %.loopexit.us, label %.lr.ph316.us

.loopexit.us:                                     ; preds = %.thread.us.us, %.preheader.us, %.split341.us.us
  %.3231.us = phi i32 [ %.3315.us.us, %.split341.us.us ], [ %.2347.us, %.preheader.us ], [ %.7206.us.us, %.thread.us.us ]
  %.5147.us = phi i1 [ false, %.split341.us.us ], [ %.0142344.us, %.preheader.us ], [ %.0142344.us, %.thread.us.us ]
  %358 = add nuw nsw i32 %.0141345.us, 1
  %exitcond410.not = icmp eq i32 %358, %356
  br i1 %exitcond410.not, label %.loopexit215, label %.preheader.us, !llvm.loop !60

.lr.ph316.us:                                     ; preds = %.preheader.us
  %359 = icmp eq i32 %.0141345.us, 1
  %brmerge.us.not = select i1 %359, i1 %.0142344.us, i1 false
  br label %360

360:                                              ; preds = %.thread.us.us, %.lr.ph316.us
  %indvars.iv406 = phi i64 [ %indvars.iv.next407, %.thread.us.us ], [ 0, %.lr.ph316.us ]
  %.3315.us.us = phi i32 [ %.7206.us.us, %.thread.us.us ], [ %.2347.us, %.lr.ph316.us ]
  %361 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %78, i64 noundef %indvars.iv406)
  %362 = load i32, ptr %361, align 4, !tbaa !30
  %363 = lshr i32 %362, 1
  %364 = and i32 %362, 1
  %365 = zext nneg i32 %363 to i64
  %366 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %26, i64 noundef %365)
  %367 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %366)
  br i1 %367, label %368, label %.thread.us.us

368:                                              ; preds = %360
  %369 = invoke noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %366)
          to label %370 unwind label %.split.us.split.us

370:                                              ; preds = %368
  %371 = call noundef zeroext i16 @_ZNK6basisu9etc_block16get_delta3_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %366)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  invoke void @_ZN6basisu9etc_block13unpack_color5ERjS1_S1_tb(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17, i16 noundef zeroext %369, i1 noundef zeroext false)
          to label %372 unwind label %.split321.us.split.us

372:                                              ; preds = %370
  %373 = invoke noundef zeroext i1 @_ZN6basisu9etc_block13unpack_color5ERjS1_S1_ttbj(ptr noundef nonnull align 4 dereferenceable(4) %36, ptr noundef nonnull align 4 dereferenceable(4) %37, ptr noundef nonnull align 4 dereferenceable(4) %38, i16 noundef zeroext %369, i16 noundef zeroext %371, i1 noundef zeroext false, i32 noundef 255)
          to label %374 unwind label %.split327.us.split.us

374:                                              ; preds = %372
  br i1 %373, label %375, label %.split333.us

375:                                              ; preds = %374
  %376 = load i8, ptr %39, align 8, !tbaa !42
  %377 = zext i8 %376 to i32
  %378 = zext nneg i32 %364 to i64
  %379 = getelementptr inbounds [2 x i32], ptr %15, i64 0, i64 %378
  store i32 %377, ptr %379, align 4, !tbaa !30
  %380 = load i8, ptr %40, align 1, !tbaa !42
  %381 = zext i8 %380 to i32
  %382 = getelementptr inbounds [2 x i32], ptr %16, i64 0, i64 %378
  store i32 %381, ptr %382, align 4, !tbaa !30
  %383 = load i8, ptr %41, align 2, !tbaa !42
  %384 = zext i8 %383 to i32
  %385 = getelementptr inbounds [2 x i32], ptr %17, i64 0, i64 %378
  store i32 %384, ptr %385, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #8
  %386 = load i32, ptr %15, align 4, !tbaa !30
  %387 = load i32, ptr %16, align 4, !tbaa !30
  %388 = load i32, ptr %17, align 4, !tbaa !30
  invoke void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %18, i32 noundef %386, i32 noundef %387, i32 noundef %388, i32 noundef 255)
          to label %389 unwind label %.split335.us.split.us

389:                                              ; preds = %375
  %390 = load i32, ptr %36, align 4, !tbaa !30
  %391 = load i32, ptr %37, align 4, !tbaa !30
  %392 = load i32, ptr %38, align 4, !tbaa !30
  invoke void @_ZN6basisu10color_rgbaC2Eiiii(ptr noundef nonnull align 1 dereferenceable(4) %42, i32 noundef %390, i32 noundef %391, i32 noundef %392, i32 noundef 255)
          to label %393 unwind label %.split335.us.split.us

393:                                              ; preds = %389
  %394 = invoke noundef zeroext i1 @_ZN6basisu9etc_block22try_pack_color5_delta3EPKNS_10color_rgbaE(ptr noundef nonnull %18)
          to label %395 unwind label %.split335.us.split.us

395:                                              ; preds = %393
  br i1 %394, label %396, label %.split341.us.us

396:                                              ; preds = %395
  br i1 %brmerge.us.not, label %397, label %select.unfold.us.us

397:                                              ; preds = %396
  invoke void @_ZN6basisu9etc_block16set_block_color5ERKNS_10color_rgbaES3_(ptr noundef nonnull align 8 dereferenceable(8) %366, ptr noundef nonnull align 1 dereferenceable(4) %18, ptr noundef nonnull align 1 dereferenceable(4) %42)
          to label %398 unwind label %.split335.us.split.us

398:                                              ; preds = %397
  %399 = load i32, ptr %43, align 4, !tbaa !61
  call void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %366, i32 noundef %364, i32 noundef %399)
  %400 = load i64, ptr %9, align 16, !tbaa !57
  store i64 %400, ptr %344, align 8, !tbaa !37
  %401 = load i32, ptr %43, align 4, !tbaa !61
  store i32 %401, ptr %345, align 8, !tbaa !30
  %402 = load i32, ptr %39, align 8, !tbaa !42
  store i32 %402, ptr %77, align 8, !tbaa !42
  %403 = add i32 %.3315.us.us, 1
  br label %select.unfold.us.us

select.unfold.us.us:                              ; preds = %398, %396
  %.5.ph.us.us = phi i32 [ %.3315.us.us, %396 ], [ %403, %398 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  br label %.thread.us.us

.thread.us.us:                                    ; preds = %select.unfold.us.us, %360
  %.7206.us.us = phi i32 [ %.5.ph.us.us, %select.unfold.us.us ], [ %.3315.us.us, %360 ]
  %indvars.iv.next407 = add nuw nsw i64 %indvars.iv406, 1
  %404 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
  %405 = zext i32 %404 to i64
  %406 = icmp ult i64 %indvars.iv.next407, %405
  br i1 %406, label %360, label %.loopexit.us, !llvm.loop !62

.split341.us.us:                                  ; preds = %395
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  br label %.loopexit.us

.split.us.split.us:                               ; preds = %368
  %407 = landingpad { ptr, i32 }
          cleanup
  br label %436

.split321.us.split.us:                            ; preds = %370
  %408 = landingpad { ptr, i32 }
          cleanup
  br label %431

.split327.us.split.us:                            ; preds = %372
  %409 = landingpad { ptr, i32 }
          cleanup
  br label %431

.split335.us.split.us:                            ; preds = %397, %393, %389, %375
  %410 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #8
  br label %431

.preheader:                                       ; preds = %355, %.loopexit
  %.2347 = phi i32 [ %.3.lcssa, %.loopexit ], [ %.1367, %355 ]
  %.0141345 = phi i32 [ %435, %.loopexit ], [ 0, %355 ]
  %411 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
  %.not377 = icmp eq i32 %411, 0
  br i1 %.not377, label %.loopexit, label %.lr.ph316

.lr.ph316:                                        ; preds = %.preheader, %.thread
  %indvars.iv403 = phi i64 [ %indvars.iv.next404, %.thread ], [ 0, %.preheader ]
  %.3315 = phi i32 [ %.7206, %.thread ], [ %.2347, %.preheader ]
  %412 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %78, i64 noundef %indvars.iv403)
  %413 = load i32, ptr %412, align 4, !tbaa !30
  %414 = lshr i32 %413, 1
  %415 = and i32 %413, 1
  %416 = zext nneg i32 %414 to i64
  %417 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %26, i64 noundef %416)
  %418 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %417)
  %419 = xor i1 %418, true
  %420 = zext i1 %419 to i64
  %.not177 = icmp eq i64 %indvars.iv411, %420
  br i1 %.not177, label %423, label %.thread

421:                                              ; preds = %423
  %422 = landingpad { ptr, i32 }
          cleanup
  br label %436

423:                                              ; preds = %.lr.ph316
  %424 = invoke noundef zeroext i16 @_ZN6basisu9etc_block11pack_color4ERKNS_10color_rgbaEbj(ptr noundef nonnull align 1 dereferenceable(4) %33, i1 noundef zeroext false, i32 noundef 127)
          to label %425 unwind label %421

425:                                              ; preds = %423
  call void @_ZN6basisu9etc_block15set_base4_colorEjt(ptr noundef nonnull align 8 dereferenceable(8) %417, i32 noundef %415, i16 noundef zeroext %424)
  %426 = load i32, ptr %35, align 4, !tbaa !61
  call void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %417, i32 noundef %415, i32 noundef %426)
  %427 = load i64, ptr %34, align 8, !tbaa !57
  store i64 %427, ptr %341, align 8, !tbaa !37
  %428 = load i32, ptr %35, align 4, !tbaa !61
  store i32 %428, ptr %342, align 4, !tbaa !30
  %429 = load i32, ptr %33, align 16, !tbaa !42
  store i32 %429, ptr %343, align 4, !tbaa !42
  %430 = add i32 %.3315, 1
  br label %.thread

.split333.us:                                     ; preds = %374
  call void @__assert_fail(ptr noundef nonnull @.str.45, ptr noundef nonnull @.str.4, i32 noundef 2491, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu15basisu_frontend38refine_block_endpoints_given_selectorsEv) #9
  unreachable

431:                                              ; preds = %.split327.us.split.us, %.split335.us.split.us, %.split321.us.split.us
  %.pn.pn = phi { ptr, i32 } [ %408, %.split321.us.split.us ], [ %410, %.split335.us.split.us ], [ %409, %.split327.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  br label %436

.thread:                                          ; preds = %425, %.lr.ph316
  %.7206 = phi i32 [ %430, %425 ], [ %.3315, %.lr.ph316 ]
  %indvars.iv.next404 = add nuw nsw i64 %indvars.iv403, 1
  %432 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
  %433 = zext i32 %432 to i64
  %434 = icmp ult i64 %indvars.iv.next404, %433
  br i1 %434, label %.lr.ph316, label %.loopexit, !llvm.loop !62

.loopexit:                                        ; preds = %.thread, %.preheader
  %.3.lcssa = phi i32 [ %.2347, %.preheader ], [ %.7206, %.thread ]
  %435 = add nuw nsw i32 %.0141345, 1
  %exitcond.not = icmp eq i32 %435, %356
  br i1 %exitcond.not, label %.loopexit215, label %.preheader, !llvm.loop !60

.loopexit215:                                     ; preds = %.loopexit, %.loopexit.us, %351
  %.9 = phi i32 [ %.1367, %351 ], [ %.3231.us, %.loopexit.us ], [ %.3.lcssa, %.loopexit ]
  %indvars.iv.next412 = add nuw nsw i64 %indvars.iv411, 1
  %exitcond414.not = icmp eq i64 %indvars.iv.next412, 2
  br i1 %exitcond414.not, label %.preheader217, label %351, !llvm.loop !63

436:                                              ; preds = %421, %431, %.split.us.split.us, %347
  %.pn188.pn.pn = phi { ptr, i32 } [ %.pn188.pn, %347 ], [ %422, %421 ], [ %.pn.pn, %431 ], [ %407, %.split.us.split.us ]
  %437 = getelementptr inbounds i8, ptr %11, i64 16
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %437) #8
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %10) #8
  br label %438

438:                                              ; preds = %436, %288
  %.pn188.pn.pn.pn = phi { ptr, i32 } [ %.pn188.pn.pn, %436 ], [ %289, %288 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %9) #8
  br label %439

439:                                              ; preds = %102, %285, %438
  %.pn197.pn.pn.pn = phi { ptr, i32 } [ %.pn188.pn.pn.pn, %438 ], [ %.pn197.pn, %285 ], [ %103, %102 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  %440 = getelementptr inbounds i8, ptr %5, i64 16
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %440) #8
  call void @_ZN6basisu6vectorIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  %441 = getelementptr inbounds i8, ptr %4, i64 16
  call void @_ZN6basisu6vectorINS_10color_rgbaEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %441) #8
  call void @_ZN6basisu6vectorINS_10color_rgbaEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn197.pn.pn.pn

442:                                              ; preds = %._crit_edge372
  %443 = uitofp i32 %.0111.lcssa to float
  %444 = fmul float %443, 1.000000e+02
  %445 = fdiv float %444, %.0112.lcssa
  %446 = fpext float %445 to double
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.46, i32 noundef %.0111.lcssa, double noundef %446)
  br label %447

447:                                              ; preds = %442, %._crit_edge372
  ret i32 %.0111.lcssa
}

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) local_unnamed_addr #7 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64)) local_unnamed_addr #7 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext) local_unnamed_addr #0 align 2

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

; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 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

declare noundef zeroext i1 @_ZN6basisu11unpack_etc1ERKNS_9etc_blockEPNS_10color_rgbaEb(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorINS_10color_rgbaEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #0 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 uwtable
declare dso_local void @_ZN6basisu6vectorIhE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu14etc1_optimizer7resultsC2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu9clear_objIA2_NS_14etc1_optimizer7resultsEEEvRT_(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14etc1_optimizerC2Ev(ptr noundef nonnull align 8 dereferenceable(384)) unnamed_addr #6 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14etc1_optimizer6paramsC2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #6 align 2

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

declare void @_ZN6basisu14etc1_optimizer4initERKNS0_6paramsERNS0_7resultsE(ptr noundef nonnull align 8 dereferenceable(384), ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN6basisu14etc1_optimizer7computeEv(ptr noundef nonnull align 8 dereferenceable(384)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu14etc1_optimizerD2Ev(ptr noundef nonnull align 8 dereferenceable(384)) unnamed_addr #3 align 2

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

declare noundef zeroext i16 @_ZN6basisu9etc_block11pack_color4ERKNS_10color_rgbaEbj(ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK6basisu9etc_block16get_delta3_colorEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

declare void @_ZN6basisu9etc_block13unpack_color5ERjS1_S1_tb(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i16 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #1

declare noundef zeroext i1 @_ZN6basisu9etc_block13unpack_color5ERjS1_S1_ttbj(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i16 noundef zeroext, i16 noundef zeroext, i1 noundef zeroext, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu9etc_block22try_pack_color5_delta3EPKNS_10color_rgbaE(ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu9etc_block16set_block_color5ERKNS_10color_rgbaES3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #6 align 2

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { 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, !8, i64 88}
!6 = !{!"_ZTSN6basisu15basisu_frontendE", !7, i64 0, !8, i64 88, !8, i64 92, !12, i64 96, !12, i64 97, !12, i64 98, !8, i64 100, !8, i64 104, !15, i64 112, !16, i64 128, !16, i64 144, !16, i64 160, !17, i64 176, !20, i64 216, !20, i64 232, !21, i64 248, !20, i64 264, !22, i64 280, !23, i64 296, !20, i64 312, !16, i64 328, !20, i64 344, !21, i64 360, !20, i64 376, !24, i64 392, !25, i64 408, !26, i64 424, !27, i64 440, !28, i64 456}
!7 = !{!"_ZTSN6basisu15basisu_frontend6paramsE", !8, i64 0, !11, i64 8, !8, i64 16, !8, i64 20, !8, i64 24, !12, i64 28, !12, i64 29, !12, i64 30, !12, i64 31, !12, i64 32, !12, i64 33, !12, i64 34, !11, i64 40, !8, i64 48, !8, i64 52, !12, i64 56, !13, i64 60, !14, i64 64, !11, i64 72, !11, i64 80}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"float", !9, i64 0}
!14 = !{!"_ZTSN6basist18basis_texture_typeE", !9, i64 0}
!15 = !{!"_ZTSN6basisu6vectorINS_11pixel_blockEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!16 = !{!"_ZTSN6basisu6vectorINS_9etc_blockEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!17 = !{!"_ZTSN6basisu17tree_vector_quantINS_3vecILj6EfEEEE", !18, i64 0, !19, i64 16, !8, i64 32}
!18 = !{!"_ZTSN6basisu6vectorINS_17tree_vector_quantINS_3vecILj6EfEEE9tsvq_nodeEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!19 = !{!"_ZTSN6basisu6vectorISt4pairINS_3vecILj6EfEEmEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!20 = !{!"_ZTSN6basisu6vectorINS0_IjEEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!21 = !{!"_ZTSN6basisu6vectorIhEE", !11, i64 0, !8, i64 8, !8, i64 12}
!22 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_5vec2UEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!24 = !{!"_ZTSN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIbEE", !11, i64 0, !8, i64 8, !8, i64 12}
!26 = !{!"_ZTSN6basisu6vectorIjEE", !11, i64 0, !8, i64 8, !8, i64 12}
!27 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27subblock_endpoint_quant_errEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!28 = !{!"_ZTSSt5mutex", !29, i64 0}
!29 = !{!"_ZTSSt12__mutex_base", !9, i64 0}
!30 = !{!8, !8, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!6, !12, i64 29}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!6, !12, i64 28}
!37 = !{!38, !38, i64 0}
!38 = !{!"long", !9, i64 0}
!39 = !{!40, !9, i64 0}
!40 = !{!"_ZTSN6basisu10etc_coord2E", !9, i64 0, !9, i64 1}
!41 = !{!40, !9, i64 1}
!42 = !{!9, !9, i64 0}
!43 = distinct !{!43, !32}
!44 = !{!45, !8, i64 12}
!45 = !{!"_ZTSN6basisu14etc1_optimizer6paramsE", !46, i64 0, !8, i64 12, !11, i64 16, !12, i64 24, !11, i64 32, !8, i64 40, !48, i64 44, !12, i64 48, !12, i64 49, !11, i64 56}
!46 = !{!"_ZTSN6basisu22basis_etc1_pack_paramsE", !47, i64 0, !12, i64 4, !12, i64 5, !12, i64 6, !12, i64 7, !13, i64 8}
!47 = !{!"_ZTSN6basisu17basis_etc_qualityE", !9, i64 0}
!48 = !{!"_ZTSN6basisu10color_rgbaE", !9, i64 0}
!49 = !{!45, !11, i64 16}
!50 = !{!45, !12, i64 24}
!51 = !{!46, !12, i64 4}
!52 = !{!45, !11, i64 56}
!53 = !{!46, !47, i64 0}
!54 = !{!55, !8, i64 16}
!55 = !{!"_ZTSN6basisu14etc1_optimizer7resultsE", !38, i64 0, !48, i64 8, !8, i64 12, !8, i64 16, !11, i64 24, !12, i64 32}
!56 = !{!55, !11, i64 24}
!57 = !{!55, !38, i64 0}
!58 = !{!12, !12, i64 0}
!59 = distinct !{!59, !32}
!60 = distinct !{!60, !32}
!61 = !{!55, !8, i64 12}
!62 = distinct !{!62, !32}
!63 = distinct !{!63, !32}


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