let size x = if x <= 0x7f then 1 else if x <= 0x7ff then 2 else if x <= 0xffff then 3 else if x <= 0x1f_ffff then 4 else if x <= 0x3ff_ffff then 5 else if x <= 0x7fff_ffff then 6 else 0