static void lsi_ram_write(void *opaque, target_phys_addr_t addr,

                          uint64_t val, unsigned size)

{

    LSIState *s = opaque;

    uint32_t newval;

    uint32_t mask;

    int shift;



    newval = s->script_ram[addr >> 2];

    shift = (addr & 3) * 8;

    mask = ((uint64_t)1 << (size * 8)) - 1;

    newval &= ~(mask << shift);

    newval |= val << shift;

    s->script_ram[addr >> 2] = newval;

}

static void lsi_ram_write(void *opaque, target_phys_addr_t addr,

                          uint64_t val, unsigned size)

{

    LSIState *s = opaque;

    uint32_t newval;

    uint32_t mask;

    int shift;



    newval = s->script_ram[addr >> 2];

    shift = (addr & 3) * 8;

    mask = ((uint64_t)1 << (size * 8)) - 1;

    newval &= ~(mask << shift);

    newval |= val << shift;

    s->script_ram[addr >> 2] = newval;

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,

                          uint64_t VAR_2, unsigned VAR_3)

{

    LSIState *s = VAR_0;

    uint32_t newval;

    uint32_t mask;

    int VAR_4;



    newval = s->script_ram[VAR_1 >> 2];

    VAR_4 = (VAR_1 & 3) * 8;

    mask = ((uint64_t)1 << (VAR_3 * 8)) - 1;

    newval &= ~(mask << VAR_4);

    newval |= VAR_2 << VAR_4;

    s->script_ram[VAR_1 >> 2] = newval;

}

static void FUNC_0(void *VAR_0, target_phys_addr_t VAR_1,
uint64_t VAR_2, unsigned VAR_3)
{ LSIState *s = VAR_0; uint32_t newval; uint32_t mask; int VAR_4; newval = s->script_ram[VAR_1 >> 2]; VAR_4 = (VAR_1 & 3) * 8; mask = ((uint64_t)1 << (VAR_3 * 8)) - 1; newval &= ~(mask << VAR_4); newval |= VAR_2 << VAR_4; s->script_ram[VAR_1 >> 2] = newval; }