code: function smix (B, Bi, r, N, V, XY) {
      var Xi = 0
      var Yi = 128 * r
      var i
  
      B.copy(XY, Xi, Bi, Bi + Yi)
  
      for (i = 0; i < N; i++) {
        XY.copy(V, i * Yi, Xi, Xi + Yi)
        blockmix_salsa8(XY, Xi, Yi, r)
  
        if (tickCallback) tickCallback()
      }
  
      for (i = 0; i < N; i++) {
        var offset = Xi + (2 * r - 1) * 64
        var j = XY.readUInt32LE(offset) & (N - 1)
        blockxor(V, j * Yi, XY, Xi, Yi)
        blockmix_salsa8(XY, Xi, Yi, r)
  
        if (tickCallback) tickCallback()
      }
  
      XY.copy(B, Bi, Xi, Xi + Yi)
    }
docs: all of these functions are actually moved to the top due to function hoisting