    #include <iostream>
    #include <cstring>

    using namespace std;

    const volatile int v1 = 0;
    volatile unsigned v2 = 0;
    
    void Fxn1()
    {
      if (v1) { v2 = 0x12345601; }
      cout << "Fxn1" << endl;
    }
    
    void Fxn2()
    {
      if (v1) { v2 = 0x12345602; }
      cout << "Fxn2" << endl;
    }
    
    int FindFxnConst(void(*f)())
    {
      const unsigned char* p = (const unsigned char*)f;
      while (memcmp(p, "\x56\x34\x12", 3))
        p++;
      return p[-1];
    }
    
    int main()
    {
      Fxn1();
      cout << FindFxnConst(Fxn1) << endl;
      Fxn2();
      cout << FindFxnConst(Fxn2) << endl;
      return 0;
    }
