#pragma clang diagnostic ignored "-Wunused-variable"

#include <metal_stdlib>
#include <simd/simd.h>
#include <metal_atomic>

using namespace metal;

struct Ptr;

struct Registers
{
    device Ptr* ptr;
};

struct Ptr
{
    uint i;
    uint2 i2;
};

struct UBO
{
    device Ptr* ptr_ubo;
};

struct SSBO
{
    device Ptr* ptr_ssbo;
};

constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);

kernel void main0(constant Registers& _12 [[buffer(0)]], constant UBO& _26 [[buffer(1)]], device SSBO& _35 [[buffer(2)]])
{
    uint _23 = atomic_fetch_add_explicit((device atomic_uint*)&_12.ptr->i, 10u, memory_order_relaxed);
    uint _32 = atomic_fetch_add_explicit((device atomic_uint*)&_26.ptr_ubo->i, 11u, memory_order_relaxed);
    uint _41 = atomic_fetch_add_explicit((device atomic_uint*)&_35.ptr_ssbo->i, 12u, memory_order_relaxed);
    uint _51 = atomic_fetch_add_explicit((device atomic_uint*)&(reinterpret_cast<device Ptr*>(as_type<ulong>(_12.ptr->i2)))->i, 13u, memory_order_relaxed);
}

