Ranges: started porting code over from https://github.com/ochafik/optimized-loops-macros