#include <metal_stdlib>
using namespace metal;

struct SB_RW {
  /* 0x0000 */ atomic_uint arg_0;
};

struct tint_module_vars_struct {
  device uint* prevent_dce;
  device SB_RW* sb_rw;
};

uint atomicLoad_fe6cc3(tint_module_vars_struct tint_module_vars) {
  uint res = atomic_load_explicit((&(*tint_module_vars.sb_rw).arg_0), memory_order_relaxed);
  return res;
}

fragment void fragment_main(device uint* prevent_dce [[buffer(0)]], device SB_RW* sb_rw [[buffer(1)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .sb_rw=sb_rw};
  (*tint_module_vars.prevent_dce) = atomicLoad_fe6cc3(tint_module_vars);
}

kernel void compute_main(device uint* prevent_dce [[buffer(0)]], device SB_RW* sb_rw [[buffer(1)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .sb_rw=sb_rw};
  (*tint_module_vars.prevent_dce) = atomicLoad_fe6cc3(tint_module_vars);
}
