the tang dynasty war