#include #include #include #include #include #include #include #include #include #ifdef __cplusplus #include #include #include #include #include #include #include #endif #define COINFLIP() (rand() % 2) int foo() { printf("%s\n", "inside foo!"); return COINFLIP(); } int bar() __attribute__((alias("foo"))); int main(int argc, char const *argv[]) { if (COINFLIP()) { printf("%s\n", "called foo!"); printf("%d\n", foo()); } else { printf("%s\n", "called bar, but..."); printf("%d\n", bar()); } if (COINFLIP()) { printf("%s\n", "called foo!"); printf("%d\n", foo()); } else { printf("%s\n", "called bar, but..."); printf("%d\n", bar()); } if (COINFLIP()) { printf("%s\n", "called foo!"); printf("%d\n", foo()); } else { printf("%s\n", "called bar, but..."); printf("%d\n", bar()); } return 0; }