[PATCH v2 07/30] ide: Move a few functions further up the file