When objc_direct methods were implemented, the implicit _cmd parameter was left as an argument to the method implementation function, but was unset by callers; if the method body referenced the _cmd variable, a selector load would be emitted inside the body. However, this leaves an unused argument in the ABI, and is unnecessary.
This change removes the empty/unset argument, and if _cmd is referenced inside an objc_direct method it will emit local storage for the implicit variable. From the ABI perspective, objc_direct methods will have the implicit self parameter, immediately followed by whatever explicit arguments are defined on the method, rather than having one unset/undefined register in the middle.
In order to fix the assert try this instead on line 487: