#include <metal_stdlib>

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

int atomicExchange_f2e22f(device SB_RW* const tint_symbol) {
  int arg_1 = 1;
  int res = atomic_exchange_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) = atomicExchange_f2e22f(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) = atomicExchange_f2e22f(tint_symbol_4);
  return;
}

