def _read_long(position, block):
    """Read an int64 using variable-length, zig-zag coding.

    Returns:
        Tuple[int, int]:
            (new position, long integer)
    """
    b = block[position]
    n = b & 0x7F
    shift = 7

    while (b & 0x80) != 0:
        position += 1
        b = block[position]
        n |= (b & 0x7F) << shift
        shift += 7

    return (position + 1, (n >> 1) ^ -(n & 1))