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

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

%"struct.basisu::ktx_header" = type { [12 x i8], %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint" }
%"struct.basisu::packed_uint" = type { [4 x i8] }

@.str.3 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb = external hidden unnamed_addr constant [95 x i8], align 1
@_ZN6basisuL13g_ktx_file_idE = external hidden constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext %2) #5 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.basisu::ktx_header", align 1
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"struct.basisu::packed_uint", align 1
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %25 = zext i1 %2 to i8
  store i8 %25, ptr %6, align 1, !tbaa !9
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %26)
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %30, label %29

29:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 1309, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

30:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 -1, ptr %10, align 4, !tbaa !13
  %31 = load i8, ptr %6, align 1, !tbaa !9, !range !15, !noundef !16
  %32 = trunc i8 %31 to i1
  br i1 %32, label %33, label %40

33:                                               ; preds = %30
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %34)
  %36 = urem i32 %35, 6
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 1320, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

39:                                               ; preds = %33
  br label %40

40:                                               ; preds = %39, %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %41

41:                                               ; preds = %142, %40
  %42 = load i32, ptr %11, align 4, !tbaa !11
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %43)
  %45 = icmp ult i32 %42, %44
  br i1 %45, label %47, label %46

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

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !11
  %50 = zext i32 %49 to i64
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %48, i64 noundef %50)
  store ptr %51, ptr %13, align 8, !tbaa !5
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %52)
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %56, label %55

55:                                               ; preds = %47
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 1332, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

56:                                               ; preds = %47
  %57 = load i32, ptr %11, align 4, !tbaa !11
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %71, label %59

59:                                               ; preds = %56
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %60, i64 noundef 0)
  %62 = call noundef i32 @_ZNK6basisu9gpu_image15get_pixel_widthEv(ptr noundef nonnull align 8 dereferenceable(48) %61)
  store i32 %62, ptr %7, align 4, !tbaa !11
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %63, i64 noundef 0)
  %65 = call noundef i32 @_ZNK6basisu9gpu_image16get_pixel_heightEv(ptr noundef nonnull align 8 dereferenceable(48) %64)
  store i32 %65, ptr %8, align 4, !tbaa !11
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %66)
  store i32 %67, ptr %9, align 4, !tbaa !11
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %68, i64 noundef 0)
  %70 = call noundef i32 @_ZNK6basisu9gpu_image10get_formatEv(ptr noundef nonnull align 8 dereferenceable(48) %69)
  store i32 %70, ptr %10, align 4, !tbaa !13
  br label %90

71:                                               ; preds = %56
  %72 = load i32, ptr %7, align 4, !tbaa !11
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %73, i64 noundef 0)
  %75 = call noundef i32 @_ZNK6basisu9gpu_image15get_pixel_widthEv(ptr noundef nonnull align 8 dereferenceable(48) %74)
  %76 = icmp ne i32 %72, %75
  br i1 %76, label %88, label %77

77:                                               ; preds = %71
  %78 = load i32, ptr %8, align 4, !tbaa !11
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %79, i64 noundef 0)
  %81 = call noundef i32 @_ZNK6basisu9gpu_image16get_pixel_heightEv(ptr noundef nonnull align 8 dereferenceable(48) %80)
  %82 = icmp ne i32 %78, %81
  br i1 %82, label %88, label %83

83:                                               ; preds = %77
  %84 = load i32, ptr %9, align 4, !tbaa !11
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %85)
  %87 = icmp ne i32 %84, %86
  br i1 %87, label %88, label %89

88:                                               ; preds = %83, %77, %71
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 1350, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

89:                                               ; preds = %83
  br label %90

90:                                               ; preds = %89, %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %91

91:                                               ; preds = %138, %90
  %92 = load i32, ptr %14, align 4, !tbaa !11
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %93)
  %95 = icmp ult i32 %92, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %91
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %141

97:                                               ; preds = %91
  %98 = load i32, ptr %14, align 4, !tbaa !11
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %128

100:                                              ; preds = %97
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = load i32, ptr %14, align 4, !tbaa !11
  %103 = zext i32 %102 to i64
  %104 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %101, i64 noundef %103)
  %105 = call noundef i32 @_ZNK6basisu9gpu_image15get_pixel_widthEv(ptr noundef nonnull align 8 dereferenceable(48) %104)
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %106, i64 noundef 0)
  %108 = call noundef i32 @_ZNK6basisu9gpu_image15get_pixel_widthEv(ptr noundef nonnull align 8 dereferenceable(48) %107)
  %109 = load i32, ptr %14, align 4, !tbaa !11
  %110 = lshr i32 %108, %109
  %111 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %110)
  %112 = icmp ne i32 %105, %111
  br i1 %112, label %126, label %113

113:                                              ; preds = %100
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = load i32, ptr %14, align 4, !tbaa !11
  %116 = zext i32 %115 to i64
  %117 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %114, i64 noundef %116)
  %118 = call noundef i32 @_ZNK6basisu9gpu_image16get_pixel_heightEv(ptr noundef nonnull align 8 dereferenceable(48) %117)
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %119, i64 noundef 0)
  %121 = call noundef i32 @_ZNK6basisu9gpu_image16get_pixel_heightEv(ptr noundef nonnull align 8 dereferenceable(48) %120)
  %122 = load i32, ptr %14, align 4, !tbaa !11
  %123 = lshr i32 %121, %122
  %124 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %123)
  %125 = icmp ne i32 %118, %124
  br i1 %125, label %126, label %127

126:                                              ; preds = %113, %100
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 1363, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

127:                                              ; preds = %113
  br label %128

128:                                              ; preds = %127, %97
  %129 = load i32, ptr %10, align 4, !tbaa !13
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  %131 = load i32, ptr %14, align 4, !tbaa !11
  %132 = zext i32 %131 to i64
  %133 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %130, i64 noundef %132)
  %134 = call noundef i32 @_ZNK6basisu9gpu_image10get_formatEv(ptr noundef nonnull align 8 dereferenceable(48) %133)
  %135 = icmp ne i32 %129, %134
  br i1 %135, label %136, label %137

136:                                              ; preds = %128
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 1371, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

137:                                              ; preds = %128
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %14, align 4, !tbaa !11
  %140 = add i32 %139, 1
  store i32 %140, ptr %14, align 4, !tbaa !11
  br label %91, !llvm.loop !17

141:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %11, align 4, !tbaa !11
  %144 = add i32 %143, 1
  store i32 %144, ptr %11, align 4, !tbaa !11
  br label %41, !llvm.loop !19

145:                                              ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 36196, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 6407, ptr %16, align 4, !tbaa !11
  %146 = load i32, ptr %10, align 4, !tbaa !13
  switch i32 %146, label %165 [
    i32 5, label %147
    i32 20, label %147
    i32 21, label %147
    i32 6, label %148
    i32 7, label %149
    i32 8, label %150
    i32 0, label %151
    i32 1, label %151
    i32 2, label %152
    i32 3, label %153
    i32 9, label %154
    i32 11, label %155
    i32 12, label %156
    i32 10, label %157
    i32 13, label %158
    i32 14, label %159
    i32 17, label %160
    i32 18, label %161
    i32 19, label %162
    i32 15, label %163
    i32 16, label %164
  ]

147:                                              ; preds = %145, %145, %145
  store i32 33776, ptr %15, align 4, !tbaa !11
  br label %166

148:                                              ; preds = %145
  store i32 33779, ptr %15, align 4, !tbaa !11
  store i32 6408, ptr %16, align 4, !tbaa !11
  br label %166

149:                                              ; preds = %145
  store i32 36283, ptr %15, align 4, !tbaa !11
  store i32 6403, ptr %16, align 4, !tbaa !11
  br label %166

150:                                              ; preds = %145
  store i32 36285, ptr %15, align 4, !tbaa !11
  store i32 33319, ptr %16, align 4, !tbaa !11
  br label %166

151:                                              ; preds = %145, %145
  store i32 36196, ptr %15, align 4, !tbaa !11
  br label %166

152:                                              ; preds = %145
  store i32 37492, ptr %15, align 4, !tbaa !11
  br label %166

153:                                              ; preds = %145
  store i32 37496, ptr %15, align 4, !tbaa !11
  store i32 6408, ptr %16, align 4, !tbaa !11
  br label %166

154:                                              ; preds = %145
  store i32 36492, ptr %15, align 4, !tbaa !11
  store i32 6408, ptr %16, align 4, !tbaa !11
  br label %166

155:                                              ; preds = %145
  store i32 35840, ptr %15, align 4, !tbaa !11
  br label %166

156:                                              ; preds = %145
  store i32 35842, ptr %15, align 4, !tbaa !11
  store i32 6408, ptr %16, align 4, !tbaa !11
  br label %166

157:                                              ; preds = %145
  store i32 37808, ptr %15, align 4, !tbaa !11
  store i32 6408, ptr %16, align 4, !tbaa !11
  br label %166

158:                                              ; preds = %145
  store i32 35986, ptr %15, align 4, !tbaa !11
  br label %166

159:                                              ; preds = %145
  store i32 34798, ptr %15, align 4, !tbaa !11
  store i32 6408, ptr %16, align 4, !tbaa !11
  br label %166

160:                                              ; preds = %145
  store i32 37488, ptr %15, align 4, !tbaa !11
  store i32 6403, ptr %16, align 4, !tbaa !11
  br label %166

161:                                              ; preds = %145
  store i32 37490, ptr %15, align 4, !tbaa !11
  store i32 33319, ptr %16, align 4, !tbaa !11
  br label %166

162:                                              ; preds = %145
  store i32 38092, ptr %15, align 4, !tbaa !11
  store i32 6408, ptr %16, align 4, !tbaa !11
  br label %166

163:                                              ; preds = %145
  store i32 34480, ptr %15, align 4, !tbaa !11
  br label %166

164:                                              ; preds = %145
  store i32 37176, ptr %15, align 4, !tbaa !11
  store i32 6408, ptr %16, align 4, !tbaa !11
  br label %166

165:                                              ; preds = %145
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 1489, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

166:                                              ; preds = %164, %163, %162, %161, %160, %159, %158, %157, %156, %155, %154, %153, %152, %151, %150, %149, %148, %147
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #7
  call void @_ZN6basisu10ktx_headerC2Ev(ptr noundef nonnull align 1 dereferenceable(64) %17)
  call void @_ZN6basisu10ktx_header5clearEv(ptr noundef nonnull align 1 dereferenceable(64) %17)
  %167 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %167, ptr align 1 @_ZN6basisuL13g_ktx_file_idE, i64 12, i1 false)
  %168 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 1
  %169 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %168, i64 noundef 67305985)
  %170 = load i32, ptr %7, align 4, !tbaa !11
  %171 = zext i32 %170 to i64
  %172 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 7
  %173 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %172, i64 noundef %171)
  %174 = load i32, ptr %8, align 4, !tbaa !11
  %175 = zext i32 %174 to i64
  %176 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 8
  %177 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %176, i64 noundef %175)
  %178 = load i32, ptr %15, align 4, !tbaa !11
  %179 = zext i32 %178 to i64
  %180 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 5
  %181 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %180, i64 noundef %179)
  %182 = load i32, ptr %16, align 4, !tbaa !11
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 6
  %185 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %184, i64 noundef %183)
  %186 = load i8, ptr %6, align 1, !tbaa !9, !range !15, !noundef !16
  %187 = trunc i8 %186 to i1
  br i1 %187, label %188, label %192

188:                                              ; preds = %166
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %189)
  %191 = udiv i32 %190, 6
  br label %195

192:                                              ; preds = %166
  %193 = load ptr, ptr %5, align 8, !tbaa !5
  %194 = call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %193)
  br label %195

195:                                              ; preds = %192, %188
  %196 = phi i32 [ %191, %188 ], [ %194, %192 ]
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 10
  %199 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %198, i64 noundef %197)
  %200 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 10
  %201 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %200)
  %202 = icmp eq i32 %201, 1
  br i1 %202, label %203, label %206

203:                                              ; preds = %195
  %204 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 10
  %205 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %204, i64 noundef 0)
  br label %206

206:                                              ; preds = %203, %195
  %207 = load i32, ptr %9, align 4, !tbaa !11
  %208 = zext i32 %207 to i64
  %209 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 12
  %210 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %209, i64 noundef %208)
  %211 = load i8, ptr %6, align 1, !tbaa !9, !range !15, !noundef !16
  %212 = trunc i8 %211 to i1
  %213 = zext i1 %212 to i64
  %214 = select i1 %212, i32 6, i32 1
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 11
  %217 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %216, i64 noundef %215)
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN6basisu13append_vectorINS_6vectorIhEEhEEvRT_PKT0_m(ptr noundef nonnull align 8 dereferenceable(16) %218, ptr noundef %17, i64 noundef 64)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %219

219:                                              ; preds = %313, %206
  %220 = load i32, ptr %18, align 4, !tbaa !11
  %221 = load i32, ptr %9, align 4, !tbaa !11
  %222 = icmp ult i32 %220, %221
  br i1 %222, label %224, label %223

223:                                              ; preds = %219
  store i32 9, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %316

224:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %225 = load ptr, ptr %5, align 8, !tbaa !5
  %226 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %225, i64 noundef 0)
  %227 = load i32, ptr %18, align 4, !tbaa !11
  %228 = zext i32 %227 to i64
  %229 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %226, i64 noundef %228)
  %230 = call noundef i32 @_ZNK6basisu9gpu_image17get_size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(48) %229)
  store i32 %230, ptr %19, align 4, !tbaa !11
  %231 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 11
  %232 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %231)
  %233 = icmp eq i32 %232, 1
  br i1 %233, label %238, label %234

234:                                              ; preds = %224
  %235 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 10
  %236 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %235)
  %237 = icmp ugt i32 %236, 1
  br i1 %237, label %238, label %247

238:                                              ; preds = %234, %224
  %239 = load i32, ptr %19, align 4, !tbaa !11
  %240 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 11
  %241 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %240)
  %242 = mul i32 %239, %241
  %243 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 10
  %244 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %243)
  %245 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %244)
  %246 = mul i32 %242, %245
  store i32 %246, ptr %19, align 4, !tbaa !11
  br label %247

247:                                              ; preds = %238, %234
  %248 = load i32, ptr %19, align 4, !tbaa !11
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %250, label %254

250:                                              ; preds = %247
  %251 = load i32, ptr %19, align 4, !tbaa !11
  %252 = and i32 %251, 3
  %253 = icmp eq i32 %252, 0
  br label %254

254:                                              ; preds = %250, %247
  %255 = phi i1 [ false, %247 ], [ %253, %250 ]
  br i1 %255, label %256, label %257

256:                                              ; preds = %254
  br label %259

257:                                              ; preds = %254
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 1523, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

258:                                              ; No predecessors!
  br label %259

259:                                              ; preds = %258, %256
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %260 = load i32, ptr %19, align 4, !tbaa !11
  %261 = zext i32 %260 to i64
  call void @_ZN6basisu11packed_uintILj4EEC2Em(ptr noundef nonnull align 1 dereferenceable(4) %20, i64 noundef %261)
  %262 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN6basisu13append_vectorINS_6vectorIhEEhEEvRT_PKT0_m(ptr noundef nonnull align 8 dereferenceable(16) %262, ptr noundef %20, i64 noundef 4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %263

263:                                              ; preds = %309, %259
  %264 = load i32, ptr %22, align 4, !tbaa !11
  %265 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 10
  %266 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %265)
  %267 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %266)
  %268 = icmp ult i32 %264, %267
  br i1 %268, label %270, label %269

269:                                              ; preds = %263
  store i32 12, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %312

270:                                              ; preds = %263
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %271

271:                                              ; preds = %305, %270
  %272 = load i32, ptr %23, align 4, !tbaa !11
  %273 = getelementptr inbounds %"struct.basisu::ktx_header", ptr %17, i32 0, i32 11
  %274 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %273)
  %275 = icmp ult i32 %272, %274
  br i1 %275, label %277, label %276

276:                                              ; preds = %271
  store i32 15, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %308

277:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %278 = load ptr, ptr %5, align 8, !tbaa !5
  %279 = load i8, ptr %6, align 1, !tbaa !9, !range !15, !noundef !16
  %280 = trunc i8 %279 to i1
  br i1 %280, label %281, label %286

281:                                              ; preds = %277
  %282 = load i32, ptr %22, align 4, !tbaa !11
  %283 = mul i32 %282, 6
  %284 = load i32, ptr %23, align 4, !tbaa !11
  %285 = add i32 %283, %284
  br label %288

286:                                              ; preds = %277
  %287 = load i32, ptr %22, align 4, !tbaa !11
  br label %288

288:                                              ; preds = %286, %281
  %289 = phi i32 [ %285, %281 ], [ %287, %286 ]
  %290 = zext i32 %289 to i64
  %291 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %278, i64 noundef %290)
  %292 = load i32, ptr %18, align 4, !tbaa !11
  %293 = zext i32 %292 to i64
  %294 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %291, i64 noundef %293)
  store ptr %294, ptr %24, align 8, !tbaa !5
  %295 = load ptr, ptr %4, align 8, !tbaa !5
  %296 = load ptr, ptr %24, align 8, !tbaa !5
  %297 = call noundef ptr @_ZNK6basisu9gpu_image7get_ptrEv(ptr noundef nonnull align 8 dereferenceable(48) %296)
  %298 = load ptr, ptr %24, align 8, !tbaa !5
  %299 = call noundef i32 @_ZNK6basisu9gpu_image17get_size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(48) %298)
  %300 = zext i32 %299 to i64
  call void @_ZN6basisu13append_vectorINS_6vectorIhEEhEEvRT_PKT0_m(ptr noundef nonnull align 8 dereferenceable(16) %295, ptr noundef %297, i64 noundef %300)
  %301 = load ptr, ptr %24, align 8, !tbaa !5
  %302 = call noundef i32 @_ZNK6basisu9gpu_image17get_size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(48) %301)
  %303 = load i32, ptr %21, align 4, !tbaa !11
  %304 = add i32 %303, %302
  store i32 %304, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %305

305:                                              ; preds = %288
  %306 = load i32, ptr %23, align 4, !tbaa !11
  %307 = add i32 %306, 1
  store i32 %307, ptr %23, align 4, !tbaa !11
  br label %271, !llvm.loop !20

308:                                              ; preds = %276
  br label %309

309:                                              ; preds = %308
  %310 = load i32, ptr %22, align 4, !tbaa !11
  %311 = add i32 %310, 1
  store i32 %311, ptr %22, align 4, !tbaa !11
  br label %263, !llvm.loop !21

312:                                              ; preds = %269
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %313

313:                                              ; preds = %312
  %314 = load i32, ptr %18, align 4, !tbaa !11
  %315 = add i32 %314, 1
  store i32 %315, ptr %18, align 4, !tbaa !11
  br label %219, !llvm.loop !22

316:                                              ; preds = %223
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 64, 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 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  ret i1 true
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu10ktx_header5clearEv(ptr noundef nonnull align 1 dereferenceable(64)) #5 align 2

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN6basisu14texture_formatE", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


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

%"struct.basisu::ktx_header" = type { [12 x i8], %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint", %"struct.basisu::packed_uint" }
%"struct.basisu::packed_uint" = type { [4 x i8] }

@.str.3 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb = external hidden unnamed_addr constant [95 x i8], align 1
@_ZN6basisuL13g_ktx_file_idE = external hidden local_unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@switch.table._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb = private unnamed_addr constant [22 x i64] [i64 36196, i64 36196, i64 37492, i64 37496, i64 33776, i64 33776, i64 33779, i64 36283, i64 36285, i64 36492, i64 37808, i64 35840, i64 35842, i64 35986, i64 34798, i64 34480, i64 37176, i64 37488, i64 37490, i64 38092, i64 33776, i64 33776], align 8
@switch.table._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb.1 = private unnamed_addr constant [22 x i64] [i64 6407, i64 6407, i64 6407, i64 6408, i64 6407, i64 6407, i64 6408, i64 6403, i64 33319, i64 6408, i64 6408, i64 6407, i64 6408, i64 6407, i64 6408, i64 6407, i64 6408, i64 6403, i64 33319, i64 6408, i64 6407, i64 6407], align 8

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext %2) local_unnamed_addr #5 {
  %4 = alloca %"struct.basisu::ktx_header", align 1
  %5 = alloca %"struct.basisu::packed_uint", align 1
  %6 = tail call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %7, label %8

7:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 1309, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

8:                                                ; preds = %3
  br i1 %2, label %9, label %13

9:                                                ; preds = %8
  %10 = tail call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %11 = urem i32 %10, 6
  %.not86 = icmp eq i32 %11, 0
  br i1 %.not86, label %13, label %12

12:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 1320, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

13:                                               ; preds = %9, %8
  %14 = tail call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %.not137 = icmp eq i32 %14, 0
  br i1 %.not137, label %._crit_edge120.thread, label %.lr.ph119

._crit_edge120:                                   ; preds = %._crit_edge
  %15 = icmp ult i32 %.183, 22
  br i1 %15, label %switch.hole_check, label %._crit_edge120.thread

.lr.ph119:                                        ; preds = %13, %._crit_edge
  %indvars.iv158 = phi i64 [ %indvars.iv.next159, %._crit_edge ], [ 0, %13 ]
  %.0117 = phi i32 [ %.1, %._crit_edge ], [ 0, %13 ]
  %.079116 = phi i32 [ %.180, %._crit_edge ], [ 0, %13 ]
  %.082114 = phi i32 [ %.183, %._crit_edge ], [ -1, %13 ]
  %.084113 = phi i32 [ %.185, %._crit_edge ], [ 0, %13 ]
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %indvars.iv158)
  %17 = tail call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %.not87 = icmp eq i32 %17, 0
  br i1 %.not87, label %18, label %19

18:                                               ; preds = %.lr.ph119
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 1332, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

19:                                               ; preds = %.lr.ph119
  %.not88 = icmp eq i64 %indvars.iv158, 0
  %20 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0)
  %21 = tail call noundef i32 @_ZNK6basisu9gpu_image15get_pixel_widthEv(ptr noundef nonnull align 8 dereferenceable(48) %20)
  br i1 %.not88, label %22, label %28

22:                                               ; preds = %19
  %23 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0)
  %24 = tail call noundef i32 @_ZNK6basisu9gpu_image16get_pixel_heightEv(ptr noundef nonnull align 8 dereferenceable(48) %23)
  %25 = tail call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %26 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0)
  %27 = tail call noundef i32 @_ZNK6basisu9gpu_image10get_formatEv(ptr noundef nonnull align 8 dereferenceable(48) %26)
  br label %35

28:                                               ; preds = %19
  %.not89 = icmp eq i32 %.0117, %21
  br i1 %.not89, label %29, label %34

29:                                               ; preds = %28
  %30 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0)
  %31 = tail call noundef i32 @_ZNK6basisu9gpu_image16get_pixel_heightEv(ptr noundef nonnull align 8 dereferenceable(48) %30)
  %.not90 = icmp eq i32 %.079116, %31
  br i1 %.not90, label %32, label %34

32:                                               ; preds = %29
  %33 = tail call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %.not91 = icmp eq i32 %.084113, %33
  br i1 %.not91, label %35, label %34

34:                                               ; preds = %32, %29, %28
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 1350, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

35:                                               ; preds = %32, %22
  %.185 = phi i32 [ %.084113, %32 ], [ %25, %22 ]
  %.183 = phi i32 [ %.082114, %32 ], [ %27, %22 ]
  %.180 = phi i32 [ %.079116, %32 ], [ %24, %22 ]
  %.1 = phi i32 [ %.0117, %32 ], [ %21, %22 ]
  %36 = tail call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %.not138 = icmp eq i32 %36, 0
  br i1 %.not138, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %35
  %37 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0)
  %38 = tail call noundef i32 @_ZNK6basisu9gpu_image10get_formatEv(ptr noundef nonnull align 8 dereferenceable(48) %37)
  %.not95.peel = icmp eq i32 %.183, %38
  br i1 %.not95.peel, label %39, label %.loopexit155

39:                                               ; preds = %.lr.ph.preheader
  %40 = tail call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %41 = icmp ugt i32 %40, 1
  br i1 %41, label %.lr.ph.peel.next, label %._crit_edge

42:                                               ; preds = %63
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %43 = tail call noundef i32 @_ZNK6basisu6vectorINS_9gpu_imageEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
  %44 = zext i32 %43 to i64
  %45 = icmp ult i64 %indvars.iv.next, %44
  br i1 %45, label %.lr.ph.peel.next, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %42, %39, %35
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %46 = tail call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %47 = zext i32 %46 to i64
  %48 = icmp ult i64 %indvars.iv.next159, %47
  br i1 %48, label %.lr.ph119, label %._crit_edge120, !llvm.loop !8

.lr.ph.peel.next:                                 ; preds = %39, %42
  %indvars.iv = phi i64 [ %indvars.iv.next, %42 ], [ 1, %39 ]
  %49 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %indvars.iv)
  %50 = tail call noundef i32 @_ZNK6basisu9gpu_image15get_pixel_widthEv(ptr noundef nonnull align 8 dereferenceable(48) %49)
  %51 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0)
  %52 = tail call noundef i32 @_ZNK6basisu9gpu_image15get_pixel_widthEv(ptr noundef nonnull align 8 dereferenceable(48) %51)
  %53 = trunc nuw i64 %indvars.iv to i32
  %54 = lshr i32 %52, %53
  %55 = tail call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %54)
  %.not93 = icmp eq i32 %50, %55
  br i1 %.not93, label %56, label %.loopexit

56:                                               ; preds = %.lr.ph.peel.next
  %57 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %indvars.iv)
  %58 = tail call noundef i32 @_ZNK6basisu9gpu_image16get_pixel_heightEv(ptr noundef nonnull align 8 dereferenceable(48) %57)
  %59 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 0)
  %60 = tail call noundef i32 @_ZNK6basisu9gpu_image16get_pixel_heightEv(ptr noundef nonnull align 8 dereferenceable(48) %59)
  %61 = lshr i32 %60, %53
  %62 = tail call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %61)
  %.not94 = icmp eq i32 %58, %62
  br i1 %.not94, label %63, label %.loopexit

.loopexit:                                        ; preds = %56, %.lr.ph.peel.next
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 1363, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

63:                                               ; preds = %56
  %64 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %indvars.iv)
  %65 = tail call noundef i32 @_ZNK6basisu9gpu_image10get_formatEv(ptr noundef nonnull align 8 dereferenceable(48) %64)
  %.not95 = icmp eq i32 %.183, %65
  br i1 %.not95, label %42, label %.loopexit155

.loopexit155:                                     ; preds = %.lr.ph.preheader, %63
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 1371, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

._crit_edge120.thread:                            ; preds = %switch.hole_check, %._crit_edge120, %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 1489, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

switch.hole_check:                                ; preds = %._crit_edge120
  %switch.shifted = lshr i32 4194287, %.183
  %switch.lobit = trunc i32 %switch.shifted to i1
  br i1 %switch.lobit, label %switch.lookup, label %._crit_edge120.thread

switch.lookup:                                    ; preds = %switch.hole_check
  %66 = zext nneg i32 %.183 to i64
  %switch.gep = getelementptr inbounds [22 x i64], ptr @switch.table._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb, i64 0, i64 %66
  %switch.load = load i64, ptr %switch.gep, align 8
  %67 = zext nneg i32 %.183 to i64
  %switch.gep203 = getelementptr inbounds [22 x i64], ptr @switch.table._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb.1, i64 0, i64 %67
  %switch.load204 = load i64, ptr %switch.gep203, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #7
  call void @_ZN6basisu10ktx_headerC2Ev(ptr noundef nonnull align 1 dereferenceable(64) %4)
  call void @_ZN6basisu10ktx_header5clearEv(ptr noundef nonnull align 1 dereferenceable(64) %4)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %4, ptr noundef nonnull align 1 dereferenceable(12) @_ZN6basisuL13g_ktx_file_idE, i64 12, i1 false)
  %68 = getelementptr inbounds i8, ptr %4, i64 12
  %69 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %68, i64 noundef 67305985)
  %70 = zext i32 %.1 to i64
  %71 = getelementptr inbounds i8, ptr %4, i64 36
  %72 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %71, i64 noundef %70)
  %73 = zext i32 %.180 to i64
  %74 = getelementptr inbounds i8, ptr %4, i64 40
  %75 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %74, i64 noundef %73)
  %76 = getelementptr inbounds i8, ptr %4, i64 28
  %77 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %76, i64 noundef %switch.load)
  %78 = getelementptr inbounds i8, ptr %4, i64 32
  %79 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %78, i64 noundef %switch.load204)
  %80 = call noundef i32 @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %81 = udiv i32 %80, 6
  %82 = select i1 %2, i32 %81, i32 %80
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %4, i64 48
  %85 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %84, i64 noundef %83)
  %86 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %84)
  %87 = icmp eq i32 %86, 1
  br i1 %87, label %88, label %90

88:                                               ; preds = %switch.lookup
  %89 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %84, i64 noundef 0)
  br label %90

90:                                               ; preds = %88, %switch.lookup
  %91 = zext i32 %.185 to i64
  %92 = getelementptr inbounds i8, ptr %4, i64 56
  %93 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %92, i64 noundef %91)
  %94 = select i1 %2, i64 6, i64 1
  %95 = getelementptr inbounds i8, ptr %4, i64 52
  %96 = call noundef nonnull align 1 dereferenceable(4) ptr @_ZN6basisu11packed_uintILj4EEaSEm(ptr noundef nonnull align 1 dereferenceable(4) %95, i64 noundef %94)
  call void @_ZN6basisu13append_vectorINS_6vectorIhEEhEEvRT_PKT0_m(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull %4, i64 noundef 64)
  %.not139 = icmp eq i32 %.185, 0
  br i1 %.not139, label %._crit_edge136, label %.lr.ph135

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

.lr.ph135:                                        ; preds = %90, %._crit_edge132
  %indvars.iv167 = phi i64 [ %indvars.iv.next168, %._crit_edge132 ], [ 0, %90 ]
  %97 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef 0)
  %98 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %97, i64 noundef %indvars.iv167)
  %99 = call noundef i32 @_ZNK6basisu9gpu_image17get_size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(48) %98)
  %100 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %95)
  %101 = icmp eq i32 %100, 1
  br i1 %101, label %105, label %102

102:                                              ; preds = %.lr.ph135
  %103 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %84)
  %104 = icmp ugt i32 %103, 1
  br i1 %104, label %105, label %111

105:                                              ; preds = %102, %.lr.ph135
  %106 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %95)
  %107 = mul i32 %106, %99
  %108 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %84)
  %109 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %108)
  %110 = mul i32 %107, %109
  br label %111

111:                                              ; preds = %105, %102
  %.074 = phi i32 [ %110, %105 ], [ %99, %102 ]
  %112 = icmp ne i32 %.074, 0
  %113 = and i32 %.074, 3
  %114 = icmp eq i32 %113, 0
  %115 = and i1 %112, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %111
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 1523, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu23create_ktx_texture_fileERNS_6vectorIhEERKNS0_INS0_INS_9gpu_imageEEEEEb) #6
  unreachable

117:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %118 = zext i32 %.074 to i64
  call void @_ZN6basisu11packed_uintILj4EEC2Em(ptr noundef nonnull align 1 dereferenceable(4) %5, i64 noundef %118)
  call void @_ZN6basisu13append_vectorINS_6vectorIhEEhEEvRT_PKT0_m(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull %5, i64 noundef 4)
  %119 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %84)
  %120 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %119)
  %.not140 = icmp eq i32 %120, 0
  br i1 %.not140, label %._crit_edge132, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %117
  br i1 %2, label %.preheader.us, label %.preheader

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge127.split.us.us
  %.071130.us = phi i32 [ %122, %._crit_edge127.split.us.us ], [ 0, %.preheader.lr.ph ]
  %121 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %95)
  %.not142 = icmp eq i32 %121, 0
  br i1 %.not142, label %._crit_edge127.split.us.us, label %.lr.ph126.us

._crit_edge127.split.us.us:                       ; preds = %127, %.preheader.us
  %122 = add nuw i32 %.071130.us, 1
  %123 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %84)
  %124 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %123)
  %125 = icmp ult i32 %122, %124
  br i1 %125, label %.preheader.us, label %._crit_edge132, !llvm.loop !9

.lr.ph126.us:                                     ; preds = %.preheader.us
  %126 = mul i32 %.071130.us, 6
  br label %127

127:                                              ; preds = %127, %.lr.ph126.us
  %indvars.iv164 = phi i64 [ %indvars.iv.next165, %127 ], [ 0, %.lr.ph126.us ]
  %128 = trunc nuw i64 %indvars.iv164 to i32
  %129 = add i32 %126, %128
  %130 = zext i32 %129 to i64
  %131 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %130)
  %132 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %131, i64 noundef %indvars.iv167)
  %133 = call noundef ptr @_ZNK6basisu9gpu_image7get_ptrEv(ptr noundef nonnull align 8 dereferenceable(48) %132)
  %134 = call noundef i32 @_ZNK6basisu9gpu_image17get_size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(48) %132)
  %135 = zext i32 %134 to i64
  call void @_ZN6basisu13append_vectorINS_6vectorIhEEhEEvRT_PKT0_m(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %133, i64 noundef %135)
  %136 = call noundef i32 @_ZNK6basisu9gpu_image17get_size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(48) %132)
  %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
  %137 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %95)
  %138 = zext i32 %137 to i64
  %139 = icmp ult i64 %indvars.iv.next165, %138
  br i1 %139, label %127, label %._crit_edge127.split.us.us, !llvm.loop !10

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge127.split
  %indvars.iv161 = phi i64 [ %indvars.iv.next162, %._crit_edge127.split ], [ 0, %.preheader.lr.ph ]
  %140 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %95)
  %.not141 = icmp eq i32 %140, 0
  br i1 %.not141, label %._crit_edge127.split, label %.lr.ph126

._crit_edge132:                                   ; preds = %._crit_edge127.split, %._crit_edge127.split.us.us, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next168, %91
  br i1 %exitcond.not, label %._crit_edge136, label %.lr.ph135, !llvm.loop !11

._crit_edge127.split:                             ; preds = %.lr.ph126, %.preheader
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %141 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %84)
  %142 = call noundef i32 @_ZN6basisu7maximumIjEET_S1_S1_(i32 noundef 1, i32 noundef %141)
  %143 = zext i32 %142 to i64
  %144 = icmp ult i64 %indvars.iv.next162, %143
  br i1 %144, label %.preheader, label %._crit_edge132, !llvm.loop !9

.lr.ph126:                                        ; preds = %.preheader, %.lr.ph126
  %.070125 = phi i32 [ %151, %.lr.ph126 ], [ 0, %.preheader ]
  %145 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu6vectorINS0_INS_9gpu_imageEEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %indvars.iv161)
  %146 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK6basisu6vectorINS_9gpu_imageEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %145, i64 noundef %indvars.iv167)
  %147 = call noundef ptr @_ZNK6basisu9gpu_image7get_ptrEv(ptr noundef nonnull align 8 dereferenceable(48) %146)
  %148 = call noundef i32 @_ZNK6basisu9gpu_image17get_size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(48) %146)
  %149 = zext i32 %148 to i64
  call void @_ZN6basisu13append_vectorINS_6vectorIhEEhEEvRT_PKT0_m(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %147, i64 noundef %149)
  %150 = call noundef i32 @_ZNK6basisu9gpu_image17get_size_in_bytesEv(ptr noundef nonnull align 8 dereferenceable(48) %146)
  %151 = add nuw i32 %.070125, 1
  %152 = call noundef i32 @_ZNK6basisu11packed_uintILj4EEcvjEv(ptr noundef nonnull align 1 dereferenceable(4) %95)
  %153 = icmp ult i32 %151, %152
  br i1 %153, label %.lr.ph126, label %._crit_edge127.split, !llvm.loop !10
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu10ktx_header5clearEv(ptr noundef nonnull align 1 dereferenceable(64)) local_unnamed_addr #5 align 2

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

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

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

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

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


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