static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr)

{

    unsigned access_size_min = mr->ops->impl.min_access_size;

    unsigned access_size_max = mr->ops->impl.max_access_size;



    /* Regions are assumed to support 1-4 byte accesses unless

       otherwise specified.  */

    if (access_size_min == 0) {

        access_size_min = 1;

    }

    if (access_size_max == 0) {

        access_size_max = 4;

    }



    /* Bound the maximum access by the alignment of the address.  */

    if (!mr->ops->impl.unaligned) {

        unsigned align_size_max = addr & -addr;

        if (align_size_max != 0 && align_size_max < access_size_max) {

            access_size_max = align_size_max;

        }

    }



    /* Don't attempt accesses larger than the maximum.  */

    if (l > access_size_max) {

        l = access_size_max;

    }

    /* ??? The users of this function are wrong, not supporting minimums larger

       than the remaining length.  C.f. memory.c:access_with_adjusted_size.  */

    assert(l >= access_size_min);



    return l;

}

static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr)

{

    unsigned access_size_min = mr->ops->impl.min_access_size;

    unsigned access_size_max = mr->ops->impl.max_access_size;



    



    if (access_size_min == 0) {

        access_size_min = 1;

    }

    if (access_size_max == 0) {

        access_size_max = 4;

    }



    

    if (!mr->ops->impl.unaligned) {

        unsigned align_size_max = addr & -addr;

        if (align_size_max != 0 && align_size_max < access_size_max) {

            access_size_max = align_size_max;

        }

    }



    

    if (l > access_size_max) {

        l = access_size_max;

    }

    



    assert(l >= access_size_min);



    return l;

}

    unsigned access_size_min = mr->ops->impl.min_access_size;     unsigned access_size_max = mr->ops->impl.max_access_size;     if (access_size_min == 0) {         access_size_min = 1;     assert(l >= access_size_min);
static int FUNC_0(MemoryRegion *VAR_0, unsigned VAR_1, hwaddr VAR_2)

{

    unsigned VAR_3 = VAR_0->ops->impl.min_access_size;

    unsigned VAR_4 = VAR_0->ops->impl.max_access_size;



    



    if (VAR_3 == 0) {

        VAR_3 = 1;

    }

    if (VAR_4 == 0) {

        VAR_4 = 4;

    }



    

    if (!VAR_0->ops->impl.unaligned) {

        unsigned VAR_5 = VAR_2 & -VAR_2;

        if (VAR_5 != 0 && VAR_5 < VAR_4) {

            VAR_4 = VAR_5;

        }

    }



    

    if (VAR_1 > VAR_4) {

        VAR_1 = VAR_4;

    }

    



    assert(VAR_1 >= VAR_3);



    return VAR_1;

}

static int FUNC_0(MemoryRegion *VAR_0, unsigned VAR_1, hwaddr VAR_2)
{ unsigned VAR_3 = VAR_0->ops->impl.min_access_size; unsigned VAR_4 = VAR_0->ops->impl.max_access_size; if (VAR_3 == 0) { VAR_3 = 1; } if (VAR_4 == 0) { VAR_4 = 4; } if (!VAR_0->ops->impl.unaligned) { unsigned VAR_5 = VAR_2 & -VAR_2; if (VAR_5 != 0 && VAR_5 < VAR_4) { VAR_4 = VAR_5; } } if (VAR_1 > VAR_4) { VAR_1 = VAR_4; } assert(VAR_1 >= VAR_3); return VAR_1; }