Remove unnecessary inlines

Rules:
- no extern inlines
- no more than 3 lines of code per inline function (except simple
  branching)