address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *xlat,

                                 hwaddr *plen, bool resolve_subpage)

{

    MemoryRegionSection *section;

    Int128 diff, diff_page;



    section = address_space_lookup_region(d, addr, resolve_subpage);

    /* Compute offset within MemoryRegionSection */

    addr -= section->offset_within_address_space;



    /* Compute offset within MemoryRegion */

    *xlat = addr + section->offset_within_region;



    diff_page = int128_make64(((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr);

    diff = int128_sub(section->mr->size, int128_make64(addr));

    diff = int128_min(diff, diff_page);

    *plen = int128_get64(int128_min(diff, int128_make64(*plen)));

    return section;

}

address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *xlat,

                                 hwaddr *plen, bool resolve_subpage)

{

    MemoryRegionSection *section;

    Int128 diff, diff_page;



    section = address_space_lookup_region(d, addr, resolve_subpage);

    

    addr -= section->offset_within_address_space;



    

    *xlat = addr + section->offset_within_region;



    diff_page = int128_make64(((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr);

    diff = int128_sub(section->mr->size, int128_make64(addr));

    diff = int128_min(diff, diff_page);

    *plen = int128_get64(int128_min(diff, int128_make64(*plen)));

    return section;

}

FUNC_0(AddressSpaceDispatch *VAR_0, hwaddr VAR_1, hwaddr *VAR_2,

                                 hwaddr *VAR_3, bool VAR_4)

{

    MemoryRegionSection *section;

    Int128 diff, diff_page;



    section = address_space_lookup_region(VAR_0, VAR_1, VAR_4);

    

    VAR_1 -= section->offset_within_address_space;



    

    *VAR_2 = VAR_1 + section->offset_within_region;



    diff_page = int128_make64(((VAR_1 & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - VAR_1);

    diff = int128_sub(section->mr->size, int128_make64(VAR_1));

    diff = int128_min(diff, diff_page);

    *VAR_3 = int128_get64(int128_min(diff, int128_make64(*VAR_3)));

    return section;

}

FUNC_0(AddressSpaceDispatch *VAR_0, hwaddr VAR_1, hwaddr *VAR_2,
hwaddr *VAR_3, bool VAR_4)
{ MemoryRegionSection *section; Int128 diff, diff_page; section = address_space_lookup_region(VAR_0, VAR_1, VAR_4); VAR_1 -= section->offset_within_address_space; *VAR_2 = VAR_1 + section->offset_within_region; diff_page = int128_make64(((VAR_1 & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - VAR_1); diff = int128_sub(section->mr->size, int128_make64(VAR_1)); diff = int128_min(diff, diff_page); *VAR_3 = int128_get64(int128_min(diff, int128_make64(*VAR_3))); return section; }