static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,

                             ram_addr_t memory, ram_addr_t region_offset)

{

    int idx, eidx;



    if (start >= TARGET_PAGE_SIZE || end >= TARGET_PAGE_SIZE)

        return -1;

    idx = SUBPAGE_IDX(start);

    eidx = SUBPAGE_IDX(end);

#if defined(DEBUG_SUBPAGE)

    printf("%s: %p start %08x end %08x idx %08x eidx %08x mem %ld\n", __func__,

           mmio, start, end, idx, eidx, memory);

#endif



    memory = (memory >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);

    for (; idx <= eidx; idx++) {

        mmio->sub_io_index[idx] = memory;

        mmio->region_offset[idx] = region_offset;

    }



    return 0;

}
static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,

                             ram_addr_t memory, ram_addr_t region_offset)

{

    int idx, eidx;



    if (start >= TARGET_PAGE_SIZE || end >= TARGET_PAGE_SIZE)

        return -1;

    idx = SUBPAGE_IDX(start);

    eidx = SUBPAGE_IDX(end);

#if defined(DEBUG_SUBPAGE)

    printf("%s: %p start %08x end %08x idx %08x eidx %08x mem %ld\n", __func__,

           mmio, start, end, idx, eidx, memory);

#endif



    memory = (memory >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);

    for (; idx <= eidx; idx++) {

        mmio->sub_io_index[idx] = memory;

        mmio->region_offset[idx] = region_offset;

    }



    return 0;

}
static int FUNC_0 (subpage_t *VAR_0, uint32_t VAR_1, uint32_t VAR_2,

                             ram_addr_t VAR_3, ram_addr_t VAR_4)

{

    int VAR_5, VAR_6;



    if (VAR_1 >= TARGET_PAGE_SIZE || VAR_2 >= TARGET_PAGE_SIZE)

        return -1;

    VAR_5 = SUBPAGE_IDX(VAR_1);

    VAR_6 = SUBPAGE_IDX(VAR_2);

#if defined(DEBUG_SUBPAGE)

    printf("%s: %p VAR_1 %08x VAR_2 %08x VAR_5 %08x VAR_6 %08x mem %ld\n", __func__,

           VAR_0, VAR_1, VAR_2, VAR_5, VAR_6, VAR_3);

#endif



    VAR_3 = (VAR_3 >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);

    for (; VAR_5 <= VAR_6; VAR_5++) {

        VAR_0->sub_io_index[VAR_5] = VAR_3;

        VAR_0->VAR_4[VAR_5] = VAR_4;

    }



    return 0;

}
static int FUNC_0 (subpage_t *VAR_0, uint32_t VAR_1, uint32_t VAR_2,
ram_addr_t VAR_3, ram_addr_t VAR_4)
{ int VAR_5, VAR_6; if (VAR_1 >= TARGET_PAGE_SIZE || VAR_2 >= TARGET_PAGE_SIZE)
return -1; VAR_5 = SUBPAGE_IDX(VAR_1); VAR_6 = SUBPAGE_IDX(VAR_2); #if defined(DEBUG_SUBPAGE)
printf("%s: %p VAR_1 %08x VAR_2 %08x VAR_5 %08x VAR_6 %08x mem %ld\n", __func__,
VAR_0, VAR_1, VAR_2, VAR_5, VAR_6, VAR_3); #endif
VAR_3 = (VAR_3 >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1); for (; VAR_5 <= VAR_6; VAR_5++) { VAR_0->sub_io_index[VAR_5] = VAR_3; VAR_0->VAR_4[VAR_5] = VAR_4; } return 0; }