HSBC shares dive after $3 billion writedown of China bank stake