I don't think it rolled, it looks like it was owned by a hotshot and had the trailer behind it when the accident happened, that or he FUBARed and jack-knifed it. The damage on the bedside and cab are consistant with the trailer hitting the cab at speed and the truck twisting to cause the trailer to hit the bed. Personally, I wouldn't touch the truck for a rebuild, but I might buy it for the drivetrain... 315k is a sh!#load of miles though.
Later,
Joe