#include <metal_stdlib>
using namespace metal;

struct atomic_compare_exchange_result_u32 {
  uint old_value;
  bool exchanged;
};

struct tint_module_vars_struct {
  device atomic_uint* a;
};

atomic_compare_exchange_result_u32 v(device atomic_uint* const atomic_ptr, uint cmp, uint val) {
  uint old_value = cmp;
  bool const v_1 = atomic_compare_exchange_weak_explicit(atomic_ptr, (&old_value), val, memory_order_relaxed, memory_order_relaxed);
  return atomic_compare_exchange_result_u32{.old_value=old_value, .exchanged=v_1};
}

kernel void tint_symbol(device atomic_uint* a [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.a=a};
  uint value = 42u;
  atomic_compare_exchange_result_u32 const result = v(tint_module_vars.a, 0u, value);
}
