#include <stdio.h>
#include <gmp.h>
extern "C" {
// SPOJ, codechef, ideone (64-bit)
const char* gmp_path = "/usr/lib64/libgmp.so.3";
void* __libc_dlopen_mode(const char* x, int y);
void* __libc_dlsym(void* x, const char* y);
#define DLOPEN __libc_dlopen_mode
#define DLSYM __libc_dlsym
}
void* p = DLOPEN(gmp_path, 2);
void* get(const char* name) { return DLSYM(p, name); }
int main() {
printf("%i", p == nullptr);
//const auto f = (decltype(mpz_init)*) get("__gmpz_init");
mpz_t v;
//f(v);
return 0;
}
ICAgICNpbmNsdWRlIDxzdGRpby5oPgogICAgIAogICAgI2luY2x1ZGUgPGdtcC5oPgogICAgIAogICAgZXh0ZXJuICJDIiB7CiAgICAgIC8vIFNQT0osIGNvZGVjaGVmLCBpZGVvbmUgKDY0LWJpdCkKICAgICAgY29uc3QgY2hhciogZ21wX3BhdGggPSAiL3Vzci9saWI2NC9saWJnbXAuc28uMyI7CiAgICAgIHZvaWQqIF9fbGliY19kbG9wZW5fbW9kZShjb25zdCBjaGFyKiB4LCBpbnQgeSk7CiAgICAgIHZvaWQqIF9fbGliY19kbHN5bSh2b2lkKiB4LCBjb25zdCBjaGFyKiB5KTsKICAgICAgI2RlZmluZSBETE9QRU4gX19saWJjX2Rsb3Blbl9tb2RlCiAgICAgICNkZWZpbmUgRExTWU0gX19saWJjX2Rsc3ltCiAgICB9CiAgICB2b2lkKiBwID0gRExPUEVOKGdtcF9wYXRoLCAyKTsKICAgICB2b2lkKiBnZXQoY29uc3QgY2hhciogbmFtZSkgeyByZXR1cm4gRExTWU0ocCwgbmFtZSk7IH0KICAgIGludCBtYWluKCkgewogICAgICAgcHJpbnRmKCIlaSIsIHAgPT0gbnVsbHB0cik7CiAgICAgICAvL2NvbnN0IGF1dG8gZiA9IChkZWNsdHlwZShtcHpfaW5pdCkqKSBnZXQoIl9fZ21wel9pbml0Iik7CiAgICAgICBtcHpfdCB2OwogICAgICAgLy9mKHYpOwogICAgICByZXR1cm4gMDsKICAgIH0KICAgICA=