#include <metal_stdlib>
using namespace metal;
struct SB_RW {
  atomic_int arg_0;
};
struct tint_module_vars_struct {
  device SB_RW* sb_rw;
  device int* prevent_dce;
};

void atomicXor_c1b78c(tint_module_vars_struct tint_module_vars) {
  int arg_1 = 1;
  int res = atomic_fetch_xor_explicit((&(*tint_module_vars.sb_rw).arg_0), arg_1, memory_order_relaxed);
  (*tint_module_vars.prevent_dce) = res;
}
fragment void fragment_main(device SB_RW* sb_rw [[buffer(0)]], device int* prevent_dce [[buffer(1)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.sb_rw=sb_rw, .prevent_dce=prevent_dce};
  atomicXor_c1b78c(tint_module_vars);
}
kernel void compute_main(device SB_RW* sb_rw [[buffer(0)]], device int* prevent_dce [[buffer(1)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.sb_rw=sb_rw, .prevent_dce=prevent_dce};
  atomicXor_c1b78c(tint_module_vars);
}
