The telecoms giant plans to shed up to 40% of its workforce by the end of the decade to cut costs.