Greatest prime number smaller than N where N can be as large as 10^18
These macros are not needed in C++:


#define c2 341550071728321
#define c1 4759123141



They should be constants, using the const keyword (or constexpr in C++11):

const int c2 = 341550071728321;
const int c1 = 4759123141;


I've only kept the names the same here because I have no idea what they mean.  Try to avoid using single-char variable names, unless their meaning is already obvious.
You use unsigned long long in many places, which could look verbose.  You could use a typedef so that you can use another (shorter) name in place of them:

typedef unsigned long long ull;


Better yet, you can use std::uint64_t from &lt;cstdint&gt;.  It is shorter, and it should be guaranteed to hold 64 bits on any system.
This is quite a bit of whitespace:


if (n &lt; c1) {

            l = 3;
    }
    else if (n &lt; c2) {
            l = 7;
    }
    else {

            l = 9;
    }



You already use four spaces for indentation, so it should be consistent:

if (n &lt; c1) {
    l = 3;
}
else if (n &lt; c2) {
    l = 7;
}
else {
    l = 9;
}


You're also lacking indentation within main() and check_prime(), but it's okay in your other functions.  I don't see the reason for all this inconsistency if you're not in a hurry to write the code itself.  Make it clean now so that fine-tuning will be easier, both for you and for others.