Implementation of set-associative cache simulator in C