Loan losses , investment writedowns and legal costs led to the largest-ever loss for a European bank last year .