def multiply_int(x, y):
    negative = (x < 0) != (y < 0)
    a = abs(x)
    b = abs(y)

    if a < b:
        a, b = b, a

    result = 0
    while b > 0:
        if b % 2 == 1:
            result += a
        a += a
        b //= 2

    if negative:
        return -result
    return result