It doesn't make sense to simulate branch prediction logic when you are simply parsing the input trace file.
To count clock cycles, create a "clkcntr" that is incremented by the number of cycles taken per instruction.
For example, if the LOAD instr. takes 4 clock cycles then clkcntr += 4; so on and so forth for each instruction.