TailCut: improving performance and lifetime of SSDs using pattern-aware state encoding