void $write_poly_int8(MSP430Operand o, int value) {
   switch (o.op_type) {
     case MSP430Operand.ABSO_val:
       $write_int8((MSP430Operand.ABSO) o, value);
       return;
     case MSP430Operand.INDX_val:
       $write_int8((MSP430Operand.INDX) o, value);
       return;
     case MSP430Operand.AIREG_B_val:
       $write_int8((MSP430Operand.AIREG_B) o, value);
       return;
     case MSP430Operand.IREG_val:
       $write_int8((MSP430Operand.IREG) o, value);
       return;
     case MSP430Operand.SYMB_val:
       $write_int8((MSP430Operand.SYMB) o, value);
       return;
     case MSP430Operand.IMML_val:
       $write_int8((MSP430Operand.IMML) o, value);
       return;
     case MSP430Operand.SREG_val:
       $write_int8((MSP430Operand.SREG) o, value);
       return;
     case MSP430Operand.IMM_val:
       $write_int8((MSP430Operand.IMM) o, value);
       return;
   }
   throw Util.failure("invalid operand type in write");
 }
 int $read_poly_uint16(MSP430Operand o) {
   switch (o.op_type) {
     case MSP430Operand.INDX_val:
       return $read_uint16((MSP430Operand.INDX) o);
     case MSP430Operand.IMML_val:
       return $read_uint16((MSP430Operand.IMML) o);
     case MSP430Operand.IMM_val:
       return $read_uint16((MSP430Operand.IMM) o);
     case MSP430Operand.IREG_val:
       return $read_uint16((MSP430Operand.IREG) o);
     case MSP430Operand.AIREG_W_val:
       return $read_uint16((MSP430Operand.AIREG_W) o);
     case MSP430Operand.ABSO_val:
       return $read_uint16((MSP430Operand.ABSO) o);
     case MSP430Operand.SREG_val:
       return $read_uint16((MSP430Operand.SREG) o);
     case MSP430Operand.SYMB_val:
       return $read_uint16((MSP430Operand.SYMB) o);
   }
   throw Util.failure("invalid operand type in read");
 }