Roger Federer turns 40 with career at crossroads