; 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.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.85 = type { ptr, i32, i32, ptr, ptr }
%class.anon.86 = type { ptr, i32, i32, ptr, ptr, ptr }
%"class.basisu::image" = type { i32, i32, i32, %"class.basisu::vector.87" }
%"class.basisu::vector.87" = type { ptr, i32, i32 }
%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%"class.basisu::basisu_frontend" = type { %"struct.basisu::basisu_frontend::params", i32, i32, i8, i8, i8, i32, i32, %"class.basisu::vector", %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::tree_vector_quant", %"class.basisu::vector.6", %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.6", %"class.basisu::vector.10", %"class.basisu::vector.12", %"class.basisu::vector.6", %"class.basisu::vector.0", %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.6", %"class.basisu::vector.14", %"class.basisu::vector.16", %"class.basisu::vector.18", %"class.basisu::vector.20", %"class.std::mutex" }
%"struct.basisu::basisu_frontend::params" = type { i32, ptr, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, ptr, i32, i32, i8, float, i32, ptr, ptr }
%"class.basisu::vector" = type { ptr, i32, i32 }
%"class.basisu::tree_vector_quant" = type <{ %"class.basisu::vector.2", %"class.basisu::vector.4", i32, [4 x i8] }>
%"class.basisu::vector.2" = type { ptr, i32, i32 }
%"class.basisu::vector.4" = type { ptr, i32, i32 }
%"class.basisu::vector.10" = type { ptr, i32, i32 }
%"class.basisu::vector.12" = type { ptr, i32, i32 }
%"class.basisu::vector.0" = type { ptr, i32, i32 }
%"class.basisu::vector.8" = type { ptr, i32, i32 }
%"class.basisu::vector.6" = type { ptr, i32, i32 }
%"class.basisu::vector.14" = type { ptr, i32, i32 }
%"class.basisu::vector.16" = type { ptr, i32, i32 }
%"class.basisu::vector.18" = type { ptr, i32, i32 }
%"class.basisu::vector.20" = type { ptr, i32, i32 }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@.str.40 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend34create_optimized_selector_codebookEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %1) #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::function", align 8
  %12 = alloca %class.anon.85, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.std::function", align 8
  %22 = alloca %class.anon.86, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %"class.basisu::image", align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca %"class.basisu::color_rgba", align 1
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca %"class.basisu::color_rgba", align 1
  %39 = alloca [256 x i8], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %40 = load ptr, ptr %3, align 8
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.40)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %41 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 19
  %42 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %41)
  store i32 %42, ptr %5, align 4, !tbaa !9
  %43 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 19
  %44 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %43)
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.41, i32 noundef %44)
  %45 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 20
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  call void @_ZN6basisu6vectorINS_9etc_blockEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %45, i64 noundef %47, i1 noundef zeroext false)
  %48 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %49 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %48, i32 0, i32 12
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %94

52:                                               ; preds = %2
  %53 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %54 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %53, i32 0, i32 15
  %55 = load i8, ptr %54, align 8, !tbaa !32, !range !33, !noundef !34
  %56 = trunc i8 %55 to i1
  br i1 %56, label %94, label %57

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  %58 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 24
  %59 = load i32, ptr %5, align 4, !tbaa !9
  %60 = zext i32 %59 to i64
  call void @_ZN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %58, i64 noundef %60, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 256, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %83, %57
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = icmp ult i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %90

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %67 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %67, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %68 = load i32, ptr %5, align 4, !tbaa !9
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = add i32 %69, 256
  %71 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %68, i32 noundef %70)
  store i32 %71, ptr %10, align 4, !tbaa !9
  %72 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %73 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %72, i32 0, i32 19
  %74 = load ptr, ptr %73, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  %75 = getelementptr inbounds %class.anon.85, ptr %12, i32 0, i32 0
  store ptr %40, ptr %75, align 8, !tbaa !36
  %76 = getelementptr inbounds %class.anon.85, ptr %12, i32 0, i32 1
  %77 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %77, ptr %76, align 8, !tbaa !38
  %78 = getelementptr inbounds %class.anon.85, ptr %12, i32 0, i32 2
  %79 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %79, ptr %78, align 4, !tbaa !39
  %80 = getelementptr inbounds %class.anon.85, ptr %12, i32 0, i32 3
  store ptr %6, ptr %80, align 8, !tbaa !5
  %81 = getelementptr inbounds %class.anon.85, ptr %12, i32 0, i32 4
  store ptr %5, ptr %81, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend34create_optimized_selector_codebookEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %12)
  invoke void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189) %74, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %82 unwind label %86

82:                                               ; preds = %66
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = add i32 %84, 256
  store i32 %85, ptr %8, align 4, !tbaa !9
  br label %61, !llvm.loop !40

86:                                               ; preds = %66
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %13, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %14, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %347

90:                                               ; preds = %65
  %91 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %92 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %91, i32 0, i32 19
  %93 = load ptr, ptr %92, align 8, !tbaa !35
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %93)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %151

94:                                               ; preds = %52, %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  %95 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %96 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %95, i32 0, i32 12
  %97 = load ptr, ptr %96, align 8, !tbaa !11
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %104

99:                                               ; preds = %94
  %100 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %101 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %100, i32 0, i32 15
  %102 = load i8, ptr %101, align 8, !tbaa !32, !range !33, !noundef !34
  %103 = trunc i8 %102 to i1
  br label %104

104:                                              ; preds = %99, %94
  %105 = phi i1 [ false, %94 ], [ %103, %99 ]
  %106 = zext i1 %105 to i8
  store i8 %106, ptr %15, align 1, !tbaa !42
  %107 = load i8, ptr %15, align 1, !tbaa !42, !range !33, !noundef !34
  %108 = trunc i8 %107 to i1
  br i1 %108, label %109, label %116

109:                                              ; preds = %104
  %110 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 25
  %111 = load i32, ptr %5, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  call void @_ZN6basisu6vectorIbE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %110, i64 noundef %112, i1 noundef zeroext false)
  %113 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 24
  %114 = load i32, ptr %5, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  call void @_ZN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %113, i64 noundef %115, i1 noundef zeroext false)
  br label %116

116:                                              ; preds = %109, %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 256, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %140, %116
  %118 = load i32, ptr %18, align 4, !tbaa !9
  %119 = load i32, ptr %5, align 4, !tbaa !9
  %120 = icmp ult i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %147

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %123 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %123, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %124 = load i32, ptr %5, align 4, !tbaa !9
  %125 = load i32, ptr %18, align 4, !tbaa !9
  %126 = add i32 %125, 256
  %127 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %124, i32 noundef %126)
  store i32 %127, ptr %20, align 4, !tbaa !9
  %128 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %129 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %128, i32 0, i32 19
  %130 = load ptr, ptr %129, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr %22) #7
  %131 = getelementptr inbounds %class.anon.86, ptr %22, i32 0, i32 0
  store ptr %40, ptr %131, align 8, !tbaa !43
  %132 = getelementptr inbounds %class.anon.86, ptr %22, i32 0, i32 1
  %133 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %133, ptr %132, align 8, !tbaa !45
  %134 = getelementptr inbounds %class.anon.86, ptr %22, i32 0, i32 2
  %135 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %135, ptr %134, align 4, !tbaa !46
  %136 = getelementptr inbounds %class.anon.86, ptr %22, i32 0, i32 3
  store ptr %15, ptr %136, align 8, !tbaa !5
  %137 = getelementptr inbounds %class.anon.86, ptr %22, i32 0, i32 4
  store ptr %16, ptr %137, align 8, !tbaa !5
  %138 = getelementptr inbounds %class.anon.86, ptr %22, i32 0, i32 5
  store ptr %5, ptr %138, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend34create_optimized_selector_codebookEjE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(40) %22)
  invoke void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189) %130, ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %139 unwind label %143

139:                                              ; preds = %122
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %18, align 4, !tbaa !9
  %142 = add i32 %141, 256
  store i32 %142, ptr %18, align 4, !tbaa !9
  br label %117, !llvm.loop !47

143:                                              ; preds = %122
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %13, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %14, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  br label %347

147:                                              ; preds = %121
  %148 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %149 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %148, i32 0, i32 19
  %150 = load ptr, ptr %149, align 8, !tbaa !35
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %150)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  br label %151

151:                                              ; preds = %147, %90
  %152 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 0
  %153 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %152, i32 0, i32 7
  %154 = load i8, ptr %153, align 2, !tbaa !48, !range !33, !noundef !34
  %155 = trunc i8 %154 to i1
  br i1 %155, label %156, label %346

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %171, %156
  %158 = load i32, ptr %24, align 4, !tbaa !9
  %159 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 19
  %160 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %159)
  %161 = icmp ult i32 %158, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %174

163:                                              ; preds = %157
  %164 = load i32, ptr %23, align 4, !tbaa !9
  %165 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 19
  %166 = load i32, ptr %24, align 4, !tbaa !9
  %167 = zext i32 %166 to i64
  %168 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %165, i64 noundef %167)
  %169 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %168)
  %170 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef %164, i32 noundef %169)
  store i32 %170, ptr %23, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %163
  %172 = load i32, ptr %24, align 4, !tbaa !9
  %173 = add i32 %172, 1
  store i32 %173, ptr %24, align 4, !tbaa !9
  br label %157, !llvm.loop !49

174:                                              ; preds = %162
  %175 = load i32, ptr %23, align 4, !tbaa !9
  %176 = mul i32 %175, 5
  %177 = icmp ult i32 %176, 32768
  br i1 %177, label %178, label %345

178:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 16, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %26) #7
  %179 = load i32, ptr %23, align 4, !tbaa !9
  %180 = mul i32 %179, 5
  %181 = add i32 16, %180
  %182 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 19
  %183 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %182)
  %184 = mul i32 %183, 5
  call void @_ZN6basisu5imageC2Ejjj(ptr noundef nonnull align 8 dereferenceable(32) %26, i32 noundef %181, i32 noundef %184, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %185

185:                                              ; preds = %328, %178
  %186 = load i32, ptr %27, align 4, !tbaa !9
  %187 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 19
  %188 = invoke noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %187)
          to label %189 unwind label %192

189:                                              ; preds = %185
  %190 = icmp ult i32 %186, %188
  br i1 %190, label %196, label %191

191:                                              ; preds = %189
  store i32 11, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %333

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

196:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %197 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 19
  %198 = load i32, ptr %27, align 4, !tbaa !9
  %199 = zext i32 %198 to i64
  %200 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %197, i64 noundef %199)
          to label %201 unwind label %206

201:                                              ; preds = %196
  store ptr %200, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %202

202:                                              ; preds = %245, %201
  %203 = load i32, ptr %30, align 4, !tbaa !9
  %204 = icmp ult i32 %203, 4
  br i1 %204, label %210, label %205

205:                                              ; preds = %202
  store i32 14, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %248

206:                                              ; preds = %196
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %13, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %14, align 4
  br label %331

210:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %211

211:                                              ; preds = %237, %210
  %212 = load i32, ptr %31, align 4, !tbaa !9
  %213 = icmp ult i32 %212, 4
  br i1 %213, label %215, label %214

214:                                              ; preds = %211
  store i32 17, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %244

215:                                              ; preds = %211
  %216 = load i32, ptr %31, align 4, !tbaa !9
  %217 = add i32 16, %216
  %218 = sub i32 %217, 12
  %219 = load i32, ptr %27, align 4, !tbaa !9
  %220 = mul i32 %219, 5
  %221 = load i32, ptr %30, align 4, !tbaa !9
  %222 = add i32 %220, %221
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %223 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 20
  %224 = load i32, ptr %27, align 4, !tbaa !9
  %225 = zext i32 %224 to i64
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %223, i64 noundef %225)
          to label %227 unwind label %240

227:                                              ; preds = %215
  %228 = load i32, ptr %31, align 4, !tbaa !9
  %229 = load i32, ptr %30, align 4, !tbaa !9
  %230 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %226, i32 noundef %228, i32 noundef %229)
          to label %231 unwind label %240

231:                                              ; preds = %227
  %232 = mul i32 %230, 255
  %233 = udiv i32 %232, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %32, i32 noundef %233)
          to label %234 unwind label %240

234:                                              ; preds = %231
  %235 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %26, i32 noundef %218, i32 noundef %222, ptr noundef nonnull align 1 dereferenceable(4) %32)
          to label %236 unwind label %240

236:                                              ; preds = %234
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %237

237:                                              ; preds = %236
  %238 = load i32, ptr %31, align 4, !tbaa !9
  %239 = add i32 %238, 1
  store i32 %239, ptr %31, align 4, !tbaa !9
  br label %211, !llvm.loop !50

240:                                              ; preds = %234, %231, %227, %215
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %13, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %331

244:                                              ; preds = %214
  br label %245

245:                                              ; preds = %244
  %246 = load i32, ptr %30, align 4, !tbaa !9
  %247 = add i32 %246, 1
  store i32 %247, ptr %30, align 4, !tbaa !9
  br label %202, !llvm.loop !51

248:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %249

249:                                              ; preds = %321, %248
  %250 = load i32, ptr %33, align 4, !tbaa !9
  %251 = load ptr, ptr %29, align 8, !tbaa !5
  %252 = invoke noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %251)
          to label %253 unwind label %256

253:                                              ; preds = %249
  %254 = icmp ult i32 %250, %252
  br i1 %254, label %260, label %255

255:                                              ; preds = %253
  store i32 20, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %327

256:                                              ; preds = %249
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %13, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %14, align 4
  br label %326

260:                                              ; preds = %253
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %261 = load ptr, ptr %29, align 8, !tbaa !5
  %262 = load i32, ptr %33, align 4, !tbaa !9
  %263 = zext i32 %262 to i64
  %264 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %261, i64 noundef %263)
          to label %265 unwind label %276

265:                                              ; preds = %260
  %266 = load i32, ptr %264, align 4, !tbaa !9
  store i32 %266, ptr %34, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %267 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %40, i32 0, i32 10
  %268 = load i32, ptr %34, align 4, !tbaa !9
  %269 = zext i32 %268 to i64
  %270 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %267, i64 noundef %269)
          to label %271 unwind label %280

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

272:                                              ; preds = %317, %271
  %273 = load i32, ptr %36, align 4, !tbaa !9
  %274 = icmp ult i32 %273, 4
  br i1 %274, label %284, label %275

275:                                              ; preds = %272
  store i32 23, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %320

276:                                              ; preds = %260
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %13, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %14, align 4
  br label %325

280:                                              ; preds = %265
  %281 = landingpad { ptr, i32 }
          cleanup
  %282 = extractvalue { ptr, i32 } %281, 0
  store ptr %282, ptr %13, align 8
  %283 = extractvalue { ptr, i32 } %281, 1
  store i32 %283, ptr %14, align 4
  br label %324

284:                                              ; preds = %272
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  store i32 0, ptr %37, align 4, !tbaa !9
  br label %285

285:                                              ; preds = %309, %284
  %286 = load i32, ptr %37, align 4, !tbaa !9
  %287 = icmp ult i32 %286, 4
  br i1 %287, label %289, label %288

288:                                              ; preds = %285
  store i32 26, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  br label %316

289:                                              ; preds = %285
  %290 = load i32, ptr %37, align 4, !tbaa !9
  %291 = add i32 16, %290
  %292 = load i32, ptr %33, align 4, !tbaa !9
  %293 = mul i32 5, %292
  %294 = add i32 %291, %293
  %295 = load i32, ptr %27, align 4, !tbaa !9
  %296 = mul i32 %295, 5
  %297 = load i32, ptr %36, align 4, !tbaa !9
  %298 = add i32 %296, %297
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  %299 = load ptr, ptr %35, align 8, !tbaa !5
  %300 = load i32, ptr %37, align 4, !tbaa !9
  %301 = load i32, ptr %36, align 4, !tbaa !9
  %302 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %299, i32 noundef %300, i32 noundef %301)
          to label %303 unwind label %312

303:                                              ; preds = %289
  %304 = mul i32 %302, 255
  %305 = udiv i32 %304, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %38, i32 noundef %305)
          to label %306 unwind label %312

306:                                              ; preds = %303
  %307 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %26, i32 noundef %294, i32 noundef %298, ptr noundef nonnull align 1 dereferenceable(4) %38)
          to label %308 unwind label %312

308:                                              ; preds = %306
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  br label %309

309:                                              ; preds = %308
  %310 = load i32, ptr %37, align 4, !tbaa !9
  %311 = add i32 %310, 1
  store i32 %311, ptr %37, align 4, !tbaa !9
  br label %285, !llvm.loop !52

312:                                              ; preds = %306, %303, %289
  %313 = landingpad { ptr, i32 }
          cleanup
  %314 = extractvalue { ptr, i32 } %313, 0
  store ptr %314, ptr %13, align 8
  %315 = extractvalue { ptr, i32 } %313, 1
  store i32 %315, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %324

316:                                              ; preds = %288
  br label %317

317:                                              ; preds = %316
  %318 = load i32, ptr %36, align 4, !tbaa !9
  %319 = add i32 %318, 1
  store i32 %319, ptr %36, align 4, !tbaa !9
  br label %272, !llvm.loop !53

320:                                              ; preds = %275
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %321

321:                                              ; preds = %320
  %322 = load i32, ptr %33, align 4, !tbaa !9
  %323 = add i32 %322, 1
  store i32 %323, ptr %33, align 4, !tbaa !9
  br label %249, !llvm.loop !54

324:                                              ; preds = %312, %280
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  br label %325

325:                                              ; preds = %324, %276
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %326

326:                                              ; preds = %325, %256
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %331

327:                                              ; preds = %255
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %328

328:                                              ; preds = %327
  %329 = load i32, ptr %27, align 4, !tbaa !9
  %330 = add i32 %329, 1
  store i32 %330, ptr %27, align 4, !tbaa !9
  br label %185, !llvm.loop !55

331:                                              ; preds = %326, %240, %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %332

332:                                              ; preds = %331, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %344

333:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 256, ptr %39) #7
  %334 = getelementptr inbounds [256 x i8], ptr %39, i64 0, i64 0
  %335 = load i32, ptr %4, align 4, !tbaa !9
  %336 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %334, i64 noundef 256, ptr noundef @.str.42, i32 noundef %335) #7
  %337 = getelementptr inbounds [256 x i8], ptr %39, i64 0, i64 0
  %338 = invoke noundef zeroext i1 @_ZN6basisu8save_pngEPKcRKNS_5imageEjj(ptr noundef %337, ptr noundef nonnull align 8 dereferenceable(32) %26, i32 noundef 0, i32 noundef 0)
          to label %339 unwind label %340

339:                                              ; preds = %333
  call void @llvm.lifetime.end.p0(i64 256, ptr %39) #7
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %345

340:                                              ; preds = %333
  %341 = landingpad { ptr, i32 }
          cleanup
  %342 = extractvalue { ptr, i32 } %341, 0
  store ptr %342, ptr %13, align 8
  %343 = extractvalue { ptr, i32 } %341, 1
  store i32 %343, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 256, ptr %39) #7
  br label %344

344:                                              ; preds = %340, %332
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %347

345:                                              ; preds = %339, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %346

346:                                              ; preds = %345, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret void

347:                                              ; preds = %344, %143, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %348

348:                                              ; preds = %347
  %349 = load ptr, ptr %13, align 8
  %350 = load i32, ptr %14, align 4
  %351 = insertvalue { ptr, i32 } poison, ptr %349, 0
  %352 = insertvalue { ptr, i32 } %351, i32 %350, 1
  resume { ptr, i32 } %352
}

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

declare void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189), ptr noundef nonnull align 8 dereferenceable(32)) #0

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189)) #0

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend34create_optimized_selector_codebookEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend34create_optimized_selector_codebookEjE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu5imageC2Ejjj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #5 align 2

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

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

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

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

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

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


; 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.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.85 = type { ptr, i32, i32, ptr, ptr }
%class.anon.86 = type { ptr, i32, i32, ptr, ptr, ptr }
%"class.basisu::image" = type { i32, i32, i32, %"class.basisu::vector.87" }
%"class.basisu::vector.87" = type { ptr, i32, i32 }
%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }

@.str.40 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #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: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend34create_optimized_selector_codebookEj(ptr noundef nonnull align 8 dereferenceable(496) %0, i32 noundef %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::function", align 8
  %6 = alloca %class.anon.85, align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::function", align 8
  %10 = alloca %class.anon.86, align 8
  %11 = alloca %"class.basisu::image", align 8
  %12 = alloca %"class.basisu::color_rgba", align 1
  %13 = alloca %"class.basisu::color_rgba", align 1
  %14 = alloca [256 x i8], align 16
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.40)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %15 = getelementptr inbounds i8, ptr %0, i64 312
  %16 = tail call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  store i32 %16, ptr %3, align 4, !tbaa !5
  %17 = tail call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.41, i32 noundef %17)
  %18 = getelementptr inbounds i8, ptr %0, i64 328
  %19 = zext i32 %16 to i64
  tail call void @_ZN6basisu6vectorINS_9etc_blockEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %19, i1 noundef zeroext false)
  %20 = getelementptr inbounds i8, ptr %0, i64 40
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %.thread, label %22

.thread:                                          ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #7
  store i8 0, ptr %7, align 1, !tbaa !31
  br label %48

22:                                               ; preds = %2
  %23 = getelementptr inbounds i8, ptr %0, i64 56
  %24 = load i8, ptr %23, align 8, !range !32, !noundef !33
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %45, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 392
  tail call void @_ZN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %27, i64 noundef %19, i1 noundef zeroext false)
  %.not95 = icmp eq i32 %16, 0
  br i1 %.not95, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %26
  %28 = getelementptr inbounds i8, ptr %0, i64 80
  %29 = getelementptr inbounds i8, ptr %6, i64 8
  %30 = getelementptr inbounds i8, ptr %6, i64 12
  %31 = getelementptr inbounds i8, ptr %6, i64 16
  %32 = getelementptr inbounds i8, ptr %6, i64 24
  br label %35

._crit_edge:                                      ; preds = %40, %26
  %33 = getelementptr inbounds i8, ptr %0, i64 80
  %34 = load ptr, ptr %33, align 8, !tbaa !34
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %34)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %67

35:                                               ; preds = %.lr.ph, %40
  %36 = phi i32 [ %16, %.lr.ph ], [ %41, %40 ]
  %.05275 = phi i32 [ 0, %.lr.ph ], [ %37, %40 ]
  %37 = add i32 %.05275, 256
  %38 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %36, i32 noundef %37)
  %39 = load ptr, ptr %28, align 8, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  store ptr %0, ptr %6, align 8, !tbaa !35
  store i32 %.05275, ptr %29, align 8, !tbaa !37
  store i32 %38, ptr %30, align 4, !tbaa !38
  store ptr %4, ptr %31, align 8, !tbaa !39
  store ptr %3, ptr %32, align 8, !tbaa !39
  call void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend34create_optimized_selector_codebookEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %6)
  invoke void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189) %39, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %40 unwind label %43

40:                                               ; preds = %35
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = icmp ult i32 %37, %41
  br i1 %42, label %35, label %._crit_edge, !llvm.loop !40

43:                                               ; preds = %35
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %264

45:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #7
  store i8 %24, ptr %7, align 1, !tbaa !31
  %46 = getelementptr inbounds i8, ptr %0, i64 408
  tail call void @_ZN6basisu6vectorIbE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %46, i64 noundef %19, i1 noundef zeroext false)
  %47 = getelementptr inbounds i8, ptr %0, i64 392
  tail call void @_ZN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %47, i64 noundef %19, i1 noundef zeroext false)
  br label %48

48:                                               ; preds = %.thread, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  %.not96 = icmp eq i32 %16, 0
  br i1 %.not96, label %._crit_edge79, label %.lr.ph78

.lr.ph78:                                         ; preds = %48
  %49 = getelementptr inbounds i8, ptr %0, i64 80
  %50 = getelementptr inbounds i8, ptr %10, i64 8
  %51 = getelementptr inbounds i8, ptr %10, i64 12
  %52 = getelementptr inbounds i8, ptr %10, i64 16
  %53 = getelementptr inbounds i8, ptr %10, i64 24
  %54 = getelementptr inbounds i8, ptr %10, i64 32
  br label %57

._crit_edge79:                                    ; preds = %62, %48
  %55 = getelementptr inbounds i8, ptr %0, i64 80
  %56 = load ptr, ptr %55, align 8, !tbaa !34
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %56)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  br label %67

57:                                               ; preds = %.lr.ph78, %62
  %58 = phi i32 [ %16, %.lr.ph78 ], [ %63, %62 ]
  %.06176 = phi i32 [ 0, %.lr.ph78 ], [ %59, %62 ]
  %59 = add i32 %.06176, 256
  %60 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %58, i32 noundef %59)
  %61 = load ptr, ptr %49, align 8, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #7
  store ptr %0, ptr %10, align 8, !tbaa !42
  store i32 %.06176, ptr %50, align 8, !tbaa !44
  store i32 %60, ptr %51, align 4, !tbaa !45
  store ptr %7, ptr %52, align 8, !tbaa !39
  store ptr %8, ptr %53, align 8, !tbaa !39
  store ptr %3, ptr %54, align 8, !tbaa !39
  call void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend34create_optimized_selector_codebookEjE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(40) %10)
  invoke void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189) %61, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %62 unwind label %65

62:                                               ; preds = %57
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = icmp ult i32 %59, %63
  br i1 %64, label %57, label %._crit_edge79, !llvm.loop !46

65:                                               ; preds = %57
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  br label %264

67:                                               ; preds = %._crit_edge79, %._crit_edge
  %68 = getelementptr inbounds i8, ptr %0, i64 30
  %69 = load i8, ptr %68, align 2, !tbaa !47, !range !32, !noundef !33
  %70 = trunc nuw i8 %69 to i1
  br i1 %70, label %.preheader74, label %263

.preheader74:                                     ; preds = %67
  %71 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %.not97 = icmp eq i32 %71, 0
  br i1 %.not97, label %._crit_edge83.thread, label %.lr.ph82

._crit_edge83:                                    ; preds = %.lr.ph82
  %72 = mul i32 %76, 5
  %73 = icmp ult i32 %72, 32768
  br i1 %73, label %._crit_edge83.thread, label %263

.lr.ph82:                                         ; preds = %.preheader74, %.lr.ph82
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph82 ], [ 0, %.preheader74 ]
  %.06380 = phi i32 [ %76, %.lr.ph82 ], [ 0, %.preheader74 ]
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %15, i64 noundef %indvars.iv)
  %75 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %74)
  %76 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef %.06380, i32 noundef %75)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %77 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %78 = zext i32 %77 to i64
  %79 = icmp ult i64 %indvars.iv.next, %78
  br i1 %79, label %.lr.ph82, label %._crit_edge83, !llvm.loop !48

._crit_edge83.thread:                             ; preds = %.preheader74, %._crit_edge83
  %80 = phi i32 [ %72, %._crit_edge83 ], [ 0, %.preheader74 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #7
  %81 = add nuw nsw i32 %80, 16
  %82 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %83 = mul i32 %82, 5
  call void @_ZN6basisu5imageC2Ejjj(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %81, i32 noundef %83, i32 noundef -1)
  %84 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %.not98 = icmp eq i32 %84, 0
  br i1 %.not98, label %._crit_edge94, label %.lr.ph93

.lr.ph93:                                         ; preds = %._crit_edge83.thread
  %85 = getelementptr inbounds i8, ptr %0, i64 144
  br label %88

._crit_edge94:                                    ; preds = %._crit_edge90, %._crit_edge83.thread
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %14) #7
  %86 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %14, i64 noundef 256, ptr noundef nonnull @.str.42, i32 noundef %1) #7
  %87 = invoke noundef zeroext i1 @_ZN6basisu8save_pngEPKcRKNS_5imageEjj(ptr noundef nonnull %14, ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 0, i32 noundef 0)
          to label %259 unwind label %260

88:                                               ; preds = %.lr.ph93, %._crit_edge90
  %indvars.iv106 = phi i64 [ 0, %.lr.ph93 ], [ %indvars.iv.next107, %._crit_edge90 ]
  %89 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %15, i64 noundef %indvars.iv106)
  %90 = trunc nuw i64 %indvars.iv106 to i32
  %91 = mul i32 %90, 5
  br label %.preheader72

.preheader73:                                     ; preds = %128
  %92 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %89)
  %.not99 = icmp eq i32 %92, 0
  br i1 %.not99, label %._crit_edge90, label %.lr.ph89

.lr.ph89:                                         ; preds = %.preheader73
  %93 = add i32 %91, 1
  %94 = add i32 %91, 2
  %95 = add i32 %91, 3
  br label %.preheader

.preheader72:                                     ; preds = %88, %128
  %.05685 = phi i32 [ 0, %88 ], [ %129, %128 ]
  %96 = add i32 %.05685, %91
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %indvars.iv106)
  %98 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %97, i32 noundef 0, i32 noundef %.05685)
          to label %99 unwind label %130

99:                                               ; preds = %.preheader72
  %100 = mul i32 %98, 255
  %101 = udiv i32 %100, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %12, i32 noundef %101)
          to label %102 unwind label %130

102:                                              ; preds = %99
  %103 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 4, i32 noundef %96, ptr noundef nonnull align 1 dereferenceable(4) %12)
          to label %104 unwind label %130

104:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %indvars.iv106)
  %106 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %105, i32 noundef 1, i32 noundef %.05685)
          to label %107 unwind label %130

107:                                              ; preds = %104
  %108 = mul i32 %106, 255
  %109 = udiv i32 %108, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %12, i32 noundef %109)
          to label %110 unwind label %130

110:                                              ; preds = %107
  %111 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 5, i32 noundef %96, ptr noundef nonnull align 1 dereferenceable(4) %12)
          to label %112 unwind label %130

112:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %indvars.iv106)
  %114 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %113, i32 noundef 2, i32 noundef %.05685)
          to label %115 unwind label %130

115:                                              ; preds = %112
  %116 = mul i32 %114, 255
  %117 = udiv i32 %116, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %12, i32 noundef %117)
          to label %118 unwind label %130

118:                                              ; preds = %115
  %119 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 6, i32 noundef %96, ptr noundef nonnull align 1 dereferenceable(4) %12)
          to label %120 unwind label %130

120:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %indvars.iv106)
  %122 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %121, i32 noundef 3, i32 noundef %.05685)
          to label %123 unwind label %130

123:                                              ; preds = %120
  %124 = mul i32 %122, 255
  %125 = udiv i32 %124, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %12, i32 noundef %125)
          to label %126 unwind label %130

126:                                              ; preds = %123
  %127 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 7, i32 noundef %96, ptr noundef nonnull align 1 dereferenceable(4) %12)
          to label %128 unwind label %130

128:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  %129 = add nuw nsw i32 %.05685, 1
  %exitcond.not = icmp eq i32 %129, 4
  br i1 %exitcond.not, label %.preheader73, label %.preheader72, !llvm.loop !49

130:                                              ; preds = %126, %123, %120, %118, %115, %112, %110, %107, %104, %102, %99, %.preheader72
  %131 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  br label %262

._crit_edge90:                                    ; preds = %253, %.preheader73
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %132 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %133 = zext i32 %132 to i64
  %134 = icmp ult i64 %indvars.iv.next107, %133
  br i1 %134, label %88, label %._crit_edge94, !llvm.loop !50

.preheader:                                       ; preds = %.lr.ph89, %253
  %indvars.iv103 = phi i64 [ 0, %.lr.ph89 ], [ %indvars.iv.next104, %253 ]
  %135 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %89, i64 noundef %indvars.iv103)
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = zext i32 %136 to i64
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN6basisu6vectorINS_9etc_blockEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %85, i64 noundef %137)
  %139 = trunc nuw i64 %indvars.iv103 to i32
  %140 = mul i32 %139, 5
  %141 = add i32 %140, 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %142 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 0, i32 noundef 0)
          to label %143 unwind label %257

143:                                              ; preds = %.preheader
  %144 = mul i32 %142, 255
  %145 = udiv i32 %144, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %145)
          to label %146 unwind label %257

146:                                              ; preds = %143
  %147 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %141, i32 noundef %91, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %148 unwind label %257

148:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  %149 = add i32 %140, 17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %150 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 1, i32 noundef 0)
          to label %151 unwind label %257

151:                                              ; preds = %148
  %152 = mul i32 %150, 255
  %153 = udiv i32 %152, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %153)
          to label %154 unwind label %257

154:                                              ; preds = %151
  %155 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %149, i32 noundef %91, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %156 unwind label %257

156:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  %157 = add i32 %140, 18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %158 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 2, i32 noundef 0)
          to label %159 unwind label %257

159:                                              ; preds = %156
  %160 = mul i32 %158, 255
  %161 = udiv i32 %160, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %161)
          to label %162 unwind label %257

162:                                              ; preds = %159
  %163 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %157, i32 noundef %91, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %164 unwind label %257

164:                                              ; preds = %162
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  %165 = add i32 %140, 19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %166 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 3, i32 noundef 0)
          to label %167 unwind label %257

167:                                              ; preds = %164
  %168 = mul i32 %166, 255
  %169 = udiv i32 %168, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %169)
          to label %170 unwind label %257

170:                                              ; preds = %167
  %171 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %165, i32 noundef %91, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %.preheader.1 unwind label %257

.preheader.1:                                     ; preds = %170
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %172 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 0, i32 noundef 1)
          to label %173 unwind label %257

173:                                              ; preds = %.preheader.1
  %174 = mul i32 %172, 255
  %175 = udiv i32 %174, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %175)
          to label %176 unwind label %257

176:                                              ; preds = %173
  %177 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %141, i32 noundef %93, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %178 unwind label %257

178:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %179 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 1, i32 noundef 1)
          to label %180 unwind label %257

180:                                              ; preds = %178
  %181 = mul i32 %179, 255
  %182 = udiv i32 %181, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %182)
          to label %183 unwind label %257

183:                                              ; preds = %180
  %184 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %149, i32 noundef %93, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %185 unwind label %257

185:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %186 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 2, i32 noundef 1)
          to label %187 unwind label %257

187:                                              ; preds = %185
  %188 = mul i32 %186, 255
  %189 = udiv i32 %188, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %189)
          to label %190 unwind label %257

190:                                              ; preds = %187
  %191 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %157, i32 noundef %93, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %192 unwind label %257

192:                                              ; preds = %190
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %193 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 3, i32 noundef 1)
          to label %194 unwind label %257

194:                                              ; preds = %192
  %195 = mul i32 %193, 255
  %196 = udiv i32 %195, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %196)
          to label %197 unwind label %257

197:                                              ; preds = %194
  %198 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %165, i32 noundef %93, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %.preheader.2 unwind label %257

.preheader.2:                                     ; preds = %197
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %199 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 0, i32 noundef 2)
          to label %200 unwind label %257

200:                                              ; preds = %.preheader.2
  %201 = mul i32 %199, 255
  %202 = udiv i32 %201, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %202)
          to label %203 unwind label %257

203:                                              ; preds = %200
  %204 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %141, i32 noundef %94, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %205 unwind label %257

205:                                              ; preds = %203
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %206 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 1, i32 noundef 2)
          to label %207 unwind label %257

207:                                              ; preds = %205
  %208 = mul i32 %206, 255
  %209 = udiv i32 %208, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %209)
          to label %210 unwind label %257

210:                                              ; preds = %207
  %211 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %149, i32 noundef %94, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %212 unwind label %257

212:                                              ; preds = %210
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %213 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 2, i32 noundef 2)
          to label %214 unwind label %257

214:                                              ; preds = %212
  %215 = mul i32 %213, 255
  %216 = udiv i32 %215, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %216)
          to label %217 unwind label %257

217:                                              ; preds = %214
  %218 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %157, i32 noundef %94, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %219 unwind label %257

219:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %220 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 3, i32 noundef 2)
          to label %221 unwind label %257

221:                                              ; preds = %219
  %222 = mul i32 %220, 255
  %223 = udiv i32 %222, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %223)
          to label %224 unwind label %257

224:                                              ; preds = %221
  %225 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %165, i32 noundef %94, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %.preheader.3 unwind label %257

.preheader.3:                                     ; preds = %224
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %226 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 0, i32 noundef 3)
          to label %227 unwind label %257

227:                                              ; preds = %.preheader.3
  %228 = mul i32 %226, 255
  %229 = udiv i32 %228, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %229)
          to label %230 unwind label %257

230:                                              ; preds = %227
  %231 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %141, i32 noundef %95, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %232 unwind label %257

232:                                              ; preds = %230
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %233 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 1, i32 noundef 3)
          to label %234 unwind label %257

234:                                              ; preds = %232
  %235 = mul i32 %233, 255
  %236 = udiv i32 %235, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %236)
          to label %237 unwind label %257

237:                                              ; preds = %234
  %238 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %149, i32 noundef %95, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %239 unwind label %257

239:                                              ; preds = %237
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %240 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 2, i32 noundef 3)
          to label %241 unwind label %257

241:                                              ; preds = %239
  %242 = mul i32 %240, 255
  %243 = udiv i32 %242, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %243)
          to label %244 unwind label %257

244:                                              ; preds = %241
  %245 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %157, i32 noundef %95, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %246 unwind label %257

246:                                              ; preds = %244
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %247 = invoke noundef i32 @_ZNK6basisu9etc_block12get_selectorEjj(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef 3, i32 noundef 3)
          to label %248 unwind label %257

248:                                              ; preds = %246
  %249 = mul i32 %247, 255
  %250 = udiv i32 %249, 3
  invoke void @_ZN6basisu10color_rgbaC2Ei(ptr noundef nonnull align 1 dereferenceable(4) %13, i32 noundef %250)
          to label %251 unwind label %257

251:                                              ; preds = %248
  %252 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image11set_clippedEiiRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %165, i32 noundef %95, ptr noundef nonnull align 1 dereferenceable(4) %13)
          to label %253 unwind label %257

253:                                              ; preds = %251
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %254 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %89)
  %255 = zext i32 %254 to i64
  %256 = icmp ult i64 %indvars.iv.next104, %255
  br i1 %256, label %.preheader, label %._crit_edge90, !llvm.loop !51

257:                                              ; preds = %251, %248, %246, %244, %241, %239, %237, %234, %232, %230, %227, %.preheader.3, %224, %221, %219, %217, %214, %212, %210, %207, %205, %203, %200, %.preheader.2, %197, %194, %192, %190, %187, %185, %183, %180, %178, %176, %173, %.preheader.1, %170, %167, %164, %162, %159, %156, %154, %151, %148, %146, %143, %.preheader
  %258 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  br label %262

259:                                              ; preds = %._crit_edge94
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %14) #7
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  br label %263

260:                                              ; preds = %._crit_edge94
  %261 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %14) #7
  br label %262

262:                                              ; preds = %130, %257, %260
  %.pn.pn = phi { ptr, i32 } [ %261, %260 ], [ %131, %130 ], [ %258, %257 ]
  call void @_ZN6basisu5imageD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  br label %264

263:                                              ; preds = %._crit_edge83, %259, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret void

264:                                              ; preds = %262, %65, %43
  %.pn70 = phi { ptr, i32 } [ %66, %65 ], [ %.pn.pn, %262 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn70
}

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

declare void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189)) local_unnamed_addr #0

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend34create_optimized_selector_codebookEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 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 #1 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend34create_optimized_selector_codebookEjE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu5imageC2Ejjj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #5 align 2

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

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

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

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

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

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

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

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


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