static void destroy_l2_mapping(PhysPageEntry *lp, unsigned level)

{

    unsigned i;

    PhysPageEntry *p;



    if (lp->ptr == PHYS_MAP_NODE_NIL) {

        return;

    }



    p = phys_map_nodes[lp->ptr];

    for (i = 0; i < L2_SIZE; ++i) {

        if (!p[i].is_leaf) {

            destroy_l2_mapping(&p[i], level - 1);

        } else {

            destroy_page_desc(p[i].ptr);

        }

    }

    lp->is_leaf = 0;

    lp->ptr = PHYS_MAP_NODE_NIL;

}

static void destroy_l2_mapping(PhysPageEntry *lp, unsigned level)

{

    unsigned i;

    PhysPageEntry *p;



    if (lp->ptr == PHYS_MAP_NODE_NIL) {

        return;

    }



    p = phys_map_nodes[lp->ptr];

    for (i = 0; i < L2_SIZE; ++i) {

        if (!p[i].is_leaf) {

            destroy_l2_mapping(&p[i], level - 1);

        } else {

            destroy_page_desc(p[i].ptr);

        }

    }

    lp->is_leaf = 0;

    lp->ptr = PHYS_MAP_NODE_NIL;

}

        } else {             destroy_page_desc(p[i].ptr);
static void FUNC_0(PhysPageEntry *VAR_0, unsigned VAR_1)

{

    unsigned VAR_2;

    PhysPageEntry *p;



    if (VAR_0->ptr == PHYS_MAP_NODE_NIL) {

        return;

    }



    p = phys_map_nodes[VAR_0->ptr];

    for (VAR_2 = 0; VAR_2 < L2_SIZE; ++VAR_2) {

        if (!p[VAR_2].is_leaf) {

            FUNC_0(&p[VAR_2], VAR_1 - 1);

        } else {

            destroy_page_desc(p[VAR_2].ptr);

        }

    }

    VAR_0->is_leaf = 0;

    VAR_0->ptr = PHYS_MAP_NODE_NIL;

}

static void FUNC_0(PhysPageEntry *VAR_0, unsigned VAR_1)
{ unsigned VAR_2; PhysPageEntry *p; if (VAR_0->ptr == PHYS_MAP_NODE_NIL) { return; } p = phys_map_nodes[VAR_0->ptr]; for (VAR_2 = 0; VAR_2 < L2_SIZE; ++VAR_2) { if (!p[VAR_2].is_leaf) { FUNC_0(&p[VAR_2], VAR_1 - 1); } else { destroy_page_desc(p[VAR_2].ptr); } } VAR_0->is_leaf = 0; VAR_0->ptr = PHYS_MAP_NODE_NIL; }