DecodeTrace: Tidied up get_sample_range