#include <metal_stdlib>

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

void atomicSub_15bfc9(device SB_RW* const tint_symbol, device uint* const tint_symbol_1) {
  uint res = atomic_fetch_sub_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
  *(tint_symbol_1) = res;
}

fragment void fragment_main(device SB_RW* tint_symbol_2 [[buffer(0)]], device uint* tint_symbol_3 [[buffer(1)]]) {
  atomicSub_15bfc9(tint_symbol_2, tint_symbol_3);
  return;
}

kernel void compute_main(device SB_RW* tint_symbol_4 [[buffer(0)]], device uint* tint_symbol_5 [[buffer(1)]]) {
  atomicSub_15bfc9(tint_symbol_4, tint_symbol_5);
  return;
}

