from "EMBED" import u16_to_bits; def main(u16 i) -> field { bool[16] bits = u16_to_bits(i); field mut res = 0; for u32 j in 0..16 { u32 exponent = 16 - j - 1; res = res + (bits[j] ? 2 ** exponent : 0); } return res; }