Korea Republic edge gritty Malaysia for semi-final spot