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

; 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.14" = type { ptr, i32, i32 }
%"class.basisu::vector.39" = type { ptr, i32, i32 }
%"class.basisu::palette_index_reorderer" = type { %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.14" }
%"class.basisu::basisu_backend" = type { ptr, %"struct.basisu::basisu_backend_params", %"class.basisu::vector", %"struct.basisu::basisu_backend_output", ptr, %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.10", %"class.basisu::vector.12", %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.16", %"class.basisu::vector.16", %"class.basisu::vector.14", %"class.basisu::vector.14" }
%"struct.basisu::basisu_backend_params" = type <{ i8, i8, i8, i8, float, float, i32, i8, [3 x i8], i32, i32, i8, i8, [2 x i8] }>
%"class.basisu::vector" = type { ptr, i32, i32 }
%"struct.basisu::basisu_backend_output" = type { i32, i8, i8, i8, i32, i32, %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::vector", %"class.basisu::vector.0", %"class.basisu::vector.2", %"class.basisu::vector.4" }
%"class.basisu::vector.0" = type { ptr, i32, i32 }
%"class.basisu::vector.2" = type { ptr, i32, i32 }
%"class.basisu::vector.4" = type { ptr, i32, i32 }
%"class.basisu::vector.6" = type { ptr, i32, i32 }
%"class.basisu::vector.8" = type { ptr, i32, i32 }
%"class.basisu::vector.10" = type { ptr, i32, i32 }
%"class.basisu::vector.12" = type { ptr, i32, i32 }
%"class.basisu::vector.16" = type { ptr, i32, i32 }
%"struct.basisu::basisu_backend_slice_desc" = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, [2 x i8] }>
%"struct.basisu::encoder_block" = type <{ i32, i32, i32, i32, i8, [3 x i8] }>

@.str.7 = external hidden unnamed_addr constant [83 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; 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
declare dso_local void @_ZN6basisu14basisu_backend23create_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu14basisu_backend38reoptimize_and_sort_endpoints_codebookEjRNS_6vectorIjEE(ptr noundef nonnull align 8 dereferenceable(336) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.basisu::vector.14", align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.basisu::vector.39", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca %"class.basisu::palette_index_reorderer", align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca ptr, align 8
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %39 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  store ptr %40, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 1
  %42 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %41, i32 0, i32 12
  %43 = load i8, ptr %42, align 1, !tbaa !28, !range !29, !noundef !30
  %44 = trunc i8 %43 to i1
  br i1 %44, label %45, label %67

45:                                               ; preds = %3
  %46 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 9
  call void @_ZN6basisu6vectorIjE5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %46)
  %47 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 9
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %48)
  %50 = zext i32 %49 to i64
  call void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %47, i64 noundef %50, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %63, %45
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %53)
  %55 = icmp ult i32 %52, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %66

57:                                               ; preds = %51
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 9
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = zext i32 %60 to i64
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %59, i64 noundef %61)
  store i32 %58, ptr %62, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %57
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = add i32 %64, 1
  store i32 %65, ptr %8, align 4, !tbaa !9
  br label %51, !llvm.loop !31

66:                                               ; preds = %56
  br label %325

67:                                               ; preds = %3
  %68 = load i32, ptr %5, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %305

70:                                               ; preds = %67
  %71 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 1
  %72 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %71, i32 0, i32 6
  %73 = load i32, ptr %72, align 4, !tbaa !33
  %74 = icmp ugt i32 %73, 1
  br i1 %74, label %75, label %305

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %76 = call noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %38)
  %77 = zext i32 %76 to i64
  call void @_ZN6basisu6vectorIjEC2Em(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %77)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %168, %75
  %79 = load i32, ptr %10, align 4, !tbaa !9
  %80 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %81 = invoke noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %80)
          to label %82 unwind label %85

82:                                               ; preds = %78
  %83 = icmp ult i32 %79, %81
  br i1 %83, label %89, label %84

84:                                               ; preds = %82
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %175

85:                                               ; preds = %78
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %11, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %12, align 4
  br label %174

89:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %90 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = zext i32 %91 to i64
  %93 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %90, i64 noundef %92)
          to label %94 unwind label %116

94:                                               ; preds = %89
  %95 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %93, i32 0, i32 0
  %96 = load i32, ptr %95, align 4, !tbaa !34
  store i32 %96, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %97 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %97, i64 noundef %99)
          to label %101 unwind label %120

101:                                              ; preds = %94
  %102 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %100, i32 0, i32 5
  %103 = load i32, ptr %102, align 4, !tbaa !36
  store i32 %103, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %104 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %105 = load i32, ptr %10, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %104, i64 noundef %106)
          to label %108 unwind label %124

108:                                              ; preds = %101
  %109 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %107, i32 0, i32 6
  %110 = load i32, ptr %109, align 4, !tbaa !37
  store i32 %110, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %164, %108
  %112 = load i32, ptr %17, align 4, !tbaa !9
  %113 = load i32, ptr %16, align 4, !tbaa !9
  %114 = icmp ult i32 %112, %113
  br i1 %114, label %128, label %115

115:                                              ; preds = %111
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %167

116:                                              ; preds = %89
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %11, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %12, align 4
  br label %173

120:                                              ; preds = %94
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %11, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %12, align 4
  br label %172

124:                                              ; preds = %101
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %11, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %12, align 4
  br label %171

128:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %156, %128
  %130 = load i32, ptr %18, align 4, !tbaa !9
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = icmp ult i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %163

134:                                              ; preds = %129
  %135 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 8
  %136 = load i32, ptr %10, align 4, !tbaa !9
  %137 = zext i32 %136 to i64
  %138 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %135, i64 noundef %137)
          to label %139 unwind label %159

139:                                              ; preds = %134
  %140 = load i32, ptr %18, align 4, !tbaa !9
  %141 = load i32, ptr %17, align 4, !tbaa !9
  %142 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %138, i32 noundef %140, i32 noundef %141)
          to label %143 unwind label %159

143:                                              ; preds = %139
  %144 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %142, i32 0, i32 1
  %145 = load i32, ptr %144, align 4, !tbaa !38
  %146 = load i32, ptr %14, align 4, !tbaa !9
  %147 = load i32, ptr %18, align 4, !tbaa !9
  %148 = add i32 %146, %147
  %149 = load i32, ptr %17, align 4, !tbaa !9
  %150 = load i32, ptr %15, align 4, !tbaa !9
  %151 = mul i32 %149, %150
  %152 = add i32 %148, %151
  %153 = zext i32 %152 to i64
  %154 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %153)
          to label %155 unwind label %159

155:                                              ; preds = %143
  store i32 %145, ptr %154, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %18, align 4, !tbaa !9
  %158 = add i32 %157, 1
  store i32 %158, ptr %18, align 4, !tbaa !9
  br label %129, !llvm.loop !40

159:                                              ; preds = %143, %139, %134
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %11, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %171

163:                                              ; preds = %133
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %17, align 4, !tbaa !9
  %166 = add i32 %165, 1
  store i32 %166, ptr %17, align 4, !tbaa !9
  br label %111, !llvm.loop !41

167:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %10, align 4, !tbaa !9
  %170 = add i32 %169, 1
  store i32 %170, ptr %10, align 4, !tbaa !9
  br label %78, !llvm.loop !42

171:                                              ; preds = %159, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %172

172:                                              ; preds = %171, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %173

173:                                              ; preds = %172, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %174

174:                                              ; preds = %173, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %304

175:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  invoke void @_ZN6basisu6vectorIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %176 unwind label %187

176:                                              ; preds = %175
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZN6basisu15basisu_frontend29reoptimize_remapped_endpointsERKNS_6vectorIjEERNS1_IiEEbPS2_(ptr noundef nonnull align 8 dereferenceable(496) %177, ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %19, i1 noundef zeroext true, ptr noundef null)
          to label %178 unwind label %191

178:                                              ; preds = %176
  invoke void @_ZN6basisu14basisu_backend23create_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %38)
          to label %179 unwind label %191

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

180:                                              ; preds = %264, %179
  %181 = load i32, ptr %20, align 4, !tbaa !9
  %182 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %183 = invoke noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %182)
          to label %184 unwind label %195

184:                                              ; preds = %180
  %185 = icmp ult i32 %181, %183
  br i1 %185, label %199, label %186

186:                                              ; preds = %184
  store i32 14, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %270

187:                                              ; preds = %175
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %11, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %12, align 4
  br label %303

191:                                              ; preds = %178, %176
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %11, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %12, align 4
  br label %302

195:                                              ; preds = %180
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %11, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %12, align 4
  br label %269

199:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %200 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %201 = load i32, ptr %20, align 4, !tbaa !9
  %202 = zext i32 %201 to i64
  %203 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %200, i64 noundef %202)
          to label %204 unwind label %219

204:                                              ; preds = %199
  %205 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %203, i32 0, i32 5
  %206 = load i32, ptr %205, align 4, !tbaa !36
  store i32 %206, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %207 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %208 = load i32, ptr %20, align 4, !tbaa !9
  %209 = zext i32 %208 to i64
  %210 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %207, i64 noundef %209)
          to label %211 unwind label %223

211:                                              ; preds = %204
  %212 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %210, i32 0, i32 6
  %213 = load i32, ptr %212, align 4, !tbaa !37
  store i32 %213, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %214

214:                                              ; preds = %260, %211
  %215 = load i32, ptr %23, align 4, !tbaa !9
  %216 = load i32, ptr %22, align 4, !tbaa !9
  %217 = icmp ult i32 %215, %216
  br i1 %217, label %227, label %218

218:                                              ; preds = %214
  store i32 17, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %263

219:                                              ; preds = %199
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %11, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %12, align 4
  br label %268

223:                                              ; preds = %204
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %11, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %12, align 4
  br label %267

227:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %228

228:                                              ; preds = %252, %227
  %229 = load i32, ptr %24, align 4, !tbaa !9
  %230 = load i32, ptr %21, align 4, !tbaa !9
  %231 = icmp ult i32 %229, %230
  br i1 %231, label %233, label %232

232:                                              ; preds = %228
  store i32 20, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %259

233:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %234 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 8
  %235 = load i32, ptr %20, align 4, !tbaa !9
  %236 = zext i32 %235 to i64
  %237 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %234, i64 noundef %236)
          to label %238 unwind label %255

238:                                              ; preds = %233
  %239 = load i32, ptr %24, align 4, !tbaa !9
  %240 = load i32, ptr %23, align 4, !tbaa !9
  %241 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %237, i32 noundef %239, i32 noundef %240)
          to label %242 unwind label %255

242:                                              ; preds = %238
  store ptr %241, ptr %25, align 8, !tbaa !5
  %243 = load ptr, ptr %25, align 8, !tbaa !5
  %244 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %243, i32 0, i32 1
  %245 = load i32, ptr %244, align 4, !tbaa !38
  %246 = sext i32 %245 to i64
  %247 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %19, i64 noundef %246)
          to label %248 unwind label %255

248:                                              ; preds = %242
  %249 = load i32, ptr %247, align 4, !tbaa !9
  %250 = load ptr, ptr %25, align 8, !tbaa !5
  %251 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %250, i32 0, i32 1
  store i32 %249, ptr %251, align 4, !tbaa !38
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %252

252:                                              ; preds = %248
  %253 = load i32, ptr %24, align 4, !tbaa !9
  %254 = add i32 %253, 1
  store i32 %254, ptr %24, align 4, !tbaa !9
  br label %228, !llvm.loop !43

255:                                              ; preds = %242, %238, %233
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %11, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %267

259:                                              ; preds = %232
  br label %260

260:                                              ; preds = %259
  %261 = load i32, ptr %23, align 4, !tbaa !9
  %262 = add i32 %261, 1
  store i32 %262, ptr %23, align 4, !tbaa !9
  br label %214, !llvm.loop !44

263:                                              ; preds = %218
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %264

264:                                              ; preds = %263
  %265 = load i32, ptr %20, align 4, !tbaa !9
  %266 = add i32 %265, 1
  store i32 %266, ptr %20, align 4, !tbaa !9
  br label %180, !llvm.loop !45

267:                                              ; preds = %255, %223
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %268

268:                                              ; preds = %267, %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %269

269:                                              ; preds = %268, %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %302

270:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %271

271:                                              ; preds = %298, %270
  %272 = load i32, ptr %26, align 4, !tbaa !9
  %273 = load ptr, ptr %6, align 8, !tbaa !5
  %274 = invoke noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %273)
          to label %275 unwind label %278

275:                                              ; preds = %271
  %276 = icmp ult i32 %272, %274
  br i1 %276, label %282, label %277

277:                                              ; preds = %275
  store i32 23, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %301

278:                                              ; preds = %291, %287, %282, %271
  %279 = landingpad { ptr, i32 }
          cleanup
  %280 = extractvalue { ptr, i32 } %279, 0
  store ptr %280, ptr %11, align 8
  %281 = extractvalue { ptr, i32 } %279, 1
  store i32 %281, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %302

282:                                              ; preds = %275
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  %284 = load i32, ptr %26, align 4, !tbaa !9
  %285 = zext i32 %284 to i64
  %286 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %283, i64 noundef %285)
          to label %287 unwind label %278

287:                                              ; preds = %282
  %288 = load i32, ptr %286, align 4, !tbaa !9
  %289 = zext i32 %288 to i64
  %290 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %19, i64 noundef %289)
          to label %291 unwind label %278

291:                                              ; preds = %287
  %292 = load i32, ptr %290, align 4, !tbaa !9
  %293 = load ptr, ptr %6, align 8, !tbaa !5
  %294 = load i32, ptr %26, align 4, !tbaa !9
  %295 = zext i32 %294 to i64
  %296 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %293, i64 noundef %295)
          to label %297 unwind label %278

297:                                              ; preds = %291
  store i32 %292, ptr %296, align 4, !tbaa !9
  br label %298

298:                                              ; preds = %297
  %299 = load i32, ptr %26, align 4, !tbaa !9
  %300 = add i32 %299, 1
  store i32 %300, ptr %26, align 4, !tbaa !9
  br label %271, !llvm.loop !46

301:                                              ; preds = %277
  call void @_ZN6basisu6vectorIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  call void @_ZN6basisu6vectorIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %305

302:                                              ; preds = %278, %269, %191
  call void @_ZN6basisu6vectorIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  br label %303

303:                                              ; preds = %302, %187
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %304

304:                                              ; preds = %303, %174
  call void @_ZN6basisu6vectorIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %436

305:                                              ; preds = %301, %70, %67
  call void @llvm.lifetime.start.p0(i64 80, ptr %27) #5
  call void @_ZN6basisu23palette_index_reordererC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %27)
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  %307 = invoke noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %306)
          to label %308 unwind label %321

308:                                              ; preds = %305
  %309 = load ptr, ptr %6, align 8, !tbaa !5
  %310 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %309, i64 noundef 0)
          to label %311 unwind label %321

311:                                              ; preds = %308
  %312 = load ptr, ptr %7, align 8, !tbaa !5
  %313 = invoke noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %312)
          to label %314 unwind label %321

314:                                              ; preds = %311
  invoke void @_ZN6basisu23palette_index_reorderer4initEjPKjjPFfjjPvES3_f(ptr noundef nonnull align 8 dereferenceable(80) %27, i32 noundef %307, ptr noundef %310, i32 noundef %313, ptr noundef null, ptr noundef null, float noundef 0.000000e+00)
          to label %315 unwind label %321

315:                                              ; preds = %314
  %316 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu23palette_index_reorderer15get_remap_tableEv(ptr noundef nonnull align 8 dereferenceable(80) %27)
          to label %317 unwind label %321

317:                                              ; preds = %315
  %318 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 9
  %319 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorIjEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %318, ptr noundef nonnull align 8 dereferenceable(16) %316)
          to label %320 unwind label %321

320:                                              ; preds = %317
  call void @_ZN6basisu23palette_index_reordererD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %27) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %27) #5
  br label %325

321:                                              ; preds = %317, %315, %314, %311, %308, %305
  %322 = landingpad { ptr, i32 }
          cleanup
  %323 = extractvalue { ptr, i32 } %322, 0
  store ptr %323, ptr %11, align 8
  %324 = extractvalue { ptr, i32 } %322, 1
  store i32 %324, ptr %12, align 4
  call void @_ZN6basisu23palette_index_reordererD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %27) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %27) #5
  br label %436

325:                                              ; preds = %320, %66
  %326 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 11
  call void @_ZN6basisu6vectorIbE5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %326)
  %327 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 11
  %328 = load ptr, ptr %7, align 8, !tbaa !5
  %329 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %328)
  %330 = zext i32 %329 to i64
  call void @_ZN6basisu6vectorIbE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %327, i64 noundef %330, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 -1, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %331

331:                                              ; preds = %387, %325
  %332 = load i32, ptr %29, align 4, !tbaa !9
  %333 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %334 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %333)
  %335 = icmp ult i32 %332, %334
  br i1 %335, label %337, label %336

336:                                              ; preds = %331
  store i32 26, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %390

337:                                              ; preds = %331
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %338 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %339 = load i32, ptr %29, align 4, !tbaa !9
  %340 = zext i32 %339 to i64
  %341 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %338, i64 noundef %340)
  %342 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %341, i32 0, i32 5
  %343 = load i32, ptr %342, align 4, !tbaa !36
  store i32 %343, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %344 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 2
  %345 = load i32, ptr %29, align 4, !tbaa !9
  %346 = zext i32 %345 to i64
  %347 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %344, i64 noundef %346)
  %348 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %347, i32 0, i32 6
  %349 = load i32, ptr %348, align 4, !tbaa !37
  store i32 %349, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  store i32 0, ptr %32, align 4, !tbaa !9
  br label %350

350:                                              ; preds = %383, %337
  %351 = load i32, ptr %32, align 4, !tbaa !9
  %352 = load i32, ptr %31, align 4, !tbaa !9
  %353 = icmp ult i32 %351, %352
  br i1 %353, label %355, label %354

354:                                              ; preds = %350
  store i32 29, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %386

355:                                              ; preds = %350
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %356

356:                                              ; preds = %379, %355
  %357 = load i32, ptr %33, align 4, !tbaa !9
  %358 = load i32, ptr %30, align 4, !tbaa !9
  %359 = icmp ult i32 %357, %358
  br i1 %359, label %361, label %360

360:                                              ; preds = %356
  store i32 32, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  br label %382

361:                                              ; preds = %356
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  %362 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 8
  %363 = load i32, ptr %29, align 4, !tbaa !9
  %364 = zext i32 %363 to i64
  %365 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %362, i64 noundef %364)
  %366 = load i32, ptr %33, align 4, !tbaa !9
  %367 = load i32, ptr %32, align 4, !tbaa !9
  %368 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %365, i32 noundef %366, i32 noundef %367)
  store ptr %368, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  %369 = load ptr, ptr %34, align 8, !tbaa !5
  %370 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %369, i32 0, i32 1
  %371 = load i32, ptr %370, align 4, !tbaa !38
  store i32 %371, ptr %35, align 4, !tbaa !9
  %372 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 11
  %373 = load i32, ptr %35, align 4, !tbaa !9
  %374 = zext i32 %373 to i64
  %375 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %372, i64 noundef %374)
  store i8 1, ptr %375, align 1, !tbaa !47
  %376 = load i32, ptr %28, align 4, !tbaa !9
  %377 = load i32, ptr %35, align 4, !tbaa !9
  %378 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %376, i32 noundef %377)
  store i32 %378, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  br label %379

379:                                              ; preds = %361
  %380 = load i32, ptr %33, align 4, !tbaa !9
  %381 = add i32 %380, 1
  store i32 %381, ptr %33, align 4, !tbaa !9
  br label %356, !llvm.loop !48

382:                                              ; preds = %360
  br label %383

383:                                              ; preds = %382
  %384 = load i32, ptr %32, align 4, !tbaa !9
  %385 = add i32 %384, 1
  store i32 %385, ptr %32, align 4, !tbaa !9
  br label %350, !llvm.loop !49

386:                                              ; preds = %354
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %387

387:                                              ; preds = %386
  %388 = load i32, ptr %29, align 4, !tbaa !9
  %389 = add i32 %388, 1
  store i32 %389, ptr %29, align 4, !tbaa !9
  br label %331, !llvm.loop !50

390:                                              ; preds = %336
  %391 = load i32, ptr %28, align 4, !tbaa !9
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.7, i32 noundef %391)
  %392 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 12
  call void @_ZN6basisu6vectorIbE5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %392)
  %393 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 12
  %394 = load ptr, ptr %7, align 8, !tbaa !5
  %395 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %394)
  %396 = zext i32 %395 to i64
  call void @_ZN6basisu6vectorIbE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %393, i64 noundef %396, i1 noundef zeroext false)
  %397 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 10
  call void @_ZN6basisu6vectorIjE5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %397)
  %398 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 10
  %399 = load ptr, ptr %7, align 8, !tbaa !5
  %400 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %399)
  %401 = zext i32 %400 to i64
  call void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %398, i64 noundef %401, i1 noundef zeroext false)
  %402 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 10
  call void @_ZN6basisu6vectorIjE7set_allERKj(ptr noundef nonnull align 8 dereferenceable(16) %402, ptr noundef nonnull align 4 dereferenceable(4) %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #5
  store i32 0, ptr %36, align 4, !tbaa !9
  br label %403

403:                                              ; preds = %432, %390
  %404 = load i32, ptr %36, align 4, !tbaa !9
  %405 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 9
  %406 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %405)
  %407 = icmp ult i32 %404, %406
  br i1 %407, label %409, label %408

408:                                              ; preds = %403
  store i32 35, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  br label %435

409:                                              ; preds = %403
  %410 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 11
  %411 = load i32, ptr %36, align 4, !tbaa !9
  %412 = zext i32 %411 to i64
  %413 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %410, i64 noundef %412)
  %414 = load i8, ptr %413, align 1, !tbaa !47, !range !29, !noundef !30
  %415 = trunc i8 %414 to i1
  br i1 %415, label %416, label %431

416:                                              ; preds = %409
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #5
  %417 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 9
  %418 = load i32, ptr %36, align 4, !tbaa !9
  %419 = zext i32 %418 to i64
  %420 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %417, i64 noundef %419)
  %421 = load i32, ptr %420, align 4, !tbaa !9
  store i32 %421, ptr %37, align 4, !tbaa !9
  %422 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 12
  %423 = load i32, ptr %37, align 4, !tbaa !9
  %424 = zext i32 %423 to i64
  %425 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %422, i64 noundef %424)
  store i8 1, ptr %425, align 1, !tbaa !47
  %426 = load i32, ptr %36, align 4, !tbaa !9
  %427 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %38, i32 0, i32 10
  %428 = load i32, ptr %37, align 4, !tbaa !9
  %429 = zext i32 %428 to i64
  %430 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %427, i64 noundef %429)
  store i32 %426, ptr %430, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  br label %431

431:                                              ; preds = %416, %409
  br label %432

432:                                              ; preds = %431
  %433 = load i32, ptr %36, align 4, !tbaa !9
  %434 = add i32 %433, 1
  store i32 %434, ptr %36, align 4, !tbaa !9
  br label %403, !llvm.loop !51

435:                                              ; preds = %408
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void

436:                                              ; preds = %321, %304
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %437

437:                                              ; preds = %436
  %438 = load ptr, ptr %11, align 8
  %439 = load i32, ptr %12, align 4
  %440 = insertvalue { ptr, i32 } poison, ptr %438, 0
  %441 = insertvalue { ptr, i32 } %440, i32 %439, 1
  resume { ptr, i32 } %441
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu6vectorIjE5clearEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 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

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

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

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

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

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

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

declare void @_ZN6basisu15basisu_frontend29reoptimize_remapped_endpointsERKNS_6vectorIjEERNS1_IiEEbPS2_(ptr noundef nonnull align 8 dereferenceable(496), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext, ptr noundef) #1

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

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

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

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

declare void @_ZN6basisu23palette_index_reorderer4initEjPKjjPFfjjPvES3_f(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, float noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu23palette_index_reorderer15get_remap_tableEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

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

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

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

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

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

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

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

!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, !6, i64 0}
!12 = !{!"_ZTSN6basisu14basisu_backendE", !6, i64 0, !13, i64 8, !16, i64 40, !17, i64 56, !6, i64 168, !22, i64 176, !23, i64 192, !24, i64 208, !25, i64 224, !26, i64 240, !26, i64 256, !27, i64 272, !27, i64 288, !26, i64 304, !26, i64 320}
!13 = !{!"_ZTSN6basisu21basisu_backend_paramsE", !14, i64 0, !14, i64 1, !14, i64 2, !15, i64 4, !15, i64 8, !10, i64 12, !14, i64 16, !10, i64 20, !10, i64 24, !14, i64 28, !14, i64 29}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTSN6basisu6vectorINS_25basisu_backend_slice_descEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!17 = !{!"_ZTSN6basisu21basisu_backend_outputE", !18, i64 0, !14, i64 4, !14, i64 5, !14, i64 6, !10, i64 8, !10, i64 12, !19, i64 16, !19, i64 32, !16, i64 48, !19, i64 64, !20, i64 80, !21, i64 96}
!18 = !{!"_ZTSN6basist16basis_tex_formatE", !7, i64 0}
!19 = !{!"_ZTSN6basisu6vectorIhEE", !6, i64 0, !10, i64 8, !10, i64 12}
!20 = !{!"_ZTSN6basisu6vectorINS0_IhEEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!21 = !{!"_ZTSN6basisu6vectorItEE", !6, i64 0, !10, i64 8, !10, i64 12}
!22 = !{!"_ZTSN6basisu6vectorINS_27etc1_endpoint_palette_entryEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!23 = !{!"_ZTSN6basisu6vectorIN6basist27etc1_selector_palette_entryEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!24 = !{!"_ZTSN6basisu6vectorINS_14basisu_backend34etc1_global_selector_cb_entry_descEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!25 = !{!"_ZTSN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!26 = !{!"_ZTSN6basisu6vectorIjEE", !6, i64 0, !10, i64 8, !10, i64 12}
!27 = !{!"_ZTSN6basisu6vectorIbEE", !6, i64 0, !10, i64 8, !10, i64 12}
!28 = !{!12, !14, i64 37}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!12, !10, i64 20}
!34 = !{!35, !10, i64 0}
!35 = !{!"_ZTSN6basisu25basisu_backend_slice_descE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !14, i64 44, !14, i64 45}
!36 = !{!35, !10, i64 20}
!37 = !{!35, !10, i64 24}
!38 = !{!39, !10, i64 4}
!39 = !{!"_ZTSN6basisu13encoder_blockE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !14, i64 16}
!40 = distinct !{!40, !32}
!41 = distinct !{!41, !32}
!42 = distinct !{!42, !32}
!43 = distinct !{!43, !32}
!44 = distinct !{!44, !32}
!45 = distinct !{!45, !32}
!46 = distinct !{!46, !32}
!47 = !{!14, !14, i64 0}
!48 = distinct !{!48, !32}
!49 = distinct !{!49, !32}
!50 = distinct !{!50, !32}
!51 = distinct !{!51, !32}


; 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.14" = type { ptr, i32, i32 }
%"class.basisu::vector.39" = type { ptr, i32, i32 }
%"class.basisu::palette_index_reorderer" = type { %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.14" }

@.str.7 = external hidden unnamed_addr constant [83 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14basisu_backend23create_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu14basisu_backend38reoptimize_and_sort_endpoints_codebookEjRNS_6vectorIjEE(ptr noundef nonnull align 8 dereferenceable(336) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.basisu::vector.14", align 8
  %5 = alloca %"class.basisu::vector.39", align 8
  %6 = alloca %"class.basisu::palette_index_reorderer", align 8
  %7 = alloca i32, align 4
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 37
  %10 = load i8, ptr %9, align 1, !tbaa !26, !range !27, !noundef !28
  %11 = trunc nuw i8 %10 to i1
  br i1 %11, label %12, label %22

12:                                               ; preds = %3
  %13 = getelementptr inbounds i8, ptr %0, i64 240
  tail call void @_ZN6basisu6vectorIjE5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %14 = tail call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %15 = zext i32 %14 to i64
  tail call void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %15, i1 noundef zeroext false)
  %16 = tail call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %.not144 = icmp eq i32 %16, 0
  br i1 %.not144, label %.loopexit, label %.lr.ph123

.lr.ph123:                                        ; preds = %12, %.lr.ph123
  %indvars.iv165 = phi i64 [ %indvars.iv.next166, %.lr.ph123 ], [ 0, %12 ]
  %17 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv165)
  %18 = trunc nuw i64 %indvars.iv165 to i32
  store i32 %18, ptr %17, align 4, !tbaa !29
  %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1
  %19 = tail call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %20 = zext i32 %19 to i64
  %21 = icmp ult i64 %indvars.iv.next166, %20
  br i1 %21, label %.lr.ph123, label %.loopexit, !llvm.loop !30

22:                                               ; preds = %3
  %.not = icmp ne i32 %1, 0
  %23 = getelementptr inbounds i8, ptr %0, i64 20
  %24 = load i32, ptr %23, align 4
  %25 = icmp ugt i32 %24, 1
  %or.cond = select i1 %.not, i1 %25, i1 false
  br i1 %or.cond, label %26, label %97

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %27 = tail call noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
  %28 = zext i32 %27 to i64
  call void @_ZN6basisu6vectorIjEC2Em(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %28)
  %29 = getelementptr inbounds i8, ptr %0, i64 40
  %30 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %29)
  %.not137 = icmp eq i32 %30, 0
  br i1 %.not137, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %26
  %31 = getelementptr inbounds i8, ptr %0, i64 224
  br label %32

._crit_edge:                                      ; preds = %._crit_edge108, %26
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN6basisu6vectorIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5)
  invoke void @_ZN6basisu15basisu_frontend29reoptimize_remapped_endpointsERKNS_6vectorIjEERNS1_IiEEbPS2_(ptr noundef nonnull align 8 dereferenceable(496) %8, ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext true, ptr noundef null)
          to label %58 unwind label %62

32:                                               ; preds = %.lr.ph, %._crit_edge108
  %indvars.iv154 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next155, %._crit_edge108 ]
  %33 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %29, i64 noundef %indvars.iv154)
  %34 = load i32, ptr %33, align 4, !tbaa !32
  %35 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %29, i64 noundef %indvars.iv154)
  %36 = getelementptr inbounds i8, ptr %35, i64 20
  %37 = load i32, ptr %36, align 4, !tbaa !34
  %38 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %29, i64 noundef %indvars.iv154)
  %39 = getelementptr inbounds i8, ptr %38, i64 24
  %40 = load i32, ptr %39, align 4, !tbaa !35
  %.not138 = icmp eq i32 %40, 0
  %.not139 = icmp eq i32 %37, 0
  %or.cond177 = select i1 %.not138, i1 true, i1 %.not139
  br i1 %or.cond177, label %._crit_edge108, label %.preheader104.us.preheader

.preheader104.us.preheader:                       ; preds = %32
  %wide.trip.count = zext i32 %37 to i64
  br label %.preheader104.us

.preheader104.us:                                 ; preds = %.preheader104.us.preheader, %._crit_edge.us
  %.089107.us = phi i32 [ %53, %._crit_edge.us ], [ 0, %.preheader104.us.preheader ]
  %41 = mul i32 %.089107.us, %37
  %42 = add i32 %41, %34
  br label %43

43:                                               ; preds = %.preheader104.us, %47
  %indvars.iv = phi i64 [ 0, %.preheader104.us ], [ %indvars.iv.next, %47 ]
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %31, i64 noundef %indvars.iv154)
  %45 = trunc nuw i64 %indvars.iv to i32
  %46 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %44, i32 noundef %45, i32 noundef %.089107.us)
          to label %47 unwind label %.split.us

47:                                               ; preds = %43
  %48 = getelementptr inbounds i8, ptr %46, i64 4
  %49 = load i32, ptr %48, align 4, !tbaa !36
  %50 = add i32 %42, %45
  %51 = zext i32 %50 to i64
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %51)
  store i32 %49, ptr %52, align 4, !tbaa !29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %43, !llvm.loop !38

._crit_edge.us:                                   ; preds = %47
  %53 = add nuw i32 %.089107.us, 1
  %exitcond153.not = icmp eq i32 %53, %40
  br i1 %exitcond153.not, label %._crit_edge108, label %.preheader104.us, !llvm.loop !39

.split.us:                                        ; preds = %43
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %96

._crit_edge108:                                   ; preds = %._crit_edge.us, %32
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %55 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %29)
  %56 = zext i32 %55 to i64
  %57 = icmp ult i64 %indvars.iv.next155, %56
  br i1 %57, label %32, label %._crit_edge, !llvm.loop !40

58:                                               ; preds = %._crit_edge
  invoke void @_ZN6basisu14basisu_backend23create_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
          to label %.preheader103 unwind label %62

.preheader103:                                    ; preds = %58
  %59 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %29)
  %.not140 = icmp eq i32 %59, 0
  br i1 %.not140, label %.preheader101, label %.lr.ph117

.lr.ph117:                                        ; preds = %.preheader103
  %60 = getelementptr inbounds i8, ptr %0, i64 224
  br label %64

.preheader101:                                    ; preds = %._crit_edge114, %.preheader103
  %61 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %.not143 = icmp eq i32 %61, 0
  br i1 %.not143, label %._crit_edge120, label %.lr.ph119

62:                                               ; preds = %58, %._crit_edge
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %95

64:                                               ; preds = %.lr.ph117, %._crit_edge114
  %indvars.iv159 = phi i64 [ 0, %.lr.ph117 ], [ %indvars.iv.next160, %._crit_edge114 ]
  %65 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %29, i64 noundef %indvars.iv159)
  %66 = getelementptr inbounds i8, ptr %65, i64 20
  %67 = load i32, ptr %66, align 4, !tbaa !34
  %68 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %29, i64 noundef %indvars.iv159)
  %69 = getelementptr inbounds i8, ptr %68, i64 24
  %70 = load i32, ptr %69, align 4, !tbaa !35
  %.not141 = icmp eq i32 %70, 0
  %.not142 = icmp eq i32 %67, 0
  %or.cond178 = select i1 %.not141, i1 true, i1 %.not142
  br i1 %or.cond178, label %._crit_edge114, label %.preheader102.us

.preheader102.us:                                 ; preds = %64, %._crit_edge112.us
  %.091113.us = phi i32 [ %81, %._crit_edge112.us ], [ 0, %64 ]
  br label %71

71:                                               ; preds = %.preheader102.us, %74
  %.090110.us = phi i32 [ 0, %.preheader102.us ], [ %80, %74 ]
  %72 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %60, i64 noundef %indvars.iv159)
  %73 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %72, i32 noundef %.090110.us, i32 noundef %.091113.us)
          to label %74 unwind label %.split.us115

74:                                               ; preds = %71
  %75 = getelementptr inbounds i8, ptr %73, i64 4
  %76 = load i32, ptr %75, align 4, !tbaa !36
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef %77)
  %79 = load i32, ptr %78, align 4, !tbaa !29
  store i32 %79, ptr %75, align 4, !tbaa !36
  %80 = add nuw i32 %.090110.us, 1
  %exitcond157.not = icmp eq i32 %80, %67
  br i1 %exitcond157.not, label %._crit_edge112.us, label %71, !llvm.loop !41

._crit_edge112.us:                                ; preds = %74
  %81 = add nuw i32 %.091113.us, 1
  %exitcond158.not = icmp eq i32 %81, %70
  br i1 %exitcond158.not, label %._crit_edge114, label %.preheader102.us, !llvm.loop !42

.split.us115:                                     ; preds = %71
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %95

._crit_edge114:                                   ; preds = %._crit_edge112.us, %64
  %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
  %83 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %29)
  %84 = zext i32 %83 to i64
  %85 = icmp ult i64 %indvars.iv.next160, %84
  br i1 %85, label %64, label %.preheader101, !llvm.loop !43

._crit_edge120:                                   ; preds = %.lr.ph119, %.preheader101
  call void @_ZN6basisu6vectorIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN6basisu6vectorIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %97

.lr.ph119:                                        ; preds = %.preheader101, %.lr.ph119
  %indvars.iv162 = phi i64 [ %indvars.iv.next163, %.lr.ph119 ], [ 0, %.preheader101 ]
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %indvars.iv162)
  %87 = load i32, ptr %86, align 4, !tbaa !29
  %88 = zext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef %88)
  %90 = load i32, ptr %89, align 4, !tbaa !29
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %indvars.iv162)
  store i32 %90, ptr %91, align 4, !tbaa !29
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %92 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %93 = zext i32 %92 to i64
  %94 = icmp ult i64 %indvars.iv.next163, %93
  br i1 %94, label %.lr.ph119, label %._crit_edge120, !llvm.loop !44

95:                                               ; preds = %.split.us115, %62
  %.pn = phi { ptr, i32 } [ %82, %.split.us115 ], [ %63, %62 ]
  call void @_ZN6basisu6vectorIiED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %96

96:                                               ; preds = %95, %.split.us
  %.pn96 = phi { ptr, i32 } [ %54, %.split.us ], [ %.pn, %95 ]
  call void @_ZN6basisu6vectorIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %162

97:                                               ; preds = %._crit_edge120, %22
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #5
  call void @_ZN6basisu23palette_index_reordererC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %98 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef 0)
  %100 = invoke noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
          to label %101 unwind label %107

101:                                              ; preds = %97
  invoke void @_ZN6basisu23palette_index_reorderer4initEjPKjjPFfjjPvES3_f(ptr noundef nonnull align 8 dereferenceable(80) %6, i32 noundef %98, ptr noundef nonnull %99, i32 noundef %100, ptr noundef null, ptr noundef null, float noundef 0.000000e+00)
          to label %102 unwind label %107

102:                                              ; preds = %101
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu23palette_index_reorderer15get_remap_tableEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %104 = getelementptr inbounds i8, ptr %0, i64 240
  %105 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorIjEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %104, ptr noundef nonnull align 8 dereferenceable(16) %103)
          to label %106 unwind label %107

106:                                              ; preds = %102
  call void @_ZN6basisu23palette_index_reordererD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #5
  br label %.loopexit

107:                                              ; preds = %102, %101, %97
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6basisu23palette_index_reordererD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #5
  br label %162

.loopexit:                                        ; preds = %.lr.ph123, %12, %106
  %109 = getelementptr inbounds i8, ptr %0, i64 272
  call void @_ZN6basisu6vectorIbE5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %109)
  %110 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %111 = zext i32 %110 to i64
  call void @_ZN6basisu6vectorIbE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %109, i64 noundef %111, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 -1, ptr %7, align 4, !tbaa !29
  %112 = getelementptr inbounds i8, ptr %0, i64 40
  %113 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %112)
  %.not145 = icmp eq i32 %113, 0
  br i1 %.not145, label %._crit_edge132, label %.lr.ph131

.lr.ph131:                                        ; preds = %.loopexit
  %114 = getelementptr inbounds i8, ptr %0, i64 224
  br label %124

._crit_edge132:                                   ; preds = %._crit_edge128, %.loopexit
  %115 = phi i32 [ -1, %.loopexit ], [ %144, %._crit_edge128 ]
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.7, i32 noundef %115)
  %116 = getelementptr inbounds i8, ptr %0, i64 288
  call void @_ZN6basisu6vectorIbE5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %116)
  %117 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %118 = zext i32 %117 to i64
  call void @_ZN6basisu6vectorIbE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %116, i64 noundef %118, i1 noundef zeroext false)
  %119 = getelementptr inbounds i8, ptr %0, i64 256
  call void @_ZN6basisu6vectorIjE5clearEv(ptr noundef nonnull align 8 dereferenceable(16) %119)
  %120 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %121 = zext i32 %120 to i64
  call void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %119, i64 noundef %121, i1 noundef zeroext false)
  call void @_ZN6basisu6vectorIjE7set_allERKj(ptr noundef nonnull align 8 dereferenceable(16) %119, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %122 = getelementptr inbounds i8, ptr %0, i64 240
  %123 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %122)
  %.not148 = icmp eq i32 %123, 0
  br i1 %.not148, label %._crit_edge136, label %.lr.ph135

124:                                              ; preds = %.lr.ph131, %._crit_edge128
  %125 = phi i32 [ -1, %.lr.ph131 ], [ %144, %._crit_edge128 ]
  %indvars.iv170 = phi i64 [ 0, %.lr.ph131 ], [ %indvars.iv.next171, %._crit_edge128 ]
  %126 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %112, i64 noundef %indvars.iv170)
  %127 = getelementptr inbounds i8, ptr %126, i64 20
  %128 = load i32, ptr %127, align 4, !tbaa !34
  %129 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %112, i64 noundef %indvars.iv170)
  %130 = getelementptr inbounds i8, ptr %129, i64 24
  %131 = load i32, ptr %130, align 4, !tbaa !35
  %.not146 = icmp eq i32 %131, 0
  %.not147 = icmp eq i32 %128, 0
  %or.cond179 = select i1 %.not146, i1 true, i1 %.not147
  br i1 %or.cond179, label %._crit_edge128, label %.preheader.us

.preheader.us:                                    ; preds = %124, %._crit_edge126.us
  %132 = phi i32 [ %141, %._crit_edge126.us ], [ %125, %124 ]
  %.083127.us = phi i32 [ %143, %._crit_edge126.us ], [ 0, %124 ]
  br label %133

133:                                              ; preds = %.preheader.us, %133
  %134 = phi i32 [ %132, %.preheader.us ], [ %141, %133 ]
  %.082124.us = phi i32 [ 0, %.preheader.us ], [ %142, %133 ]
  %135 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %114, i64 noundef %indvars.iv170)
  %136 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %135, i32 noundef %.082124.us, i32 noundef %.083127.us)
  %137 = getelementptr inbounds i8, ptr %136, i64 4
  %138 = load i32, ptr %137, align 4, !tbaa !36
  %139 = zext i32 %138 to i64
  %140 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %109, i64 noundef %139)
  store i8 1, ptr %140, align 1, !tbaa !45
  %141 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %134, i32 noundef %138)
  store i32 %141, ptr %7, align 4, !tbaa !29
  %142 = add nuw i32 %.082124.us, 1
  %exitcond168.not = icmp eq i32 %142, %128
  br i1 %exitcond168.not, label %._crit_edge126.us, label %133, !llvm.loop !46

._crit_edge126.us:                                ; preds = %133
  %143 = add nuw i32 %.083127.us, 1
  %exitcond169.not = icmp eq i32 %143, %131
  br i1 %exitcond169.not, label %._crit_edge128, label %.preheader.us, !llvm.loop !47

._crit_edge128:                                   ; preds = %._crit_edge126.us, %124
  %144 = phi i32 [ %125, %124 ], [ %141, %._crit_edge126.us ]
  %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
  %145 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %112)
  %146 = zext i32 %145 to i64
  %147 = icmp ult i64 %indvars.iv.next171, %146
  br i1 %147, label %124, label %._crit_edge132, !llvm.loop !48

._crit_edge136:                                   ; preds = %158, %._crit_edge132
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  ret void

.lr.ph135:                                        ; preds = %._crit_edge132, %158
  %indvars.iv173 = phi i64 [ %indvars.iv.next174, %158 ], [ 0, %._crit_edge132 ]
  %148 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %109, i64 noundef %indvars.iv173)
  %149 = load i8, ptr %148, align 1, !tbaa !45, !range !27, !noundef !28
  %150 = trunc nuw i8 %149 to i1
  br i1 %150, label %151, label %158

151:                                              ; preds = %.lr.ph135
  %152 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %122, i64 noundef %indvars.iv173)
  %153 = load i32, ptr %152, align 4, !tbaa !29
  %154 = zext i32 %153 to i64
  %155 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIbEixEm(ptr noundef nonnull align 8 dereferenceable(16) %116, i64 noundef %154)
  store i8 1, ptr %155, align 1, !tbaa !45
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %119, i64 noundef %154)
  %157 = trunc nuw i64 %indvars.iv173 to i32
  store i32 %157, ptr %156, align 4, !tbaa !29
  br label %158

158:                                              ; preds = %.lr.ph135, %151
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %159 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %122)
  %160 = zext i32 %159 to i64
  %161 = icmp ult i64 %indvars.iv.next174, %160
  br i1 %161, label %.lr.ph135, label %._crit_edge136, !llvm.loop !49

162:                                              ; preds = %107, %96
  %.pn96.pn = phi { ptr, i32 } [ %.pn96, %96 ], [ %108, %107 ]
  resume { ptr, i32 } %.pn96.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu6vectorIjE5clearEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 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

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

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

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

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

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

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

declare void @_ZN6basisu15basisu_frontend29reoptimize_remapped_endpointsERKNS_6vectorIjEERNS1_IiEEbPS2_(ptr noundef nonnull align 8 dereferenceable(496), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext, ptr noundef) local_unnamed_addr #1

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

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

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

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

declare void @_ZN6basisu23palette_index_reorderer4initEjPKjjPFfjjPvES3_f(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu23palette_index_reorderer15get_remap_tableEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN6basisu14basisu_backendE", !7, i64 0, !10, i64 8, !14, i64 40, !15, i64 56, !7, i64 168, !20, i64 176, !21, i64 192, !22, i64 208, !23, i64 224, !24, i64 240, !24, i64 256, !25, i64 272, !25, i64 288, !24, i64 304, !24, i64 320}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6basisu21basisu_backend_paramsE", !11, i64 0, !11, i64 1, !11, i64 2, !12, i64 4, !12, i64 8, !13, i64 12, !11, i64 16, !13, i64 20, !13, i64 24, !11, i64 28, !11, i64 29}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!"_ZTSN6basisu6vectorINS_25basisu_backend_slice_descEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!15 = !{!"_ZTSN6basisu21basisu_backend_outputE", !16, i64 0, !11, i64 4, !11, i64 5, !11, i64 6, !13, i64 8, !13, i64 12, !17, i64 16, !17, i64 32, !14, i64 48, !17, i64 64, !18, i64 80, !19, i64 96}
!16 = !{!"_ZTSN6basist16basis_tex_formatE", !8, i64 0}
!17 = !{!"_ZTSN6basisu6vectorIhEE", !7, i64 0, !13, i64 8, !13, i64 12}
!18 = !{!"_ZTSN6basisu6vectorINS0_IhEEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!19 = !{!"_ZTSN6basisu6vectorItEE", !7, i64 0, !13, i64 8, !13, i64 12}
!20 = !{!"_ZTSN6basisu6vectorINS_27etc1_endpoint_palette_entryEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!21 = !{!"_ZTSN6basisu6vectorIN6basist27etc1_selector_palette_entryEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!22 = !{!"_ZTSN6basisu6vectorINS_14basisu_backend34etc1_global_selector_cb_entry_descEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!24 = !{!"_ZTSN6basisu6vectorIjEE", !7, i64 0, !13, i64 8, !13, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIbEE", !7, i64 0, !13, i64 8, !13, i64 12}
!26 = !{!6, !11, i64 37}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!13, !13, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!33, !13, i64 0}
!33 = !{!"_ZTSN6basisu25basisu_backend_slice_descE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !11, i64 44, !11, i64 45}
!34 = !{!33, !13, i64 20}
!35 = !{!33, !13, i64 24}
!36 = !{!37, !13, i64 4}
!37 = !{!"_ZTSN6basisu13encoder_blockE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !11, i64 16}
!38 = distinct !{!38, !31}
!39 = distinct !{!39, !31}
!40 = distinct !{!40, !31}
!41 = distinct !{!41, !31}
!42 = distinct !{!42, !31}
!43 = distinct !{!43, !31}
!44 = distinct !{!44, !31}
!45 = !{!11, !11, i64 0}
!46 = distinct !{!46, !31}
!47 = distinct !{!47, !31}
!48 = distinct !{!48, !31}
!49 = distinct !{!49, !31}


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