ref: 9e683ae8cde8033a158230841ad97866e49b27cb dir: /plan9_builtins.c/
#include "platform.h" int __builtin_clz(unsigned int x) { unsigned int r; if(x == 0) return 32; for(r = 0; (x & (1UL<<31)) == 0; x <<= 1, r++); return r; }