static void m5206_mbar_writew(void *opaque, target_phys_addr_t offset,

                              uint32_t value)

{

    m5206_mbar_state *s = (m5206_mbar_state *)opaque;

    int width;

    offset &= 0x3ff;

    if (offset > 0x200) {

        hw_error("Bad MBAR write offset 0x%x", (int)offset);

    }

    width = m5206_mbar_width[offset >> 2];

    if (width > 2) {

        uint32_t tmp;

        tmp = m5206_mbar_readl(opaque, offset & ~3);

        if (offset & 3) {

            tmp = (tmp & 0xffff0000) | value;

        } else {

            tmp = (tmp & 0x0000ffff) | (value << 16);

        }

        m5206_mbar_writel(opaque, offset & ~3, tmp);

        return;

    } else if (width < 2) {

        m5206_mbar_writeb(opaque, offset, value >> 8);

        m5206_mbar_writeb(opaque, offset + 1, value & 0xff);

        return;

    }

    m5206_mbar_write(s, offset, value, 2);

}

static void m5206_mbar_writew(void *opaque, target_phys_addr_t offset,

                              uint32_t value)

{

    m5206_mbar_state *s = (m5206_mbar_state *)opaque;

    int width;

    offset &= 0x3ff;

    if (offset > 0x200) {

        hw_error("Bad MBAR write offset 0x%x", (int)offset);

    }

    width = m5206_mbar_width[offset >> 2];

    if (width > 2) {

        uint32_t tmp;

        tmp = m5206_mbar_readl(opaque, offset & ~3);

        if (offset & 3) {

            tmp = (tmp & 0xffff0000) | value;

        } else {

            tmp = (tmp & 0x0000ffff) | (value << 16);

        }

        m5206_mbar_writel(opaque, offset & ~3, tmp);

        return;

    } else if (width < 2) {

        m5206_mbar_writeb(opaque, offset, value >> 8);

        m5206_mbar_writeb(opaque, offset + 1, value & 0xff);

        return;

    }

    m5206_mbar_write(s, offset, value, 2);

}

    if (offset > 0x200) {     if (offset > 0x200) {     if (offset > 0x200) {     if (offset > 0x200) {     if (offset > 0x200) {     if (offset > 0x200) {
static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,

                              uint32_t VAR_2)

{

    m5206_mbar_state *s = (m5206_mbar_state *)VAR_0;

    int VAR_3;

    VAR_1 &= 0x3ff;

    if (VAR_1 > 0x200) {

        hw_error("Bad MBAR write VAR_1 0x%x", (int)VAR_1);

    }

    VAR_3 = m5206_mbar_width[VAR_1 >> 2];

    if (VAR_3 > 2) {

        uint32_t tmp;

        tmp = m5206_mbar_readl(VAR_0, VAR_1 & ~3);

        if (VAR_1 & 3) {

            tmp = (tmp & 0xffff0000) | VAR_2;

        } else {

            tmp = (tmp & 0x0000ffff) | (VAR_2 << 16);

        }

        m5206_mbar_writel(VAR_0, VAR_1 & ~3, tmp);

        return;

    } else if (VAR_3 < 2) {

        m5206_mbar_writeb(VAR_0, VAR_1, VAR_2 >> 8);

        m5206_mbar_writeb(VAR_0, VAR_1 + 1, VAR_2 & 0xff);

        return;

    }

    m5206_mbar_write(s, VAR_1, VAR_2, 2);

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,
uint32_t VAR_2)
{ m5206_mbar_state *s = (m5206_mbar_state *)VAR_0; int VAR_3; VAR_1 &= 0x3ff; if (VAR_1 > 0x200) { hw_error("Bad MBAR write VAR_1 0x%x", (int)VAR_1); } VAR_3 = m5206_mbar_width[VAR_1 >> 2]; if (VAR_3 > 2) { uint32_t tmp; tmp = m5206_mbar_readl(VAR_0, VAR_1 & ~3); if (VAR_1 & 3) { tmp = (tmp & 0xffff0000) | VAR_2; } else { tmp = (tmp & 0x0000ffff) | (VAR_2 << 16); } m5206_mbar_writel(VAR_0, VAR_1 & ~3, tmp); return; } else if (VAR_3 < 2) { m5206_mbar_writeb(VAR_0, VAR_1, VAR_2 >> 8); m5206_mbar_writeb(VAR_0, VAR_1 + 1, VAR_2 & 0xff); return; } m5206_mbar_write(s, VAR_1, VAR_2, 2); }