return cost;
if (mop.index != null && mop.index.register == EBP) {  return prefix + 5; }   if (mop.base != null && mop.base.register == ESP) { if (fits(mop.disp,8)) { return prefix + 2; } else { return prefix + 5; } }  if (mop.index == null) {  if (mop.disp.isZero()) { return prefix + 0; } else if (fits(mop.disp,8)) { return  prefix + 1; } else { return prefix + 4; } } else {  if (mop.base == null && mop.scale != 0) {  return prefix + 5; } else { if (mop.disp.isZero()) { return prefix + 1; } else if (fits(mop.disp,8)) { return  prefix + 2; } else { return prefix + 5; } } }
  private static int operandCost(OPT_Operand op, boolean shortFormImmediate) {    if (op instanceof OPT_MemoryOperand) {      int cost = 1; // might need SIB byte      OPT_MemoryOperand mop = (OPT_MemoryOperand)op;      if (!mop.disp.isZero()) {        if (fits(mop.disp,8)) {          cost += 1;        } else {          cost += 4;        }      }      return cost;    } else if (op instanceof OPT_IntConstantOperand) {      if (shortFormImmediate && fits(((OPT_IntConstantOperand)op).value,8)) {        return 1;      } else {        return 4;      }    } else {      return 0;    }  }