SWAP_FLAGS
SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
SWAP_FLAGS (bottom + i, middle + i);