def gcd(num1: int, num2: int) -> int:
    """
    Returns the greatest common divisor of `num1` and `num2`.

    Examples:
    >>> gcd(12, 30)
    6
    >>> gcd(0, 0)
    0
    >>> gcd(-1001, 26)
    13
    """
    if num1 == 0:
        return num2
    if num2 == 0:
        return num1
    if num1 < 0:
        num1 = -num1
    if num2 < 0:
        num2 = -num2
    # This is the Euclidean algorithm
    while num2 != 0:
        num1, num2 = num2, num1 % num2
    return num1