#include <metal_stdlib>

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

uint atomicLoad_fe6cc3(device SB_RW* const tint_symbol) {
  uint res = atomic_load_explicit(&((*(tint_symbol)).arg_0), 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) = atomicLoad_fe6cc3(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) = atomicLoad_fe6cc3(tint_symbol_4);
  return;
}

