Taiwan’s giant chipmaker must balance demands from America, China and home