Byte swap (32 bit or 64 bit registers only) (i486).
330913
public final void bswap(Register dst)
  {
    assert(dst.type() == REG_GPD || dst.type() == REG_GPQ);
    emitX86(INST_BSWAP, dst);
  }
82676
private static byte[] toByteArrayReverse(BitSet bits) {
        byte[] bytes = new byte[bits.length() / 8 + 1];
        for (int i = 0; i < bits.length(); i++) {
            if (bits.get(i)) {
                final int value = bytes[i / 8] | (1 << (7 - (i % 8)));
                bytes[i / 8] = (byte) value;
            }
        }
        return bytes;
    }
925051
@SuppressWarnings("deprecation")
    private static int unsignedShortBE(ByteBuf buffer, int offset) {
        return buffer.order() == ByteOrder.BIG_ENDIAN ?
                buffer.getUnsignedShort(offset) : buffer.getUnsignedShortLE(offset);
    }
101301
public static long varIntBytesToLong(byte[] bytes, int offset) {
        int shift = 0;
        long result = 0;
        while (shift < 64) {
            final byte b = bytes[offset++];
            result |= (long)(b & 0x7F) << shift;
            if ((b & 0x80) == 0) {
                return result;
            }
            shift += 7;
        }
        throw new IllegalStateException("Varint representation is invalid or exceeds 64-bit value");
    }
540109
private static byte[] bitSetToByteArray(BitSet bitSet) {

    while (bitSet.length() % 8 != 0) { bitSet.set(bitSet.length(), true); }
    
    byte[] array = new byte[bitSet.length()/8];

    for (int i = 0; i < array.length; i++) {
      int offset = i * 8;

      int index = 0;
      for (int j = 0; j < 8; j++) {
        index <<= 1;        
        if (bitSet.get(offset+j)) { index++; }
      }

      array[i] = (byte)(index - 128);
    }

    return array;
  }
821704
public static void writeUnsignedIntegerBigEndian(ByteBuffer io, long value) {
		io.put((byte)((value >> 24) & 0xFF));
		io.put((byte)((value >> 16) & 0xFF));
		io.put((byte)((value >> 8) & 0xFF));
		io.put((byte)(value & 0xFF));
	}
166893
def Is64bit(self):
    """"""
    if "64" not in platform.machine():
      return False
    iswow64 = ctypes.c_bool(False)
    if IsWow64Process is None:
      return False
    if not IsWow64Process(self.h_process, ctypes.byref(iswow64)):
      raise process_error.ProcessError("Error while calling IsWow64Process.")
    return not iswow64.value
857407
def _abs32(ins):
    
    output = _32bit_oper(ins.quad[2])
    output.append('call __ABS32')
    output.append('push de')
    output.append('push hl')
    REQUIRES.add('abs32.asm')
    return output
1189098
private static void set16(byte[] b, int off, int value) {
        b[off+0] = (byte)value;
        b[off+1] = (byte)(value >> 8);
    }
990018
public static final Mem byte_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
        return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_BYTE);
    }
1004794
public static void writeUnsigned24BitsIntegerLittleEndian(IO.WritableByteStream io, long value) throws IOException {
		io.write((byte)(value & 0xFF));
		io.write((byte)((value >> 8) & 0xFF));
		io.write((byte)((value >> 16) & 0xFF));
	}
1051961
function UInt32Be(value, opt) {
	SingleType.call(this, value, 4, Buffer.prototype.readUInt32BE, Buffer.prototype.writeUInt32BE, opt);
}
983359
private byte[] bytesForBig(BigInteger big, int sigbytes, boolean remainder)
    {
        byte[] bytes = new byte[sigbytes + (remainder ? 1 : 0)];
        if (remainder)
        {
            // remaining bit is the most significant in the last byte
            bytes[sigbytes] |= 0x80;
        }
        // bitmask for a single byte
        for (int i = 0; i < sigbytes; i++)
        {
            int maskpos = 8 * (sigbytes - (i + 1));
            // apply bitmask and get byte value
            bytes[i] = (byte)(big.and(BYTE_MASK.shiftLeft(maskpos)).shiftRight(maskpos).intValue() & 0xFF);
        }
        return bytes;
    }
1191944
protected final void putInt16(int i16) {
        ensureCapacity(position + 2);

        byte[] buf = buffer;
        buf[position++] = (byte) (i16 & 0xff);
        buf[position++] = (byte) (i16 >>> 8);
    }
973640
static final int get6Bit(final Memory mem, final int offsetBytes, final int slotNo) {
    final int startBit = slotNo * 6;
    final int shift = startBit & 0X7;
    final int byteIdx = (startBit >>> 3) + offsetBytes;
    return (byte) ((mem.getShort(byteIdx) >>> shift) & 0X3F);
  }
428846
def readSB(self, bits):
        
        shift = 32 - bits
        return int32(self.readbits(bits) << shift) >> shift
1142733
private static final void cpy32(byte[] d, byte[] s) {
		int i;
		for (i = 0; i < 32; i++)
			d[i] = s[i];
	}