Halliday & Matthiessen (2014: 145):
Note that some of the negative forms, such as mayn’t, are rather infrequent; if they occur in a negative clause, the negative is usually separated (may not, used not to). In such cases, the not can be analysed as part of the Residue; but it is important to note that this is an oversimplification — sometimes it belongs functionally with the Finite, for example
you may not leave before the end (‘are not allowed to’): not is part of Finite
you may not stay right to the end (‘are allowed not to’): not is part of Residue