#include <metal_stdlib>

using namespace metal;
void tint_zero_workgroup_memory(uint local_idx, threadgroup int* const tint_symbol_1) {
  {
    *(tint_symbol_1) = 0;
  }
  threadgroup_barrier(mem_flags::mem_threadgroup);
}

void tint_symbol_inner(uint local_invocation_index, threadgroup int* const tint_symbol_2) {
  tint_zero_workgroup_memory(local_invocation_index, tint_symbol_2);
  int const i = *(tint_symbol_2);
}

kernel void tint_symbol(uint local_invocation_index [[thread_index_in_threadgroup]]) {
  threadgroup int tint_symbol_3;
  tint_symbol_inner(local_invocation_index, &(tint_symbol_3));
  return;
}

