fn write_code( scode: u64, code_bits: &mut u64, code_bit_count: &mut u64, out: impl Write, ) -> UnitResult