void memory_region_set_address(MemoryRegion *mr, hwaddr addr)

{

    MemoryRegion *parent = mr->parent;

    int priority = mr->priority;

    bool may_overlap = mr->may_overlap;



    if (addr == mr->addr || !parent) {

        mr->addr = addr;

        return;

    }



    memory_region_transaction_begin();

    memory_region_ref(mr);

    memory_region_del_subregion(parent, mr);

    if (may_overlap) {

        memory_region_add_subregion_overlap(parent, addr, mr, priority);

    } else {

        memory_region_add_subregion(parent, addr, mr);

    }

    memory_region_unref(mr);

    memory_region_transaction_commit();

}

void memory_region_set_address(MemoryRegion *mr, hwaddr addr)

{

    MemoryRegion *parent = mr->parent;

    int priority = mr->priority;

    bool may_overlap = mr->may_overlap;



    if (addr == mr->addr || !parent) {

        mr->addr = addr;

        return;

    }



    memory_region_transaction_begin();

    memory_region_ref(mr);

    memory_region_del_subregion(parent, mr);

    if (may_overlap) {

        memory_region_add_subregion_overlap(parent, addr, mr, priority);

    } else {

        memory_region_add_subregion(parent, addr, mr);

    }

    memory_region_unref(mr);

    memory_region_transaction_commit();

}

void FUNC_0(MemoryRegion *VAR_0, hwaddr VAR_1)

{

    MemoryRegion *parent = VAR_0->parent;

    int VAR_2 = VAR_0->VAR_2;

    bool may_overlap = VAR_0->may_overlap;



    if (VAR_1 == VAR_0->VAR_1 || !parent) {

        VAR_0->VAR_1 = VAR_1;

        return;

    }



    memory_region_transaction_begin();

    memory_region_ref(VAR_0);

    memory_region_del_subregion(parent, VAR_0);

    if (may_overlap) {

        memory_region_add_subregion_overlap(parent, VAR_1, VAR_0, VAR_2);

    } else {

        memory_region_add_subregion(parent, VAR_1, VAR_0);

    }

    memory_region_unref(VAR_0);

    memory_region_transaction_commit();

}

void FUNC_0(MemoryRegion *VAR_0, hwaddr VAR_1)
{ MemoryRegion *parent = VAR_0->parent; int VAR_2 = VAR_0->VAR_2; bool may_overlap = VAR_0->may_overlap; if (VAR_1 == VAR_0->VAR_1 || !parent) { VAR_0->VAR_1 = VAR_1; return; } memory_region_transaction_begin(); memory_region_ref(VAR_0); memory_region_del_subregion(parent, VAR_0); if (may_overlap) { memory_region_add_subregion_overlap(parent, VAR_1, VAR_0, VAR_2); } else { memory_region_add_subregion(parent, VAR_1, VAR_0); } memory_region_unref(VAR_0); memory_region_transaction_commit(); }