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

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

%struct.anon.41 = type { i8, i8 }
%"class.basisu::vector.14" = type { ptr, i32, i32 }
%"struct.basisu::etc_block" = type { %union.anon.36 }
%union.anon.36 = type { i64 }
%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%"class.basisu::basisu_backend" = type { ptr, %"struct.basisu::basisu_backend_params", %"class.basisu::vector", %"struct.basisu::basisu_backend_output", ptr, %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.10", %"class.basisu::vector.12", %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.16", %"class.basisu::vector.16", %"class.basisu::vector.14", %"class.basisu::vector.14" }
%"struct.basisu::basisu_backend_params" = type <{ i8, i8, i8, i8, float, float, i32, i8, [3 x i8], i32, i32, i8, i8, [2 x i8] }>
%"class.basisu::vector" = type { ptr, i32, i32 }
%"struct.basisu::basisu_backend_output" = type { i32, i8, i8, i8, i32, i32, %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::vector", %"class.basisu::vector.0", %"class.basisu::vector.2", %"class.basisu::vector.4" }
%"class.basisu::vector.0" = type { ptr, i32, i32 }
%"class.basisu::vector.2" = type { ptr, i32, i32 }
%"class.basisu::vector.4" = type { ptr, i32, i32 }
%"class.basisu::vector.6" = type { ptr, i32, i32 }
%"class.basisu::vector.8" = type { ptr, i32, i32 }
%"class.basisu::vector.10" = type { ptr, i32, i32 }
%"class.basisu::vector.12" = type { ptr, i32, i32 }
%"class.basisu::vector.16" = type { ptr, i32, i32 }
%"struct.basisu::basisu_frontend::params" = type { i32, ptr, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, ptr, i32, i32, i8, float, i32, ptr, ptr }
%"struct.basisu::basisu_backend_slice_desc" = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, [2 x i8] }>
%"struct.basisu::encoder_block" = type <{ i32, i32, i32, i32, i8, [3 x i8] }>

@_ZN6basisuL16g_endpoint_predsE = external hidden constant [3 x %struct.anon.41], align 1
@.str.9 = external hidden unnamed_addr constant [126 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN6basisuL6verifyEbi(i1 noundef zeroext, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14basisu_backend38reoptimize_and_sort_endpoints_codebookEjRNS_6vectorIjEE(ptr noundef nonnull align 8 dereferenceable(336), i32 noundef, ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu14basisu_backend21create_encoder_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0) #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.basisu::vector.14", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %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 ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca %"struct.basisu::etc_block", align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca %"struct.basisu::etc_block", align 8
  %37 = alloca i64, align 8
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca %"class.basisu::color_rgba", align 1
  %45 = alloca [16 x %"class.basisu::color_rgba"], align 16
  %46 = alloca i64, align 8
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %49 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %50 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  store ptr %51, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496) %52)
  %54 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %53, i32 0, i32 17
  %55 = load i32, ptr %54, align 8, !tbaa !27
  %56 = icmp eq i32 %55, 3
  %57 = zext i1 %56 to i8
  store i8 %57, ptr %4, align 1, !tbaa !30
  %58 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %59 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 2
  %60 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %59)
  %61 = zext i32 %60 to i64
  call void @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %58, i64 noundef %61, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #7
  call void @_ZN6basisu6vectorIjEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8)
  %62 = invoke noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %49)
          to label %63 unwind label %73

63:                                               ; preds = %1
  %64 = zext i32 %62 to i64
  invoke void @_ZN6basisu6vectorIjE7reserveEm(ptr noundef nonnull align 8 dereferenceable(16) %8, i64 noundef %64)
          to label %65 unwind label %73

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

66:                                               ; preds = %657, %65
  %67 = load i32, ptr %11, align 4, !tbaa !31
  %68 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 2
  %69 = invoke noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %68)
          to label %70 unwind label %77

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

72:                                               ; preds = %70
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %666

73:                                               ; preds = %697, %696, %694, %690, %681, %672, %666, %63, %1
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %9, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %10, align 4
  br label %699

77:                                               ; preds = %66
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %9, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %10, align 4
  br label %665

81:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %82 = load i8, ptr %4, align 1, !tbaa !30, !range !32, !noundef !33
  %83 = trunc i8 %82 to i1
  br i1 %83, label %84, label %88

84:                                               ; preds = %81
  %85 = load i32, ptr %11, align 4, !tbaa !31
  %86 = invoke noundef i32 @_ZN6basisu14basisu_backend16find_video_frameEii(ptr noundef nonnull align 8 dereferenceable(336) %49, i32 noundef %85, i32 noundef -1)
          to label %87 unwind label %135

87:                                               ; preds = %84
  br label %89

88:                                               ; preds = %81
  br label %89

89:                                               ; preds = %88, %87
  %90 = phi i32 [ %86, %87 ], [ -1, %88 ]
  store i32 %90, ptr %13, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  %91 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 2
  %92 = load i32, ptr %11, align 4, !tbaa !31
  %93 = zext i32 %92 to i64
  %94 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %91, i64 noundef %93)
          to label %95 unwind label %139

95:                                               ; preds = %89
  %96 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %94, i32 0, i32 12
  %97 = load i8, ptr %96, align 1, !tbaa !34, !range !32, !noundef !33
  %98 = trunc i8 %97 to i1
  %99 = zext i1 %98 to i8
  store i8 %99, ptr %14, align 1, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %100 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 2
  %101 = load i32, ptr %11, align 4, !tbaa !31
  %102 = zext i32 %101 to i64
  %103 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %100, i64 noundef %102)
          to label %104 unwind label %143

104:                                              ; preds = %95
  %105 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %103, i32 0, i32 0
  %106 = load i32, ptr %105, align 4, !tbaa !36
  store i32 %106, ptr %15, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %107 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 2
  %108 = load i32, ptr %11, align 4, !tbaa !31
  %109 = zext i32 %108 to i64
  %110 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %107, i64 noundef %109)
          to label %111 unwind label %147

111:                                              ; preds = %104
  %112 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %110, i32 0, i32 5
  %113 = load i32, ptr %112, align 4, !tbaa !37
  store i32 %113, ptr %16, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %114 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 2
  %115 = load i32, ptr %11, align 4, !tbaa !31
  %116 = zext i32 %115 to i64
  %117 = invoke noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %114, i64 noundef %116)
          to label %118 unwind label %151

118:                                              ; preds = %111
  %119 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %117, i32 0, i32 6
  %120 = load i32, ptr %119, align 4, !tbaa !38
  store i32 %120, ptr %17, align 4, !tbaa !31
  %121 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %122 = load i32, ptr %11, align 4, !tbaa !31
  %123 = zext i32 %122 to i64
  %124 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %121, i64 noundef %123)
          to label %125 unwind label %151

125:                                              ; preds = %118
  %126 = load i32, ptr %16, align 4, !tbaa !31
  %127 = load i32, ptr %17, align 4, !tbaa !31
  %128 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu8vector2DINS_13encoder_blockEE6resizeEjj(ptr noundef nonnull align 8 dereferenceable(24) %124, i32 noundef %126, i32 noundef %127)
          to label %129 unwind label %151

129:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !31
  br label %130

130:                                              ; preds = %653, %129
  %131 = load i32, ptr %18, align 4, !tbaa !31
  %132 = load i32, ptr %17, align 4, !tbaa !31
  %133 = icmp ult i32 %131, %132
  br i1 %133, label %155, label %134

134:                                              ; preds = %130
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %656

135:                                              ; preds = %84
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %9, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %10, align 4
  br label %664

139:                                              ; preds = %89
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %9, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %10, align 4
  br label %663

143:                                              ; preds = %95
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %9, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %10, align 4
  br label %662

147:                                              ; preds = %104
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %9, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %10, align 4
  br label %661

151:                                              ; preds = %125, %118, %111
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %9, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %10, align 4
  br label %660

155:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !31
  br label %156

156:                                              ; preds = %647, %155
  %157 = load i32, ptr %19, align 4, !tbaa !31
  %158 = load i32, ptr %16, align 4, !tbaa !31
  %159 = icmp ult i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %652

161:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %162 = load i32, ptr %15, align 4, !tbaa !31
  %163 = load i32, ptr %19, align 4, !tbaa !31
  %164 = add i32 %162, %163
  %165 = load i32, ptr %18, align 4, !tbaa !31
  %166 = load i32, ptr %16, align 4, !tbaa !31
  %167 = mul i32 %165, %166
  %168 = add i32 %164, %167
  store i32 %168, ptr %20, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %169 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %170 = load i32, ptr %11, align 4, !tbaa !31
  %171 = zext i32 %170 to i64
  %172 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %169, i64 noundef %171)
          to label %173 unwind label %209

173:                                              ; preds = %161
  %174 = load i32, ptr %19, align 4, !tbaa !31
  %175 = load i32, ptr %18, align 4, !tbaa !31
  %176 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %172, i32 noundef %174, i32 noundef %175)
          to label %177 unwind label %209

177:                                              ; preds = %173
  store ptr %176, ptr %21, align 8, !tbaa !5
  %178 = load ptr, ptr %3, align 8, !tbaa !5
  %179 = load i32, ptr %20, align 4, !tbaa !31
  %180 = invoke noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %178, i32 noundef %179, i32 noundef 0)
          to label %181 unwind label %209

181:                                              ; preds = %177
  %182 = load ptr, ptr %21, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %182, i32 0, i32 1
  store i32 %180, ptr %183, align 4, !tbaa !39
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = load i32, ptr %20, align 4, !tbaa !31
  %186 = invoke noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %184, i32 noundef %185, i32 noundef 0)
          to label %187 unwind label %209

187:                                              ; preds = %181
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = load i32, ptr %20, align 4, !tbaa !31
  %190 = invoke noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %188, i32 noundef %189, i32 noundef 1)
          to label %191 unwind label %209

191:                                              ; preds = %187
  %192 = icmp eq i32 %186, %190
  invoke void @_ZN6basisuL6verifyEbi(i1 noundef zeroext %192, i32 noundef 489)
          to label %193 unwind label %209

193:                                              ; preds = %191
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  %195 = load i32, ptr %20, align 4, !tbaa !31
  %196 = invoke noundef i32 @_ZNK6basisu15basisu_frontend32get_block_selector_cluster_indexEj(ptr noundef nonnull align 8 dereferenceable(496) %194, i32 noundef %195)
          to label %197 unwind label %209

197:                                              ; preds = %193
  %198 = load ptr, ptr %21, align 8, !tbaa !5
  %199 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %198, i32 0, i32 2
  store i32 %196, ptr %199, align 4, !tbaa !41
  %200 = load ptr, ptr %21, align 8, !tbaa !5
  %201 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %200, i32 0, i32 0
  store i32 3, ptr %201, align 4, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %202 = load ptr, ptr %21, align 8, !tbaa !5
  %203 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %202, i32 0, i32 1
  %204 = load i32, ptr %203, align 4, !tbaa !39
  store i32 %204, ptr %22, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 -1, ptr %23, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !31
  br label %205

205:                                              ; preds = %373, %197
  %206 = load i32, ptr %24, align 4, !tbaa !31
  %207 = icmp ult i32 %206, 3
  br i1 %207, label %213, label %208

208:                                              ; preds = %205
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %377

209:                                              ; preds = %193, %191, %187, %181, %177, %173, %161
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %9, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %10, align 4
  br label %651

213:                                              ; preds = %205
  %214 = load i8, ptr %4, align 1, !tbaa !30, !range !32, !noundef !33
  %215 = trunc i8 %214 to i1
  br i1 %215, label %216, label %309

216:                                              ; preds = %213
  %217 = load i32, ptr %24, align 4, !tbaa !31
  %218 = icmp eq i32 %217, 2
  br i1 %218, label %219, label %309

219:                                              ; preds = %216
  %220 = load i32, ptr %13, align 4, !tbaa !31
  %221 = icmp ne i32 %220, -1
  br i1 %221, label %222, label %308

222:                                              ; preds = %219
  %223 = load i8, ptr %14, align 1, !tbaa !30, !range !32, !noundef !33
  %224 = trunc i8 %223 to i1
  br i1 %224, label %308, label %225

225:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %226 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %227 = load i32, ptr %11, align 4, !tbaa !31
  %228 = zext i32 %227 to i64
  %229 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %226, i64 noundef %228)
          to label %230 unwind label %288

230:                                              ; preds = %225
  %231 = load i32, ptr %19, align 4, !tbaa !31
  %232 = load i32, ptr %18, align 4, !tbaa !31
  %233 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %229, i32 noundef %231, i32 noundef %232)
          to label %234 unwind label %288

234:                                              ; preds = %230
  %235 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %233, i32 0, i32 1
  %236 = load i32, ptr %235, align 4, !tbaa !39
  store i32 %236, ptr %25, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %237 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %238 = load i32, ptr %11, align 4, !tbaa !31
  %239 = zext i32 %238 to i64
  %240 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %237, i64 noundef %239)
          to label %241 unwind label %292

241:                                              ; preds = %234
  %242 = load i32, ptr %19, align 4, !tbaa !31
  %243 = load i32, ptr %18, align 4, !tbaa !31
  %244 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %240, i32 noundef %242, i32 noundef %243)
          to label %245 unwind label %292

245:                                              ; preds = %241
  %246 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %244, i32 0, i32 2
  %247 = load i32, ptr %246, align 4, !tbaa !41
  store i32 %247, ptr %26, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %248 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %249 = load i32, ptr %13, align 4, !tbaa !31
  %250 = sext i32 %249 to i64
  %251 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %248, i64 noundef %250)
          to label %252 unwind label %296

252:                                              ; preds = %245
  %253 = load i32, ptr %19, align 4, !tbaa !31
  %254 = load i32, ptr %18, align 4, !tbaa !31
  %255 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %251, i32 noundef %253, i32 noundef %254)
          to label %256 unwind label %296

256:                                              ; preds = %252
  %257 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %255, i32 0, i32 1
  %258 = load i32, ptr %257, align 4, !tbaa !39
  store i32 %258, ptr %27, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %259 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %260 = load i32, ptr %13, align 4, !tbaa !31
  %261 = sext i32 %260 to i64
  %262 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %259, i64 noundef %261)
          to label %263 unwind label %300

263:                                              ; preds = %256
  %264 = load i32, ptr %19, align 4, !tbaa !31
  %265 = load i32, ptr %18, align 4, !tbaa !31
  %266 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %262, i32 noundef %264, i32 noundef %265)
          to label %267 unwind label %300

267:                                              ; preds = %263
  %268 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %266, i32 0, i32 2
  %269 = load i32, ptr %268, align 4, !tbaa !41
  store i32 %269, ptr %28, align 4, !tbaa !31
  %270 = load i32, ptr %25, align 4, !tbaa !31
  %271 = load i32, ptr %27, align 4, !tbaa !31
  %272 = icmp eq i32 %270, %271
  br i1 %272, label %273, label %304

273:                                              ; preds = %267
  %274 = load i32, ptr %26, align 4, !tbaa !31
  %275 = load i32, ptr %28, align 4, !tbaa !31
  %276 = icmp eq i32 %274, %275
  br i1 %276, label %277, label %304

277:                                              ; preds = %273
  store i32 2, ptr %23, align 4, !tbaa !31
  %278 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %279 = load i32, ptr %13, align 4, !tbaa !31
  %280 = sext i32 %279 to i64
  %281 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %278, i64 noundef %280)
          to label %282 unwind label %300

282:                                              ; preds = %277
  %283 = load i32, ptr %19, align 4, !tbaa !31
  %284 = load i32, ptr %18, align 4, !tbaa !31
  %285 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %281, i32 noundef %283, i32 noundef %284)
          to label %286 unwind label %300

286:                                              ; preds = %282
  %287 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %285, i32 0, i32 4
  store i8 1, ptr %287, align 4, !tbaa !43
  br label %304

288:                                              ; preds = %230, %225
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %9, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %10, align 4
  br label %307

292:                                              ; preds = %241, %234
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %9, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %10, align 4
  br label %306

296:                                              ; preds = %252, %245
  %297 = landingpad { ptr, i32 }
          cleanup
  %298 = extractvalue { ptr, i32 } %297, 0
  store ptr %298, ptr %9, align 8
  %299 = extractvalue { ptr, i32 } %297, 1
  store i32 %299, ptr %10, align 4
  br label %305

300:                                              ; preds = %282, %277, %263, %256
  %301 = landingpad { ptr, i32 }
          cleanup
  %302 = extractvalue { ptr, i32 } %301, 0
  store ptr %302, ptr %9, align 8
  %303 = extractvalue { ptr, i32 } %301, 1
  store i32 %303, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %305

304:                                              ; preds = %286, %273, %267
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %308

305:                                              ; preds = %300, %296
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %306

306:                                              ; preds = %305, %292
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %307

307:                                              ; preds = %306, %288
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %376

308:                                              ; preds = %304, %222, %219
  br label %372

309:                                              ; preds = %216, %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %310 = load i32, ptr %19, align 4, !tbaa !31
  %311 = load i32, ptr %24, align 4, !tbaa !31
  %312 = zext i32 %311 to i64
  %313 = getelementptr inbounds [3 x %struct.anon.41], ptr @_ZN6basisuL16g_endpoint_predsE, i64 0, i64 %312
  %314 = getelementptr inbounds %struct.anon.41, ptr %313, i32 0, i32 0
  %315 = load i8, ptr %314, align 1, !tbaa !44
  %316 = sext i8 %315 to i32
  %317 = add i32 %310, %316
  store i32 %317, ptr %29, align 4, !tbaa !31
  %318 = load i32, ptr %29, align 4, !tbaa !31
  %319 = icmp slt i32 %318, 0
  br i1 %319, label %324, label %320

320:                                              ; preds = %309
  %321 = load i32, ptr %29, align 4, !tbaa !31
  %322 = load i32, ptr %16, align 4, !tbaa !31
  %323 = icmp sge i32 %321, %322
  br i1 %323, label %324, label %325

324:                                              ; preds = %320, %309
  store i32 13, ptr %12, align 4
  br label %369

325:                                              ; preds = %320
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %326 = load i32, ptr %18, align 4, !tbaa !31
  %327 = load i32, ptr %24, align 4, !tbaa !31
  %328 = zext i32 %327 to i64
  %329 = getelementptr inbounds [3 x %struct.anon.41], ptr @_ZN6basisuL16g_endpoint_predsE, i64 0, i64 %328
  %330 = getelementptr inbounds %struct.anon.41, ptr %329, i32 0, i32 1
  %331 = load i8, ptr %330, align 1, !tbaa !46
  %332 = sext i8 %331 to i32
  %333 = add i32 %326, %332
  store i32 %333, ptr %30, align 4, !tbaa !31
  %334 = load i32, ptr %30, align 4, !tbaa !31
  %335 = icmp slt i32 %334, 0
  br i1 %335, label %340, label %336

336:                                              ; preds = %325
  %337 = load i32, ptr %30, align 4, !tbaa !31
  %338 = load i32, ptr %17, align 4, !tbaa !31
  %339 = icmp sge i32 %337, %338
  br i1 %339, label %340, label %341

340:                                              ; preds = %336, %325
  store i32 13, ptr %12, align 4
  br label %368

341:                                              ; preds = %336
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %342 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %343 = load i32, ptr %11, align 4, !tbaa !31
  %344 = zext i32 %343 to i64
  %345 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %342, i64 noundef %344)
          to label %346 unwind label %362

346:                                              ; preds = %341
  %347 = load i32, ptr %29, align 4, !tbaa !31
  %348 = load i32, ptr %30, align 4, !tbaa !31
  %349 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %345, i32 noundef %347, i32 noundef %348)
          to label %350 unwind label %362

350:                                              ; preds = %346
  %351 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %349, i32 0, i32 1
  %352 = load i32, ptr %351, align 4, !tbaa !39
  store i32 %352, ptr %31, align 4, !tbaa !31
  %353 = load i32, ptr %31, align 4, !tbaa !31
  %354 = load i32, ptr %22, align 4, !tbaa !31
  %355 = icmp eq i32 %353, %354
  br i1 %355, label %356, label %367

356:                                              ; preds = %350
  %357 = load i32, ptr %24, align 4, !tbaa !31
  %358 = load i32, ptr %23, align 4, !tbaa !31
  %359 = icmp ult i32 %357, %358
  br i1 %359, label %360, label %366

360:                                              ; preds = %356
  %361 = load i32, ptr %24, align 4, !tbaa !31
  store i32 %361, ptr %23, align 4, !tbaa !31
  br label %366

362:                                              ; preds = %346, %341
  %363 = landingpad { ptr, i32 }
          cleanup
  %364 = extractvalue { ptr, i32 } %363, 0
  store ptr %364, ptr %9, align 8
  %365 = extractvalue { ptr, i32 } %363, 1
  store i32 %365, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %376

366:                                              ; preds = %360, %356
  br label %367

367:                                              ; preds = %366, %350
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  store i32 0, ptr %12, align 4
  br label %368

368:                                              ; preds = %367, %340
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %369

369:                                              ; preds = %368, %324
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  %370 = load i32, ptr %12, align 4
  switch i32 %370, label %705 [
    i32 0, label %371
    i32 13, label %373
  ]

371:                                              ; preds = %369
  br label %372

372:                                              ; preds = %371, %308
  br label %373

373:                                              ; preds = %372, %369
  %374 = load i32, ptr %24, align 4, !tbaa !31
  %375 = add i32 %374, 1
  store i32 %375, ptr %24, align 4, !tbaa !31
  br label %205, !llvm.loop !47

376:                                              ; preds = %362, %307
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %650

377:                                              ; preds = %208
  %378 = load i32, ptr %23, align 4, !tbaa !31
  %379 = icmp ne i32 %378, -1
  br i1 %379, label %380, label %386

380:                                              ; preds = %377
  %381 = load i32, ptr %23, align 4, !tbaa !31
  %382 = load ptr, ptr %21, align 8, !tbaa !5
  %383 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %382, i32 0, i32 0
  store i32 %381, ptr %383, align 4, !tbaa !42
  %384 = load i32, ptr %6, align 4, !tbaa !31
  %385 = add i32 %384, 1
  store i32 %385, ptr %6, align 4, !tbaa !31
  br label %632

386:                                              ; preds = %377
  %387 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 1
  %388 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %387, i32 0, i32 4
  %389 = load float, ptr %388, align 4, !tbaa !49
  %390 = fcmp ogt float %389, 0.000000e+00
  br i1 %390, label %391, label %628

391:                                              ; preds = %386
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %392 = load ptr, ptr %3, align 8, !tbaa !5
  %393 = load i32, ptr %20, align 4, !tbaa !31
  %394 = invoke noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %392, i32 noundef %393)
          to label %395 unwind label %427

395:                                              ; preds = %391
  store ptr %394, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %396 = load ptr, ptr %3, align 8, !tbaa !5
  %397 = load i32, ptr %20, align 4, !tbaa !31
  %398 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend16get_output_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %396, i32 noundef %397)
          to label %399 unwind label %431

399:                                              ; preds = %395
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %398, i64 8, i1 false), !tbaa.struct !50
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %400 = load ptr, ptr %32, align 8, !tbaa !5
  %401 = invoke noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %400)
          to label %402 unwind label %435

402:                                              ; preds = %399
  %403 = load ptr, ptr %3, align 8, !tbaa !5
  %404 = invoke noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496) %403)
          to label %405 unwind label %435

405:                                              ; preds = %402
  %406 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %404, i32 0, i32 5
  %407 = load i8, ptr %406, align 4, !tbaa !52, !range !32, !noundef !33
  %408 = trunc i8 %407 to i1
  %409 = invoke noundef i64 @_ZNK6basisu9etc_block19evaluate_etc1_errorEPKNS_10color_rgbaEbi(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef %401, i1 noundef zeroext %408, i32 noundef -1)
          to label %410 unwind label %435

410:                                              ; preds = %405
  store i64 %409, ptr %34, align 8, !tbaa !53
  %411 = load i64, ptr %34, align 8, !tbaa !53
  %412 = icmp ne i64 %411, 0
  br i1 %412, label %413, label %624

413:                                              ; preds = %410
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %414 = load i64, ptr %34, align 8, !tbaa !53
  %415 = uitofp i64 %414 to float
  %416 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 1
  %417 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %416, i32 0, i32 4
  %418 = load float, ptr %417, align 4, !tbaa !49
  %419 = invoke noundef float @_ZN6basisu7maximumIfEET_S1_S1_(float noundef 1.000000e+00, float noundef %418)
          to label %420 unwind label %439

420:                                              ; preds = %413
  %421 = fmul float %415, %419
  %422 = fptoui float %421 to i64
  store i64 %422, ptr %35, align 8, !tbaa !53
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %33, i64 8, i1 false), !tbaa.struct !50
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  store i64 -1, ptr %37, align 8, !tbaa !53
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  store i32 0, ptr %38, align 4, !tbaa !31
  store i32 -1, ptr %23, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  store i32 0, ptr %39, align 4, !tbaa !31
  br label %423

423:                                              ; preds = %598, %420
  %424 = load i32, ptr %39, align 4, !tbaa !31
  %425 = icmp ult i32 %424, 3
  br i1 %425, label %443, label %426

426:                                              ; preds = %423
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  br label %605

427:                                              ; preds = %391
  %428 = landingpad { ptr, i32 }
          cleanup
  %429 = extractvalue { ptr, i32 } %428, 0
  store ptr %429, ptr %9, align 8
  %430 = extractvalue { ptr, i32 } %428, 1
  store i32 %430, ptr %10, align 4
  br label %627

431:                                              ; preds = %395
  %432 = landingpad { ptr, i32 }
          cleanup
  %433 = extractvalue { ptr, i32 } %432, 0
  store ptr %433, ptr %9, align 8
  %434 = extractvalue { ptr, i32 } %432, 1
  store i32 %434, ptr %10, align 4
  br label %626

435:                                              ; preds = %405, %402, %399
  %436 = landingpad { ptr, i32 }
          cleanup
  %437 = extractvalue { ptr, i32 } %436, 0
  store ptr %437, ptr %9, align 8
  %438 = extractvalue { ptr, i32 } %436, 1
  store i32 %438, ptr %10, align 4
  br label %625

439:                                              ; preds = %413
  %440 = landingpad { ptr, i32 }
          cleanup
  %441 = extractvalue { ptr, i32 } %440, 0
  store ptr %441, ptr %9, align 8
  %442 = extractvalue { ptr, i32 } %440, 1
  store i32 %442, ptr %10, align 4
  br label %623

443:                                              ; preds = %423
  %444 = load i8, ptr %4, align 1, !tbaa !30, !range !32, !noundef !33
  %445 = trunc i8 %444 to i1
  br i1 %445, label %446, label %450

446:                                              ; preds = %443
  %447 = load i32, ptr %39, align 4, !tbaa !31
  %448 = icmp eq i32 %447, 2
  br i1 %448, label %449, label %450

449:                                              ; preds = %446
  br label %598

450:                                              ; preds = %446, %443
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  %451 = load i32, ptr %19, align 4, !tbaa !31
  %452 = load i32, ptr %39, align 4, !tbaa !31
  %453 = zext i32 %452 to i64
  %454 = getelementptr inbounds [3 x %struct.anon.41], ptr @_ZN6basisuL16g_endpoint_predsE, i64 0, i64 %453
  %455 = getelementptr inbounds %struct.anon.41, ptr %454, i32 0, i32 0
  %456 = load i8, ptr %455, align 1, !tbaa !44
  %457 = sext i8 %456 to i32
  %458 = add i32 %451, %457
  store i32 %458, ptr %40, align 4, !tbaa !31
  %459 = load i32, ptr %40, align 4, !tbaa !31
  %460 = icmp slt i32 %459, 0
  br i1 %460, label %465, label %461

461:                                              ; preds = %450
  %462 = load i32, ptr %40, align 4, !tbaa !31
  %463 = load i32, ptr %16, align 4, !tbaa !31
  %464 = icmp sge i32 %462, %463
  br i1 %464, label %465, label %466

465:                                              ; preds = %461, %450
  store i32 16, ptr %12, align 4
  br label %595

466:                                              ; preds = %461
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #7
  %467 = load i32, ptr %18, align 4, !tbaa !31
  %468 = load i32, ptr %39, align 4, !tbaa !31
  %469 = zext i32 %468 to i64
  %470 = getelementptr inbounds [3 x %struct.anon.41], ptr @_ZN6basisuL16g_endpoint_predsE, i64 0, i64 %469
  %471 = getelementptr inbounds %struct.anon.41, ptr %470, i32 0, i32 1
  %472 = load i8, ptr %471, align 1, !tbaa !46
  %473 = sext i8 %472 to i32
  %474 = add i32 %467, %473
  store i32 %474, ptr %41, align 4, !tbaa !31
  %475 = load i32, ptr %41, align 4, !tbaa !31
  %476 = icmp slt i32 %475, 0
  br i1 %476, label %481, label %477

477:                                              ; preds = %466
  %478 = load i32, ptr %41, align 4, !tbaa !31
  %479 = load i32, ptr %17, align 4, !tbaa !31
  %480 = icmp sge i32 %478, %479
  br i1 %480, label %481, label %482

481:                                              ; preds = %477, %466
  store i32 16, ptr %12, align 4
  br label %594

482:                                              ; preds = %477
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #7
  %483 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %49, i32 0, i32 8
  %484 = load i32, ptr %11, align 4, !tbaa !31
  %485 = zext i32 %484 to i64
  %486 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %483, i64 noundef %485)
          to label %487 unwind label %522

487:                                              ; preds = %482
  %488 = load i32, ptr %40, align 4, !tbaa !31
  %489 = load i32, ptr %41, align 4, !tbaa !31
  %490 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %486, i32 noundef %488, i32 noundef %489)
          to label %491 unwind label %522

491:                                              ; preds = %487
  %492 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %490, i32 0, i32 1
  %493 = load i32, ptr %492, align 4, !tbaa !39
  store i32 %493, ptr %42, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #7
  %494 = load ptr, ptr %3, align 8, !tbaa !5
  %495 = load i32, ptr %42, align 4, !tbaa !31
  %496 = invoke noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496) %494, i32 noundef %495, i1 noundef zeroext false)
          to label %497 unwind label %526

497:                                              ; preds = %491
  store i32 %496, ptr %43, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #7
  %498 = load ptr, ptr %3, align 8, !tbaa !5
  %499 = load i32, ptr %42, align 4, !tbaa !31
  %500 = invoke noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496) %498, i32 noundef %499, i1 noundef zeroext false)
          to label %501 unwind label %530

501:                                              ; preds = %497
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %44, ptr align 1 %500, i64 4, i1 false), !tbaa.struct !55
  invoke void @_ZN6basisu9etc_block16set_block_color5ERKNS_10color_rgbaES3_(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull align 1 dereferenceable(4) %44, ptr noundef nonnull align 1 dereferenceable(4) %44)
          to label %502 unwind label %530

502:                                              ; preds = %501
  %503 = load i32, ptr %43, align 4, !tbaa !31
  invoke void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %36, i32 noundef 0, i32 noundef %503)
          to label %504 unwind label %530

504:                                              ; preds = %502
  %505 = load i32, ptr %43, align 4, !tbaa !31
  invoke void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %36, i32 noundef 1, i32 noundef %505)
          to label %506 unwind label %530

506:                                              ; preds = %504
  call void @llvm.lifetime.start.p0(i64 64, ptr %45) #7
  %507 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %45, i32 0, i32 0
  %508 = getelementptr inbounds %"class.basisu::color_rgba", ptr %507, i64 16
  br label %509

509:                                              ; preds = %511, %506
  %510 = phi ptr [ %507, %506 ], [ %512, %511 ]
  invoke void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %510)
          to label %511 unwind label %534

511:                                              ; preds = %509
  %512 = getelementptr inbounds %"class.basisu::color_rgba", ptr %510, i64 1
  %513 = icmp eq ptr %512, %508
  br i1 %513, label %514, label %509

514:                                              ; preds = %511
  %515 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %45, i64 0, i64 0
  %516 = invoke noundef zeroext i1 @_ZN6basisu11unpack_etc1ERKNS_9etc_blockEPNS_10color_rgbaEb(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef %515, i1 noundef zeroext false)
          to label %517 unwind label %534

517:                                              ; preds = %514
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #7
  store i64 0, ptr %46, align 8, !tbaa !53
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #7
  store i32 0, ptr %47, align 4, !tbaa !31
  br label %518

518:                                              ; preds = %568, %517
  %519 = load i32, ptr %47, align 4, !tbaa !31
  %520 = icmp ult i32 %519, 16
  br i1 %520, label %538, label %521

521:                                              ; preds = %518
  store i32 17, ptr %12, align 4
  br label %571

522:                                              ; preds = %487, %482
  %523 = landingpad { ptr, i32 }
          cleanup
  %524 = extractvalue { ptr, i32 } %523, 0
  store ptr %524, ptr %9, align 8
  %525 = extractvalue { ptr, i32 } %523, 1
  store i32 %525, ptr %10, align 4
  br label %604

526:                                              ; preds = %491
  %527 = landingpad { ptr, i32 }
          cleanup
  %528 = extractvalue { ptr, i32 } %527, 0
  store ptr %528, ptr %9, align 8
  %529 = extractvalue { ptr, i32 } %527, 1
  store i32 %529, ptr %10, align 4
  br label %603

530:                                              ; preds = %504, %502, %501, %497
  %531 = landingpad { ptr, i32 }
          cleanup
  %532 = extractvalue { ptr, i32 } %531, 0
  store ptr %532, ptr %9, align 8
  %533 = extractvalue { ptr, i32 } %531, 1
  store i32 %533, ptr %10, align 4
  br label %602

534:                                              ; preds = %514, %509
  %535 = landingpad { ptr, i32 }
          cleanup
  %536 = extractvalue { ptr, i32 } %535, 0
  store ptr %536, ptr %9, align 8
  %537 = extractvalue { ptr, i32 } %535, 1
  store i32 %537, ptr %10, align 4
  br label %601

538:                                              ; preds = %518
  %539 = load ptr, ptr %3, align 8, !tbaa !5
  %540 = invoke noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496) %539)
          to label %541 unwind label %563

541:                                              ; preds = %538
  %542 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %540, i32 0, i32 5
  %543 = load i8, ptr %542, align 4, !tbaa !52, !range !32, !noundef !33
  %544 = trunc i8 %543 to i1
  %545 = load ptr, ptr %32, align 8, !tbaa !5
  %546 = invoke noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %545)
          to label %547 unwind label %563

547:                                              ; preds = %541
  %548 = load i32, ptr %47, align 4, !tbaa !31
  %549 = zext i32 %548 to i64
  %550 = getelementptr inbounds %"class.basisu::color_rgba", ptr %546, i64 %549
  %551 = load i32, ptr %47, align 4, !tbaa !31
  %552 = zext i32 %551 to i64
  %553 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %45, i64 0, i64 %552
  %554 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %544, ptr noundef nonnull align 1 dereferenceable(4) %550, ptr noundef nonnull align 1 dereferenceable(4) %553, i1 noundef zeroext false)
          to label %555 unwind label %563

555:                                              ; preds = %547
  %556 = zext i32 %554 to i64
  %557 = load i64, ptr %46, align 8, !tbaa !53
  %558 = add i64 %557, %556
  store i64 %558, ptr %46, align 8, !tbaa !53
  %559 = load i64, ptr %46, align 8, !tbaa !53
  %560 = load i64, ptr %35, align 8, !tbaa !53
  %561 = icmp ugt i64 %559, %560
  br i1 %561, label %562, label %567

562:                                              ; preds = %555
  store i32 17, ptr %12, align 4
  br label %571

563:                                              ; preds = %547, %541, %538
  %564 = landingpad { ptr, i32 }
          cleanup
  %565 = extractvalue { ptr, i32 } %564, 0
  store ptr %565, ptr %9, align 8
  %566 = extractvalue { ptr, i32 } %564, 1
  store i32 %566, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  br label %601

567:                                              ; preds = %555
  br label %568

568:                                              ; preds = %567
  %569 = load i32, ptr %47, align 4, !tbaa !31
  %570 = add i32 %569, 1
  store i32 %570, ptr %47, align 4, !tbaa !31
  br label %518, !llvm.loop !56

571:                                              ; preds = %562, %521
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #7
  br label %572

572:                                              ; preds = %571
  %573 = load i64, ptr %46, align 8, !tbaa !53
  %574 = load i64, ptr %35, align 8, !tbaa !53
  %575 = icmp ule i64 %573, %574
  br i1 %575, label %576, label %593

576:                                              ; preds = %572
  %577 = load i64, ptr %46, align 8, !tbaa !53
  %578 = load i64, ptr %37, align 8, !tbaa !53
  %579 = icmp ult i64 %577, %578
  br i1 %579, label %588, label %580

580:                                              ; preds = %576
  %581 = load i64, ptr %46, align 8, !tbaa !53
  %582 = load i64, ptr %37, align 8, !tbaa !53
  %583 = icmp eq i64 %581, %582
  br i1 %583, label %584, label %592

584:                                              ; preds = %580
  %585 = load i32, ptr %39, align 4, !tbaa !31
  %586 = load i32, ptr %23, align 4, !tbaa !31
  %587 = icmp ult i32 %585, %586
  br i1 %587, label %588, label %592

588:                                              ; preds = %584, %576
  %589 = load i32, ptr %39, align 4, !tbaa !31
  store i32 %589, ptr %23, align 4, !tbaa !31
  %590 = load i64, ptr %46, align 8, !tbaa !53
  store i64 %590, ptr %37, align 8, !tbaa !53
  %591 = load i32, ptr %42, align 4, !tbaa !31
  store i32 %591, ptr %38, align 4, !tbaa !31
  br label %592

592:                                              ; preds = %588, %584, %580
  br label %593

593:                                              ; preds = %592, %572
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #7
  store i32 0, ptr %12, align 4
  br label %594

594:                                              ; preds = %593, %481
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  br label %595

595:                                              ; preds = %594, %465
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  %596 = load i32, ptr %12, align 4
  switch i32 %596, label %705 [
    i32 0, label %597
    i32 16, label %598
  ]

597:                                              ; preds = %595
  br label %598

598:                                              ; preds = %597, %595, %449
  %599 = load i32, ptr %39, align 4, !tbaa !31
  %600 = add i32 %599, 1
  store i32 %600, ptr %39, align 4, !tbaa !31
  br label %423, !llvm.loop !57

601:                                              ; preds = %563, %534
  call void @llvm.lifetime.end.p0(i64 64, ptr %45) #7
  br label %602

602:                                              ; preds = %601, %530
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #7
  br label %603

603:                                              ; preds = %602, %526
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #7
  br label %604

604:                                              ; preds = %603, %522
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  br label %623

605:                                              ; preds = %426
  %606 = load i32, ptr %23, align 4, !tbaa !31
  %607 = icmp ne i32 %606, -1
  br i1 %607, label %608, label %619

608:                                              ; preds = %605
  %609 = load i32, ptr %38, align 4, !tbaa !31
  %610 = load ptr, ptr %21, align 8, !tbaa !5
  %611 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %610, i32 0, i32 1
  store i32 %609, ptr %611, align 4, !tbaa !39
  %612 = load i32, ptr %23, align 4, !tbaa !31
  %613 = load ptr, ptr %21, align 8, !tbaa !5
  %614 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %613, i32 0, i32 0
  store i32 %612, ptr %614, align 4, !tbaa !42
  %615 = load i32, ptr %6, align 4, !tbaa !31
  %616 = add i32 %615, 1
  store i32 %616, ptr %6, align 4, !tbaa !31
  %617 = load i32, ptr %7, align 4, !tbaa !31
  %618 = add i32 %617, 1
  store i32 %618, ptr %7, align 4, !tbaa !31
  br label %622

619:                                              ; preds = %605
  %620 = load i32, ptr %5, align 4, !tbaa !31
  %621 = add i32 %620, 1
  store i32 %621, ptr %5, align 4, !tbaa !31
  br label %622

622:                                              ; preds = %619, %608
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  br label %624

623:                                              ; preds = %604, %439
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  br label %625

624:                                              ; preds = %622, %410
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %631

625:                                              ; preds = %623, %435
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  br label %626

626:                                              ; preds = %625, %431
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br label %627

627:                                              ; preds = %626, %427
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %650

628:                                              ; preds = %386
  %629 = load i32, ptr %5, align 4, !tbaa !31
  %630 = add i32 %629, 1
  store i32 %630, ptr %5, align 4, !tbaa !31
  br label %631

631:                                              ; preds = %628, %624
  br label %632

632:                                              ; preds = %631, %380
  %633 = load ptr, ptr %21, align 8, !tbaa !5
  %634 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %633, i32 0, i32 0
  %635 = load i32, ptr %634, align 4, !tbaa !42
  %636 = icmp eq i32 %635, 3
  br i1 %636, label %637, label %646

637:                                              ; preds = %632
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #7
  %638 = load ptr, ptr %21, align 8, !tbaa !5
  %639 = getelementptr inbounds %"struct.basisu::encoder_block", ptr %638, i32 0, i32 1
  %640 = load i32, ptr %639, align 4, !tbaa !39
  store i32 %640, ptr %48, align 4, !tbaa !31
  invoke void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %48)
          to label %641 unwind label %642

641:                                              ; preds = %637
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #7
  br label %646

642:                                              ; preds = %637
  %643 = landingpad { ptr, i32 }
          cleanup
  %644 = extractvalue { ptr, i32 } %643, 0
  store ptr %644, ptr %9, align 8
  %645 = extractvalue { ptr, i32 } %643, 1
  store i32 %645, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #7
  br label %650

646:                                              ; preds = %641, %632
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %647

647:                                              ; preds = %646
  %648 = load i32, ptr %19, align 4, !tbaa !31
  %649 = add i32 %648, 1
  store i32 %649, ptr %19, align 4, !tbaa !31
  br label %156, !llvm.loop !58

650:                                              ; preds = %642, %627, %376
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %651

651:                                              ; preds = %650, %209
  call void @llvm.lifetime.end.p0(i64 8, 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
  br label %660

652:                                              ; preds = %160
  br label %653

653:                                              ; preds = %652
  %654 = load i32, ptr %18, align 4, !tbaa !31
  %655 = add i32 %654, 1
  store i32 %655, ptr %18, align 4, !tbaa !31
  br label %130, !llvm.loop !59

656:                                              ; preds = %134
  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 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %657

657:                                              ; preds = %656
  %658 = load i32, ptr %11, align 4, !tbaa !31
  %659 = add i32 %658, 1
  store i32 %659, ptr %11, align 4, !tbaa !31
  br label %66, !llvm.loop !60

660:                                              ; preds = %651, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %661

661:                                              ; preds = %660, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %662

662:                                              ; preds = %661, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %663

663:                                              ; preds = %662, %139
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  br label %664

664:                                              ; preds = %663, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %665

665:                                              ; preds = %664, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %699

666:                                              ; preds = %72
  %667 = load i32, ptr %5, align 4, !tbaa !31
  %668 = load i32, ptr %5, align 4, !tbaa !31
  %669 = uitofp i32 %668 to float
  %670 = fmul float %669, 1.000000e+02
  %671 = invoke noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %49)
          to label %672 unwind label %73

672:                                              ; preds = %666
  %673 = uitofp i32 %671 to float
  %674 = fdiv float %670, %673
  %675 = fpext float %674 to double
  %676 = load i32, ptr %6, align 4, !tbaa !31
  %677 = load i32, ptr %6, align 4, !tbaa !31
  %678 = uitofp i32 %677 to float
  %679 = fmul float %678, 1.000000e+02
  %680 = invoke noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %49)
          to label %681 unwind label %73

681:                                              ; preds = %672
  %682 = uitofp i32 %680 to float
  %683 = fdiv float %679, %682
  %684 = fpext float %683 to double
  %685 = load i32, ptr %7, align 4, !tbaa !31
  %686 = load i32, ptr %7, align 4, !tbaa !31
  %687 = uitofp i32 %686 to float
  %688 = fmul float %687, 1.000000e+02
  %689 = invoke noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %49)
          to label %690 unwind label %73

690:                                              ; preds = %681
  %691 = uitofp i32 %689 to float
  %692 = fdiv float %688, %691
  %693 = fpext float %692 to double
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.9, i32 noundef %667, double noundef %675, i32 noundef %676, double noundef %684, i32 noundef %685, double noundef %693)
          to label %694 unwind label %73

694:                                              ; preds = %690
  %695 = load i32, ptr %7, align 4, !tbaa !31
  invoke void @_ZN6basisu14basisu_backend38reoptimize_and_sort_endpoints_codebookEjRNS_6vectorIjEE(ptr noundef nonnull align 8 dereferenceable(336) %49, i32 noundef %695, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %696 unwind label %73

696:                                              ; preds = %694
  invoke void @_ZN6basisu14basisu_backend22sort_selector_codebookEv(ptr noundef nonnull align 8 dereferenceable(336) %49)
          to label %697 unwind label %73

697:                                              ; preds = %696
  invoke void @_ZN6basisu14basisu_backend25check_for_valid_cr_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %49)
          to label %698 unwind label %73

698:                                              ; preds = %697
  call void @_ZN6basisu6vectorIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret void

699:                                              ; preds = %665, %73
  call void @_ZN6basisu6vectorIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %700

700:                                              ; preds = %699
  %701 = load ptr, ptr %9, align 8
  %702 = load i32, ptr %10, align 4
  %703 = insertvalue { ptr, i32 } poison, ptr %701, 0
  %704 = insertvalue { ptr, i32 } %703, i32 %702, 1
  resume { ptr, i32 } %704

705:                                              ; preds = %595, %369
  unreachable
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496), i32 noundef) #5 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #0 align 2

declare noundef zeroext i1 @_ZN6basisu11unpack_etc1ERKNS_9etc_blockEPNS_10color_rgbaEb(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i1 noundef zeroext) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext, ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext) #6

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

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

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

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


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

%struct.anon.41 = type { i8, i8 }
%"class.basisu::vector.14" = type { ptr, i32, i32 }
%"struct.basisu::etc_block" = type { %union.anon.36 }
%union.anon.36 = type { i64 }
%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }

@_ZN6basisuL16g_endpoint_predsE = external hidden local_unnamed_addr constant [3 x %struct.anon.41], align 1
@.str.9 = external hidden unnamed_addr constant [126 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN6basisuL6verifyEbi(i1 noundef zeroext, i32 noundef) local_unnamed_addr #0

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu14basisu_backend21create_encoder_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.basisu::vector.14", align 8
  %3 = alloca %"struct.basisu::etc_block", align 8
  %4 = alloca %"struct.basisu::etc_block", align 8
  %5 = alloca %"class.basisu::color_rgba", align 4
  %6 = alloca [16 x %"class.basisu::color_rgba"], align 16
  %7 = alloca i32, align 4
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %9 = tail call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %10 = getelementptr inbounds i8, ptr %9, i64 64
  %11 = load i32, ptr %10, align 8, !tbaa !26
  %12 = icmp eq i32 %11, 3
  %13 = getelementptr inbounds i8, ptr %0, i64 224
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = tail call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %16 = zext i32 %15 to i64
  tail call void @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %16, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  call void @_ZN6basisu6vectorIjEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %17 = invoke noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
          to label %18 unwind label %35

18:                                               ; preds = %1
  %19 = zext i32 %17 to i64
  invoke void @_ZN6basisu6vectorIjE7reserveEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %19)
          to label %.preheader264 unwind label %35

.preheader264:                                    ; preds = %18
  %20 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader264
  %21 = getelementptr inbounds i8, ptr %0, i64 12
  %22 = load i8, ptr @_ZN6basisuL16g_endpoint_predsE, align 1
  %23 = sext i8 %22 to i32
  %24 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL16g_endpoint_predsE, i64 1), align 1
  %25 = sext i8 %24 to i32
  %26 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL16g_endpoint_predsE, i64 2), align 1
  %27 = sext i8 %26 to i32
  %28 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL16g_endpoint_predsE, i64 3), align 1
  %29 = sext i8 %28 to i32
  %30 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL16g_endpoint_predsE, i64 4), align 1
  %31 = sext i8 %30 to i32
  %32 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL16g_endpoint_predsE, i64 5), align 1
  %33 = sext i8 %32 to i32
  %.ptr.us.1 = getelementptr inbounds i8, ptr %6, i64 4
  %.ptr.us.2 = getelementptr inbounds i8, ptr %6, i64 8
  %.ptr.us.3 = getelementptr inbounds i8, ptr %6, i64 12
  %.ptr.us.4 = getelementptr inbounds i8, ptr %6, i64 16
  %.ptr.us.5 = getelementptr inbounds i8, ptr %6, i64 20
  %.ptr.us.6 = getelementptr inbounds i8, ptr %6, i64 24
  %.ptr.us.7 = getelementptr inbounds i8, ptr %6, i64 28
  %.ptr.us.8 = getelementptr inbounds i8, ptr %6, i64 32
  %.ptr.us.9 = getelementptr inbounds i8, ptr %6, i64 36
  %.ptr.us.10 = getelementptr inbounds i8, ptr %6, i64 40
  %.ptr.us.11 = getelementptr inbounds i8, ptr %6, i64 44
  %.ptr.us.12 = getelementptr inbounds i8, ptr %6, i64 48
  %.ptr.us.13 = getelementptr inbounds i8, ptr %6, i64 52
  %.ptr.us.14 = getelementptr inbounds i8, ptr %6, i64 56
  %.ptr.us.15 = getelementptr inbounds i8, ptr %6, i64 60
  br label %37

._crit_edge:                                      ; preds = %._crit_edge421, %.preheader264
  %.0167.lcssa = phi i32 [ 0, %.preheader264 ], [ %.1168.lcssa, %._crit_edge421 ]
  %.0161.lcssa = phi i32 [ 0, %.preheader264 ], [ %.1162.lcssa, %._crit_edge421 ]
  %.0159.lcssa = phi i32 [ 0, %.preheader264 ], [ %.1160.lcssa, %._crit_edge421 ]
  %34 = invoke noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
          to label %262 unwind label %35

35:                                               ; preds = %284, %283, %282, %271, %269, %262, %._crit_edge, %18, %1
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %286

37:                                               ; preds = %.lr.ph, %._crit_edge421
  %indvars.iv483 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next484, %._crit_edge421 ]
  %.0159467 = phi i32 [ 0, %.lr.ph ], [ %.1160.lcssa, %._crit_edge421 ]
  %.0161466 = phi i32 [ 0, %.lr.ph ], [ %.1162.lcssa, %._crit_edge421 ]
  %.0167465 = phi i32 [ 0, %.lr.ph ], [ %.1168.lcssa, %._crit_edge421 ]
  br i1 %12, label %38, label %41

38:                                               ; preds = %37
  %39 = trunc nuw i64 %indvars.iv483 to i32
  %40 = invoke noundef i32 @_ZN6basisu14basisu_backend16find_video_frameEii(ptr noundef nonnull align 8 dereferenceable(336) %0, i32 noundef %39, i32 noundef -1)
          to label %41 unwind label %254

41:                                               ; preds = %37, %38
  %42 = phi i32 [ %40, %38 ], [ -1, %37 ]
  %43 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %14, i64 noundef %indvars.iv483)
  %44 = getelementptr inbounds i8, ptr %43, i64 45
  %45 = load i8, ptr %44, align 1, !tbaa !29, !range !31, !noundef !32
  %46 = trunc nuw i8 %45 to i1
  %47 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %14, i64 noundef %indvars.iv483)
  %48 = load i32, ptr %47, align 4, !tbaa !33
  %49 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %14, i64 noundef %indvars.iv483)
  %50 = getelementptr inbounds i8, ptr %49, i64 20
  %51 = load i32, ptr %50, align 4, !tbaa !34
  %52 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %14, i64 noundef %indvars.iv483)
  %53 = getelementptr inbounds i8, ptr %52, i64 24
  %54 = load i32, ptr %53, align 4, !tbaa !35
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv483)
  %56 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu8vector2DINS_13encoder_blockEE6resizeEjj(ptr noundef nonnull align 8 dereferenceable(24) %55, i32 noundef %51, i32 noundef %54)
          to label %.preheader263 unwind label %256

.preheader263:                                    ; preds = %41
  %.not470 = icmp eq i32 %54, 0
  br i1 %.not470, label %._crit_edge421, label %.preheader262.lr.ph

.preheader262.lr.ph:                              ; preds = %.preheader263
  %.not471 = icmp eq i32 %51, 0
  %.not242 = icmp eq i32 %42, -1
  %brmerge = select i1 %.not242, i1 true, i1 %46
  %57 = sext i32 %42 to i64
  br i1 %.not471, label %._crit_edge421, label %.preheader262.us

.preheader262.us:                                 ; preds = %.preheader262.lr.ph, %._crit_edge.us
  %.1160420.us = phi i32 [ %.5.us503, %._crit_edge.us ], [ %.0159467, %.preheader262.lr.ph ]
  %.1162419.us = phi i32 [ %.5166.us502, %._crit_edge.us ], [ %.0161466, %.preheader262.lr.ph ]
  %.1168418.us = phi i32 [ %.5172.us501, %._crit_edge.us ], [ %.0167465, %.preheader262.lr.ph ]
  %.0205417.us = phi i32 [ %237, %._crit_edge.us ], [ 0, %.preheader262.lr.ph ]
  %58 = mul i32 %.0205417.us, %51
  %59 = add i32 %58, %48
  %60 = add i32 %.0205417.us, %25
  %61 = icmp slt i32 %60, 0
  %.not241.us = icmp sge i32 %60, %54
  %62 = add i32 %.0205417.us, %29
  %63 = icmp slt i32 %62, 0
  %.not241.us.1 = icmp sge i32 %62, %54
  %64 = add i32 %.0205417.us, %33
  %65 = icmp slt i32 %64, 0
  %.not241.us.2 = icmp sge i32 %64, %54
  br label %66

66:                                               ; preds = %.preheader262.us, %166
  %.2414.us = phi i32 [ %.1160420.us, %.preheader262.us ], [ %.5.us503, %166 ]
  %.2163413.us = phi i32 [ %.1162419.us, %.preheader262.us ], [ %.5166.us502, %166 ]
  %.2169412.us = phi i32 [ %.1168418.us, %.preheader262.us ], [ %.5172.us501, %166 ]
  %.0206411.us = phi i32 [ 0, %.preheader262.us ], [ %167, %166 ]
  %67 = add i32 %59, %.0206411.us
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv483)
  %69 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %68, i32 noundef %.0206411.us, i32 noundef %.0205417.us)
          to label %70 unwind label %.split.us

70:                                               ; preds = %66
  %71 = invoke noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %8, i32 noundef %67, i32 noundef 0)
          to label %72 unwind label %.split.us

72:                                               ; preds = %70
  %73 = getelementptr inbounds i8, ptr %69, i64 4
  store i32 %71, ptr %73, align 4, !tbaa !36
  %74 = invoke noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %8, i32 noundef %67, i32 noundef 0)
          to label %75 unwind label %.split.us

75:                                               ; preds = %72
  %76 = invoke noundef i32 @_ZNK6basisu15basisu_frontend35get_subblock_endpoint_cluster_indexEjj(ptr noundef nonnull align 8 dereferenceable(496) %8, i32 noundef %67, i32 noundef 1)
          to label %77 unwind label %.split.us

77:                                               ; preds = %75
  %78 = icmp eq i32 %74, %76
  call void @_ZN6basisuL6verifyEbi(i1 noundef zeroext %78, i32 noundef 489)
  %79 = invoke noundef i32 @_ZNK6basisu15basisu_frontend32get_block_selector_cluster_indexEj(ptr noundef nonnull align 8 dereferenceable(496) %8, i32 noundef %67)
          to label %168 unwind label %.split.us

.thread497:                                       ; preds = %202, %234, %236
  %.5212.us.2507 = phi i32 [ %.5212.us.1, %236 ], [ 2, %234 ], [ %206, %202 ]
  store i32 %.5212.us.2507, ptr %69, align 4, !tbaa !38
  %80 = add i32 %.2163413.us, 1
  br label %166

81:                                               ; preds = %236
  %82 = load float, ptr %21, align 4, !tbaa !39
  %83 = fcmp ogt float %82, 0.000000e+00
  br i1 %83, label %86, label %84

84:                                               ; preds = %81
  %85 = add i32 %.2414.us, 1
  br label %161

86:                                               ; preds = %81
  %87 = invoke noundef nonnull align 1 dereferenceable(64) ptr @_ZNK6basisu15basisu_frontend22get_source_pixel_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %8, i32 noundef %67)
          to label %88 unwind label %.split429.us

88:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK6basisu15basisu_frontend16get_output_blockEj(ptr noundef nonnull align 8 dereferenceable(496) %8, i32 noundef %67)
  %90 = load i64, ptr %89, align 8, !tbaa !40
  store i64 %90, ptr %3, align 8, !tbaa !40
  %91 = call noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %87)
  %92 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %93 = getelementptr inbounds i8, ptr %92, i64 28
  %94 = load i8, ptr %93, align 4, !tbaa !41, !range !31, !noundef !32
  %95 = trunc nuw i8 %94 to i1
  %96 = invoke noundef i64 @_ZNK6basisu9etc_block19evaluate_etc1_errorEPKNS_10color_rgbaEbi(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %91, i1 noundef zeroext %95, i32 noundef -1)
          to label %97 unwind label %.split432.us

97:                                               ; preds = %88
  %.not229.us = icmp eq i64 %96, 0
  br i1 %.not229.us, label %160, label %98

98:                                               ; preds = %97
  %99 = uitofp i64 %96 to float
  %100 = load float, ptr %21, align 4, !tbaa !39
  %101 = call noundef float @_ZN6basisu7maximumIfEET_S1_S1_(float noundef 1.000000e+00, float noundef %100)
  %102 = fmul float %101, %99
  %103 = fptoui float %102 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %104 = load i64, ptr %3, align 8, !tbaa !40
  store i64 %104, ptr %4, align 8, !tbaa !40
  br label %111

.thread:                                          ; preds = %111, %159
  %.4184.us496 = phi i32 [ %.4184.us, %159 ], [ %.0180407.us, %111 ]
  %.10217.us495 = phi i32 [ %.10217.us, %159 ], [ %.6213405.us, %111 ]
  %.not230.us = icmp eq i32 %.10217.us495, -1
  br i1 %.not230.us, label %108, label %105

105:                                              ; preds = %.thread
  store i32 %.4184.us496, ptr %73, align 4, !tbaa !36
  store i32 %.10217.us495, ptr %69, align 4, !tbaa !38
  %106 = add i32 %.2163413.us, 1
  %107 = add i32 %.2169412.us, 1
  br label %110

108:                                              ; preds = %.thread
  %109 = add i32 %.2414.us, 1
  br label %110

110:                                              ; preds = %108, %105
  %.3170.us = phi i32 [ %107, %105 ], [ %.2169412.us, %108 ]
  %.3164.us = phi i32 [ %106, %105 ], [ %.2163413.us, %108 ]
  %.3.us = phi i32 [ %.2414.us, %105 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %160

111:                                              ; preds = %159, %98
  %indvars.iv478 = phi i64 [ %indvars.iv.next479, %159 ], [ 0, %98 ]
  %.0180407.us = phi i32 [ %.4184.us, %159 ], [ 0, %98 ]
  %.0185406.us = phi i64 [ %.4189.us, %159 ], [ -1, %98 ]
  %.6213405.us = phi i32 [ %.10217.us, %159 ], [ -1, %98 ]
  %112 = icmp eq i64 %indvars.iv478, 2
  %or.cond3.us = and i1 %12, %112
  br i1 %or.cond3.us, label %.thread, label %113

113:                                              ; preds = %111
  %114 = getelementptr inbounds [3 x %struct.anon.41], ptr @_ZN6basisuL16g_endpoint_predsE, i64 0, i64 %indvars.iv478
  %115 = load i8, ptr %114, align 1, !tbaa !42
  %116 = sext i8 %115 to i32
  %117 = add i32 %.0206411.us, %116
  %118 = icmp sgt i32 %117, -1
  %.not231.us = icmp slt i32 %117, %51
  %or.cond259.us = select i1 %118, i1 %.not231.us, i1 false
  br i1 %or.cond259.us, label %119, label %159

119:                                              ; preds = %113
  %120 = getelementptr inbounds i8, ptr %114, i64 1
  %121 = load i8, ptr %120, align 1, !tbaa !44
  %122 = sext i8 %121 to i32
  %123 = add i32 %.0205417.us, %122
  %124 = icmp sgt i32 %123, -1
  %.not232.us = icmp slt i32 %123, %54
  %or.cond260.us = select i1 %124, i1 %.not232.us, i1 false
  br i1 %or.cond260.us, label %125, label %159

125:                                              ; preds = %119
  %126 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv483)
  %127 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %126, i32 noundef %117, i32 noundef %123)
          to label %128 unwind label %.split435.us

128:                                              ; preds = %125
  %129 = getelementptr inbounds i8, ptr %127, i64 4
  %130 = load i32, ptr %129, align 4, !tbaa !36
  %131 = call noundef i32 @_ZNK6basisu15basisu_frontend32get_endpoint_cluster_inten_tableEjb(ptr noundef nonnull align 8 dereferenceable(496) %8, i32 noundef %130, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %132 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZNK6basisu15basisu_frontend35get_endpoint_cluster_unscaled_colorEjb(ptr noundef nonnull align 8 dereferenceable(496) %8, i32 noundef %130, i1 noundef zeroext false)
  %133 = load i32, ptr %132, align 1, !tbaa !40
  store i32 %133, ptr %5, align 4, !tbaa !40
  invoke void @_ZN6basisu9etc_block16set_block_color5ERKNS_10color_rgbaES3_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(4) %5)
          to label %134 unwind label %.split438.us

134:                                              ; preds = %128
  call void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0, i32 noundef %131)
  call void @_ZN6basisu9etc_block15set_inten_tableEjj(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 1, i32 noundef %131)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #7
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %6)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.1)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.2)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.3)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.4)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.5)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.6)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.7)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.8)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.9)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.10)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.11)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.12)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.13)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.14)
  call void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4) %.ptr.us.15)
  %135 = invoke noundef zeroext i1 @_ZN6basisu11unpack_etc1ERKNS_9etc_blockEPNS_10color_rgbaEb(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %6, i1 noundef zeroext false)
          to label %.preheader.us unwind label %.split441.us

.preheader.us:                                    ; preds = %134, %144
  %indvars.iv = phi i64 [ %indvars.iv.next, %144 ], [ 0, %134 ]
  %.0158403.us = phi i64 [ %146, %144 ], [ 0, %134 ]
  %136 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496) %8)
  %137 = getelementptr inbounds i8, ptr %136, i64 28
  %138 = load i8, ptr %137, align 4, !tbaa !41, !range !31, !noundef !32
  %139 = trunc nuw i8 %138 to i1
  %140 = call noundef ptr @_ZNK6basisu11pixel_block7get_ptrEv(ptr noundef nonnull align 1 dereferenceable(64) %87)
  %141 = getelementptr inbounds %"class.basisu::color_rgba", ptr %140, i64 %indvars.iv
  %142 = getelementptr inbounds [16 x %"class.basisu::color_rgba"], ptr %6, i64 0, i64 %indvars.iv
  %143 = invoke noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext %139, ptr noundef nonnull align 1 dereferenceable(4) %141, ptr noundef nonnull align 1 dereferenceable(4) %142, i1 noundef zeroext false)
          to label %144 unwind label %.split444.us

144:                                              ; preds = %.preheader.us
  %145 = zext i32 %143 to i64
  %146 = add i64 %.0158403.us, %145
  %147 = icmp ule i64 %146, %103
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %148 = icmp ult i64 %indvars.iv, 15
  %or.cond = select i1 %147, i1 %148, i1 false
  br i1 %or.cond, label %.preheader.us, label %149, !llvm.loop !45

149:                                              ; preds = %144
  %.not239.us = icmp ugt i64 %146, %103
  br i1 %.not239.us, label %158, label %150

150:                                              ; preds = %149
  %151 = icmp ult i64 %146, %.0185406.us
  br i1 %151, label %156, label %152

152:                                              ; preds = %150
  %153 = icmp eq i64 %146, %.0185406.us
  %154 = zext i32 %.6213405.us to i64
  %155 = icmp ult i64 %indvars.iv478, %154
  %or.cond261.us = select i1 %153, i1 %155, i1 false
  br i1 %or.cond261.us, label %156, label %158

156:                                              ; preds = %152, %150
  %157 = trunc nuw nsw i64 %indvars.iv478 to i32
  br label %158

158:                                              ; preds = %156, %152, %149
  %.7214.us = phi i32 [ %157, %156 ], [ %.6213405.us, %152 ], [ %.6213405.us, %149 ]
  %.1186.us = phi i64 [ %146, %156 ], [ %.0185406.us, %152 ], [ %.0185406.us, %149 ]
  %.1181.us = phi i32 [ %130, %156 ], [ %.0180407.us, %152 ], [ %.0180407.us, %149 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %159

159:                                              ; preds = %158, %119, %113
  %.10217.us = phi i32 [ %.6213405.us, %113 ], [ %.7214.us, %158 ], [ %.6213405.us, %119 ]
  %.4189.us = phi i64 [ %.0185406.us, %113 ], [ %.1186.us, %158 ], [ %.0185406.us, %119 ]
  %.4184.us = phi i32 [ %.0180407.us, %113 ], [ %.1181.us, %158 ], [ %.0180407.us, %119 ]
  %indvars.iv.next479 = add nuw nsw i64 %indvars.iv478, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next479, 3
  br i1 %exitcond.not, label %.thread, label %111, !llvm.loop !47

160:                                              ; preds = %110, %97
  %.4171.us = phi i32 [ %.3170.us, %110 ], [ %.2169412.us, %97 ]
  %.4165.us = phi i32 [ %.3164.us, %110 ], [ %.2163413.us, %97 ]
  %.4.us = phi i32 [ %.3.us, %110 ], [ %.2414.us, %97 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %161

161:                                              ; preds = %84, %160
  %.5172.ph.us = phi i32 [ %.2169412.us, %84 ], [ %.4171.us, %160 ]
  %.5166.ph.us = phi i32 [ %.2163413.us, %84 ], [ %.4165.us, %160 ]
  %.5.ph.us = phi i32 [ %85, %84 ], [ %.4.us, %160 ]
  %.pr.us = load i32, ptr %69, align 4, !tbaa !38
  %162 = icmp eq i32 %.pr.us, 3
  br i1 %162, label %163, label %166

163:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %164 = load i32, ptr %73, align 4, !tbaa !36
  store i32 %164, ptr %7, align 4, !tbaa !48
  invoke void @_ZN6basisu6vectorIjE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %165 unwind label %.split447.us

165:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %166

166:                                              ; preds = %.thread497, %165, %161
  %.5.us503 = phi i32 [ %.2414.us, %.thread497 ], [ %.5.ph.us, %165 ], [ %.5.ph.us, %161 ]
  %.5166.us502 = phi i32 [ %80, %.thread497 ], [ %.5166.ph.us, %165 ], [ %.5166.ph.us, %161 ]
  %.5172.us501 = phi i32 [ %.2169412.us, %.thread497 ], [ %.5172.ph.us, %165 ], [ %.5172.ph.us, %161 ]
  %167 = add nuw i32 %.0206411.us, 1
  %exitcond481.not = icmp eq i32 %167, %51
  br i1 %exitcond481.not, label %._crit_edge.us, label %66, !llvm.loop !49

168:                                              ; preds = %77
  %169 = getelementptr inbounds i8, ptr %69, i64 8
  store i32 %79, ptr %169, align 4, !tbaa !50
  store i32 3, ptr %69, align 4, !tbaa !38
  %170 = load i32, ptr %73, align 4, !tbaa !36
  %171 = add i32 %.0206411.us, %23
  %172 = icmp slt i32 %171, 0
  %.not240.us = icmp sge i32 %171, %51
  %or.cond256.us.not512 = select i1 %172, i1 true, i1 %.not240.us
  %173 = select i1 %or.cond256.us.not512, i1 true, i1 %61
  %brmerge508 = select i1 %173, i1 true, i1 %.not241.us
  br i1 %brmerge508, label %181, label %174

174:                                              ; preds = %168
  %175 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv483)
  %176 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %175, i32 noundef %171, i32 noundef %60)
          to label %177 unwind label %.split450.us

177:                                              ; preds = %174
  %178 = getelementptr inbounds i8, ptr %176, i64 4
  %179 = load i32, ptr %178, align 4, !tbaa !36
  %180 = icmp ne i32 %179, %170
  %.2209.us = sext i1 %180 to i32
  br label %181

181:                                              ; preds = %168, %177
  %.5212.us = phi i32 [ -1, %168 ], [ %.2209.us, %177 ]
  %182 = add i32 %.0206411.us, %27
  %183 = icmp slt i32 %182, 0
  %.not240.us.1 = icmp sge i32 %182, %51
  %or.cond256.us.1.not516 = select i1 %183, i1 true, i1 %.not240.us.1
  %184 = select i1 %or.cond256.us.1.not516, i1 true, i1 %63
  %brmerge509 = select i1 %184, i1 true, i1 %.not241.us.1
  br i1 %brmerge509, label %194, label %185

185:                                              ; preds = %181
  %186 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv483)
  %187 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %186, i32 noundef %182, i32 noundef %62)
          to label %188 unwind label %.split450.us

188:                                              ; preds = %185
  %189 = getelementptr inbounds i8, ptr %187, i64 4
  %190 = load i32, ptr %189, align 4, !tbaa !36
  %191 = icmp eq i32 %190, %170
  %192 = icmp ne i32 %.5212.us, 0
  %193 = zext i1 %192 to i32
  %.2209.us.1 = select i1 %191, i32 %193, i32 %.5212.us
  br label %194

194:                                              ; preds = %181, %188
  %.5212.us.1 = phi i32 [ %.5212.us, %181 ], [ %.2209.us.1, %188 ]
  br i1 %12, label %207, label %195

195:                                              ; preds = %194
  %196 = add i32 %.0206411.us, %31
  %197 = icmp slt i32 %196, 0
  %.not240.us.2 = icmp sge i32 %196, %51
  %or.cond256.us.2.not520 = select i1 %197, i1 true, i1 %.not240.us.2
  %198 = select i1 %or.cond256.us.2.not520, i1 true, i1 %65
  %brmerge510 = select i1 %198, i1 true, i1 %.not241.us.2
  br i1 %brmerge510, label %236, label %199

199:                                              ; preds = %195
  %200 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv483)
  %201 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %200, i32 noundef %196, i32 noundef %64)
          to label %202 unwind label %.split450.us

202:                                              ; preds = %199
  %203 = getelementptr inbounds i8, ptr %201, i64 4
  %204 = load i32, ptr %203, align 4, !tbaa !36
  %205 = icmp eq i32 %204, %170
  %206 = call i32 @llvm.umin.i32(i32 %.5212.us.1, i32 2)
  br i1 %205, label %.thread497, label %236

207:                                              ; preds = %194
  br i1 %brmerge, label %236, label %208

208:                                              ; preds = %207
  %209 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv483)
  %210 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %209, i32 noundef %.0206411.us, i32 noundef %.0205417.us)
          to label %211 unwind label %.split453.us

211:                                              ; preds = %208
  %212 = getelementptr inbounds i8, ptr %210, i64 4
  %213 = load i32, ptr %212, align 4, !tbaa !36
  %214 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %indvars.iv483)
  %215 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %214, i32 noundef %.0206411.us, i32 noundef %.0205417.us)
          to label %216 unwind label %.split456.us

216:                                              ; preds = %211
  %217 = getelementptr inbounds i8, ptr %215, i64 8
  %218 = load i32, ptr %217, align 4, !tbaa !50
  %219 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %57)
  %220 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %219, i32 noundef %.0206411.us, i32 noundef %.0205417.us)
          to label %221 unwind label %.split459.us

221:                                              ; preds = %216
  %222 = getelementptr inbounds i8, ptr %220, i64 4
  %223 = load i32, ptr %222, align 4, !tbaa !36
  %224 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %57)
  %225 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %224, i32 noundef %.0206411.us, i32 noundef %.0205417.us)
          to label %226 unwind label %.split462.us

226:                                              ; preds = %221
  %227 = icmp eq i32 %213, %223
  %228 = getelementptr inbounds i8, ptr %225, i64 8
  %229 = load i32, ptr %228, align 4
  %230 = icmp eq i32 %218, %229
  %or.cond255.us.2 = select i1 %227, i1 %230, i1 false
  br i1 %or.cond255.us.2, label %231, label %236

231:                                              ; preds = %226
  %232 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %57)
  %233 = invoke noundef nonnull align 4 dereferenceable(17) ptr @_ZN6basisu8vector2DINS_13encoder_blockEEclEjj(ptr noundef nonnull align 8 dereferenceable(24) %232, i32 noundef %.0206411.us, i32 noundef %.0205417.us)
          to label %234 unwind label %.split462.us

234:                                              ; preds = %231
  %235 = getelementptr inbounds i8, ptr %233, i64 16
  store i8 1, ptr %235, align 4, !tbaa !51
  br label %.thread497

236:                                              ; preds = %195, %202, %226, %207
  %.not.us = icmp eq i32 %.5212.us.1, -1
  br i1 %.not.us, label %81, label %.thread497

._crit_edge.us:                                   ; preds = %166
  %237 = add nuw i32 %.0205417.us, 1
  %exitcond482.not = icmp eq i32 %237, %54
  br i1 %exitcond482.not, label %._crit_edge421, label %.preheader262.us, !llvm.loop !52

.split.us:                                        ; preds = %77, %75, %72, %70, %66
  %238 = landingpad { ptr, i32 }
          cleanup
  br label %286

.split429.us:                                     ; preds = %86
  %239 = landingpad { ptr, i32 }
          cleanup
  br label %286

.split432.us:                                     ; preds = %88
  %240 = landingpad { ptr, i32 }
          cleanup
  br label %261

.split435.us:                                     ; preds = %125
  %241 = landingpad { ptr, i32 }
          cleanup
  br label %260

.split438.us:                                     ; preds = %128
  %242 = landingpad { ptr, i32 }
          cleanup
  br label %259

.split441.us:                                     ; preds = %134
  %243 = landingpad { ptr, i32 }
          cleanup
  br label %258

.split444.us:                                     ; preds = %.preheader.us
  %244 = landingpad { ptr, i32 }
          cleanup
  br label %258

.split447.us:                                     ; preds = %163
  %245 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %286

.split450.us:                                     ; preds = %199, %185, %174
  %246 = landingpad { ptr, i32 }
          cleanup
  br label %286

.split453.us:                                     ; preds = %208
  %247 = landingpad { ptr, i32 }
          cleanup
  br label %286

.split456.us:                                     ; preds = %211
  %248 = landingpad { ptr, i32 }
          cleanup
  br label %286

.split459.us:                                     ; preds = %216
  %249 = landingpad { ptr, i32 }
          cleanup
  br label %286

.split462.us:                                     ; preds = %231, %221
  %250 = landingpad { ptr, i32 }
          cleanup
  br label %286

._crit_edge421:                                   ; preds = %._crit_edge.us, %.preheader262.lr.ph, %.preheader263
  %.1168.lcssa = phi i32 [ %.0167465, %.preheader263 ], [ %.0167465, %.preheader262.lr.ph ], [ %.5172.us501, %._crit_edge.us ]
  %.1162.lcssa = phi i32 [ %.0161466, %.preheader263 ], [ %.0161466, %.preheader262.lr.ph ], [ %.5166.us502, %._crit_edge.us ]
  %.1160.lcssa = phi i32 [ %.0159467, %.preheader263 ], [ %.0159467, %.preheader262.lr.ph ], [ %.5.us503, %._crit_edge.us ]
  %indvars.iv.next484 = add nuw nsw i64 %indvars.iv483, 1
  %251 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %252 = zext i32 %251 to i64
  %253 = icmp ult i64 %indvars.iv.next484, %252
  br i1 %253, label %37, label %._crit_edge, !llvm.loop !53

254:                                              ; preds = %38
  %255 = landingpad { ptr, i32 }
          cleanup
  br label %286

256:                                              ; preds = %41
  %257 = landingpad { ptr, i32 }
          cleanup
  br label %286

258:                                              ; preds = %.split444.us, %.split441.us
  %.pn = phi { ptr, i32 } [ %244, %.split444.us ], [ %243, %.split441.us ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #7
  br label %259

259:                                              ; preds = %258, %.split438.us
  %.pn.pn = phi { ptr, i32 } [ %.pn, %258 ], [ %242, %.split438.us ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %260

260:                                              ; preds = %259, %.split435.us
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %259 ], [ %241, %.split435.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %261

261:                                              ; preds = %260, %.split432.us
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %260 ], [ %240, %.split432.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %286

262:                                              ; preds = %._crit_edge
  %263 = uitofp i32 %.0159.lcssa to float
  %264 = fmul float %263, 1.000000e+02
  %265 = uitofp i32 %34 to float
  %266 = fdiv float %264, %265
  %267 = fpext float %266 to double
  %268 = invoke noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
          to label %269 unwind label %35

269:                                              ; preds = %262
  %270 = invoke noundef i32 @_ZNK6basisu14basisu_backend16get_total_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
          to label %271 unwind label %35

271:                                              ; preds = %269
  %272 = uitofp i32 %.0167.lcssa to float
  %273 = fmul float %272, 1.000000e+02
  %274 = uitofp i32 %.0161.lcssa to float
  %275 = fmul float %274, 1.000000e+02
  %276 = uitofp i32 %268 to float
  %277 = fdiv float %275, %276
  %278 = fpext float %277 to double
  %279 = uitofp i32 %270 to float
  %280 = fdiv float %273, %279
  %281 = fpext float %280 to double
  invoke void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.9, i32 noundef %.0159.lcssa, double noundef %267, i32 noundef %.0161.lcssa, double noundef %278, i32 noundef %.0167.lcssa, double noundef %281)
          to label %282 unwind label %35

282:                                              ; preds = %271
  invoke void @_ZN6basisu14basisu_backend38reoptimize_and_sort_endpoints_codebookEjRNS_6vectorIjEE(ptr noundef nonnull align 8 dereferenceable(336) %0, i32 noundef %.0167.lcssa, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %283 unwind label %35

283:                                              ; preds = %282
  invoke void @_ZN6basisu14basisu_backend22sort_selector_codebookEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
          to label %284 unwind label %35

284:                                              ; preds = %283
  invoke void @_ZN6basisu14basisu_backend25check_for_valid_cr_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
          to label %285 unwind label %35

285:                                              ; preds = %284
  call void @_ZN6basisu6vectorIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  ret void

286:                                              ; preds = %254, %.split.us, %.split429.us, %261, %.split450.us, %.split456.us, %.split462.us, %.split459.us, %.split453.us, %.split447.us, %256, %35
  %.pn243.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %36, %35 ], [ %255, %254 ], [ %257, %256 ], [ %238, %.split.us ], [ %245, %.split447.us ], [ %246, %.split450.us ], [ %247, %.split453.us ], [ %248, %.split456.us ], [ %250, %.split462.us ], [ %249, %.split459.us ], [ %.pn.pn.pn.pn, %261 ], [ %239, %.split429.us ]
  call void @_ZN6basisu6vectorIjED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn243.pn.pn.pn.pn.pn.pn.pn.pn
}

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu10color_rgbaC2Ev(ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #0 align 2

declare noundef zeroext i1 @_ZN6basisu11unpack_etc1ERKNS_9etc_blockEPNS_10color_rgbaEb(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu14color_distanceEbRKNS_10color_rgbaES2_b(i1 noundef zeroext, ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4), i1 noundef zeroext) local_unnamed_addr #5

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #6

attributes #0 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 0}
!6 = !{!"_ZTSN6basisu14basisu_backendE", !7, i64 0, !10, i64 8, !14, i64 40, !15, i64 56, !7, i64 168, !20, i64 176, !21, i64 192, !22, i64 208, !23, i64 224, !24, i64 240, !24, i64 256, !25, i64 272, !25, i64 288, !24, i64 304, !24, i64 320}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6basisu21basisu_backend_paramsE", !11, i64 0, !11, i64 1, !11, i64 2, !12, i64 4, !12, i64 8, !13, i64 12, !11, i64 16, !13, i64 20, !13, i64 24, !11, i64 28, !11, i64 29}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!"_ZTSN6basisu6vectorINS_25basisu_backend_slice_descEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!15 = !{!"_ZTSN6basisu21basisu_backend_outputE", !16, i64 0, !11, i64 4, !11, i64 5, !11, i64 6, !13, i64 8, !13, i64 12, !17, i64 16, !17, i64 32, !14, i64 48, !17, i64 64, !18, i64 80, !19, i64 96}
!16 = !{!"_ZTSN6basist16basis_tex_formatE", !8, i64 0}
!17 = !{!"_ZTSN6basisu6vectorIhEE", !7, i64 0, !13, i64 8, !13, i64 12}
!18 = !{!"_ZTSN6basisu6vectorINS0_IhEEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!19 = !{!"_ZTSN6basisu6vectorItEE", !7, i64 0, !13, i64 8, !13, i64 12}
!20 = !{!"_ZTSN6basisu6vectorINS_27etc1_endpoint_palette_entryEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!21 = !{!"_ZTSN6basisu6vectorIN6basist27etc1_selector_palette_entryEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!22 = !{!"_ZTSN6basisu6vectorINS_14basisu_backend34etc1_global_selector_cb_entry_descEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!24 = !{!"_ZTSN6basisu6vectorIjEE", !7, i64 0, !13, i64 8, !13, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIbEE", !7, i64 0, !13, i64 8, !13, i64 12}
!26 = !{!27, !28, i64 64}
!27 = !{!"_ZTSN6basisu15basisu_frontend6paramsE", !13, i64 0, !7, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !11, i64 28, !11, i64 29, !11, i64 30, !11, i64 31, !11, i64 32, !11, i64 33, !11, i64 34, !7, i64 40, !13, i64 48, !13, i64 52, !11, i64 56, !12, i64 60, !28, i64 64, !7, i64 72, !7, i64 80}
!28 = !{!"_ZTSN6basist18basis_texture_typeE", !8, i64 0}
!29 = !{!30, !11, i64 45}
!30 = !{!"_ZTSN6basisu25basisu_backend_slice_descE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !11, i64 44, !11, i64 45}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!30, !13, i64 0}
!34 = !{!30, !13, i64 20}
!35 = !{!30, !13, i64 24}
!36 = !{!37, !13, i64 4}
!37 = !{!"_ZTSN6basisu13encoder_blockE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !11, i64 16}
!38 = !{!37, !13, i64 0}
!39 = !{!6, !12, i64 12}
!40 = !{!8, !8, i64 0}
!41 = !{!27, !11, i64 28}
!42 = !{!43, !8, i64 0}
!43 = !{!"_ZTSN6basisu3$_0E", !8, i64 0, !8, i64 1}
!44 = !{!43, !8, i64 1}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = distinct !{!47, !46}
!48 = !{!13, !13, i64 0}
!49 = distinct !{!49, !46}
!50 = !{!37, !13, i64 8}
!51 = !{!37, !11, i64 16}
!52 = distinct !{!52, !46}
!53 = distinct !{!53, !46}


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