// if, 3項演算子, その他の制御構文を使わずに strcmp を実装する
int cond_lt (int a, int b) {
 return ((a - b) >> 31) & 1;
}
int cond_zero (int a) {
 return (~(a ^ -a) >> 31) & 1;
}
int zero (const char* s1, const char* s2) {
 return 0;
}
int one (const char* s1, const char* s2) {
 return 1;
}
int minus_one (const char* s1, const char* s2) {
 return -1;
}
int strcmp (const char* s1, const char* s2) {
 int a = *s1 & 0xff;
 int b = *s2 & 0xff;
 int (*table[8]) (const char*, const char*) = {
  strcmp, zero, minus_one, minus_one, one,
  0, 0, 0   // この3パターンは有り得ない
 };
 return (*table[
  (cond_zero(a)) |
  (cond_lt(a,b) << 1) |
  (cond_lt(b,a) << 2)]) (s1 + 1, s2 + 1);
}