from typing import Tuple


def decompress(buf: bytearray) -> Tuple[int, int]:
    """
    Decompresses a single variable int from a buffer.

    :param buf: The buffer sliced so that index 0 is the start of the variable int.
    :return: The integer and the length in the bytearray
    """
    index = 0
    sign = (buf[index] >> 6) & 1
    extended = (buf[index] >> 7) == 1
    out = buf[index] & 0b00111111
    while extended:
        index += 1
        if index > 4:
            break
        extended = (buf[index] >> 7) == 1
        out |= (buf[index] & 0b01111111) << (6 + 7 * (index - 1))

    out ^= - sign
    return out, index + 1