static void access_with_adjusted_size(hwaddr addr,

                                      uint64_t *value,

                                      unsigned size,

                                      unsigned access_size_min,

                                      unsigned access_size_max,

                                      void (*access)(MemoryRegion *mr,

                                                     hwaddr addr,

                                                     uint64_t *value,

                                                     unsigned size,

                                                     unsigned shift,

                                                     uint64_t mask),

                                      MemoryRegion *mr)

{

    uint64_t access_mask;

    unsigned access_size;

    unsigned i;



    if (!access_size_min) {

        access_size_min = 1;

    }

    if (!access_size_max) {

        access_size_max = 4;

    }



    /* FIXME: support unaligned access? */

    access_size = MAX(MIN(size, access_size_max), access_size_min);

    access_mask = -1ULL >> (64 - access_size * 8);

    for (i = 0; i < size; i += access_size) {

#ifdef TARGET_WORDS_BIGENDIAN

        access(mr, addr + i, value, access_size,

               (size - access_size - i) * 8, access_mask);

#else

        access(mr, addr + i, value, access_size, i * 8, access_mask);

#endif

    }

}

static void access_with_adjusted_size(hwaddr addr,

                                      uint64_t *value,

                                      unsigned size,

                                      unsigned access_size_min,

                                      unsigned access_size_max,

                                      void (*access)(MemoryRegion *mr,

                                                     hwaddr addr,

                                                     uint64_t *value,

                                                     unsigned size,

                                                     unsigned shift,

                                                     uint64_t mask),

                                      MemoryRegion *mr)

{

    uint64_t access_mask;

    unsigned access_size;

    unsigned i;



    if (!access_size_min) {

        access_size_min = 1;

    }

    if (!access_size_max) {

        access_size_max = 4;

    }



    

    access_size = MAX(MIN(size, access_size_max), access_size_min);

    access_mask = -1ULL >> (64 - access_size * 8);

    for (i = 0; i < size; i += access_size) {

#ifdef TARGET_WORDS_BIGENDIAN

        access(mr, addr + i, value, access_size,

               (size - access_size - i) * 8, access_mask);

#else

        access(mr, addr + i, value, access_size, i * 8, access_mask);

#endif

    }

}

static void FUNC_0(hwaddr VAR_7,

                                      uint64_t *VAR_7,

                                      unsigned VAR_7,

                                      unsigned VAR_3,

                                      unsigned VAR_4,

                                      void (*VAR_5)(MemoryRegion *VAR_9,

                                                     hwaddr VAR_7,

                                                     uint64_t *VAR_7,

                                                     unsigned VAR_7,

                                                     unsigned VAR_7,

                                                     uint64_t VAR_8),

                                      MemoryRegion *VAR_9)

{

    uint64_t access_mask;

    unsigned VAR_9;

    unsigned VAR_10;



    if (!VAR_3) {

        VAR_3 = 1;

    }

    if (!VAR_4) {

        VAR_4 = 4;

    }



    

    VAR_9 = MAX(MIN(VAR_7, VAR_4), VAR_3);

    access_mask = -1ULL >> (64 - VAR_9 * 8);

    for (VAR_10 = 0; VAR_10 < VAR_7; VAR_10 += VAR_9) {

#ifdef TARGET_WORDS_BIGENDIAN

        VAR_5(VAR_9, VAR_7 + VAR_10, VAR_7, VAR_9,

               (VAR_7 - VAR_9 - VAR_10) * 8, access_mask);

#else

        VAR_5(VAR_9, VAR_7 + VAR_10, VAR_7, VAR_9, VAR_10 * 8, access_mask);

#endif

    }

}

static void FUNC_0(hwaddr VAR_7,
uint64_t *VAR_7,
unsigned VAR_7,
unsigned VAR_3,
unsigned VAR_4,
void (*VAR_5)(MemoryRegion *VAR_9,
hwaddr VAR_7,
uint64_t *VAR_7,
unsigned VAR_7,
unsigned VAR_7,
uint64_t VAR_8),
MemoryRegion *VAR_9)
{ uint64_t access_mask; unsigned VAR_9; unsigned VAR_10; if (!VAR_3) { VAR_3 = 1; } if (!VAR_4) { VAR_4 = 4; } VAR_9 = MAX(MIN(VAR_7, VAR_4), VAR_3); access_mask = -1ULL >> (64 - VAR_9 * 8); for (VAR_10 = 0; VAR_10 < VAR_7; VAR_10 += VAR_9) { #ifdef TARGET_WORDS_BIGENDIAN
VAR_5(VAR_9, VAR_7 + VAR_10, VAR_7, VAR_9,
(VAR_7 - VAR_9 - VAR_10) * 8, access_mask); #else
VAR_5(VAR_9, VAR_7 + VAR_10, VAR_7, VAR_9, VAR_10 * 8, access_mask); #endif
} }