#include <metal_stdlib>

using namespace metal;
void textureStore_83bcc1(texture1d<uint, access::write> tint_symbol) {
  int arg_1 = 1;
  uint4 arg_2 = uint4(1u);
  tint_symbol.write(arg_2, uint(arg_1));
}

fragment void fragment_main(texture1d<uint, access::write> tint_symbol_1 [[texture(0)]]) {
  textureStore_83bcc1(tint_symbol_1);
  return;
}

kernel void compute_main(texture1d<uint, access::write> tint_symbol_2 [[texture(0)]]) {
  textureStore_83bcc1(tint_symbol_2);
  return;
}

