static int item_compare(const void *a, const void *b) {
        const Item *x = a, *y = b;

        /* Make sure that the ownership taking item is put first, so
         * that we first create the node, and then can adjust it */

        if (takes_ownership(x->type) && !takes_ownership(y->type))
                return -1;
        if (!takes_ownership(x->type) && takes_ownership(y->type))
                return 1;

        return (int) x->type - (int) y->type;
}
static int item_compare(const void *a, const void *b) {
        const Item *x = a, *y = b;

         

        if (takes_ownership(x->type) && !takes_ownership(y->type))
                return -1;
        if (!takes_ownership(x->type) && takes_ownership(y->type))
                return 1;

        return (int) x->type - (int) y->type;
}