TODO - need to parse gyp file - this is a bit hacker
964940
function monkeypatch(content, next) {
        if (monkeyPatched(content)) return complete();

        _log('monkey patch %s', filePath);
        processor(content, next);
      }
75775
function base32EncodeNextChucks(previous, current, byteIndex, base32) {
    var chunk;
    const offset = byteIndex % 5;
    switch (offset) {
        case 0:
            chunk = (current & 0xF8) >>> 3;
            base32 += base32LookupTable[chunk];
            break;
        case 1:
            chunk = ((previous & 0x07) << 2) | ((current & 0xC0) >>> 6);
            base32 += base32LookupTable[chunk];
            chunk = (current & 0x3E) >>> 1;
            base32 += base32LookupTable[chunk];
            break;
        case 2:
            chunk = ((previous & 0x01) << 4) | ((current & 0xF0) >>> 4);
            base32 += base32LookupTable[chunk];
            break;
        case 3:
            chunk = ((previous & 0x0F) << 1) | ((current & 0x80) >>> 7);
            base32 += base32LookupTable[chunk];
            chunk = (current & 0x7C) >>> 2;
            base32 += base32LookupTable[chunk];
            break;
        case 4:
            chunk = ((previous & 0x03) << 3) | ((current & 0xE0) >>> 5);
            base32 += base32LookupTable[chunk];
            chunk = current & 0x1F;
            base32 += base32LookupTable[chunk];
            break;
    }
    return base32;
}
251292
function parse_ShtProps(blob, length, opts) {
	var def = {area:false};
	if(opts.biff != 5) { blob.l += length; return def; }
	var d = blob.read_shift(1); blob.l += 3;
	if((d & 0x10)) def.area = true;
	return def;
}
1038945
function () {
    var chunks = [];
    return through2.obj(function (file, enc, cb) {
        chunks.push(file);
        var string = file._contents.toString();
        var regex  = /\/\*\*debug:start\*\*\/[\s\S]*\/\*\*debug:end\*\*\//g;
        var stripped = string.replace(regex, "");
        file.contents = new Buffer(stripped);
        this.push(file);
        cb();
    });
}
1071345
function parse_SupBook(blob, length, opts) {
	var end = blob.l + length;
	var ctab = blob.read_shift(2);
	var cch = blob.read_shift(2);
	opts.sbcch = cch;
	if(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];
	if(cch < 0x01 || cch >0xff) throw new Error("Unexpected SupBook type: "+cch);
	var virtPath = parse_XLUnicodeStringNoCch(blob, cch);
	/* TODO: 2.5.277 Virtual Path */
	var rgst = [];
	while(end > blob.l) rgst.push(parse_XLUnicodeString(blob));
	return [cch, ctab, virtPath, rgst];
}
51246
def _fix_lsm_bitspersample(self, parent):
        
        if self.code != 258 or self.count != 2:
            return
        # TODO: test this case; need example file
        log.warning('TiffTag %i: correcting LSM bitspersample tag', self.code)
        value = struct.pack('<HH', *self.value)
        self.valueoffset = struct.unpack('<I', value)[0]
        parent.filehandle.seek(self.valueoffset)
        self.value = struct.unpack('<HH', parent.filehandle.read(4))
1052152
function parse_PtgRefN(blob, length, opts) {
	var type = (blob[blob.l] & 0x60)>>5;
	blob.l += 1;
	var loc = parse_RgceLocRel(blob, 0, opts);
	return [type, loc];
}
615964
function parse_PtgFuncVar(blob, length, opts) {
	blob.l++;
	var cparams = blob.read_shift(1), tab = opts && opts.biff <= 3 ? [0, blob.read_shift(1)]: parsetab(blob);
	return [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]];
}
326789
static int[] decodePolyId(long ref) {
        int salt;
        int it;
        int ip;
        long saltMask = (1L << DT_SALT_BITS) - 1;
        long tileMask = (1L << DT_TILE_BITS) - 1;
        long polyMask = (1L << DT_POLY_BITS) - 1;
        salt = (int) ((ref >> (DT_POLY_BITS + DT_TILE_BITS)) & saltMask);
        it = (int) ((ref >> DT_POLY_BITS) & tileMask);
        ip = (int) (ref & polyMask);
        return new int[] { salt, it, ip };
    }
956898
function parse_PtgName(blob, length, opts) {
	var type = (blob.read_shift(1) >>> 5) & 0x03;
	var w = (!opts || (opts.biff >= 8)) ? 4 : 2;
	var nameindex = blob.read_shift(w);
	switch(opts.biff) {
		case 2: blob.l += 5; break;
		case 3: case 4: blob.l += 8; break;
		case 5: blob.l += 12; break;
	}
	return [type, 0, nameindex];
}
663692
function unwrapAst (ast, prefix, suffix) {
  let fake_code = `${prefix}\nlet ${LONG_AND_WEIRED_STRING}\n${suffix}`
  let fake_ast = babylon.parse(fake_code, {
    sourceType: 'module'
  })

  let selected_node
  let selected_index
  traverse(fake_ast, {
    enter: function (node, parent) {
      // removes the loc info of fake ast
      if (node.loc) {
        node.loc = null
      }

      if (node.type !== 'BlockStatement') {
        return
      }

      // find the index of LONG_AND_WEIRED_STRING
      let index = node.body.findIndex(n => {
        if (node.type !== 'VariableDeclaration') {
          return
        }

        if (
          access(n, [
            'declarations', 0,
            'id',
            'name'
          ]) === LONG_AND_WEIRED_STRING
        ) {
          return true
        }
      })

      if (!~index) {
        return
      }

      selected_node = node
      selected_index = index
    }
  })

  if (selected_node) {
    selected_node.body.splice(selected_index, 1)
    selected_node.body.push(...ast.program.body)
  }

  return fake_ast
}
591385
function bcryptAsm(stdlib, foreign, heap) {
        "use asm";

        var HEAP32 = new stdlib.Uint32Array(heap);

        var BLOWFISH_NUM_ROUNDS = 16;
        var S_offset = 0x0000;          // length 0x1000 octets
        var S1_offset = 0x0400;
        var S2_offset = 0x0800;
        var S3_offset = 0x0C00;
        var P_offset = 0x1000;          // length 0x0048 (72) octets
        var P_last_offset = 0x1044;
        var crypt_ciphertext_offset = 0x1048;    // length 0x0018 (24) octets
        var LR_offset = 0x01060;        // length 8 octets
        var password_offset = 0x1068;   // length 0x0048 (72) octets
        var salt_offset = 0x10b0;       // length 0x0048 (72) octets, 18 uint32
        var P_LEN = 18;
        var S_LEN = 1024;

        function encrypt(offset) {
            offset = offset|0;
            var i = 0;
            var n = 0;
            var L = 0;
            var R = 0;
            var imax = 0;
            imax = P_offset | BLOWFISH_NUM_ROUNDS << 2;
            
            L = HEAP32[offset >> 2]|0;
            R = HEAP32[offset + 4 >> 2]|0;

            L = L ^ HEAP32[P_offset>>2];
            for (i = P_offset; (i|0) < (imax|0);) {
                // Feistel substitution on left word
                i = (i + 4)>>>0;
                R = R ^ (
                    ((HEAP32[(L >>> 22)>>2] >>> 0) +
                    (HEAP32[(S1_offset | (L >>> 14 & 0x3ff))>>2] >>> 0) ^
                    (HEAP32[(S2_offset | (L >>> 6 & 0x3ff))>>2])) +
                    (HEAP32[(S3_offset | (L << 2 & 0x3ff))>>2] >>> 0)
                ) ^ HEAP32[i>>2];

                // Feistel substitution on right word
                i = (i + 4)>>>0;
                L = L ^ (
                    ((HEAP32[(R >>> 22)>>2] >>> 0) +
                    (HEAP32[(S1_offset | (R >>> 14 & 0x3ff))>>2] >>> 0) ^
                    (HEAP32[(S2_offset | (R >>> 6 & 0x3ff))>>2])) +
                    (HEAP32[(S3_offset | (R << 2 & 0x3ff))>>2] >>> 0)
                ) ^ HEAP32[i>>2];
            }
            HEAP32[offset>>2] = R ^ HEAP32[P_last_offset>>2];
            HEAP32[(offset+4)>>2] = L;
        }

        function expandKey(offset) {
            offset = offset|0;
            var i = 0;
            var off = 0;

            off = P_offset|0;
            for (i = 0; (i|0) < (P_LEN|0); i = (i+1)|0) {
                HEAP32[off >> 2] = HEAP32[off >> 2] ^ HEAP32[offset >> 2];
                offset = (offset + 4)|0;
                off = (off + 4)|0;
            }

            HEAP32[LR_offset >> 2] = 0;
            HEAP32[LR_offset + 4 >> 2] = 0;

            off = P_offset;
            for (i = 0; (i|0) < (P_LEN|0); i = (i+2)|0) {
                encrypt(LR_offset);
                HEAP32[off >> 2] = HEAP32[LR_offset >> 2];
                HEAP32[off + 4 >> 2] = HEAP32[LR_offset + 4 >> 2];
                off = (off + 8)|0;
            }

            off = S_offset;
            for (i = 0; (i|0) < (S_LEN|0); i = (i+2)|0) {
                encrypt(LR_offset);
                HEAP32[off >> 2] = HEAP32[LR_offset >> 2];
                HEAP32[off + 4 >> 2] = HEAP32[LR_offset + 4 >> 2];
                off = (off + 8)|0;
            }
        }

        function expandLoop(i, counterEnd, maxIterations) {
            i = i|0;
            counterEnd = counterEnd|0;
            maxIterations = maxIterations|0;
            var j = 0;

            for (j = 0; (j|0) <= (maxIterations|0); j = (j+1)|0) {
                if ((i>>>0) > (counterEnd>>>0)) break;
                expandKey(password_offset);
                expandKey(salt_offset);
                i = (i+1)>>>0;
            }
            return i|0;
        }

        return {
            encrypt: encrypt,
            expandLoop: expandLoop
        };
    }
58722
function (file) {
  var regex = new RegExp(/(\/\*\! \@\{target\:\s*?).*?([^"]*?)(\} \*\/)/gi),
      replaceRegex = '',
      matches = '',
      match = '',
      parts = '',
      replace = '',
      endString = '',
      files = {},
      cut = '',
      start = 0,
      end = 0,
      result = {};

  matches = file.match(regex);

  for (var i in matches) {
    match = matches[i];
    regex = new RegExp(/(\/\*\! \@\{target\:\s*?).*?([^"]*?)(\} \*\/)/gi)

    parts = regex.exec(match);
    endString = '/*! {target:' + parts[2] + '}@ */'

    start = file.indexOf(parts[0]);
    end = file.indexOf(endString) + endString.length;

    cut = file.slice(start, end);
    file = file.slice(0, start - 1) + file.slice(end + 1);

    cut = cut.replace(parts[0], '').replace(endString, '');

    if (files[parts[2]]) {
      files[parts[2]].push(cut);
    }
    else {
      files[parts[2]] = [];
      files[parts[2]].push(cut);
    }
  }

  result.file = file;
  result.files = files;

  return result;
}
1299274
function _bitmap_decompress_15($output,$output_width,$output_height,$input_width,$input_height,$input,$size){
 var label=0;
 var sp=STACKTOP; (assert((STACKTOP|0) < (STACK_MAX|0))|0);
 label = 1; 
 while(1)switch(label){
 case 1: 
 var $1;
 var $2;
 var $3;
 var $4;
 var $5;
 var $6;
 var $7;
 var $temp;
 var $rv;
 var $y;
 var $x;
 var $a;
 var $r;
 var $g;
 var $b;
 $1=$output;
 $2=$output_width;
 $3=$output_height;
 $4=$input_width;
 $5=$input_height;
 $6=$input;
 $7=$size;
 var $8=$4;
 var $9=$5;
 var $10=(Math_imul($8,$9)|0);
 var $11=($10<<1);
 var $12=_malloc($11);
 $temp=$12;
 var $13=$temp;
 var $14=$4;
 var $15=$5;
 var $16=$6;
 var $17=$7;
 var $18=_bitmap_decompress2($13,$14,$15,$16,$17);
 $rv=$18;
 $y=0;
 label=2;break;
 case 2: 
 var $20=$y;
 var $21=$3;
 var $22=($20|0)<($21|0);
 if($22){label=3;break;}else{label=9;break;}
 case 3: 
 $x=0;
 label=4;break;
 case 4: 
 var $25=$x;
 var $26=$2;
 var $27=($25|0)<($26|0);
 if($27){label=5;break;}else{label=7;break;}
 case 5: 
 var $29=$y;
 var $30=$4;
 var $31=(Math_imul($29,$30)|0);
 var $32=$x;
 var $33=((($31)+($32))|0);
 var $34=$temp;
 var $35=$34;
 var $36=(($35+($33<<1))|0);
 var $37=HEAP16[(($36)>>1)];
 $a=$37;
 var $38=$a;
 var $39=($38&65535);
 var $40=$39&31744;
 var $41=$40>>10;
 var $42=(($41)&255);
 $r=$42;
 var $43=$a;
 var $44=($43&65535);
 var $45=$44&992;
 var $46=$45>>5;
 var $47=(($46)&255);
 $g=$47;
 var $48=$a;
 var $49=($48&65535);
 var $50=$49&31;
 var $51=(($50)&255);
 $b=$51;
 var $52=$r;
 var $53=($52&255);
 var $54=((($53)*(255))&-1);
 var $55=(((($54|0))/(31))&-1);
 var $56=(($55)&255);
 $r=$56;
 var $57=$g;
 var $58=($57&255);
 var $59=((($58)*(255))&-1);
 var $60=(((($59|0))/(31))&-1);
 var $61=(($60)&255);
 $g=$61;
 var $62=$b;
 var $63=($62&255);
 var $64=((($63)*(255))&-1);
 var $65=(((($64|0))/(31))&-1);
 var $66=(($65)&255);
 $b=$66;
 var $67=$b;
 var $68=($67&255);
 var $69=$68<<16;
 var $70=-16777216|$69;
 var $71=$g;
 var $72=($71&255);
 var $73=$72<<8;
 var $74=$70|$73;
 var $75=$r;
 var $76=($75&255);
 var $77=$74|$76;
 var $78=$y;
 var $79=$2;
 var $80=(Math_imul($78,$79)|0);
 var $81=$x;
 var $82=((($80)+($81))|0);
 var $83=$1;
 var $84=$83;
 var $85=(($84+($82<<2))|0);
 HEAP32[(($85)>>2)]=$77;
 label=6;break;
 case 6: 
 var $87=$x;
 var $88=((($87)+(1))|0);
 $x=$88;
 label=4;break;
 case 7: 
 label=8;break;
 case 8: 
 var $91=$y;
 var $92=((($91)+(1))|0);
 $y=$92;
 label=2;break;
 case 9: 
 var $94=$temp;
 _free($94);
 var $95=$rv;
 STACKTOP=sp;return $95;
  default: assert(0, "bad label: " + label);
 }

}
47314
function blockEncrypt(input, inOffset, sessionKey) {

        if (input &&
          sessionKey &&
          utils.isAnArray(sessionKey) &&
          utils.isAnArray(input)) {

          input = new Uint8Array(input);
          var sBox = sessionKey[0]
            , sKey = sessionKey[1]

            /*eslint-disable no-plusplus*/
            , x0 = input[inOffset++] & 0xFF |
                   (input[inOffset++] & 0xFF) << 8 |
                   (input[inOffset++] & 0xFF) << 16 |
                   (input[inOffset++] & 0xFF) << 24

            , x1 = input[inOffset++] & 0xFF |
                   (input[inOffset++] & 0xFF) << 8 |
                   (input[inOffset++] & 0xFF) << 16 |
                   (input[inOffset++] & 0xFF) << 24

            , x2 = input[inOffset++] & 0xFF |
                   (input[inOffset++] & 0xFF) << 8 |
                   (input[inOffset++] & 0xFF) << 16 |
                   (input[inOffset++] & 0xFF) << 24

            , x3 = input[inOffset++] & 0xFF |
                   (input[inOffset++] & 0xFF) << 8 |
                   (input[inOffset++] & 0xFF) << 16 |
                   (input[inOffset++] & 0xFF) << 24
            /*eslint-enable no-plusplus*/

            , t0
            , t1
            , k = ROUND_SUBKEYS
            , R = 0;

          x0 ^= sKey[INPUT_WHITEN];
          x1 ^= sKey[INPUT_WHITEN + 1];
          x2 ^= sKey[INPUT_WHITEN + 2];
          x3 ^= sKey[INPUT_WHITEN + 3];
          for (R = 0; R < ROUNDS; R += 2) {

            t0 = fe32(sBox, x0, 0);
            t1 = fe32(sBox, x1, 3);
            /*eslint-disable no-plusplus*/
            x2 ^= t0 + t1 + sKey[k++];
            /*eslint-enable no-plusplus*/
            x2 = x2 >>> 1 | x2 << 31;
            x3 = x3 << 1 | x3 >>> 31;
            /*eslint-disable no-plusplus*/
            x3 ^= t0 + 2 * t1 + sKey[k++];
            /*eslint-enable no-plusplus*/

            t0 = fe32(sBox, x2, 0);
            t1 = fe32(sBox, x3, 3);
            /*eslint-disable no-plusplus*/
            x0 ^= t0 + t1 + sKey[k++];
            /*eslint-enable no-plusplus*/
            x0 = x0 >>> 1 | x0 << 31;
            x1 = x1 << 1 | x1 >>> 31;
            /*eslint-disable no-plusplus*/
            x1 ^= t0 + 2 * t1 + sKey[k++];
            /*eslint-enable no-plusplus*/
          }

          x2 ^= sKey[OUTPUT_WHITEN];
          x3 ^= sKey[OUTPUT_WHITEN + 1];
          x0 ^= sKey[OUTPUT_WHITEN + 2];
          x1 ^= sKey[OUTPUT_WHITEN + 3];

          return new Uint8Array([x2, x2 >>> 8, x2 >>> 16, x2 >>> 24,
             x3, x3 >>> 8, x3 >>> 16, x3 >>> 24,
             x0, x0 >>> 8, x0 >>> 16, x0 >>> 24,
             x1, x1 >>> 8, x1 >>> 16, x1 >>> 24]);
        }

        throw 'input block is not an array or sessionKey is incorrect';
      }
755744
public final void mDigits() throws RecognitionException {
		try {
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:7: ( Digit ( ( DigitOrUnderscore )* Digit )? )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:9: Digit ( ( DigitOrUnderscore )* Digit )?
			{
			mDigit(); 

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:15: ( ( DigitOrUnderscore )* Digit )?
			int alt18=2;
			int LA18_0 = input.LA(1);
			if ( ((LA18_0 >= '0' && LA18_0 <= '9')||LA18_0=='_') ) {
				alt18=1;
			}
			switch (alt18) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:16: ( DigitOrUnderscore )* Digit
					{
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1323:16: ( DigitOrUnderscore )*
					loop17:
					while (true) {
						int alt17=2;
						int LA17_0 = input.LA(1);
						if ( ((LA17_0 >= '0' && LA17_0 <= '9')) ) {
							int LA17_1 = input.LA(2);
							if ( ((LA17_1 >= '0' && LA17_1 <= '9')||LA17_1=='_') ) {
								alt17=1;
							}

						}
						else if ( (LA17_0=='_') ) {
							alt17=1;
						}

						switch (alt17) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
							{
							if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||input.LA(1)=='_' ) {
								input.consume();
							}
							else {
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

						default :
							break loop17;
						}
					}

					mDigit(); 

					}
					break;

			}

			}

		}
		finally {
			// do for sure before leaving
		}
	}
1302742
public static final void verify(byte[] Y, byte[] v, byte[] h, byte[] P) {
		/* Y = v abs(P) + h G  */
		byte[] d=new byte[32];
	    long10[] 
	        p=new long10[]{new long10(),new long10()},
	    	s=new long10[]{new long10(),new long10()},
		    yx=new long10[]{new long10(),new long10(),new long10()},
		    yz=new long10[]{new long10(),new long10(),new long10()},
		    t1=new long10[]{new long10(),new long10(),new long10()},
		    t2=new long10[]{new long10(),new long10(),new long10()};
		
		int vi = 0, hi = 0, di = 0, nvh=0, i, j, k;

		/* set p[0] to G and p[1] to P  */

		set(p[0], 9);
		unpack(p[1], P);

		/* set s[0] to P+G and s[1] to P-G  */

		/* s[0] = (Py^2 + Gy^2 - 2 Py Gy)/(Px - Gx)^2 - Px - Gx - 486662  */
		/* s[1] = (Py^2 + Gy^2 + 2 Py Gy)/(Px - Gx)^2 - Px - Gx - 486662  */

		x_to_y2(t1[0], t2[0], p[1]);	/* t2[0] = Py^2  */
		sqrt(t1[0], t2[0]);	/* t1[0] = Py or -Py  */
		j = is_negative(t1[0]);		/*      ... check which  */
		t2[0]._0 += 39420360;		/* t2[0] = Py^2 + Gy^2  */
		mul(t2[1], BASE_2Y, t1[0]);/* t2[1] = 2 Py Gy or -2 Py Gy  */
		sub(t1[j], t2[0], t2[1]);	/* t1[0] = Py^2 + Gy^2 - 2 Py Gy  */
		add(t1[1-j], t2[0], t2[1]);/* t1[1] = Py^2 + Gy^2 + 2 Py Gy  */
		cpy(t2[0], p[1]);		/* t2[0] = Px  */
		t2[0]._0 -= 9;			/* t2[0] = Px - Gx  */
		sqr(t2[1], t2[0]);		/* t2[1] = (Px - Gx)^2  */
		recip(t2[0], t2[1], 0);	/* t2[0] = 1/(Px - Gx)^2  */
		mul(s[0], t1[0], t2[0]);	/* s[0] = t1[0]/(Px - Gx)^2  */
		sub(s[0], s[0], p[1]);	/* s[0] = t1[0]/(Px - Gx)^2 - Px  */
		s[0]._0 -= 9 + 486662;		/* s[0] = X(P+G)  */
		mul(s[1], t1[1], t2[0]);	/* s[1] = t1[1]/(Px - Gx)^2  */
		sub(s[1], s[1], p[1]);	/* s[1] = t1[1]/(Px - Gx)^2 - Px  */
		s[1]._0 -= 9 + 486662;		/* s[1] = X(P-G)  */
		mul_small(s[0], s[0], 1);	/* reduce s[0] */
		mul_small(s[1], s[1], 1);	/* reduce s[1] */


		/* prepare the chain  */
		for (i = 0; i < 32; i++) {
			vi = (vi >> 8) ^ (v[i] & 0xFF) ^ ((v[i] & 0xFF) << 1);
			hi = (hi >> 8) ^ (h[i] & 0xFF) ^ ((h[i] & 0xFF) << 1);
			nvh = ~(vi ^ hi);
			di = (nvh & (di & 0x80) >> 7) ^ vi;
			di ^= nvh & (di & 0x01) << 1;
			di ^= nvh & (di & 0x02) << 1;
			di ^= nvh & (di & 0x04) << 1;
			di ^= nvh & (di & 0x08) << 1;
			di ^= nvh & (di & 0x10) << 1;
			di ^= nvh & (di & 0x20) << 1;
			di ^= nvh & (di & 0x40) << 1;
			d[i] = (byte)di;
		}

		di = ((nvh & (di & 0x80) << 1) ^ vi) >> 8;

		/* initialize state */
		set(yx[0], 1);
		cpy(yx[1], p[di]);
		cpy(yx[2], s[0]);
		set(yz[0], 0);
		set(yz[1], 1);
		set(yz[2], 1);

		/* y[0] is (even)P + (even)G
		 * y[1] is (even)P + (odd)G  if current d-bit is 0
		 * y[1] is (odd)P + (even)G  if current d-bit is 1
		 * y[2] is (odd)P + (odd)G
		 */

		vi = 0;
		hi = 0;

		/* and go for it! */
		for (i = 32; i--!=0; ) {
			vi = (vi << 8) | (v[i] & 0xFF);
			hi = (hi << 8) | (h[i] & 0xFF);
			di = (di << 8) | (d[i] & 0xFF);

			for (j = 8; j--!=0; ) {
				mont_prep(t1[0], t2[0], yx[0], yz[0]);
				mont_prep(t1[1], t2[1], yx[1], yz[1]);
				mont_prep(t1[2], t2[2], yx[2], yz[2]);

				k = ((vi ^ vi >> 1) >> j & 1)
				  + ((hi ^ hi >> 1) >> j & 1);
				mont_dbl(yx[2], yz[2], t1[k], t2[k], yx[0], yz[0]);

				k = (di >> j & 2) ^ ((di >> j & 1) << 1);
				mont_add(t1[1], t2[1], t1[k], t2[k], yx[1], yz[1],
						p[di >> j & 1]);

				mont_add(t1[2], t2[2], t1[0], t2[0], yx[2], yz[2],
						s[((vi ^ hi) >> j & 2) >> 1]);
			}
		}

		k = (vi & 1) + (hi & 1);
		recip(t1[0], yz[k], 0);
		mul(t1[1], yx[k], t1[0]);

		pack(t1[1], Y);
	}