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

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

%"class.basisu::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.26 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [50 x i8], align 1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend26generate_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.26)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %22 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 0
  %23 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %22, i32 0, i32 2
  %24 = load i32, ptr %23, align 8, !tbaa !9
  %25 = icmp uge i32 %24, 256
  %26 = zext i1 %25 to i64
  %27 = select i1 %25, i32 16, i32 0
  store i32 %27, ptr %3, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !31
  %28 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 0
  %29 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %28, i32 0, i32 10
  %30 = load i8, ptr %29, align 1, !tbaa !32, !range !33, !noundef !34
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %35

32:                                               ; preds = %1
  %33 = call noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #6
  %34 = call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef %33, i32 noundef 8)
  br label %36

35:                                               ; preds = %1
  br label %36

36:                                               ; preds = %35, %32
  %37 = phi i32 [ %34, %32 ], [ 0, %35 ]
  store i32 %37, ptr %4, align 4, !tbaa !31
  %38 = load i32, ptr %4, align 4, !tbaa !31
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.27, i32 noundef %38)
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  %39 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 12
  %40 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 0
  %41 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !9
  %43 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 4
  %44 = load i8, ptr %43, align 1, !tbaa !35, !range !33, !noundef !34
  %45 = trunc i8 %44 to i1
  br i1 %45, label %46, label %48

46:                                               ; preds = %36
  %47 = load i32, ptr %3, align 4, !tbaa !31
  br label %49

48:                                               ; preds = %36
  br label %49

49:                                               ; preds = %48, %46
  %50 = phi i32 [ %47, %46 ], [ 0, %48 ]
  %51 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 13
  %52 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  %53 = load i32, ptr %4, align 4, !tbaa !31
  %54 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 0
  %55 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %54, i32 0, i32 19
  %56 = load ptr, ptr %55, align 8, !tbaa !36
  %57 = call noundef zeroext i1 @_ZN6basisu39generate_hierarchical_codebook_threadedINS_17tree_vector_quantINS_3vecILj6EfEEEEEEbRT_jjRNS_6vectorINS7_IjEEEESA_jPNS_8job_poolE(ptr noundef nonnull align 8 dereferenceable(36) %39, i32 noundef %42, i32 noundef %50, ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(16) %52, i32 noundef %53, ptr noundef %56)
  %58 = zext i1 %57 to i8
  store i8 %58, ptr %5, align 1, !tbaa !37
  br label %59

59:                                               ; preds = %49
  %60 = load i8, ptr %5, align 1, !tbaa !37, !range !33, !noundef !34
  %61 = trunc i8 %60 to i1
  br i1 %61, label %63, label %62

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

63:                                               ; preds = %62, %59
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 4
  %67 = load i8, ptr %66, align 1, !tbaa !35, !range !33, !noundef !34
  %68 = trunc i8 %67 to i1
  br i1 %68, label %69, label %220

69:                                               ; preds = %65
  %70 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  %71 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %70)
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %96, label %73

73:                                               ; preds = %69
  %74 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  call void @_ZN6basisu6vectorINS0_IjEEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %74, i64 noundef 0, i1 noundef zeroext false)
  %75 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  call void @_ZN6basisu6vectorINS0_IjEEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %75, i64 noundef 1, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !31
  br label %76

76:                                               ; preds = %92, %73
  %77 = load i32, ptr %6, align 4, !tbaa !31
  %78 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 1
  %79 = load i32, ptr %78, align 8, !tbaa !38
  %80 = icmp ult i32 %77, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %95

82:                                               ; preds = %76
  %83 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %83, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %85 = load i32, ptr %6, align 4, !tbaa !31
  %86 = mul i32 %85, 2
  store i32 %86, ptr %7, align 4, !tbaa !31
  call void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %84, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  %87 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %87, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %89 = load i32, ptr %6, align 4, !tbaa !31
  %90 = mul i32 %89, 2
  %91 = add i32 %90, 1
  store i32 %91, ptr %8, align 4, !tbaa !31
  call void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %88, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %92

92:                                               ; preds = %82
  %93 = load i32, ptr %6, align 4, !tbaa !31
  %94 = add i32 %93, 1
  store i32 %94, ptr %6, align 4, !tbaa !31
  br label %76, !llvm.loop !39

95:                                               ; preds = %81
  br label %96

96:                                               ; preds = %95, %69
  %97 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 15
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %97, i64 noundef 0, i1 noundef zeroext false)
  %98 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 15
  %99 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 1
  %100 = load i32, ptr %99, align 8, !tbaa !38
  %101 = zext i32 %100 to i64
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %98, i64 noundef %101, i1 noundef zeroext false)
  %102 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 15
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  store i8 -1, ptr %9, align 1, !tbaa !41
  call void @_ZN6basisu14vector_set_allINS_6vectorIhEEEEvRT_RKNS3_10value_typeE(ptr noundef nonnull align 8 dereferenceable(16) %102, ptr noundef nonnull align 1 dereferenceable(1) %9)
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !31
  br label %103

103:                                              ; preds = %137, %96
  %104 = load i32, ptr %10, align 4, !tbaa !31
  %105 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  %106 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %105)
  %107 = icmp ult i32 %104, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %103
  store i32 7, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %140

109:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %110 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  %111 = load i32, ptr %10, align 4, !tbaa !31
  %112 = zext i32 %111 to i64
  %113 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %110, i64 noundef %112)
  store ptr %113, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !31
  br label %114

114:                                              ; preds = %133, %109
  %115 = load i32, ptr %13, align 4, !tbaa !31
  %116 = load ptr, ptr %12, align 8, !tbaa !5
  %117 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %116)
  %118 = icmp ult i32 %115, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %114
  store i32 10, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %136

120:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = load i32, ptr %13, align 4, !tbaa !31
  %123 = zext i32 %122 to i64
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %121, i64 noundef %123)
  %125 = load i32, ptr %124, align 4, !tbaa !31
  %126 = lshr i32 %125, 1
  store i32 %126, ptr %14, align 4, !tbaa !31
  %127 = load i32, ptr %10, align 4, !tbaa !31
  %128 = trunc i32 %127 to i8
  %129 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 15
  %130 = load i32, ptr %14, align 4, !tbaa !31
  %131 = zext i32 %130 to i64
  %132 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %129, i64 noundef %131)
  store i8 %128, ptr %132, align 1, !tbaa !41
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %133

133:                                              ; preds = %120
  %134 = load i32, ptr %13, align 4, !tbaa !31
  %135 = add i32 %134, 1
  store i32 %135, ptr %13, align 4, !tbaa !31
  br label %114, !llvm.loop !42

136:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %10, align 4, !tbaa !31
  %139 = add i32 %138, 1
  store i32 %139, ptr %10, align 4, !tbaa !31
  br label %103, !llvm.loop !43

140:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !31
  br label %141

141:                                              ; preds = %160, %140
  %142 = load i32, ptr %15, align 4, !tbaa !31
  %143 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 1
  %144 = load i32, ptr %143, align 8, !tbaa !38
  %145 = icmp ult i32 %142, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %141
  store i32 13, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %163

147:                                              ; preds = %141
  br label %148

148:                                              ; preds = %147
  %149 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 15
  %150 = load i32, ptr %15, align 4, !tbaa !31
  %151 = zext i32 %150 to i64
  %152 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %149, i64 noundef %151)
  %153 = load i8, ptr %152, align 1, !tbaa !41
  %154 = zext i8 %153 to i32
  %155 = icmp ne i32 %154, 255
  br i1 %155, label %157, label %156

156:                                              ; preds = %148
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 931)
  br label %157

157:                                              ; preds = %156, %148
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %15, align 4, !tbaa !31
  %162 = add i32 %161, 1
  store i32 %162, ptr %15, align 4, !tbaa !31
  br label %141, !llvm.loop !44

163:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !31
  br label %164

164:                                              ; preds = %216, %163
  %165 = load i32, ptr %16, align 4, !tbaa !31
  %166 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 13
  %167 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %166)
  %168 = icmp ult i32 %165, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %164
  store i32 18, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %219

170:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %171 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 13
  %172 = load i32, ptr %16, align 4, !tbaa !31
  %173 = zext i32 %172 to i64
  %174 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %171, i64 noundef %173)
  store ptr %174, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !31
  br label %175

175:                                              ; preds = %212, %170
  %176 = load i32, ptr %19, align 4, !tbaa !31
  %177 = load ptr, ptr %17, align 8, !tbaa !5
  %178 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %177)
  %179 = icmp ult i32 %176, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %175
  store i32 21, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %215

181:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %182 = load ptr, ptr %17, align 8, !tbaa !5
  %183 = load i32, ptr %19, align 4, !tbaa !31
  %184 = zext i32 %183 to i64
  %185 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %182, i64 noundef %184)
  %186 = load i32, ptr %185, align 4, !tbaa !31
  %187 = lshr i32 %186, 1
  store i32 %187, ptr %20, align 4, !tbaa !31
  %188 = load i32, ptr %19, align 4, !tbaa !31
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %197, label %190

190:                                              ; preds = %181
  %191 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 15
  %192 = load i32, ptr %20, align 4, !tbaa !31
  %193 = zext i32 %192 to i64
  %194 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %191, i64 noundef %193)
  %195 = load i8, ptr %194, align 1, !tbaa !41
  %196 = zext i8 %195 to i32
  store i32 %196, ptr %18, align 4, !tbaa !31
  br label %211

197:                                              ; preds = %181
  br label %198

198:                                              ; preds = %197
  %199 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 15
  %200 = load i32, ptr %20, align 4, !tbaa !31
  %201 = zext i32 %200 to i64
  %202 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %199, i64 noundef %201)
  %203 = load i8, ptr %202, align 1, !tbaa !41
  %204 = zext i8 %203 to i32
  %205 = load i32, ptr %18, align 4, !tbaa !31
  %206 = icmp eq i32 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %198
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 949)
  br label %208

208:                                              ; preds = %207, %198
  br label %209

209:                                              ; preds = %208
  br label %210

210:                                              ; preds = %209
  br label %211

211:                                              ; preds = %210, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %212

212:                                              ; preds = %211
  %213 = load i32, ptr %19, align 4, !tbaa !31
  %214 = add i32 %213, 1
  store i32 %214, ptr %19, align 4, !tbaa !31
  br label %175, !llvm.loop !45

215:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %216

216:                                              ; preds = %215
  %217 = load i32, ptr %16, align 4, !tbaa !31
  %218 = add i32 %217, 1
  store i32 %218, ptr %16, align 4, !tbaa !31
  br label %164, !llvm.loop !46

219:                                              ; preds = %169
  br label %220

220:                                              ; preds = %219, %65
  %221 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 0
  %222 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %221, i32 0, i32 6
  %223 = load i8, ptr %222, align 1, !tbaa !47, !range !33, !noundef !34
  %224 = trunc i8 %223 to i1
  br i1 %224, label %225, label %230

225:                                              ; preds = %220
  %226 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 13
  %227 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %226)
  %228 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %21, i32 0, i32 14
  %229 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %228)
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.28, i32 noundef %227, i32 noundef %229)
  br label %230

230:                                              ; preds = %225, %220
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void
}

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

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu39generate_hierarchical_codebook_threadedINS_17tree_vector_quantINS_3vecILj6EfEEEEEEbRT_jjRNS_6vectorINS7_IjEEEESA_jPNS_8job_poolE(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14vector_set_allINS_6vectorIhEEEEvRT_RKNS3_10value_typeE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #1

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

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

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

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


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

@.str.26 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [50 x i8], align 1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend26generate_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.26)
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = icmp ugt i32 %6, 255
  %8 = getelementptr inbounds i8, ptr %0, i64 33
  %9 = load i8, ptr %8, align 1, !tbaa !30, !range !31, !noundef !32
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %11, label %14

11:                                               ; preds = %1
  %12 = tail call noundef i32 @_ZNSt6thread20hardware_concurrencyEv() #6
  %13 = tail call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef %12, i32 noundef 8)
  br label %14

14:                                               ; preds = %1, %11
  %15 = phi i32 [ %13, %11 ], [ 0, %1 ]
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.27, i32 noundef %15)
  %16 = getelementptr inbounds i8, ptr %0, i64 176
  %17 = load i32, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 97
  %19 = load i8, ptr %18, align 1, !tbaa !33, !range !31, !noundef !32
  %20 = trunc nuw i8 %19 to i1
  %21 = select i1 %20, i1 %7, i1 false
  %22 = select i1 %21, i32 16, i32 0
  %23 = getelementptr inbounds i8, ptr %0, i64 216
  %24 = getelementptr inbounds i8, ptr %0, i64 232
  %25 = getelementptr inbounds i8, ptr %0, i64 80
  %26 = load ptr, ptr %25, align 8, !tbaa !34
  %27 = tail call noundef zeroext i1 @_ZN6basisu39generate_hierarchical_codebook_threadedINS_17tree_vector_quantINS_3vecILj6EfEEEEEEbRT_jjRNS_6vectorINS7_IjEEEESA_jPNS_8job_poolE(ptr noundef nonnull align 8 dereferenceable(36) %16, i32 noundef %17, i32 noundef %22, ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %24, i32 noundef %15, ptr noundef %26)
  br i1 %27, label %29, label %28

28:                                               ; preds = %14
  tail call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 899)
  br label %29

29:                                               ; preds = %28, %14
  %30 = load i8, ptr %18, align 1, !tbaa !33, !range !31, !noundef !32
  %31 = trunc nuw i8 %30 to i1
  br i1 %31, label %32, label %.loopexit

32:                                               ; preds = %29
  %33 = tail call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
  %.not = icmp eq i32 %33, 0
  br i1 %.not, label %34, label %.loopexit42

34:                                               ; preds = %32
  tail call void @_ZN6basisu6vectorINS0_IjEEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %24, i64 noundef 0, i1 noundef zeroext false)
  tail call void @_ZN6basisu6vectorINS0_IjEEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %24, i64 noundef 1, i1 noundef zeroext false)
  %35 = getelementptr inbounds i8, ptr %0, i64 88
  %36 = load i32, ptr %35, align 8, !tbaa !35
  %.not58 = icmp eq i32 %36, 0
  br i1 %.not58, label %.loopexit42, label %.lr.ph

.lr.ph:                                           ; preds = %34, %.lr.ph
  %.03443 = phi i32 [ %41, %.lr.ph ], [ 0, %34 ]
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %24, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %38 = shl i32 %.03443, 1
  store i32 %38, ptr %2, align 4, !tbaa !36
  call void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %24, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %40 = or disjoint i32 %38, 1
  store i32 %40, ptr %3, align 4, !tbaa !36
  call void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %41 = add nuw i32 %.03443, 1
  %42 = load i32, ptr %35, align 8, !tbaa !35
  %43 = icmp ult i32 %41, %42
  br i1 %43, label %.lr.ph, label %.loopexit42, !llvm.loop !37

.loopexit42:                                      ; preds = %.lr.ph, %34, %32
  %44 = getelementptr inbounds i8, ptr %0, i64 248
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %44, i64 noundef 0, i1 noundef zeroext false)
  %45 = getelementptr inbounds i8, ptr %0, i64 88
  %46 = load i32, ptr %45, align 8, !tbaa !35
  %47 = zext i32 %46 to i64
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %44, i64 noundef %47, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  store i8 -1, ptr %4, align 1, !tbaa !39
  call void @_ZN6basisu14vector_set_allINS_6vectorIhEEEEvRT_RKNS3_10value_typeE(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 1 dereferenceable(1) %4)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %48 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
  %.not59 = icmp eq i32 %48, 0
  br i1 %.not59, label %.preheader41, label %.lr.ph48

.preheader41:                                     ; preds = %._crit_edge, %.loopexit42
  %49 = load i32, ptr %45, align 8, !tbaa !35
  %.not61 = icmp eq i32 %49, 0
  br i1 %.not61, label %.preheader, label %.lr.ph50

.lr.ph48:                                         ; preds = %.loopexit42, %._crit_edge
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge ], [ 0, %.loopexit42 ]
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %24, i64 noundef %indvars.iv65)
  %51 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %50)
  %.not60 = icmp eq i32 %51, 0
  br i1 %.not60, label %._crit_edge, label %.lr.ph45

.lr.ph45:                                         ; preds = %.lr.ph48
  %52 = trunc i64 %indvars.iv65 to i8
  br label %56

._crit_edge:                                      ; preds = %56, %.lr.ph48
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %53 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
  %54 = zext i32 %53 to i64
  %55 = icmp ult i64 %indvars.iv.next66, %54
  br i1 %55, label %.lr.ph48, label %.preheader41, !llvm.loop !40

56:                                               ; preds = %.lr.ph45, %56
  %indvars.iv = phi i64 [ 0, %.lr.ph45 ], [ %indvars.iv.next, %56 ]
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %50, i64 noundef %indvars.iv)
  %58 = load i32, ptr %57, align 4, !tbaa !36
  %59 = lshr i32 %58, 1
  %60 = zext nneg i32 %59 to i64
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %44, i64 noundef %60)
  store i8 %52, ptr %61, align 1, !tbaa !39
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %62 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %50)
  %63 = zext i32 %62 to i64
  %64 = icmp ult i64 %indvars.iv.next, %63
  br i1 %64, label %56, label %._crit_edge, !llvm.loop !41

.preheader:                                       ; preds = %69, %.preheader41
  %65 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
  %.not62 = icmp eq i32 %65, 0
  br i1 %.not62, label %.loopexit, label %.lr.ph57

.lr.ph50:                                         ; preds = %.preheader41, %69
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %69 ], [ 0, %.preheader41 ]
  %66 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %44, i64 noundef %indvars.iv68)
  %67 = load i8, ptr %66, align 1, !tbaa !39
  %.not40 = icmp eq i8 %67, -1
  br i1 %.not40, label %68, label %69

68:                                               ; preds = %.lr.ph50
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 931)
  br label %69

69:                                               ; preds = %.lr.ph50, %68
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %70 = load i32, ptr %45, align 8, !tbaa !35
  %71 = zext i32 %70 to i64
  %72 = icmp ult i64 %indvars.iv.next69, %71
  br i1 %72, label %.lr.ph50, label %.preheader, !llvm.loop !42

.lr.ph57:                                         ; preds = %.preheader, %._crit_edge55
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %._crit_edge55 ], [ 0, %.preheader ]
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %23, i64 noundef %indvars.iv75)
  %74 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %73)
  %.not63 = icmp eq i32 %74, 0
  br i1 %.not63, label %._crit_edge55, label %75

75:                                               ; preds = %.lr.ph57
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %73, i64 noundef 0)
  %77 = load i32, ptr %76, align 4, !tbaa !36
  %78 = lshr i32 %77, 1
  %79 = zext nneg i32 %78 to i64
  %80 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %44, i64 noundef %79)
  %81 = load i8, ptr %80, align 1, !tbaa !39
  %82 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %73)
  %83 = icmp ugt i32 %82, 1
  br i1 %83, label %.lr.ph54.peel.next, label %._crit_edge55

._crit_edge55:                                    ; preds = %95, %75, %.lr.ph57
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %84 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
  %85 = zext i32 %84 to i64
  %86 = icmp ult i64 %indvars.iv.next76, %85
  br i1 %86, label %.lr.ph57, label %.loopexit, !llvm.loop !43

.lr.ph54.peel.next:                               ; preds = %75, %95
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %95 ], [ 1, %75 ]
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %73, i64 noundef %indvars.iv71)
  %88 = load i32, ptr %87, align 4, !tbaa !36
  %89 = lshr i32 %88, 1
  %90 = zext nneg i32 %89 to i64
  %91 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %44, i64 noundef %90)
  %92 = load i8, ptr %91, align 1, !tbaa !39
  %93 = icmp eq i8 %81, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %.lr.ph54.peel.next
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 949)
  br label %95

95:                                               ; preds = %.lr.ph54.peel.next, %94
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %96 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %73)
  %97 = zext i32 %96 to i64
  %98 = icmp ult i64 %indvars.iv.next72, %97
  br i1 %98, label %.lr.ph54.peel.next, label %._crit_edge55, !llvm.loop !44

.loopexit:                                        ; preds = %._crit_edge55, %.preheader, %29
  %99 = getelementptr inbounds i8, ptr %0, i64 29
  %100 = load i8, ptr %99, align 1, !tbaa !46, !range !31, !noundef !32
  %101 = trunc nuw i8 %100 to i1
  br i1 %101, label %102, label %105

102:                                              ; preds = %.loopexit
  %103 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %23)
  %104 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.28, i32 noundef %103, i32 noundef %104)
  br label %105

105:                                              ; preds = %102, %.loopexit
  ret void
}

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

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare noundef i32 @_ZNSt6thread20hardware_concurrencyEv() local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu39generate_hierarchical_codebook_threadedINS_17tree_vector_quantINS_3vecILj6EfEEEEEEbRT_jjRNS_6vectorINS7_IjEEEESA_jPNS_8job_poolE(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14vector_set_allINS_6vectorIhEEEEvRT_RKNS3_10value_typeE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

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

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

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

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

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


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