#include <metal_stdlib>

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

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

