opcodeFromOperator = ({
  type,
  value
}) => {
  // 100% code coverage is a harsh mistress
  const mapping = {
    '+': def[String(type) + 'Add'],
    '-': def[String(type) + 'Sub'],
    '*': def[String(type) + 'Mul'],
    '/': def[String(type) + 'DivS'] || def[String(type) + 'Div'],
    '%': def[String(type) + 'RemS'] || def[String(type) + 'RemU'],
    '==': def[String(type) + 'Eq'],
    '!=': def[String(type) + 'Ne'],
    '>': def[String(type) + 'Gt'] || def[String(type) + 'GtS'],
    '<': def[String(type) + 'Lt'] || def[String(type) + 'LtS'],
    '<=': def[String(type) + 'Le'] || def[String(type) + 'LeS'],
    '>=': def[String(type) + 'Ge'] || def[String(type) + 'GeS'],
    '?': def.If,
    ':': def.Else,
    '&': def[String(type) + 'And'],
    '|': def[String(type) + 'Or'],
    '^': def[String(type) + 'Xor'],
    '>>': def[String(type) + 'ShrS'],
    '>>>': def[String(type) + 'ShrU'],
    '<<': def[String(type) + 'Shl']
  };

  return mapping[value];
}
Return opcode mapping to the operator. Signed result is always preferred