#include <metal_stdlib>

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

uint atomicExchange_d59712(device SB_RW* const tint_symbol) {
  uint res = atomic_exchange_explicit(&((*(tint_symbol)).arg_0), 1u, memory_order_relaxed);
  return res;
}

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

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

