Calculate iterator wraparounds for flattening loops