#include <metal_stdlib>

using namespace metal;
struct SB_RW {
  /* 0x0000 */ atomic_int arg_0;
};

int atomicAdd_d32fe4(device SB_RW* const tint_symbol) {
  int arg_1 = 1;
  int res = atomic_fetch_add_explicit(&((*(tint_symbol)).arg_0), arg_1, memory_order_relaxed);
  return res;
}

fragment void fragment_main(device int* tint_symbol_1 [[buffer(0)]], device SB_RW* tint_symbol_2 [[buffer(1)]]) {
  *(tint_symbol_1) = atomicAdd_d32fe4(tint_symbol_2);
  return;
}

kernel void compute_main(device int* tint_symbol_3 [[buffer(0)]], device SB_RW* tint_symbol_4 [[buffer(1)]]) {
  *(tint_symbol_3) = atomicAdd_d32fe4(tint_symbol_4);
  return;
}

