Code extracted from: https://github.com/facebook/zstd.git at commit 470344d33e1d52a2ada75d278466da8d4ee2faf6 (v1.3.8).