An attempt was made to generically recreate these functions as close to the original implementations as possible to reduce possibility of performance any regression.
This patch is intended to simplify implementation of 16-bit integer division/multiplication LibCalls required on 16-bit targets and fixing some UB.