; 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_block" = type { %union.anon.22 }
%union.anon.22 = type { i64 }
%"struct.basist::etc1_global_selector_codebook_entry_id" = type <{ i32, %"class.basist::etc1_global_palette_entry_modifier", [3 x i8] }>
%"class.basist::etc1_global_palette_entry_modifier" = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%"struct.basist::etc1_selector_palette_entry" = type { [16 x i8] }
%"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.16" = 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.57 = external hidden unnamed_addr constant [17 x i8], align 1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN6basisuL21handle_verify_failureEi(i32 noundef) #5

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK6basisu15basisu_frontend15validate_outputEv(ptr noundef nonnull align 8 dereferenceable(496) %0) #4 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca %"struct.basisu::etc_block", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca %"struct.basist::etc1_global_selector_codebook_entry_id", align 4
  %14 = alloca %"struct.basist::etc1_selector_palette_entry", align 1
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.57)
  %18 = call noundef zeroext i1 @_ZNK6basisu15basisu_frontend23check_etc1s_constraintsEv(ptr noundef nonnull align 8 dereferenceable(496) %17)
  br i1 %18, label %20, label %19

19:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %250

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

21:                                               ; preds = %246, %20
  %22 = load i32, ptr %4, align 4, !tbaa !9
  %23 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %17, i32 0, i32 1
  %24 = load i32, ptr %23, align 8, !tbaa !11
  %25 = icmp ult i32 %22, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %21
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %249

27:                                               ; preds = %21
  br label %28

28:                                               ; preds = %27
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend16get_output_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %29)
  %31 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_flip_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = zext i1 %31 to i32
  %33 = icmp eq i32 %32, 1
  br i1 %33, label %35, label %34

34:                                               ; preds = %28
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2853)
  br label %35

35:                                               ; preds = %34, %28
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #8
  %38 = load i32, ptr %4, align 4, !tbaa !9
  %39 = call noundef zeroext i1 @_ZNK6basisu15basisu_frontend13get_diff_flagEj(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %38)
  %40 = zext i1 %39 to i8
  store i8 %40, ptr %6, align 1, !tbaa !32
  br label %41

41:                                               ; preds = %37
  %42 = load i8, ptr %6, align 1, !tbaa !32, !range !33, !noundef !34
  %43 = trunc i8 %42 to i1
  %44 = zext i1 %43 to i32
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2856)
  br label %47

47:                                               ; preds = %46, %41
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 8, i1 false)
  call void @_ZN6basisu9etc_block12set_flip_bitEb(ptr noundef nonnull align 8 dereferenceable(8) %7, i1 noundef zeroext true)
  call void @_ZN6basisu9etc_block12set_diff_bitEb(ptr noundef nonnull align 8 dereferenceable(8) %7, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %50 = load i32, ptr %4, align 4, !tbaa !9
  %51 = call noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %50, i32 noundef 0)
  store i32 %51, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %52 = load i32, ptr %4, align 4, !tbaa !9
  %53 = call noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %52, i32 noundef 1)
  store i32 %53, ptr %9, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %49
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = icmp eq i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2867)
  br label %59

59:                                               ; preds = %58, %54
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %63, i1 noundef zeroext false)
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %65, i1 noundef zeroext false)
  %67 = call noundef zeroext i1 @_ZN6basisu9etc_block22set_block_color5_checkERKNS_10color_rgbaES3_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 1 dereferenceable(4) %64, ptr noundef nonnull align 1 dereferenceable(4) %66)
  br i1 %67, label %69, label %68

68:                                               ; preds = %62
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2869)
  br label %69

69:                                               ; preds = %68, %62
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = call noundef zeroext i1 @_ZNK6basisu15basisu_frontend34get_endpoint_cluster_color_is_usedEjb(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %73, i1 noundef zeroext false)
  br i1 %74, label %76, label %75

75:                                               ; preds = %72
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2871)
  br label %76

76:                                               ; preds = %75, %72
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = call noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %79, i1 noundef zeroext false)
  call void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0, i32 noundef %80)
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = call noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %81, i1 noundef zeroext false)
  call void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 1, i32 noundef %82)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %83 = load i32, ptr %4, align 4, !tbaa !9
  %84 = call noundef i32 @_ZNK6basisu15basisu_frontend32get_block_selector_cluster_indexEj(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %83)
  store i32 %84, ptr %10, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %78
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_selector_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %17)
  %88 = icmp ult i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2877)
  br label %90

90:                                               ; preds = %89, %85
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu15basisu_frontend34get_selector_cluster_block_indicesEj(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %94)
  %96 = call noundef i32 @_ZN6basisu11vector_findINS_6vectorIjEEEEiRKT_RKNS3_10value_typeE(ptr noundef nonnull align 8 dereferenceable(16) %95, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %97 = icmp ne i32 %96, -1
  br i1 %97, label %99, label %98

98:                                               ; preds = %93
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2879)
  br label %99

99:                                               ; preds = %98, %93
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %10, align 4, !tbaa !9
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend34get_selector_cluster_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %102)
  %104 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %103)
  call void @_ZN6basisu9etc_block21set_raw_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef %104)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %105 = load i32, ptr %4, align 4, !tbaa !9
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend16get_output_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %17, i32 noundef %105)
  store ptr %106, ptr %11, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %101
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_flip_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %108)
  %110 = zext i1 %109 to i32
  %111 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_flip_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %112 = zext i1 %111 to i32
  %113 = icmp eq i32 %110, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %107
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2885)
  br label %115

115:                                              ; preds = %114, %107
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %119)
  %121 = zext i1 %120 to i32
  %122 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %123 = zext i1 %122 to i32
  %124 = icmp eq i32 %121, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %118
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2886)
  br label %126

126:                                              ; preds = %125, %118
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = call noundef i32 @_ZNK6basisu9etc_block15get_inten_tableEj(ptr noundef nonnull align 8 dereferenceable(8) %130, i32 noundef 0)
  %132 = call noundef i32 @_ZNK6basisu9etc_block15get_inten_tableEj(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0)
  %133 = icmp eq i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %129
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2887)
  br label %135

135:                                              ; preds = %134, %129
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = call noundef i32 @_ZNK6basisu9etc_block15get_inten_tableEj(ptr noundef nonnull align 8 dereferenceable(8) %139, i32 noundef 1)
  %141 = call noundef i32 @_ZNK6basisu9etc_block15get_inten_tableEj(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 1)
  %142 = icmp eq i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %138
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2888)
  br label %144

144:                                              ; preds = %143, %138
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = call noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %148)
  %150 = zext i16 %149 to i32
  %151 = call noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %152 = zext i16 %151 to i32
  %153 = icmp eq i32 %150, %152
  br i1 %153, label %155, label %154

154:                                              ; preds = %147
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2889)
  br label %155

155:                                              ; preds = %154, %147
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  %160 = call noundef zeroext i16 @_ZNK6basisu9etc_block16get_delta3_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %159)
  %161 = zext i16 %160 to i32
  %162 = call noundef zeroext i16 @_ZNK6basisu9etc_block16get_delta3_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %163 = zext i16 %162 to i32
  %164 = icmp eq i32 %161, %163
  br i1 %164, label %166, label %165

165:                                              ; preds = %158
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2890)
  br label %166

166:                                              ; preds = %165, %158
  br label %167

167:                                              ; preds = %166
  br label %168

168:                                              ; preds = %167
  br label %169

169:                                              ; preds = %168
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  %171 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %170)
  %172 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %173 = icmp eq i32 %171, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %169
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2891)
  br label %175

175:                                              ; preds = %174, %169
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  %178 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %17, i32 0, i32 0
  %179 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %178, i32 0, i32 12
  %180 = load ptr, ptr %179, align 8, !tbaa !35
  %181 = icmp ne ptr %180, null
  br i1 %181, label %182, label %245

182:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #8
  store i8 1, ptr %12, align 1, !tbaa !32
  %183 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %17, i32 0, i32 0
  %184 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %183, i32 0, i32 15
  %185 = load i8, ptr %184, align 8, !tbaa !36, !range !33, !noundef !34
  %186 = trunc i8 %185 to i1
  br i1 %186, label %187, label %195

187:                                              ; preds = %182
  %188 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %17, i32 0, i32 25
  %189 = load i32, ptr %10, align 4, !tbaa !9
  %190 = zext i32 %189 to i64
  %191 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %188, i64 noundef %190)
  %192 = load i8, ptr %191, align 1, !tbaa !32, !range !33, !noundef !34
  %193 = trunc i8 %192 to i1
  %194 = zext i1 %193 to i8
  store i8 %194, ptr %12, align 1, !tbaa !32
  br label %195

195:                                              ; preds = %187, %182
  %196 = load i8, ptr %12, align 1, !tbaa !32, !range !33, !noundef !34
  %197 = trunc i8 %196 to i1
  br i1 %197, label %198, label %244

198:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 20, ptr %13) #8
  %199 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu15basisu_frontend46get_selector_cluster_global_selector_entry_idsEv(ptr noundef nonnull align 8 dereferenceable(496) %17)
  %200 = load i32, ptr %10, align 4, !tbaa !9
  %201 = zext i32 %200 to i64
  %202 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZNK6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %199, i64 noundef %201)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %202, i64 20, i1 false), !tbaa.struct !37
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #8
  %203 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %17, i32 0, i32 0
  %204 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %203, i32 0, i32 12
  %205 = load ptr, ptr %204, align 8, !tbaa !35
  %206 = call { i64, i64 } @_ZNK6basist29etc1_global_selector_codebook9get_entryERKNS_38etc1_global_selector_codebook_entry_idE(ptr noundef nonnull align 8 dereferenceable(16) %205, ptr noundef nonnull align 4 dereferenceable(17) %13)
  %207 = getelementptr inbounds %"struct.basist::etc1_selector_palette_entry", ptr %14, i32 0, i32 0
  %208 = getelementptr inbounds { i64, i64 }, ptr %207, i32 0, i32 0
  %209 = extractvalue { i64, i64 } %206, 0
  store i64 %209, ptr %208, align 1
  %210 = getelementptr inbounds { i64, i64 }, ptr %207, i32 0, i32 1
  %211 = extractvalue { i64, i64 } %206, 1
  store i64 %211, ptr %210, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %212

212:                                              ; preds = %240, %198
  %213 = load i32, ptr %15, align 4, !tbaa !9
  %214 = icmp ult i32 %213, 4
  br i1 %214, label %216, label %215

215:                                              ; preds = %212
  store i32 33, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %243

216:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %217

217:                                              ; preds = %236, %216
  %218 = load i32, ptr %16, align 4, !tbaa !9
  %219 = icmp ult i32 %218, 4
  br i1 %219, label %221, label %220

220:                                              ; preds = %217
  store i32 36, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %239

221:                                              ; preds = %217
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %16, align 4, !tbaa !9
  %224 = load i32, ptr %15, align 4, !tbaa !9
  %225 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %14, i32 noundef %223, i32 noundef %224)
  %226 = load i8, ptr %225, align 1, !tbaa !38
  %227 = zext i8 %226 to i32
  %228 = load i32, ptr %16, align 4, !tbaa !9
  %229 = load i32, ptr %15, align 4, !tbaa !9
  %230 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef %228, i32 noundef %229)
  %231 = icmp eq i32 %227, %230
  br i1 %231, label %233, label %232

232:                                              ; preds = %222
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %233

233:                                              ; preds = %232, %222
  br label %234

234:                                              ; preds = %233
  br label %235

235:                                              ; preds = %234
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %16, align 4, !tbaa !9
  %238 = add i32 %237, 1
  store i32 %238, ptr %16, align 4, !tbaa !9
  br label %217, !llvm.loop !39

239:                                              ; preds = %220
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %15, align 4, !tbaa !9
  %242 = add i32 %241, 1
  store i32 %242, ptr %15, align 4, !tbaa !9
  br label %212, !llvm.loop !41

243:                                              ; preds = %215
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 20, ptr %13) #8
  br label %244

244:                                              ; preds = %243, %195
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #8
  br label %245

245:                                              ; preds = %244, %177
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #8
  br label %246

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

249:                                              ; preds = %26
  store i1 true, ptr %2, align 1
  br label %250

250:                                              ; preds = %249, %19
  %251 = load i1, ptr %2, align 1
  ret i1 %251
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu9etc_block12set_flip_bitEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) #5 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) #5 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)) #5 align 2

; 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) #4 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) #4 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) #6 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) #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) #7 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)) #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8)) #7 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)) #5 align 2

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu15basisu_frontend46get_selector_cluster_global_selector_entry_idsEv(ptr noundef nonnull align 8 dereferenceable(496)) #6 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZNK6basist29etc1_global_selector_codebook9get_entryERKNS_38etc1_global_selector_codebook_entry_idE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(17)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16), i32 noundef, i32 noundef) #6 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 = !{!14, !14, i64 0}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!12, !6, i64 40}
!36 = !{!12, !14, i64 56}
!37 = !{i64 0, i64 4, !9, i64 4, i64 1, !38, i64 5, i64 1, !32, i64 6, i64 1, !32, i64 7, i64 1, !32, i64 8, i64 1, !32, i64 9, i64 1, !32, i64 10, i64 1, !32, i64 11, i64 1, !32, i64 12, i64 1, !32, i64 13, i64 1, !32, i64 14, i64 1, !32, i64 15, i64 1, !32, i64 16, i64 1, !38}
!38 = !{!7, !7, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}
!42 = distinct !{!42, !40}


; 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_block" = type { %union.anon.22 }
%union.anon.22 = type { i64 }
%"struct.basist::etc1_global_selector_codebook_entry_id" = type <{ i32, %"class.basist::etc1_global_palette_entry_modifier", [3 x i8] }>
%"class.basist::etc1_global_palette_entry_modifier" = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%"struct.basist::etc1_selector_palette_entry" = type { [16 x i8] }

@.str.57 = external hidden unnamed_addr constant [17 x i8], align 1

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

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

; 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 uwtable
declare dso_local noundef zeroext i1 @_ZNK6basisu15basisu_frontend23check_etc1s_constraintsEv(ptr noundef nonnull align 8 dereferenceable(496)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN6basisuL21handle_verify_failureEi(i32 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK6basisu15basisu_frontend15validate_outputEv(ptr noundef nonnull align 8 dereferenceable(496) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca %"struct.basisu::etc_block", align 8
  %4 = alloca %"struct.basist::etc1_global_selector_codebook_entry_id", align 4
  %5 = alloca %"struct.basist::etc1_selector_palette_entry", align 8
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.57)
  %6 = tail call noundef zeroext i1 @_ZNK6basisu15basisu_frontend23check_etc1s_constraintsEv(ptr noundef nonnull align 8 dereferenceable(496) %0)
  br i1 %6, label %7, label %218

7:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %8 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 0, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr %8, align 8, !tbaa !9
  %.not39 = icmp eq i32 %9, 0
  br i1 %.not39, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = getelementptr inbounds i8, ptr %0, i64 56
  %12 = getelementptr inbounds i8, ptr %0, i64 408
  %13 = getelementptr inbounds i8, ptr %5, i64 8
  br label %14

._crit_edge:                                      ; preds = %213, %7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %218

14:                                               ; preds = %.lr.ph, %213
  %storemerge38 = phi i32 [ 0, %.lr.ph ], [ %215, %213 ]
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend16get_output_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %storemerge38)
  %16 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_flip_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2853)
  br label %18

18:                                               ; preds = %17, %14
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = call noundef zeroext i1 @_ZNK6basisu15basisu_frontend13get_diff_flagEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %19)
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2856)
  br label %22

22:                                               ; preds = %21, %18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 0, ptr %3, align 8
  call void @_ZN6basisu9etc_block12set_flip_bitEb(ptr noundef nonnull align 8 dereferenceable(8) %3, i1 noundef zeroext true)
  call void @_ZN6basisu9etc_block12set_diff_bitEb(ptr noundef nonnull align 8 dereferenceable(8) %3, i1 noundef zeroext true)
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = call noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %23, i32 noundef 0)
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = call noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %25, i32 noundef 1)
  %27 = icmp eq i32 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2867)
  br label %29

29:                                               ; preds = %22, %28
  %30 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %24, i1 noundef zeroext false)
  %31 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %26, i1 noundef zeroext false)
  %32 = call noundef zeroext i1 @_ZN6basisu9etc_block22set_block_color5_checkERKNS_10color_rgbaES3_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 1 dereferenceable(4) %30, ptr noundef nonnull align 1 dereferenceable(4) %31)
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2869)
  br label %34

34:                                               ; preds = %29, %33
  %35 = call noundef zeroext i1 @_ZNK6basisu15basisu_frontend34get_endpoint_cluster_color_is_usedEjb(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %24, i1 noundef zeroext false)
  br i1 %35, label %37, label %36

36:                                               ; preds = %34
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2871)
  br label %37

37:                                               ; preds = %36, %34
  %38 = call noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %24, i1 noundef zeroext false)
  call void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef %38)
  %39 = call noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %26, i1 noundef zeroext false)
  call void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef %39)
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = call noundef i32 @_ZNK6basisu15basisu_frontend32get_block_selector_cluster_indexEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %40)
  %42 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_selector_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %0)
  %43 = icmp ult i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %37
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2877)
  br label %45

45:                                               ; preds = %37, %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu15basisu_frontend34get_selector_cluster_block_indicesEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %41)
  %47 = call noundef i32 @_ZN6basisu11vector_findINS_6vectorIjEEEEiRKT_RKNS3_10value_typeE(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.not = icmp eq i32 %47, -1
  br i1 %.not, label %48, label %49

48:                                               ; preds = %45
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2879)
  br label %49

49:                                               ; preds = %48, %45
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend34get_selector_cluster_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %41)
  %51 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %50)
  call void @_ZN6basisu9etc_block21set_raw_selector_bitsEj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %51)
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend16get_output_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %52)
  %54 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_flip_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %53)
  %55 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_flip_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %56 = xor i1 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %49
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2885)
  br label %58

58:                                               ; preds = %49, %57
  %59 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %53)
  %60 = call noundef zeroext i1 @_ZNK6basisu9etc_block12get_diff_bitEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %61 = xor i1 %59, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2886)
  br label %63

63:                                               ; preds = %58, %62
  %64 = call noundef i32 @_ZNK6basisu9etc_block15get_inten_tableEj(ptr noundef nonnull align 8 dereferenceable(8) %53, i32 noundef 0)
  %65 = call noundef i32 @_ZNK6basisu9etc_block15get_inten_tableEj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0)
  %66 = icmp eq i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2887)
  br label %68

68:                                               ; preds = %63, %67
  %69 = call noundef i32 @_ZNK6basisu9etc_block15get_inten_tableEj(ptr noundef nonnull align 8 dereferenceable(8) %53, i32 noundef 1)
  %70 = call noundef i32 @_ZNK6basisu9etc_block15get_inten_tableEj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1)
  %71 = icmp eq i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2888)
  br label %73

73:                                               ; preds = %68, %72
  %74 = call noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %53)
  %75 = call noundef zeroext i16 @_ZNK6basisu9etc_block15get_base5_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %76 = icmp eq i16 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2889)
  br label %78

78:                                               ; preds = %73, %77
  %79 = call noundef zeroext i16 @_ZNK6basisu9etc_block16get_delta3_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %53)
  %80 = call noundef zeroext i16 @_ZNK6basisu9etc_block16get_delta3_colorEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %81 = icmp eq i16 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2890)
  br label %83

83:                                               ; preds = %78, %82
  %84 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %53)
  %85 = call noundef i32 @_ZNK6basisu9etc_block21get_raw_selector_bitsEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %86 = icmp eq i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2891)
  br label %88

88:                                               ; preds = %87, %83
  %89 = load ptr, ptr %10, align 8, !tbaa !31
  %.not34 = icmp eq ptr %89, null
  br i1 %.not34, label %213, label %90

90:                                               ; preds = %88
  %91 = load i8, ptr %11, align 8, !tbaa !32, !range !33, !noundef !34
  %92 = trunc nuw i8 %91 to i1
  %93 = zext i32 %41 to i64
  br i1 %92, label %94, label %.thread

94:                                               ; preds = %90
  %95 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %12, i64 noundef %93)
  %96 = load i8, ptr %95, align 1, !tbaa !35, !range !33, !noundef !34
  %97 = trunc nuw i8 %96 to i1
  br i1 %97, label %.thread, label %213

.thread:                                          ; preds = %90, %94
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %4) #7
  %98 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu15basisu_frontend46get_selector_cluster_global_selector_entry_idsEv(ptr noundef nonnull align 8 dereferenceable(496) %0)
  %99 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZNK6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %98, i64 noundef %93)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %4, ptr noundef nonnull align 4 dereferenceable(20) %99, i64 20, i1 false), !tbaa.struct !36
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %100 = load ptr, ptr %10, align 8, !tbaa !31
  %101 = call { i64, i64 } @_ZNK6basist29etc1_global_selector_codebook9get_entryERKNS_38etc1_global_selector_codebook_entry_idE(ptr noundef nonnull align 8 dereferenceable(16) %100, ptr noundef nonnull align 4 dereferenceable(17) %4)
  %102 = extractvalue { i64, i64 } %101, 0
  store i64 %102, ptr %5, align 8
  %103 = extractvalue { i64, i64 } %101, 1
  store i64 %103, ptr %13, align 8
  %104 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 0, i32 noundef 0)
  %105 = load i8, ptr %104, align 1, !tbaa !37
  %106 = zext i8 %105 to i32
  %107 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef 0)
  %108 = icmp eq i32 %107, %106
  br i1 %108, label %110, label %109

109:                                              ; preds = %.thread
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %110

110:                                              ; preds = %.thread, %109
  %111 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 1, i32 noundef 0)
  %112 = load i8, ptr %111, align 1, !tbaa !37
  %113 = zext i8 %112 to i32
  %114 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 0)
  %115 = icmp eq i32 %114, %113
  br i1 %115, label %117, label %116

116:                                              ; preds = %110
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %117

117:                                              ; preds = %116, %110
  %118 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 2, i32 noundef 0)
  %119 = load i8, ptr %118, align 1, !tbaa !37
  %120 = zext i8 %119 to i32
  %121 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 0)
  %122 = icmp eq i32 %121, %120
  br i1 %122, label %124, label %123

123:                                              ; preds = %117
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %124

124:                                              ; preds = %123, %117
  %125 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 3, i32 noundef 0)
  %126 = load i8, ptr %125, align 1, !tbaa !37
  %127 = zext i8 %126 to i32
  %128 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 3, i32 noundef 0)
  %129 = icmp eq i32 %128, %127
  br i1 %129, label %.preheader.1, label %130

130:                                              ; preds = %124
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %.preheader.1

.preheader.1:                                     ; preds = %130, %124
  %131 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 0, i32 noundef 1)
  %132 = load i8, ptr %131, align 1, !tbaa !37
  %133 = zext i8 %132 to i32
  %134 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef 1)
  %135 = icmp eq i32 %134, %133
  br i1 %135, label %137, label %136

136:                                              ; preds = %.preheader.1
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %137

137:                                              ; preds = %136, %.preheader.1
  %138 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 1, i32 noundef 1)
  %139 = load i8, ptr %138, align 1, !tbaa !37
  %140 = zext i8 %139 to i32
  %141 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 1)
  %142 = icmp eq i32 %141, %140
  br i1 %142, label %144, label %143

143:                                              ; preds = %137
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %144

144:                                              ; preds = %143, %137
  %145 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 2, i32 noundef 1)
  %146 = load i8, ptr %145, align 1, !tbaa !37
  %147 = zext i8 %146 to i32
  %148 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 1)
  %149 = icmp eq i32 %148, %147
  br i1 %149, label %151, label %150

150:                                              ; preds = %144
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %151

151:                                              ; preds = %150, %144
  %152 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 3, i32 noundef 1)
  %153 = load i8, ptr %152, align 1, !tbaa !37
  %154 = zext i8 %153 to i32
  %155 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 3, i32 noundef 1)
  %156 = icmp eq i32 %155, %154
  br i1 %156, label %.preheader.2, label %157

157:                                              ; preds = %151
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %.preheader.2

.preheader.2:                                     ; preds = %157, %151
  %158 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 0, i32 noundef 2)
  %159 = load i8, ptr %158, align 1, !tbaa !37
  %160 = zext i8 %159 to i32
  %161 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef 2)
  %162 = icmp eq i32 %161, %160
  br i1 %162, label %164, label %163

163:                                              ; preds = %.preheader.2
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %164

164:                                              ; preds = %163, %.preheader.2
  %165 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 1, i32 noundef 2)
  %166 = load i8, ptr %165, align 1, !tbaa !37
  %167 = zext i8 %166 to i32
  %168 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 2)
  %169 = icmp eq i32 %168, %167
  br i1 %169, label %171, label %170

170:                                              ; preds = %164
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %171

171:                                              ; preds = %170, %164
  %172 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 2, i32 noundef 2)
  %173 = load i8, ptr %172, align 1, !tbaa !37
  %174 = zext i8 %173 to i32
  %175 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 2)
  %176 = icmp eq i32 %175, %174
  br i1 %176, label %178, label %177

177:                                              ; preds = %171
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %178

178:                                              ; preds = %177, %171
  %179 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 3, i32 noundef 2)
  %180 = load i8, ptr %179, align 1, !tbaa !37
  %181 = zext i8 %180 to i32
  %182 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 3, i32 noundef 2)
  %183 = icmp eq i32 %182, %181
  br i1 %183, label %.preheader.3, label %184

184:                                              ; preds = %178
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %.preheader.3

.preheader.3:                                     ; preds = %184, %178
  %185 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 0, i32 noundef 3)
  %186 = load i8, ptr %185, align 1, !tbaa !37
  %187 = zext i8 %186 to i32
  %188 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0, i32 noundef 3)
  %189 = icmp eq i32 %188, %187
  br i1 %189, label %191, label %190

190:                                              ; preds = %.preheader.3
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %191

191:                                              ; preds = %190, %.preheader.3
  %192 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 1, i32 noundef 3)
  %193 = load i8, ptr %192, align 1, !tbaa !37
  %194 = zext i8 %193 to i32
  %195 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 1, i32 noundef 3)
  %196 = icmp eq i32 %195, %194
  br i1 %196, label %198, label %197

197:                                              ; preds = %191
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %198

198:                                              ; preds = %197, %191
  %199 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 2, i32 noundef 3)
  %200 = load i8, ptr %199, align 1, !tbaa !37
  %201 = zext i8 %200 to i32
  %202 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 2, i32 noundef 3)
  %203 = icmp eq i32 %202, %201
  br i1 %203, label %205, label %204

204:                                              ; preds = %198
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %205

205:                                              ; preds = %204, %198
  %206 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16) %5, i32 noundef 3, i32 noundef 3)
  %207 = load i8, ptr %206, align 1, !tbaa !37
  %208 = zext i8 %207 to i32
  %209 = call noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 3, i32 noundef 3)
  %210 = icmp eq i32 %209, %208
  br i1 %210, label %212, label %211

211:                                              ; preds = %205
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 2909)
  br label %212

212:                                              ; preds = %211, %205
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %4) #7
  br label %213

213:                                              ; preds = %94, %212, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %214 = load i32, ptr %2, align 4, !tbaa !5
  %215 = add i32 %214, 1
  store i32 %215, ptr %2, align 4, !tbaa !5
  %216 = load i32, ptr %8, align 8, !tbaa !9
  %217 = icmp ult i32 %215, %216
  br i1 %217, label %14, label %._crit_edge, !llvm.loop !38

218:                                              ; preds = %1, %._crit_edge
  ret i1 %6
}

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

; 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

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

; 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 #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)) local_unnamed_addr #6 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 #4 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu9etc_block22set_block_color5_checkERKNS_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 #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6basisu15basisu_frontend34get_endpoint_cluster_color_is_usedEjb(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 i32 @_ZNK6basisu15basisu_frontend32get_block_selector_cluster_indexEj(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu11vector_findINS_6vectorIjEEEEiRKT_RKNS3_10value_typeE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu15basisu_frontend46get_selector_cluster_global_selector_entry_idsEv(ptr noundef nonnull align 8 dereferenceable(496)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZNK6basist29etc1_global_selector_codebook9get_entryERKNS_38etc1_global_selector_codebook_entry_idE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(17)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basist27etc1_selector_palette_entryclEjj(ptr noundef nonnull align 1 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #5 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 88}
!10 = !{!"_ZTSN6basisu15basisu_frontendE", !11, i64 0, !6, i64 88, !6, i64 92, !13, i64 96, !13, i64 97, !13, i64 98, !6, i64 100, !6, 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", !6, i64 0, !12, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !13, i64 28, !13, i64 29, !13, i64 30, !13, i64 31, !13, i64 32, !13, i64 33, !13, i64 34, !12, i64 40, !6, i64 48, !6, i64 52, !13, i64 56, !14, i64 60, !15, i64 64, !12, i64 72, !12, i64 80}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTSN6basist18basis_texture_typeE", !7, i64 0}
!16 = !{!"_ZTSN6basisu6vectorINS_11pixel_blockEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!17 = !{!"_ZTSN6basisu6vectorINS_9etc_blockEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!18 = !{!"_ZTSN6basisu17tree_vector_quantINS_3vecILj6EfEEEE", !19, i64 0, !20, i64 16, !6, i64 32}
!19 = !{!"_ZTSN6basisu6vectorINS_17tree_vector_quantINS_3vecILj6EfEEE9tsvq_nodeEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!20 = !{!"_ZTSN6basisu6vectorISt4pairINS_3vecILj6EfEEmEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!21 = !{!"_ZTSN6basisu6vectorINS0_IjEEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!22 = !{!"_ZTSN6basisu6vectorIhEE", !12, i64 0, !6, i64 8, !6, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!24 = !{!"_ZTSN6basisu6vectorINS_5vec2UEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!26 = !{!"_ZTSN6basisu6vectorIbEE", !12, i64 0, !6, i64 8, !6, i64 12}
!27 = !{!"_ZTSN6basisu6vectorIjEE", !12, i64 0, !6, i64 8, !6, i64 12}
!28 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27subblock_endpoint_quant_errEEE", !12, i64 0, !6, i64 8, !6, i64 12}
!29 = !{!"_ZTSSt5mutex", !30, i64 0}
!30 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!31 = !{!10, !12, i64 40}
!32 = !{!10, !13, i64 56}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!13, !13, i64 0}
!36 = !{i64 0, i64 4, !5, i64 4, i64 1, !37, i64 5, i64 1, !35, i64 6, i64 1, !35, i64 7, i64 1, !35, i64 8, i64 1, !35, i64 9, i64 1, !35, i64 10, i64 1, !35, i64 11, i64 1, !35, i64 12, i64 1, !35, i64 13, i64 1, !35, i64 14, i64 1, !35, i64 15, i64 1, !35, i64 16, i64 1, !37}
!37 = !{!7, !7, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


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