#include <metal_stdlib>
using namespace metal;

struct S {
  int a;
  float b;
};

struct tint_module_vars_struct {
  threadgroup S* v;
};

struct tint_symbol_2 {
  S tint_symbol_1;
};

void tint_symbol_inner(uint tint_local_index, tint_module_vars_struct tint_module_vars) {
  if ((tint_local_index == 0u)) {
    (*tint_module_vars.v) = S{};
  }
  threadgroup_barrier(mem_flags::mem_threadgroup);
}

kernel void tint_symbol(uint tint_local_index [[thread_index_in_threadgroup]], threadgroup tint_symbol_2* v_1 [[threadgroup(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.v=(&(*v_1).tint_symbol_1)};
  tint_symbol_inner(tint_local_index, tint_module_vars);
}
