Time-critical function in C; reorganized directory tree