Rewrite add_offset_map code generator.