#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  texture2d_array<float, access::write> arg_0;
};

void textureStore_258ab0(tint_module_vars_struct tint_module_vars) {
  uint2 arg_1 = uint2(1u);
  int arg_2 = 1;
  float4 arg_3 = float4(1.0f);
  tint_module_vars.arg_0.write(arg_3, arg_1, arg_2);
}

fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
  textureStore_258ab0(tint_module_vars);
}

kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
  textureStore_258ab0(tint_module_vars);
}
