check_overflow_mul(int64_t num1, int64_t num2)
{
    if (((num1 == -1) && (num2 == INT64_MIN)) || ((num2 == -1) && (num1 == INT64_MIN))) {
        return 1;
    }

    if ((num1 > INT64_MAX / num2) || (num1 < INT64_MIN / num2)) {
        return 1;
    }

    return 0;
}
check_overflow_mul(int64_t num1, int64_t num2)
{
    if (((num1 == -1) && (num2 == INT64_MIN)) || ((num2 == -1) && (num1 == INT64_MIN))) {
        return 1;
    }

    if ((num1 > INT64_MAX / num2) || (num1 < INT64_MIN / num2)) {
        return 1;
    }

    return 0;
}