<s> class RegisterMap ( object ) : <EOL> def __init__ ( self , arch ) : <EOL> self . _reg_map = { } <EOL> self . _general_register_width = arch . bytes <EOL> def assign ( self , reg_offset , expr ) : <EOL> if reg_offset % self . _general_register_width == <NUM_LIT:0> : <EOL> self . _reg_map [ reg_offset ] = expr <EOL> else : <EOL> raise Exception ( "<STR_LIT>" % reg_offset ) <EOL> def contains ( self , reg_offset ) : <EOL> assert reg_offset % self . _general_register_width == <NUM_LIT:0> <EOL> return reg_offset in self . _reg_map <EOL> def get ( self , reg_offset ) : <EOL> if reg_offset % self . _general_register_width == <NUM_LIT:0> : <EOL> if reg_offset in self . _reg_map : <EOL> return self . _reg_map [ reg_offset ] <EOL> else : <EOL> return None <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> def remove ( self , reg_offset ) : <EOL> if reg_offset % self . _general_register_width == <NUM_LIT:0> : <EOL> del self . _reg_map [ reg_offset ] <EOL> else : <EOL> raise Exception ( "<STR_LIT>" ) </s>
