; 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"

%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%struct.anon = type { i8, i8, i8, i8 }

@_ZN6basisu17g_etc2_eac_tablesE = external constant [16 x [8 x i8]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15unpack_etc2_eacEPKvPNS_10color_rgbaE(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %10, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = load i16, ptr %11, align 2
  %13 = lshr i16 %12, 8
  %14 = and i16 %13, 15
  %15 = zext i16 %14 to i64
  %16 = getelementptr inbounds [16 x [8 x i8]], ptr @_ZN6basisu17g_etc2_eac_tablesE, i64 0, i64 %15
  %17 = getelementptr inbounds [8 x i8], ptr %16, i64 0, i64 0
  store ptr %17, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call noundef i64 @_ZNK6basisu12eac_a8_block17get_selector_bitsEv(ptr noundef nonnull align 2 dereferenceable(8) %18)
  store i64 %19, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = load i16, ptr %20, align 2
  %22 = and i16 %21, 255
  %23 = zext i16 %22 to i32
  store i32 %23, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load i16, ptr %24, align 2
  %26 = lshr i16 %25, 12
  %27 = zext i16 %26 to i32
  store i32 %27, ptr %9, align 4, !tbaa !11
  %28 = load i32, ptr %8, align 4, !tbaa !11
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = load i64, ptr %7, align 8, !tbaa !9
  %32 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %30, i32 noundef 0, i32 noundef 0, i64 noundef %31)
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %29, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !13
  %36 = sext i8 %35 to i32
  %37 = load i32, ptr %9, align 4, !tbaa !11
  %38 = mul nsw i32 %36, %37
  %39 = add nsw i32 %28, %38
  %40 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %39)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.basisu::color_rgba", ptr %41, i64 0
  %43 = getelementptr inbounds %"class.basisu::color_rgba", ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds %struct.anon, ptr %43, i32 0, i32 3
  store i8 %40, ptr %44, align 1, !tbaa !13
  %45 = load i32, ptr %8, align 4, !tbaa !11
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = load i64, ptr %7, align 8, !tbaa !9
  %49 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %47, i32 noundef 1, i32 noundef 0, i64 noundef %48)
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds i8, ptr %46, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !13
  %53 = sext i8 %52 to i32
  %54 = load i32, ptr %9, align 4, !tbaa !11
  %55 = mul nsw i32 %53, %54
  %56 = add nsw i32 %45, %55
  %57 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %56)
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %"class.basisu::color_rgba", ptr %58, i64 1
  %60 = getelementptr inbounds %"class.basisu::color_rgba", ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %struct.anon, ptr %60, i32 0, i32 3
  store i8 %57, ptr %61, align 1, !tbaa !13
  %62 = load i32, ptr %8, align 4, !tbaa !11
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load i64, ptr %7, align 8, !tbaa !9
  %66 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %64, i32 noundef 2, i32 noundef 0, i64 noundef %65)
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds i8, ptr %63, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !13
  %70 = sext i8 %69 to i32
  %71 = load i32, ptr %9, align 4, !tbaa !11
  %72 = mul nsw i32 %70, %71
  %73 = add nsw i32 %62, %72
  %74 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %73)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.basisu::color_rgba", ptr %75, i64 2
  %77 = getelementptr inbounds %"class.basisu::color_rgba", ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.anon, ptr %77, i32 0, i32 3
  store i8 %74, ptr %78, align 1, !tbaa !13
  %79 = load i32, ptr %8, align 4, !tbaa !11
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load i64, ptr %7, align 8, !tbaa !9
  %83 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %81, i32 noundef 3, i32 noundef 0, i64 noundef %82)
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds i8, ptr %80, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !13
  %87 = sext i8 %86 to i32
  %88 = load i32, ptr %9, align 4, !tbaa !11
  %89 = mul nsw i32 %87, %88
  %90 = add nsw i32 %79, %89
  %91 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %90)
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.basisu::color_rgba", ptr %92, i64 3
  %94 = getelementptr inbounds %"class.basisu::color_rgba", ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds %struct.anon, ptr %94, i32 0, i32 3
  store i8 %91, ptr %95, align 1, !tbaa !13
  %96 = load i32, ptr %8, align 4, !tbaa !11
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load i64, ptr %7, align 8, !tbaa !9
  %100 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %98, i32 noundef 0, i32 noundef 1, i64 noundef %99)
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %97, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !13
  %104 = sext i8 %103 to i32
  %105 = load i32, ptr %9, align 4, !tbaa !11
  %106 = mul nsw i32 %104, %105
  %107 = add nsw i32 %96, %106
  %108 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %107)
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %"class.basisu::color_rgba", ptr %109, i64 4
  %111 = getelementptr inbounds %"class.basisu::color_rgba", ptr %110, i32 0, i32 0
  %112 = getelementptr inbounds %struct.anon, ptr %111, i32 0, i32 3
  store i8 %108, ptr %112, align 1, !tbaa !13
  %113 = load i32, ptr %8, align 4, !tbaa !11
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load i64, ptr %7, align 8, !tbaa !9
  %117 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %115, i32 noundef 1, i32 noundef 1, i64 noundef %116)
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds i8, ptr %114, i64 %118
  %120 = load i8, ptr %119, align 1, !tbaa !13
  %121 = sext i8 %120 to i32
  %122 = load i32, ptr %9, align 4, !tbaa !11
  %123 = mul nsw i32 %121, %122
  %124 = add nsw i32 %113, %123
  %125 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %124)
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %"class.basisu::color_rgba", ptr %126, i64 5
  %128 = getelementptr inbounds %"class.basisu::color_rgba", ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds %struct.anon, ptr %128, i32 0, i32 3
  store i8 %125, ptr %129, align 1, !tbaa !13
  %130 = load i32, ptr %8, align 4, !tbaa !11
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = load i64, ptr %7, align 8, !tbaa !9
  %134 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %132, i32 noundef 2, i32 noundef 1, i64 noundef %133)
  %135 = zext i32 %134 to i64
  %136 = getelementptr inbounds i8, ptr %131, i64 %135
  %137 = load i8, ptr %136, align 1, !tbaa !13
  %138 = sext i8 %137 to i32
  %139 = load i32, ptr %9, align 4, !tbaa !11
  %140 = mul nsw i32 %138, %139
  %141 = add nsw i32 %130, %140
  %142 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %141)
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %"class.basisu::color_rgba", ptr %143, i64 6
  %145 = getelementptr inbounds %"class.basisu::color_rgba", ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.anon, ptr %145, i32 0, i32 3
  store i8 %142, ptr %146, align 1, !tbaa !13
  %147 = load i32, ptr %8, align 4, !tbaa !11
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = load i64, ptr %7, align 8, !tbaa !9
  %151 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %149, i32 noundef 3, i32 noundef 1, i64 noundef %150)
  %152 = zext i32 %151 to i64
  %153 = getelementptr inbounds i8, ptr %148, i64 %152
  %154 = load i8, ptr %153, align 1, !tbaa !13
  %155 = sext i8 %154 to i32
  %156 = load i32, ptr %9, align 4, !tbaa !11
  %157 = mul nsw i32 %155, %156
  %158 = add nsw i32 %147, %157
  %159 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %158)
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %"class.basisu::color_rgba", ptr %160, i64 7
  %162 = getelementptr inbounds %"class.basisu::color_rgba", ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds %struct.anon, ptr %162, i32 0, i32 3
  store i8 %159, ptr %163, align 1, !tbaa !13
  %164 = load i32, ptr %8, align 4, !tbaa !11
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load i64, ptr %7, align 8, !tbaa !9
  %168 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %166, i32 noundef 0, i32 noundef 2, i64 noundef %167)
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds i8, ptr %165, i64 %169
  %171 = load i8, ptr %170, align 1, !tbaa !13
  %172 = sext i8 %171 to i32
  %173 = load i32, ptr %9, align 4, !tbaa !11
  %174 = mul nsw i32 %172, %173
  %175 = add nsw i32 %164, %174
  %176 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %175)
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = getelementptr inbounds %"class.basisu::color_rgba", ptr %177, i64 8
  %179 = getelementptr inbounds %"class.basisu::color_rgba", ptr %178, i32 0, i32 0
  %180 = getelementptr inbounds %struct.anon, ptr %179, i32 0, i32 3
  store i8 %176, ptr %180, align 1, !tbaa !13
  %181 = load i32, ptr %8, align 4, !tbaa !11
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = load i64, ptr %7, align 8, !tbaa !9
  %185 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %183, i32 noundef 1, i32 noundef 2, i64 noundef %184)
  %186 = zext i32 %185 to i64
  %187 = getelementptr inbounds i8, ptr %182, i64 %186
  %188 = load i8, ptr %187, align 1, !tbaa !13
  %189 = sext i8 %188 to i32
  %190 = load i32, ptr %9, align 4, !tbaa !11
  %191 = mul nsw i32 %189, %190
  %192 = add nsw i32 %181, %191
  %193 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %192)
  %194 = load ptr, ptr %4, align 8, !tbaa !5
  %195 = getelementptr inbounds %"class.basisu::color_rgba", ptr %194, i64 9
  %196 = getelementptr inbounds %"class.basisu::color_rgba", ptr %195, i32 0, i32 0
  %197 = getelementptr inbounds %struct.anon, ptr %196, i32 0, i32 3
  store i8 %193, ptr %197, align 1, !tbaa !13
  %198 = load i32, ptr %8, align 4, !tbaa !11
  %199 = load ptr, ptr %6, align 8, !tbaa !5
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = load i64, ptr %7, align 8, !tbaa !9
  %202 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %200, i32 noundef 2, i32 noundef 2, i64 noundef %201)
  %203 = zext i32 %202 to i64
  %204 = getelementptr inbounds i8, ptr %199, i64 %203
  %205 = load i8, ptr %204, align 1, !tbaa !13
  %206 = sext i8 %205 to i32
  %207 = load i32, ptr %9, align 4, !tbaa !11
  %208 = mul nsw i32 %206, %207
  %209 = add nsw i32 %198, %208
  %210 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %209)
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %"class.basisu::color_rgba", ptr %211, i64 10
  %213 = getelementptr inbounds %"class.basisu::color_rgba", ptr %212, i32 0, i32 0
  %214 = getelementptr inbounds %struct.anon, ptr %213, i32 0, i32 3
  store i8 %210, ptr %214, align 1, !tbaa !13
  %215 = load i32, ptr %8, align 4, !tbaa !11
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = load i64, ptr %7, align 8, !tbaa !9
  %219 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %217, i32 noundef 3, i32 noundef 2, i64 noundef %218)
  %220 = zext i32 %219 to i64
  %221 = getelementptr inbounds i8, ptr %216, i64 %220
  %222 = load i8, ptr %221, align 1, !tbaa !13
  %223 = sext i8 %222 to i32
  %224 = load i32, ptr %9, align 4, !tbaa !11
  %225 = mul nsw i32 %223, %224
  %226 = add nsw i32 %215, %225
  %227 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %226)
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  %229 = getelementptr inbounds %"class.basisu::color_rgba", ptr %228, i64 11
  %230 = getelementptr inbounds %"class.basisu::color_rgba", ptr %229, i32 0, i32 0
  %231 = getelementptr inbounds %struct.anon, ptr %230, i32 0, i32 3
  store i8 %227, ptr %231, align 1, !tbaa !13
  %232 = load i32, ptr %8, align 4, !tbaa !11
  %233 = load ptr, ptr %6, align 8, !tbaa !5
  %234 = load ptr, ptr %5, align 8, !tbaa !5
  %235 = load i64, ptr %7, align 8, !tbaa !9
  %236 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %234, i32 noundef 0, i32 noundef 3, i64 noundef %235)
  %237 = zext i32 %236 to i64
  %238 = getelementptr inbounds i8, ptr %233, i64 %237
  %239 = load i8, ptr %238, align 1, !tbaa !13
  %240 = sext i8 %239 to i32
  %241 = load i32, ptr %9, align 4, !tbaa !11
  %242 = mul nsw i32 %240, %241
  %243 = add nsw i32 %232, %242
  %244 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %243)
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = getelementptr inbounds %"class.basisu::color_rgba", ptr %245, i64 12
  %247 = getelementptr inbounds %"class.basisu::color_rgba", ptr %246, i32 0, i32 0
  %248 = getelementptr inbounds %struct.anon, ptr %247, i32 0, i32 3
  store i8 %244, ptr %248, align 1, !tbaa !13
  %249 = load i32, ptr %8, align 4, !tbaa !11
  %250 = load ptr, ptr %6, align 8, !tbaa !5
  %251 = load ptr, ptr %5, align 8, !tbaa !5
  %252 = load i64, ptr %7, align 8, !tbaa !9
  %253 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %251, i32 noundef 1, i32 noundef 3, i64 noundef %252)
  %254 = zext i32 %253 to i64
  %255 = getelementptr inbounds i8, ptr %250, i64 %254
  %256 = load i8, ptr %255, align 1, !tbaa !13
  %257 = sext i8 %256 to i32
  %258 = load i32, ptr %9, align 4, !tbaa !11
  %259 = mul nsw i32 %257, %258
  %260 = add nsw i32 %249, %259
  %261 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %260)
  %262 = load ptr, ptr %4, align 8, !tbaa !5
  %263 = getelementptr inbounds %"class.basisu::color_rgba", ptr %262, i64 13
  %264 = getelementptr inbounds %"class.basisu::color_rgba", ptr %263, i32 0, i32 0
  %265 = getelementptr inbounds %struct.anon, ptr %264, i32 0, i32 3
  store i8 %261, ptr %265, align 1, !tbaa !13
  %266 = load i32, ptr %8, align 4, !tbaa !11
  %267 = load ptr, ptr %6, align 8, !tbaa !5
  %268 = load ptr, ptr %5, align 8, !tbaa !5
  %269 = load i64, ptr %7, align 8, !tbaa !9
  %270 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %268, i32 noundef 2, i32 noundef 3, i64 noundef %269)
  %271 = zext i32 %270 to i64
  %272 = getelementptr inbounds i8, ptr %267, i64 %271
  %273 = load i8, ptr %272, align 1, !tbaa !13
  %274 = sext i8 %273 to i32
  %275 = load i32, ptr %9, align 4, !tbaa !11
  %276 = mul nsw i32 %274, %275
  %277 = add nsw i32 %266, %276
  %278 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %277)
  %279 = load ptr, ptr %4, align 8, !tbaa !5
  %280 = getelementptr inbounds %"class.basisu::color_rgba", ptr %279, i64 14
  %281 = getelementptr inbounds %"class.basisu::color_rgba", ptr %280, i32 0, i32 0
  %282 = getelementptr inbounds %struct.anon, ptr %281, i32 0, i32 3
  store i8 %278, ptr %282, align 1, !tbaa !13
  %283 = load i32, ptr %8, align 4, !tbaa !11
  %284 = load ptr, ptr %6, align 8, !tbaa !5
  %285 = load ptr, ptr %5, align 8, !tbaa !5
  %286 = load i64, ptr %7, align 8, !tbaa !9
  %287 = call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %285, i32 noundef 3, i32 noundef 3, i64 noundef %286)
  %288 = zext i32 %287 to i64
  %289 = getelementptr inbounds i8, ptr %284, i64 %288
  %290 = load i8, ptr %289, align 1, !tbaa !13
  %291 = sext i8 %290 to i32
  %292 = load i32, ptr %9, align 4, !tbaa !11
  %293 = mul nsw i32 %291, %292
  %294 = add nsw i32 %283, %293
  %295 = call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %294)
  %296 = load ptr, ptr %4, align 8, !tbaa !5
  %297 = getelementptr inbounds %"class.basisu::color_rgba", ptr %296, i64 15
  %298 = getelementptr inbounds %"class.basisu::color_rgba", ptr %297, i32 0, i32 0
  %299 = getelementptr inbounds %struct.anon, ptr %298, i32 0, i32 3
  store i8 %295, ptr %299, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef) #2

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

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

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


; 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"

@_ZN6basisu17g_etc2_eac_tablesE = external local_unnamed_addr constant [16 x [8 x i8]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6basisu15unpack_etc2_eacEPKvPNS_10color_rgbaE(ptr noundef nonnull %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #0 {
  %3 = load i16, ptr %0, align 2
  %4 = lshr i16 %3, 8
  %5 = and i16 %4, 15
  %6 = zext nneg i16 %5 to i64
  %7 = getelementptr inbounds [16 x [8 x i8]], ptr @_ZN6basisu17g_etc2_eac_tablesE, i64 0, i64 %6
  %8 = tail call noundef i64 @_ZNK6basisu12eac_a8_block17get_selector_bitsEv(ptr noundef nonnull align 2 dereferenceable(8) %0)
  %9 = load i16, ptr %0, align 2
  %10 = and i16 %9, 255
  %11 = zext nneg i16 %10 to i32
  %12 = lshr i16 %9, 12
  %13 = zext nneg i16 %12 to i32
  %14 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 0, i32 noundef 0, i64 noundef %8)
  %15 = zext i32 %14 to i64
  %16 = getelementptr inbounds i8, ptr %7, i64 %15
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = sext i8 %17 to i32
  %19 = mul nsw i32 %18, %13
  %20 = add nsw i32 %19, %11
  %21 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %20)
  %22 = getelementptr inbounds i8, ptr %1, i64 3
  store i8 %21, ptr %22, align 1, !tbaa !5
  %23 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 1, i32 noundef 0, i64 noundef %8)
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds i8, ptr %7, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = sext i8 %26 to i32
  %28 = mul nsw i32 %27, %13
  %29 = add nsw i32 %28, %11
  %30 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %29)
  %31 = getelementptr inbounds i8, ptr %1, i64 7
  store i8 %30, ptr %31, align 1, !tbaa !5
  %32 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 2, i32 noundef 0, i64 noundef %8)
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %7, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !5
  %36 = sext i8 %35 to i32
  %37 = mul nsw i32 %36, %13
  %38 = add nsw i32 %37, %11
  %39 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %38)
  %40 = getelementptr inbounds i8, ptr %1, i64 11
  store i8 %39, ptr %40, align 1, !tbaa !5
  %41 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 3, i32 noundef 0, i64 noundef %8)
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %7, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = sext i8 %44 to i32
  %46 = mul nsw i32 %45, %13
  %47 = add nsw i32 %46, %11
  %48 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %47)
  %49 = getelementptr inbounds i8, ptr %1, i64 15
  store i8 %48, ptr %49, align 1, !tbaa !5
  %50 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 0, i32 noundef 1, i64 noundef %8)
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds i8, ptr %7, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !5
  %54 = sext i8 %53 to i32
  %55 = mul nsw i32 %54, %13
  %56 = add nsw i32 %55, %11
  %57 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %56)
  %58 = getelementptr inbounds i8, ptr %1, i64 19
  store i8 %57, ptr %58, align 1, !tbaa !5
  %59 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 1, i32 noundef 1, i64 noundef %8)
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %7, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !5
  %63 = sext i8 %62 to i32
  %64 = mul nsw i32 %63, %13
  %65 = add nsw i32 %64, %11
  %66 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %65)
  %67 = getelementptr inbounds i8, ptr %1, i64 23
  store i8 %66, ptr %67, align 1, !tbaa !5
  %68 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 2, i32 noundef 1, i64 noundef %8)
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %7, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !5
  %72 = sext i8 %71 to i32
  %73 = mul nsw i32 %72, %13
  %74 = add nsw i32 %73, %11
  %75 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %74)
  %76 = getelementptr inbounds i8, ptr %1, i64 27
  store i8 %75, ptr %76, align 1, !tbaa !5
  %77 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 3, i32 noundef 1, i64 noundef %8)
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %7, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !5
  %81 = sext i8 %80 to i32
  %82 = mul nsw i32 %81, %13
  %83 = add nsw i32 %82, %11
  %84 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %83)
  %85 = getelementptr inbounds i8, ptr %1, i64 31
  store i8 %84, ptr %85, align 1, !tbaa !5
  %86 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 0, i32 noundef 2, i64 noundef %8)
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds i8, ptr %7, i64 %87
  %89 = load i8, ptr %88, align 1, !tbaa !5
  %90 = sext i8 %89 to i32
  %91 = mul nsw i32 %90, %13
  %92 = add nsw i32 %91, %11
  %93 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %92)
  %94 = getelementptr inbounds i8, ptr %1, i64 35
  store i8 %93, ptr %94, align 1, !tbaa !5
  %95 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 1, i32 noundef 2, i64 noundef %8)
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %7, i64 %96
  %98 = load i8, ptr %97, align 1, !tbaa !5
  %99 = sext i8 %98 to i32
  %100 = mul nsw i32 %99, %13
  %101 = add nsw i32 %100, %11
  %102 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %101)
  %103 = getelementptr inbounds i8, ptr %1, i64 39
  store i8 %102, ptr %103, align 1, !tbaa !5
  %104 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 2, i32 noundef 2, i64 noundef %8)
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds i8, ptr %7, i64 %105
  %107 = load i8, ptr %106, align 1, !tbaa !5
  %108 = sext i8 %107 to i32
  %109 = mul nsw i32 %108, %13
  %110 = add nsw i32 %109, %11
  %111 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %110)
  %112 = getelementptr inbounds i8, ptr %1, i64 43
  store i8 %111, ptr %112, align 1, !tbaa !5
  %113 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 3, i32 noundef 2, i64 noundef %8)
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds i8, ptr %7, i64 %114
  %116 = load i8, ptr %115, align 1, !tbaa !5
  %117 = sext i8 %116 to i32
  %118 = mul nsw i32 %117, %13
  %119 = add nsw i32 %118, %11
  %120 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %119)
  %121 = getelementptr inbounds i8, ptr %1, i64 47
  store i8 %120, ptr %121, align 1, !tbaa !5
  %122 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 0, i32 noundef 3, i64 noundef %8)
  %123 = zext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %7, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !5
  %126 = sext i8 %125 to i32
  %127 = mul nsw i32 %126, %13
  %128 = add nsw i32 %127, %11
  %129 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %128)
  %130 = getelementptr inbounds i8, ptr %1, i64 51
  store i8 %129, ptr %130, align 1, !tbaa !5
  %131 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 1, i32 noundef 3, i64 noundef %8)
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds i8, ptr %7, i64 %132
  %134 = load i8, ptr %133, align 1, !tbaa !5
  %135 = sext i8 %134 to i32
  %136 = mul nsw i32 %135, %13
  %137 = add nsw i32 %136, %11
  %138 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %137)
  %139 = getelementptr inbounds i8, ptr %1, i64 55
  store i8 %138, ptr %139, align 1, !tbaa !5
  %140 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 2, i32 noundef 3, i64 noundef %8)
  %141 = zext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %7, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !5
  %144 = sext i8 %143 to i32
  %145 = mul nsw i32 %144, %13
  %146 = add nsw i32 %145, %11
  %147 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %146)
  %148 = getelementptr inbounds i8, ptr %1, i64 59
  store i8 %147, ptr %148, align 1, !tbaa !5
  %149 = tail call noundef i32 @_ZNK6basisu12eac_a8_block12get_selectorEjjm(ptr noundef nonnull align 2 dereferenceable(8) %0, i32 noundef 3, i32 noundef 3, i64 noundef %8)
  %150 = zext i32 %149 to i64
  %151 = getelementptr inbounds i8, ptr %7, i64 %150
  %152 = load i8, ptr %151, align 1, !tbaa !5
  %153 = sext i8 %152 to i32
  %154 = mul nsw i32 %153, %13
  %155 = add nsw i32 %154, %11
  %156 = tail call noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef %155)
  %157 = getelementptr inbounds i8, ptr %1, i64 63
  store i8 %156, ptr %157, align 1, !tbaa !5
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZN6basisu8clamp255Ei(i32 noundef) local_unnamed_addr #1

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

attributes #0 = { 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 = { 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass