; 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"

%"class.basisu::vector.16" = type { ptr, i32, i32 }
%"struct.basisu::etc_block" = type { %union.anon.22 }
%union.anon.22 = type { i64 }
%"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.8" = type { ptr, i32, i32 }
%"class.basisu::vector.6" = type { ptr, i32, i32 }
%"class.basisu::vector.14" = type { ptr, i32, i32 }
%"class.basisu::vector.18" = 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 }

@.str.16 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [58 x i8], align 1

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) #0

; 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) #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend35introduce_special_selector_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.basisu::vector.16", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.basisu::etc_block", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.basisu::etc_block", align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %25 = load ptr, ptr %2, align 8
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.16)
  %26 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %26, i32 0, i32 12
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %1
  br label %337

31:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %32 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 19
  %33 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %32)
  store i32 %33, ptr %4, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  %34 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 1
  %35 = load i32, ptr %34, align 8, !tbaa !32
  %36 = zext i32 %35 to i64
  call void @_ZN6basisu6vectorIbEC2Em(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !31
  br label %37

37:                                               ; preds = %248, %31
  %38 = load i32, ptr %6, align 4, !tbaa !31
  %39 = icmp ult i32 %38, 4
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %254

41:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  invoke void @_ZN6basisu9clear_objINS_9etc_blockEEEvRT_(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %42 unwind label %47

42:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !31
  br label %43

43:                                               ; preds = %58, %42
  %44 = load i32, ptr %11, align 4, !tbaa !31
  %45 = icmp ult i32 %44, 16
  br i1 %45, label %51, label %46

46:                                               ; preds = %43
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %65

47:                                               ; preds = %41
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %9, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %10, align 4
  br label %253

51:                                               ; preds = %43
  %52 = load i32, ptr %11, align 4, !tbaa !31
  %53 = and i32 %52, 3
  %54 = load i32, ptr %11, align 4, !tbaa !31
  %55 = lshr i32 %54, 2
  %56 = load i32, ptr %6, align 4, !tbaa !31
  invoke void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef %53, i32 noundef %55, i32 noundef %56)
          to label %57 unwind label %61

57:                                               ; preds = %51
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %11, align 4, !tbaa !31
  %60 = add i32 %59, 1
  store i32 %60, ptr %11, align 4, !tbaa !31
  br label %43, !llvm.loop !33

61:                                               ; preds = %51
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %9, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %253

65:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !31
  br label %66

66:                                               ; preds = %89, %65
  %67 = load i32, ptr %12, align 4, !tbaa !31
  %68 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 20
  %69 = invoke noundef i32 @_ZNK6basisu6vectorINS_9etc_blockEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %68)
          to label %70 unwind label %84

70:                                               ; preds = %66
  %71 = icmp slt i32 %67, %69
  br i1 %71, label %72, label %92

72:                                               ; preds = %70
  %73 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 20
  %74 = load i32, ptr %12, align 4, !tbaa !31
  %75 = sext i32 %74 to i64
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %73, i64 noundef %75)
          to label %77 unwind label %84

77:                                               ; preds = %72
  %78 = invoke noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %76)
          to label %79 unwind label %84

79:                                               ; preds = %77
  %80 = invoke noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %81 unwind label %84

81:                                               ; preds = %79
  %82 = icmp eq i32 %78, %80
  br i1 %82, label %83, label %88

83:                                               ; preds = %81
  br label %92

84:                                               ; preds = %99, %92, %79, %77, %72, %66
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %9, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %10, align 4
  br label %252

88:                                               ; preds = %81
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %12, align 4, !tbaa !31
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %12, align 4, !tbaa !31
  br label %66, !llvm.loop !35

92:                                               ; preds = %83, %70
  %93 = load i32, ptr %12, align 4, !tbaa !31
  %94 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 20
  %95 = invoke noundef i32 @_ZNK6basisu6vectorINS_9etc_blockEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %94)
          to label %96 unwind label %84

96:                                               ; preds = %92
  %97 = icmp slt i32 %93, %95
  br i1 %97, label %98, label %99

98:                                               ; preds = %96
  store i32 4, ptr %7, align 4
  br label %245

99:                                               ; preds = %96
  %100 = load i32, ptr %6, align 4, !tbaa !31
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.17, i32 noundef %100)
          to label %101 unwind label %84

101:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %102 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 20
  %103 = invoke noundef i32 @_ZNK6basisu6vectorINS_9etc_blockEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %102)
          to label %104 unwind label %117

104:                                              ; preds = %101
  store i32 %103, ptr %13, align 4, !tbaa !31
  %105 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 20
  invoke void @_ZN6basisu6vectorINS_9etc_blockEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %105, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %106 unwind label %117

106:                                              ; preds = %104
  %107 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 19
  %108 = load i32, ptr %13, align 4, !tbaa !31
  %109 = zext i32 %108 to i64
  invoke void @_ZN6basisu30vector_ensure_element_is_validINS_6vectorINS1_IjEEEEEEvRT_m(ptr noundef nonnull align 8 dereferenceable(16) %107, i64 noundef %109)
          to label %110 unwind label %117

110:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !31
  br label %111

111:                                              ; preds = %237, %110
  %112 = load i32, ptr %14, align 4, !tbaa !31
  %113 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 1
  %114 = load i32, ptr %113, align 8, !tbaa !32
  %115 = icmp ult i32 %112, %114
  br i1 %115, label %121, label %116

116:                                              ; preds = %111
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %244

117:                                              ; preds = %106, %104, %101
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %9, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %10, align 4
  br label %251

121:                                              ; preds = %111
  %122 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 10
  %123 = load i32, ptr %14, align 4, !tbaa !31
  %124 = zext i32 %123 to i64
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %122, i64 noundef %124)
          to label %126 unwind label %133

126:                                              ; preds = %121
  %127 = invoke noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %125)
          to label %128 unwind label %133

128:                                              ; preds = %126
  %129 = invoke noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %130 unwind label %133

130:                                              ; preds = %128
  %131 = icmp ne i32 %127, %129
  br i1 %131, label %132, label %137

132:                                              ; preds = %130
  br label %237

133:                                              ; preds = %128, %126, %121
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %9, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %10, align 4
  br label %243

137:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %138 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 26
  %139 = load i32, ptr %14, align 4, !tbaa !31
  %140 = zext i32 %139 to i64
  %141 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %138, i64 noundef %140)
          to label %142 unwind label %191

142:                                              ; preds = %137
  %143 = load i32, ptr %141, align 4, !tbaa !31
  store i32 %143, ptr %15, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %144 = load i32, ptr %14, align 4, !tbaa !31
  %145 = invoke noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %25, i32 noundef %144, i32 noundef 0)
          to label %146 unwind label %195

146:                                              ; preds = %142
  store i32 %145, ptr %17, align 4, !tbaa !31
  %147 = load i32, ptr %17, align 4, !tbaa !31
  %148 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496) %25, i32 noundef %147, i1 noundef zeroext false)
          to label %149 unwind label %195

149:                                              ; preds = %146
  invoke void @_ZN6basisu9etc_block22set_block_color5_etc1sERKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 1 dereferenceable(4) %148)
          to label %150 unwind label %195

150:                                              ; preds = %149
  %151 = load i32, ptr %17, align 4, !tbaa !31
  %152 = invoke noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496) %25, i32 noundef %151, i1 noundef zeroext false)
          to label %153 unwind label %195

153:                                              ; preds = %150
  invoke void @_ZN6basisu9etc_block22set_inten_tables_etc1sEj(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef %152)
          to label %154 unwind label %195

154:                                              ; preds = %153
  %155 = load i32, ptr %15, align 4, !tbaa !31
  %156 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend34get_selector_cluster_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(496) %25, i32 noundef %155)
          to label %157 unwind label %195

157:                                              ; preds = %154
  %158 = invoke noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %156)
          to label %159 unwind label %195

159:                                              ; preds = %157
  invoke void @_ZN6basisu9etc_block21set_raw_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef %158)
          to label %160 unwind label %195

160:                                              ; preds = %159
  invoke void @_ZN6basisu9etc_block12set_flip_bitEb(ptr noundef nonnull align 8 dereferenceable(8) %16, i1 noundef zeroext true)
          to label %161 unwind label %195

161:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %162 = load i32, ptr %14, align 4, !tbaa !31
  %163 = invoke noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %25, i32 noundef %162)
          to label %164 unwind label %199

164:                                              ; preds = %161
  %165 = invoke noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %163)
          to label %166 unwind label %199

166:                                              ; preds = %164
  %167 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 0
  %168 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %167, i32 0, i32 5
  %169 = load i8, ptr %168, align 4, !tbaa !36, !range !37, !noundef !38
  %170 = trunc i8 %169 to i1
  %171 = invoke noundef i64 @_ZNK6basisu9etc_block19evaluate_etc1_errorEPKNS_10color_rgbaEbi(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef %165, i1 noundef zeroext %170, i32 noundef -1)
          to label %172 unwind label %199

172:                                              ; preds = %166
  store i64 %171, ptr %18, align 8, !tbaa !39
  %173 = invoke noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %174 unwind label %199

174:                                              ; preds = %172
  invoke void @_ZN6basisu9etc_block21set_raw_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef %173)
          to label %175 unwind label %199

175:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %176 = load i32, ptr %14, align 4, !tbaa !31
  %177 = invoke noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %25, i32 noundef %176)
          to label %178 unwind label %203

178:                                              ; preds = %175
  %179 = invoke noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %177)
          to label %180 unwind label %203

180:                                              ; preds = %178
  %181 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 0
  %182 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %181, i32 0, i32 5
  %183 = load i8, ptr %182, align 4, !tbaa !36, !range !37, !noundef !38
  %184 = trunc i8 %183 to i1
  %185 = invoke noundef i64 @_ZNK6basisu9etc_block19evaluate_etc1_errorEPKNS_10color_rgbaEbi(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef %179, i1 noundef zeroext %184, i32 noundef -1)
          to label %186 unwind label %203

186:                                              ; preds = %180
  store i64 %185, ptr %19, align 8, !tbaa !39
  %187 = load i64, ptr %19, align 8, !tbaa !39
  %188 = load i64, ptr %18, align 8, !tbaa !39
  %189 = icmp uge i64 %187, %188
  br i1 %189, label %190, label %207

190:                                              ; preds = %186
  store i32 13, ptr %7, align 4
  br label %234

191:                                              ; preds = %137
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %9, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %10, align 4
  br label %242

195:                                              ; preds = %160, %159, %157, %154, %153, %150, %149, %146, %142
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %9, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %10, align 4
  br label %241

199:                                              ; preds = %174, %172, %166, %164, %161
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %9, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %10, align 4
  br label %240

203:                                              ; preds = %232, %230, %223, %219, %218, %213, %207, %180, %178, %175
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %9, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %240

207:                                              ; preds = %186
  %208 = load i32, ptr %13, align 4, !tbaa !31
  %209 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 26
  %210 = load i32, ptr %14, align 4, !tbaa !31
  %211 = zext i32 %210 to i64
  %212 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %209, i64 noundef %211)
          to label %213 unwind label %203

213:                                              ; preds = %207
  store i32 %208, ptr %212, align 4, !tbaa !31
  %214 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 19
  %215 = load i32, ptr %13, align 4, !tbaa !31
  %216 = zext i32 %215 to i64
  %217 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %214, i64 noundef %216)
          to label %218 unwind label %203

218:                                              ; preds = %213
  invoke void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %217, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %219 unwind label %203

219:                                              ; preds = %218
  %220 = load i32, ptr %14, align 4, !tbaa !31
  %221 = zext i32 %220 to i64
  %222 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef %221)
          to label %223 unwind label %203

223:                                              ; preds = %219
  store i8 1, ptr %222, align 1, !tbaa !41
  %224 = load i32, ptr %3, align 4, !tbaa !31
  %225 = add i32 %224, 1
  store i32 %225, ptr %3, align 4, !tbaa !31
  %226 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 9
  %227 = load i32, ptr %14, align 4, !tbaa !31
  %228 = zext i32 %227 to i64
  %229 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %226, i64 noundef %228)
          to label %230 unwind label %203

230:                                              ; preds = %223
  %231 = invoke noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %232 unwind label %203

232:                                              ; preds = %230
  invoke void @_ZN6basisu9etc_block21set_raw_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(8) %229, i32 noundef %231)
          to label %233 unwind label %203

233:                                              ; preds = %232
  store i32 0, ptr %7, align 4
  br label %234

234:                                              ; preds = %233, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %235 = load i32, ptr %7, align 4
  switch i32 %235, label %344 [
    i32 0, label %236
    i32 13, label %237
  ]

236:                                              ; preds = %234
  br label %237

237:                                              ; preds = %236, %234, %132
  %238 = load i32, ptr %14, align 4, !tbaa !31
  %239 = add i32 %238, 1
  store i32 %239, ptr %14, align 4, !tbaa !31
  br label %111, !llvm.loop !42

240:                                              ; preds = %203, %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %241

241:                                              ; preds = %240, %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %242

242:                                              ; preds = %241, %191
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %243

243:                                              ; preds = %242, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %251

244:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  store i32 0, ptr %7, align 4
  br label %245

245:                                              ; preds = %244, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %246 = load i32, ptr %7, align 4
  switch i32 %246, label %344 [
    i32 0, label %247
    i32 4, label %248
  ]

247:                                              ; preds = %245
  br label %248

248:                                              ; preds = %247, %245
  %249 = load i32, ptr %6, align 4, !tbaa !31
  %250 = add i32 %249, 1
  store i32 %250, ptr %6, align 4, !tbaa !31
  br label %37, !llvm.loop !43

251:                                              ; preds = %243, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %252

252:                                              ; preds = %251, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %253

253:                                              ; preds = %252, %61, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %338

254:                                              ; preds = %40
  %255 = load i32, ptr %3, align 4, !tbaa !31
  %256 = icmp ne i32 %255, 0
  br i1 %256, label %257, label %334

257:                                              ; preds = %254
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.18)
          to label %258 unwind label %264

258:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !31
  br label %259

259:                                              ; preds = %324, %258
  %260 = load i32, ptr %20, align 4, !tbaa !31
  %261 = load i32, ptr %4, align 4, !tbaa !31
  %262 = icmp slt i32 %260, %261
  br i1 %262, label %268, label %263

263:                                              ; preds = %259
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %333

264:                                              ; preds = %334, %257
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %9, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %10, align 4
  br label %338

268:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %269 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %25, i32 0, i32 19
  %270 = load i32, ptr %20, align 4, !tbaa !31
  %271 = sext i32 %270 to i64
  %272 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %269, i64 noundef %271)
          to label %273 unwind label %281

273:                                              ; preds = %268
  store ptr %272, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !31
  br label %274

274:                                              ; preds = %315, %273
  %275 = load i32, ptr %23, align 4, !tbaa !31
  %276 = load ptr, ptr %21, align 8, !tbaa !5
  %277 = invoke noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %276)
          to label %278 unwind label %285

278:                                              ; preds = %274
  %279 = icmp ult i32 %275, %277
  br i1 %279, label %289, label %280

280:                                              ; preds = %278
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %319

281:                                              ; preds = %268
  %282 = landingpad { ptr, i32 }
          cleanup
  %283 = extractvalue { ptr, i32 } %282, 0
  store ptr %283, ptr %9, align 8
  %284 = extractvalue { ptr, i32 } %282, 1
  store i32 %284, ptr %10, align 4
  br label %332

285:                                              ; preds = %274
  %286 = landingpad { ptr, i32 }
          cleanup
  %287 = extractvalue { ptr, i32 } %286, 0
  store ptr %287, ptr %9, align 8
  %288 = extractvalue { ptr, i32 } %286, 1
  store i32 %288, ptr %10, align 4
  br label %318

289:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %290 = load ptr, ptr %21, align 8, !tbaa !5
  %291 = load i32, ptr %23, align 4, !tbaa !31
  %292 = zext i32 %291 to i64
  %293 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %290, i64 noundef %292)
          to label %294 unwind label %310

294:                                              ; preds = %289
  %295 = load i32, ptr %293, align 4, !tbaa !31
  store i32 %295, ptr %24, align 4, !tbaa !31
  %296 = load i32, ptr %24, align 4, !tbaa !31
  %297 = zext i32 %296 to i64
  %298 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef %297)
          to label %299 unwind label %310

299:                                              ; preds = %294
  %300 = load i8, ptr %298, align 1, !tbaa !41, !range !37, !noundef !38
  %301 = trunc i8 %300 to i1
  br i1 %301, label %314, label %302

302:                                              ; preds = %299
  %303 = load i32, ptr %24, align 4, !tbaa !31
  %304 = load ptr, ptr %21, align 8, !tbaa !5
  %305 = load i32, ptr %22, align 4, !tbaa !31
  %306 = add i32 %305, 1
  store i32 %306, ptr %22, align 4, !tbaa !31
  %307 = zext i32 %305 to i64
  %308 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %304, i64 noundef %307)
          to label %309 unwind label %310

309:                                              ; preds = %302
  store i32 %303, ptr %308, align 4, !tbaa !31
  br label %314

310:                                              ; preds = %302, %294, %289
  %311 = landingpad { ptr, i32 }
          cleanup
  %312 = extractvalue { ptr, i32 } %311, 0
  store ptr %312, ptr %9, align 8
  %313 = extractvalue { ptr, i32 } %311, 1
  store i32 %313, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %318

314:                                              ; preds = %309, %299
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %315

315:                                              ; preds = %314
  %316 = load i32, ptr %23, align 4, !tbaa !31
  %317 = add i32 %316, 1
  store i32 %317, ptr %23, align 4, !tbaa !31
  br label %274, !llvm.loop !44

318:                                              ; preds = %310, %285
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %331

319:                                              ; preds = %280
  %320 = load ptr, ptr %21, align 8, !tbaa !5
  %321 = load i32, ptr %22, align 4, !tbaa !31
  %322 = zext i32 %321 to i64
  invoke void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %320, i64 noundef %322, i1 noundef zeroext false)
          to label %323 unwind label %327

323:                                              ; preds = %319
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %324

324:                                              ; preds = %323
  %325 = load i32, ptr %20, align 4, !tbaa !31
  %326 = add nsw i32 %325, 1
  store i32 %326, ptr %20, align 4, !tbaa !31
  br label %259, !llvm.loop !45

327:                                              ; preds = %319
  %328 = landingpad { ptr, i32 }
          cleanup
  %329 = extractvalue { ptr, i32 } %328, 0
  store ptr %329, ptr %9, align 8
  %330 = extractvalue { ptr, i32 } %328, 1
  store i32 %330, ptr %10, align 4
  br label %331

331:                                              ; preds = %327, %318
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %332

332:                                              ; preds = %331, %281
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %338

333:                                              ; preds = %263
  br label %334

334:                                              ; preds = %333, %254
  %335 = load i32, ptr %3, align 4, !tbaa !31
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.19, i32 noundef %335)
          to label %336 unwind label %264

336:                                              ; preds = %334
  call void @_ZN6basisu6vectorIbED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %337

337:                                              ; preds = %336, %30
  ret void

338:                                              ; preds = %332, %264, %253
  call void @_ZN6basisu6vectorIbED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %339

339:                                              ; preds = %338
  %340 = load ptr, ptr %9, align 8
  %341 = load i32, ptr %10, align 4
  %342 = insertvalue { ptr, i32 } poison, ptr %340, 0
  %343 = insertvalue { ptr, i32 } %342, i32 %341, 1
  resume { ptr, i32 } %343

344:                                              ; preds = %245, %234
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu9etc_block12set_flip_bitEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) #1 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef, i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef, i1 noundef zeroext) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend34get_selector_cluster_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef) #3 align 2

declare noundef i64 @_ZNK6basisu9etc_block19evaluate_etc1_errorEPKNS_10color_rgbaEbi(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i1 noundef zeroext, i32 noundef) #0

; 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) #3 align 2

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

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

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

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

attributes #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 40}
!10 = !{!"_ZTSN6basisu15basisu_frontendE", !11, i64 0, !12, i64 88, !12, i64 92, !13, i64 96, !13, i64 97, !13, i64 98, !12, i64 100, !12, i64 104, !16, i64 112, !17, i64 128, !17, i64 144, !17, i64 160, !18, i64 176, !21, i64 216, !21, i64 232, !22, i64 248, !21, i64 264, !23, i64 280, !24, i64 296, !21, i64 312, !17, i64 328, !21, i64 344, !22, i64 360, !21, i64 376, !25, i64 392, !26, i64 408, !27, i64 424, !28, i64 440, !29, i64 456}
!11 = !{!"_ZTSN6basisu15basisu_frontend6paramsE", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !13, i64 28, !13, i64 29, !13, i64 30, !13, i64 31, !13, i64 32, !13, i64 33, !13, i64 34, !6, i64 40, !12, i64 48, !12, i64 52, !13, i64 56, !14, i64 60, !15, i64 64, !6, i64 72, !6, i64 80}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTSN6basist18basis_texture_typeE", !7, i64 0}
!16 = !{!"_ZTSN6basisu6vectorINS_11pixel_blockEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!17 = !{!"_ZTSN6basisu6vectorINS_9etc_blockEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!18 = !{!"_ZTSN6basisu17tree_vector_quantINS_3vecILj6EfEEEE", !19, i64 0, !20, i64 16, !12, i64 32}
!19 = !{!"_ZTSN6basisu6vectorINS_17tree_vector_quantINS_3vecILj6EfEEE9tsvq_nodeEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!20 = !{!"_ZTSN6basisu6vectorISt4pairINS_3vecILj6EfEEmEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!21 = !{!"_ZTSN6basisu6vectorINS0_IjEEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!22 = !{!"_ZTSN6basisu6vectorIhEE", !6, i64 0, !12, i64 8, !12, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!24 = !{!"_ZTSN6basisu6vectorINS_5vec2UEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!26 = !{!"_ZTSN6basisu6vectorIbEE", !6, i64 0, !12, i64 8, !12, i64 12}
!27 = !{!"_ZTSN6basisu6vectorIjEE", !6, i64 0, !12, i64 8, !12, i64 12}
!28 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27subblock_endpoint_quant_errEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!29 = !{!"_ZTSSt5mutex", !30, i64 0}
!30 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!31 = !{!12, !12, i64 0}
!32 = !{!10, !12, i64 88}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}
!36 = !{!10, !13, i64 28}
!37 = !{i8 0, i8 2}
!38 = !{}
!39 = !{!40, !40, i64 0}
!40 = !{!"long", !7, i64 0}
!41 = !{!13, !13, i64 0}
!42 = distinct !{!42, !34}
!43 = distinct !{!43, !34}
!44 = distinct !{!44, !34}
!45 = distinct !{!45, !34}


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

%"class.basisu::vector.16" = type { ptr, i32, i32 }
%"struct.basisu::etc_block" = type { %union.anon.22 }
%union.anon.22 = type { i64 }

@.str.16 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [58 x i8], align 1

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) local_unnamed_addr #0

; 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 #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend35introduce_special_selector_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.basisu::vector.16", align 8
  %3 = alloca %"struct.basisu::etc_block", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.basisu::etc_block", align 8
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.16)
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %135

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 312
  %10 = tail call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  %11 = getelementptr inbounds i8, ptr %0, i64 88
  %12 = load i32, ptr %11, align 8, !tbaa !30
  %13 = zext i32 %12 to i64
  call void @_ZN6basisu6vectorIbEC2Em(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %13)
  %14 = getelementptr inbounds i8, ptr %0, i64 328
  %15 = getelementptr inbounds i8, ptr %0, i64 144
  %16 = getelementptr inbounds i8, ptr %0, i64 424
  %17 = getelementptr inbounds i8, ptr %0, i64 28
  %18 = getelementptr inbounds i8, ptr %0, i64 128
  br label %.preheader66

19:                                               ; preds = %107
  %.not58 = icmp eq i32 %.4, 0
  br i1 %.not58, label %.loopexit, label %110

.preheader66:                                     ; preds = %8, %107
  %.088 = phi i32 [ 0, %8 ], [ %.4, %107 ]
  %.04387 = phi i32 [ 0, %8 ], [ %108, %107 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @_ZN6basisu9clear_objINS_9etc_blockEEEvRT_(ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef 0, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 0, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 0, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 3, i32 noundef 0, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef 1, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 1, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 1, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 3, i32 noundef 1, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef 2, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 2, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 2, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 3, i32 noundef 2, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef 3, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 3, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 3, i32 noundef %.04387)
  call void @_ZN6basisu9etc_block12set_selectorEjjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 3, i32 noundef 3, i32 noundef %.04387)
  %20 = call noundef i32 @_ZNK6basisu6vectorINS_9etc_blockEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader66, %28
  %indvars.iv = phi i64 [ %indvars.iv.next, %28 ], [ 0, %.preheader66 ]
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %14, i64 noundef %indvars.iv)
  %23 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %22)
  %24 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %25 = icmp eq i32 %23, %24
  br i1 %25, label %._crit_edge.loopexit, label %28

26:                                               ; preds = %34
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %109

28:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = call noundef i32 @_ZNK6basisu6vectorINS_9etc_blockEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !31

._crit_edge.loopexit:                             ; preds = %.lr.ph, %28
  %.056.lcssa.ph.in = phi i64 [ %indvars.iv.next, %28 ], [ %indvars.iv, %.lr.ph ]
  %.056.lcssa.ph = trunc i64 %.056.lcssa.ph.in to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader66
  %.056.lcssa = phi i32 [ 0, %.preheader66 ], [ %.056.lcssa.ph, %._crit_edge.loopexit ]
  %32 = call noundef i32 @_ZNK6basisu6vectorINS_9etc_blockEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %33 = icmp slt i32 %.056.lcssa, %32
  br i1 %33, label %107, label %34

34:                                               ; preds = %._crit_edge
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.17, i32 noundef %.04387)
          to label %35 unwind label %26

35:                                               ; preds = %34
  %36 = call noundef i32 @_ZNK6basisu6vectorINS_9etc_blockEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  invoke void @_ZN6basisu6vectorINS_9etc_blockEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %37 unwind label %41

37:                                               ; preds = %35
  %38 = zext i32 %36 to i64
  invoke void @_ZN6basisu30vector_ensure_element_is_validINS_6vectorINS1_IjEEEEEEvRT_m(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %38)
          to label %39 unwind label %41

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !33
  %40 = load i32, ptr %11, align 8, !tbaa !30
  %.not97 = icmp eq i32 %40, 0
  br i1 %.not97, label %._crit_edge85, label %.lr.ph84

._crit_edge85:                                    ; preds = %101, %39
  %.1.lcssa = phi i32 [ %.088, %39 ], [ %.3, %101 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %107

41:                                               ; preds = %37, %35
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %109

.lr.ph84:                                         ; preds = %39, %101
  %.182 = phi i32 [ %.3, %101 ], [ %.088, %39 ]
  %storemerge81 = phi i32 [ %103, %101 ], [ 0, %39 ]
  %43 = zext i32 %storemerge81 to i64
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %15, i64 noundef %43)
  %45 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %.not59 = icmp eq i32 %45, %46
  br i1 %.not59, label %47, label %101

47:                                               ; preds = %.lr.ph84
  %48 = load i32, ptr %4, align 4, !tbaa !33
  %49 = zext i32 %48 to i64
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %49)
  %51 = load i32, ptr %50, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %52 = load i32, ptr %4, align 4, !tbaa !33
  %53 = invoke noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %52, i32 noundef 0)
          to label %54 unwind label %80

54:                                               ; preds = %47
  %55 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %53, i1 noundef zeroext false)
          to label %56 unwind label %80

56:                                               ; preds = %54
  invoke void @_ZN6basisu9etc_block22set_block_color5_etc1sERKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 1 dereferenceable(4) %55)
          to label %57 unwind label %80

57:                                               ; preds = %56
  %58 = call noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %53, i1 noundef zeroext false)
  invoke void @_ZN6basisu9etc_block22set_inten_tables_etc1sEj(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %58)
          to label %59 unwind label %80

59:                                               ; preds = %57
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend34get_selector_cluster_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %51)
          to label %61 unwind label %80

61:                                               ; preds = %59
  %62 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %60)
  call void @_ZN6basisu9etc_block21set_raw_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %62)
  call void @_ZN6basisu9etc_block12set_flip_bitEb(ptr noundef nonnull align 8 dereferenceable(8) %5, i1 noundef zeroext true)
  %63 = load i32, ptr %4, align 4, !tbaa !33
  %64 = invoke noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %63)
          to label %65 unwind label %82

65:                                               ; preds = %61
  %66 = call noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %64)
  %67 = load i8, ptr %17, align 4, !tbaa !34, !range !35, !noundef !36
  %68 = trunc nuw i8 %67 to i1
  %69 = invoke noundef i64 @_ZNK6basisu9etc_block19evaluate_etc1_errorEPKNS_10color_rgbaEbi(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %66, i1 noundef zeroext %68, i32 noundef -1)
          to label %70 unwind label %82

70:                                               ; preds = %65
  %71 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @_ZN6basisu9etc_block21set_raw_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %71)
  %72 = load i32, ptr %4, align 4, !tbaa !33
  %73 = invoke noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %72)
          to label %74 unwind label %84

74:                                               ; preds = %70
  %75 = call noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %73)
  %76 = load i8, ptr %17, align 4, !tbaa !34, !range !35, !noundef !36
  %77 = trunc nuw i8 %76 to i1
  %78 = invoke noundef i64 @_ZNK6basisu9etc_block19evaluate_etc1_errorEPKNS_10color_rgbaEbi(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %75, i1 noundef zeroext %77, i32 noundef -1)
          to label %79 unwind label %84

79:                                               ; preds = %74
  %.not60 = icmp ult i64 %78, %69
  br i1 %.not60, label %86, label %100

80:                                               ; preds = %59, %57, %56, %54, %47
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %106

82:                                               ; preds = %65, %61
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %106

84:                                               ; preds = %86, %74, %70
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %106

86:                                               ; preds = %79
  %87 = load i32, ptr %4, align 4, !tbaa !33
  %88 = zext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %88)
  store i32 %36, ptr %89, align 4, !tbaa !33
  %90 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %38)
  invoke void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %90, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %91 unwind label %84

91:                                               ; preds = %86
  %92 = load i32, ptr %4, align 4, !tbaa !33
  %93 = zext i32 %92 to i64
  %94 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %93)
  store i8 1, ptr %94, align 1, !tbaa !37
  %95 = add i32 %.182, 1
  %96 = load i32, ptr %4, align 4, !tbaa !33
  %97 = zext i32 %96 to i64
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %97)
  %99 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @_ZN6basisu9etc_block21set_raw_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(8) %98, i32 noundef %99)
  br label %100

100:                                              ; preds = %79, %91
  %.2 = phi i32 [ %95, %91 ], [ %.182, %79 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %101

101:                                              ; preds = %100, %.lr.ph84
  %.3 = phi i32 [ %.182, %.lr.ph84 ], [ %.2, %100 ]
  %102 = load i32, ptr %4, align 4, !tbaa !33
  %103 = add i32 %102, 1
  store i32 %103, ptr %4, align 4, !tbaa !33
  %104 = load i32, ptr %11, align 8, !tbaa !30
  %105 = icmp ult i32 %103, %104
  br i1 %105, label %.lr.ph84, label %._crit_edge85, !llvm.loop !38

106:                                              ; preds = %82, %84, %80
  %.pn.pn = phi { ptr, i32 } [ %81, %80 ], [ %85, %84 ], [ %83, %82 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %109

107:                                              ; preds = %._crit_edge, %._crit_edge85
  %.4 = phi i32 [ %.1.lcssa, %._crit_edge85 ], [ %.088, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %108 = add nuw nsw i32 %.04387, 1
  %exitcond.not = icmp eq i32 %108, 4
  br i1 %exitcond.not, label %19, label %.preheader66, !llvm.loop !39

109:                                              ; preds = %41, %106, %26
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %27, %26 ], [ %.pn.pn, %106 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %136

110:                                              ; preds = %19
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.18)
          to label %.preheader unwind label %112

.preheader:                                       ; preds = %110
  %111 = icmp sgt i32 %10, 0
  br i1 %111, label %.lr.ph96.preheader, label %.loopexit

.lr.ph96.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %10 to i64
  br label %.lr.ph96

112:                                              ; preds = %.loopexit, %110
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %136

.lr.ph96:                                         ; preds = %.lr.ph96.preheader, %131
  %indvars.iv104 = phi i64 [ 0, %.lr.ph96.preheader ], [ %indvars.iv.next105, %131 ]
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %indvars.iv104)
  %115 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %114)
  %.not98 = icmp eq i32 %115, 0
  br i1 %.not98, label %._crit_edge93, label %.lr.ph92

._crit_edge93:                                    ; preds = %127, %.lr.ph96
  %.041.lcssa = phi i32 [ 0, %.lr.ph96 ], [ %.142, %127 ]
  %116 = zext i32 %.041.lcssa to i64
  invoke void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %114, i64 noundef %116, i1 noundef zeroext false)
          to label %131 unwind label %132

.lr.ph92:                                         ; preds = %.lr.ph96, %127
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %127 ], [ 0, %.lr.ph96 ]
  %.04189 = phi i32 [ %.142, %127 ], [ 0, %.lr.ph96 ]
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %114, i64 noundef %indvars.iv100)
  %118 = load i32, ptr %117, align 4, !tbaa !33
  %119 = zext i32 %118 to i64
  %120 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %119)
  %121 = load i8, ptr %120, align 1, !tbaa !37, !range !35, !noundef !36
  %122 = trunc nuw i8 %121 to i1
  br i1 %122, label %127, label %123

123:                                              ; preds = %.lr.ph92
  %124 = add i32 %.04189, 1
  %125 = zext i32 %.04189 to i64
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %114, i64 noundef %125)
  store i32 %118, ptr %126, align 4, !tbaa !33
  br label %127

127:                                              ; preds = %123, %.lr.ph92
  %.142 = phi i32 [ %.04189, %.lr.ph92 ], [ %124, %123 ]
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %128 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %114)
  %129 = zext i32 %128 to i64
  %130 = icmp ult i64 %indvars.iv.next101, %129
  br i1 %130, label %.lr.ph92, label %._crit_edge93, !llvm.loop !40

131:                                              ; preds = %._crit_edge93
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count
  br i1 %exitcond108.not, label %.loopexit, label %.lr.ph96, !llvm.loop !41

132:                                              ; preds = %._crit_edge93
  %133 = landingpad { ptr, i32 }
          cleanup
  br label %136

.loopexit:                                        ; preds = %131, %.preheader, %19
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.19, i32 noundef %.4)
          to label %134 unwind label %112

134:                                              ; preds = %.loopexit
  call void @_ZN6basisu6vectorIbED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  br label %135

135:                                              ; preds = %1, %134
  ret void

136:                                              ; preds = %132, %112, %109
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %109 ], [ %133, %132 ], [ %113, %112 ]
  call void @_ZN6basisu6vectorIbED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn.pn.pn.pn.pn
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu9etc_block12set_flip_bitEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #1 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef, i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef, i1 noundef zeroext) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend34get_selector_cluster_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef) local_unnamed_addr #3 align 2

declare noundef i64 @_ZNK6basisu9etc_block19evaluate_etc1_errorEPKNS_10color_rgbaEbi(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #0

; 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 #3 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 #5 align 2

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

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

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

attributes #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 40}
!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 = !{!6, !8, i64 88}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!8, !8, i64 0}
!34 = !{!6, !12, i64 28}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = !{!12, !12, i64 0}
!38 = distinct !{!38, !32}
!39 = distinct !{!39, !32}
!40 = distinct !{!40, !32}
!41 = distinct !{!41, !32}


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