Revert "Use libdivide"

This reverts commit dd61dd7648122afa2d13615dde9ff06df8bc80f2.