static uint64_t m5208_sys_read(void *opaque, target_phys_addr_t addr,

                               unsigned size)

{

    switch (addr) {

    case 0x110: /* SDCS0 */

        {

            int n;

            for (n = 0; n < 32; n++) {

                if (ram_size < (2u << n))

                    break;

            }

            return (n - 1)  | 0x40000000;

        }

    case 0x114: /* SDCS1 */

        return 0;



    default:

        hw_error("m5208_sys_read: Bad offset 0x%x\n", (int)addr);

        return 0;

    }

}

static uint64_t m5208_sys_read(void *opaque, target_phys_addr_t addr,

                               unsigned size)

{

    switch (addr) {

    case 0x110: 

        {

            int n;

            for (n = 0; n < 32; n++) {

                if (ram_size < (2u << n))

                    break;

            }

            return (n - 1)  | 0x40000000;

        }

    case 0x114: 

        return 0;



    default:

        hw_error("m5208_sys_read: Bad offset 0x%x\n", (int)addr);

        return 0;

    }

}

static uint64_t FUNC_0(void *opaque, target_phys_addr_t addr,

                               unsigned size)

{

    switch (addr) {

    case 0x110: 

        {

            int VAR_0;

            for (VAR_0 = 0; VAR_0 < 32; VAR_0++) {

                if (ram_size < (2u << VAR_0))

                    break;

            }

            return (VAR_0 - 1)  | 0x40000000;

        }

    case 0x114: 

        return 0;



    default:

        hw_error("FUNC_0: Bad offset 0x%x\VAR_0", (int)addr);

        return 0;

    }

}

static uint64_t FUNC_0(void *opaque, target_phys_addr_t addr,
unsigned size)
{ switch (addr) { case 0x110:
{ int VAR_0; for (VAR_0 = 0; VAR_0 < 32; VAR_0++) { if (ram_size < (2u << VAR_0))
break; } return (VAR_0 - 1)  | 0x40000000; } case 0x114:
return 0; default:
hw_error("FUNC_0: Bad offset 0x%x\VAR_0", (int)addr); return 0; } }