/* eslint-enable no-shadow /* eslint-disable no-bitwise
354232
function decryptCBC(userKey, chiperText) {
        if (utils.isAnArray(userKey) &&
          utils.isAnArray(chiperText)) {

          userKey = new Uint8Array(userKey);
          chiperText = new Uint8Array(chiperText);
        } else {

          throw 'Inputs must be an array';
        }
        userKey = makeKey(userKey);

        var result = []
          , loops = chiperText.length / BLOCK_SIZE
          , pos = 0
          , cBuffer = []
          , buffer1 = []
          , plain = []
          , vector = initializingVector
          , index = 0
          , secondIndex = 0
          , tmpCBuffer
          , nVal
          , position;

        for (; index < loops; index += 1) {

          cBuffer = chiperText.subarray(pos, pos + BLOCK_SIZE);
          if (cBuffer.length < BLOCK_SIZE) {

            tmpCBuffer = [];
            for (paddingIndex = 0; paddingIndex < BLOCK_SIZE; paddingIndex += 1) {

              nVal = cBuffer[paddingIndex];
              if (nVal !== undefined) {

                tmpCBuffer.push(nVal);
              } else {

                tmpCBuffer.push(0x00);
              }
            }
            cBuffer = tmpCBuffer;
          }
          buffer1 = blockDecrypt(cBuffer, 0, userKey);
          plain = xorBuffers(buffer1, vector);

          for (secondIndex = pos; secondIndex < plain.length + pos; secondIndex += 1) {

            position = secondIndex - pos;
            if (plain[position] !== undefined) {

              result.splice(secondIndex, 0, plain[position]);
            }
          }
          plain = [];
          vector = cBuffer;

          pos += BLOCK_SIZE;
        }

        return result;
      }
698658
function matchBinaries (input, binary) {
  const regExp = bytecodeToBytecodeRegex(binary);
  return (input.match(regExp) !== null);
}
809909
function setbit(key, offset, value, req) {
  var buf = this.getValueBuffer(key, req, true)
    , zeros
    , pos
    , shift
    , byte
    , bit;
  if(buf === undefined) buf = new Buffer('');
  pos = Math.floor(offset / 8);
  bit = pos >= buf.length ? 0 : this.getbit(key, offset, req);

  if(pos + 1 >= buf.length) {
    zeros = new Buffer(pos + 1 - buf.length);
    zeros.fill('\u0000');
    buf = Buffer.concat([buf, zeros], buf.length + zeros.length);
  }

  shift = 7 - (offset & 0x7);
  byte = buf[pos];
  byte &= ~(1 << shift);
  byte |= ((value & 0x01) << shift);
  buf[pos] = byte;
  this.setKey(key, buf, undefined, undefined, undefined, req);
  return bit;
}
1096267
function bitwise(str){
	var hash = 0;
	if (str.length == 0) return hash;
	for (var i = 0; i < str.length; i++) {
		var ch = str.charCodeAt(i);
		hash = ((hash<<5)-hash) + ch;
		hash = hash & hash; // Convert to 32bit integer
	}
	return hash;
}
1065719
function binaryString( x ) {
	var b;

	// Convert the input value to a bit string:
	b = div2( x );

	// Left pad the bit string to ensure 32 bits are represented:
	b = lpad( b, 32, '0' );

	return b;
}
566844
function(context) {
        /*
        if a key is a node type, ESLint calls that visitor function while going down the tree
        if a key is a node type plus :exit, ESLint calls that visitor function while going up the tree
        if a key is an event name, ESLint calls that handler function for code path analysis
        */

        'use strict';
        var defaultOptions = {
            comments: true,
            strings: true,
            identifiers: true,
            templates: true,
            skipWords: [],
            skipIfMatch: [],
            skipWordIfMatch: [],
            minLength: 1
        },
        options = lodash.assign(defaultOptions, context.options[0]),
        lang = options.lang || 'en_US';


        if (dictionaryLang !== lang) { //Dictionary will only be initialized if changed
            dictionaryLang = lang;
            initializeDictionary(lang);
        }

        options.skipWords = new Set(lodash.union(options.skipWords, skipWords)
            .map(function (string) {
                return string.toLowerCase();
            }));

        function initializeDictionary(language) {
            dictionary = spell.parse({
                aff: fs.readFileSync(__dirname + '/utils/dicts/' + language + '.aff'),
                dic: fs.readFileSync(__dirname + '/utils/dicts/' + language + '.dic')
            });

            spell.use(dictionary);
        }

        function isSpellingError(aWord) {
            return !options.skipWords.has(aWord) && !spell.check(aWord);
        }

        function checkSpelling(aNode, value, spellingType) {
            if(!hasToSkip(value)) {
                // Regular expression matches regexp metacharacters, and any special char
                var regexp = /(\\[sSwdDB0nfrtv])|\\[0-7][0-7][0-7]|\\x[0-9A-F][0-9A-F]|\\u[0-9A-F][0-9A-F][0-9A-F][0-9A-F]|[^0-9a-zA-Z ']/g,
                    nodeWords = value.replace(regexp, ' ')
                        .replace(/([A-Z])/g, ' $1').split(' '),
                    errors;
                errors = nodeWords
                    .filter(hasToSkipWord)
                    .filter(isSpellingError)
                    .filter(function(aWord) {
                      // Split words by numbers for special cases such as test12anything78variable and to include 2nd and 3rd ordinals
                      // also for Proper names we convert to lower case in second pass.
                        var splitByNumberWords = aWord.replace(/[0-9']/g, ' ').replace(/([A-Z])/g, ' $1').toLowerCase().split(' ');
                        return splitByNumberWords.some(isSpellingError);
                    })
                    .forEach(function(aWord) {
                        context.report(
                            aNode,
                            'You have a misspelled word: {{word}} on {{spellingType}}', {
                              word: aWord,
                              spellingType: spellingType
                        });
                    });
                }
            }

        function checkComment(aNode) {
            if(options.comments) {
                checkSpelling(aNode, aNode.value, 'Comment');
            }
        }

        function checkLiteral(aNode){
            if(options.strings && typeof aNode.value === 'string') {
                checkSpelling(aNode, aNode.value, 'String');
            }
        }
        function checkTemplateElement(aNode){
            if(options.templates && typeof aNode.value.raw === 'string') {
                checkSpelling(aNode, aNode.value.raw, 'Template');
            }
        }

        function checkIdentifier(aNode) {
            if(options.identifiers) {
                checkSpelling(aNode, aNode.name, 'Identifier');
            }
        }
        /* Returns true if the string in value has to be skipped for spell checking */
        function hasToSkip(value) {
            return options.skipWords.has(value) ||
                lodash.find(options.skipIfMatch, function (aPattern) {
                    return value.match(aPattern);
                });
        }


        /**
         * returns false if the word has to be skipped
         * @param  {string}  word
         * @return {Boolean} false if skip; true if not
         */
        function hasToSkipWord(word) {
            if(word.length < options.minLength) return false;
            if(lodash.find(options.skipWordIfMatch, function (aPattern) {
                return word.match(aPattern);
            })){
                return false;
            }
            return true;
        }

        // Coverage exclusion only needed for ESLint<4
        /* istanbul ignore next */
        if (isEslint4OrAbove(context)) {
          context
            .getSourceCode()
            .getAllComments()
            .forEach(function (commentNode) {
              checkComment(commentNode);
            });
        }

        return {
            // Noop in ESLint 4+
            'BlockComment': checkComment,
            // Noop in ESLint 4+
            'LineComment': checkComment,
            'Literal': checkLiteral,
            'TemplateElement': checkTemplateElement,
            'Identifier': checkIdentifier
        };
    }
1336319
function(value) {
      var s = '';
      var i = 1;
      var len = value.length - 1;
      var c, c2, hex, n, index, length;

      while (i < len) {
        c = value.charAt(i++);

        if (c === '\\') {
          if (i < len) {
            c2 = value.charCodeAt(i);
            if (isLineTerminator(c2)) {
              i++;
              if (c2 === 0x0D && i < len && value.charCodeAt(i) === 0x0A) {
                i++;
              }
              continue;
            }
          }

          c = value.charAt(i++);
          switch (c) {
            case 'b':
              c = '\b';
              break;
            case 't':
              c = '\t';
              break;
            case 'r':
              c = '\r';
              break;
            case 'n':
              c = '\n';
              break;
            case 'v':
              c = '\x0B';
              break;
            case 'f':
              c = '\f';
              break;
            case 'u':
            case 'x':
              if (c === 'u' && i < len && value.charAt(i) === '{') {
                i++;
                index = value.indexOf('}', i);
                if (!~index) {
                  this.unexpected();
                }
                hex = value.substring(i, index);
                i = index + 1;
              } else {
                length = c === 'u' ? 4 : 2;
                hex = value.substr(i, length);
                i += length;
              }
              c = fromCodePoint(parseInt(hex, 16));
              break;
            default:
              if (isOctalDigit(c)) {
                n = c;
                do {
                  c = value.charAt(i);
                  if (!isOctalDigit(c)) {
                    break;
                  }
                  n += c;
                } while (i++ < len && n.length < 3);

                if (n.length > 0 && n.charAt(0) === '0') {
                  n = n.substring(1);
                }
                c = fromCharCode(parseInt(n, 8));
              }
          }
        }
        s += c;
      }

      return s;
    }
947283
function bnpBitwiseTo(a,op,r) {
var i, f, m = Math.min(a.t,this.t);
for(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]);
if(a.t < this.t) {
 f = a.s&this.DM;
 for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f);
 r.t = this.t;
} else {
 f = this.s&this.DM;
 for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]);
 r.t = a.t;
}
r.s = op(this.s,a.s);
r.clamp();
}
904053
function getChangedBits({ state: prevState }, { state: nextState }) {
    let mask = 0
    for (let id in nextState) {
      if (prevState[id] !== nextState[id]) {
        mask |= NAME_BITS[id]
      }
    }
    return mask
  }
519374
function setBit (buffer, pos, bit) {
  const byte = Math.floor(pos / 8)
  const bitPos = pos % 8

  if (bit === 0) {
    const mask = 255 - (1 << bitPos)
    buffer[byte] &= mask
  } else {
    const mask = (1 << bitPos)
    buffer[byte] |= mask
  }
}
1237800
function bnpFromRadix(s, b)
{
  this.fromInt(0);
  if (b == null) b = 10;
  var cs = this.chunkSize(b);
  var d = Math.pow(b, cs),
    mi = false,
    j = 0,
    w = 0;
  for (var i = 0; i < s.length; ++i)
  {
    var x = intAt(s, i);
    if (x < 0)
    {
      if (s.charAt(i) == "-" && this.signum() == 0) mi = true;
      continue;
    }
    w = b * w + x;
    if (++j >= cs)
    {
      this.dMultiply(d);
      this.dAddOffset(w, 0);
      j = 0;
      w = 0;
    }
  }
  if (j > 0)
  {
    this.dMultiply(Math.pow(b, j));
    this.dAddOffset(w, 0);
  }
  if (mi) Int128.ZERO.subTo(this, this);
}
345728
function makeCRCTable() {
    var c;
    var crcTable = [];
    for (var n = 0; n < 256; n++) {
        c = n;
        for (var k = 0; k < 8; k++) {
            /* jslint bitwise: true */
            c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
        }
        crcTable[n] = c;
    }
    return crcTable;
}
1108787
function baseCreateWrapper(data) {
      var func = data[0],
          bitmask = data[1],
          arity = data[2],
          thisArg = data[3],
          partialArgs = data[4],
          partialRightArgs = data[5],
          partialHolders = data[6],
          partialRightHolders = data[7];

      var isBind = bitmask & BIND_FLAG,
          isBindKey = bitmask & BIND_KEY_FLAG,
          isCurry = bitmask & CURRY_FLAG,
          isCurryBound = bitmask & CURRY_BOUND_FLAG,
          key = func;

      function bound() {
        var thisBinding = isBind ? thisArg : this;
        if (partialArgs) {
          var args = composeArgs(partialArgs, partialHolders, arguments);
        }
        if (partialRightArgs) {
          args = composeArgsRight(partialRightArgs, partialRightHolders, args || arguments);
        }
        if (isCurry) {
          var argsLength = arguments.length;
          if (argsLength < arity) {
            args || (args = slice(arguments));
            bitmask |= PARTIAL_FLAG;
            bitmask &= ~PARTIAL_RIGHT_FLAG
            if (!isCurryBound) {
              bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
            }
            var newArity = nativeMax(0, arity - argsLength);
            return baseCreateWrapper([func, bitmask, newArity, thisArg, args, null, []]);
          }
        }
        args || (args = arguments);
        if (isBindKey) {
          func = thisBinding[key];
        }
        if (this instanceof bound) {
          thisBinding = baseCreate(func.prototype);
          var result = func.apply(thisBinding, args);
          return isObject(result) ? result : thisBinding;
        }
        return func.apply(thisBinding, args);
      }
      setData(bound, data);
      return bound;
    }
1152336
function writeBitField(setBits, bitIndex) {
	var bitLen = bitIndex.length;
	var blen = Math.ceil(bitLen / 8);
	var unused = blen * 8 - bitLen;
	var bits = Buffer.alloc(1 + blen); // zero-filled
	bits[0] = unused;
	for (var i = 0; i < bitLen; ++i) {
		var byteN = 1 + Math.floor(i / 8);
		var bit = 7 - (i % 8);
		var mask = 1 << bit;
		var name = bitIndex[i];
		if (name === undefined)
			continue;
		var bitVal = (setBits.indexOf(name) !== -1);
		if (bitVal) {
			bits[byteN] |= mask;
		}
	}
	return (bits);
}
132909
function fixDoubleBlack(stack) {
  var n, p, s, z
  for(var i=stack.length-1; i>=0; --i) {
    n = stack[i]
    if(i === 0) {
      n._color = BLACK
      return
    }
    //console.log("visit node:", n.key, i, stack[i].key, stack[i-1].key)
    p = stack[i-1]
    if(p.left === n) {
      //console.log("left child")
      s = p.right
      if(s.right && s.right._color === RED) {
        //console.log("case 1: right sibling child red")
        s = p.right = cloneNode(s)
        z = s.right = cloneNode(s.right)
        p.right = s.left
        s.left = p
        s.right = z
        s._color = p._color
        n._color = BLACK
        p._color = BLACK
        z._color = BLACK
        recount(p)
        recount(s)
        if(i > 1) {
          var pp = stack[i-2]
          if(pp.left === p) {
            pp.left = s
          } else {
            pp.right = s
          }
        }
        stack[i-1] = s
        return
      } else if(s.left && s.left._color === RED) {
        //console.log("case 1: left sibling child red")
        s = p.right = cloneNode(s)
        z = s.left = cloneNode(s.left)
        p.right = z.left
        s.left = z.right
        z.left = p
        z.right = s
        z._color = p._color
        p._color = BLACK
        s._color = BLACK
        n._color = BLACK
        recount(p)
        recount(s)
        recount(z)
        if(i > 1) {
          var pp = stack[i-2]
          if(pp.left === p) {
            pp.left = z
          } else {
            pp.right = z
          }
        }
        stack[i-1] = z
        return
      }
      if(s._color === BLACK) {
        if(p._color === RED) {
          //console.log("case 2: black sibling, red parent", p.right.value)
          p._color = BLACK
          p.right = repaint(RED, s)
          return
        } else {
          //console.log("case 2: black sibling, black parent", p.right.value)
          p.right = repaint(RED, s)
          continue  
        }
      } else {
        //console.log("case 3: red sibling")
        s = cloneNode(s)
        p.right = s.left
        s.left = p
        s._color = p._color
        p._color = RED
        recount(p)
        recount(s)
        if(i > 1) {
          var pp = stack[i-2]
          if(pp.left === p) {
            pp.left = s
          } else {
            pp.right = s
          }
        }
        stack[i-1] = s
        stack[i] = p
        if(i+1 < stack.length) {
          stack[i+1] = n
        } else {
          stack.push(n)
        }
        i = i+2
      }
    } else {
      //console.log("right child")
      s = p.left
      if(s.left && s.left._color === RED) {
        //console.log("case 1: left sibling child red", p.value, p._color)
        s = p.left = cloneNode(s)
        z = s.left = cloneNode(s.left)
        p.left = s.right
        s.right = p
        s.left = z
        s._color = p._color
        n._color = BLACK
        p._color = BLACK
        z._color = BLACK
        recount(p)
        recount(s)
        if(i > 1) {
          var pp = stack[i-2]
          if(pp.right === p) {
            pp.right = s
          } else {
            pp.left = s
          }
        }
        stack[i-1] = s
        return
      } else if(s.right && s.right._color === RED) {
        //console.log("case 1: right sibling child red")
        s = p.left = cloneNode(s)
        z = s.right = cloneNode(s.right)
        p.left = z.right
        s.right = z.left
        z.right = p
        z.left = s
        z._color = p._color
        p._color = BLACK
        s._color = BLACK
        n._color = BLACK
        recount(p)
        recount(s)
        recount(z)
        if(i > 1) {
          var pp = stack[i-2]
          if(pp.right === p) {
            pp.right = z
          } else {
            pp.left = z
          }
        }
        stack[i-1] = z
        return
      }
      if(s._color === BLACK) {
        if(p._color === RED) {
          //console.log("case 2: black sibling, red parent")
          p._color = BLACK
          p.left = repaint(RED, s)
          return
        } else {
          //console.log("case 2: black sibling, black parent")
          p.left = repaint(RED, s)
          continue  
        }
      } else {
        //console.log("case 3: red sibling")
        s = cloneNode(s)
        p.left = s.right
        s.right = p
        s._color = p._color
        p._color = RED
        recount(p)
        recount(s)
        if(i > 1) {
          var pp = stack[i-2]
          if(pp.right === p) {
            pp.right = s
          } else {
            pp.left = s
          }
        }
        stack[i-1] = s
        stack[i] = p
        if(i+1 < stack.length) {
          stack[i+1] = n
        } else {
          stack.push(n)
        }
        i = i+2
      }
    }
  }
}
681173
function bin_val() {
    var ret = this.seq(
        this.istringf('b'),
        bitChar,
        this.mightf(
            this.choicef(
                bit_string,
                bit_range)));
    var r3 = ret[3];
    if (r3) {
        if (typeof(r3) === "string") {
            // series of concatenated bit values
            return ret[2] + r3;
        } else {
            // range
            r3.setFirst(ret[2]);
            return r3;
        }
    }
    return ret[2];
}
603028
function getbit(key, bitoffset, req) {
  var buf = this.getValueBuffer(key, req)
    , byte = bitoffset >> 3
    , bit = 7 - (bitoffset & 0x7)
    , bitval = 0;
  if(buf === undefined) return 0;
  if(byte < buf.length) {
    bitval = buf[byte] & (1 << bit);
  }
  return bitval ? 1 : 0;
}