A simulated cache memory in C