Here you go

So I added a slightly better translation, less C crap.

if you can work out k_size and PATCHLEN this might be good to go.