code: func MulInt64(a int64, b int64) (int64, error) {
  	if a == 0 || b == 0 {
  		return 0, nil
  	}
  
  	var (
  		res      uint64
  		err      error
  		negative = false
  	)
  
  	if a > 0 && b > 0 {
  		res, err = MulUint64(uint64(a), uint64(b))
  	} else if a < 0 && b < 0 {
  		res, err = MulUint64(uint64(-a), uint64(-b))
  	} else if a < 0 && b > 0 {
  		negative = true
  		res, err = MulUint64(uint64(-a), uint64(b))
  	} else {
  		negative = true
  		res, err = MulUint64(uint64(a), uint64(-b))
  	}
  
  	if err != nil {
  		return 0, errors.Trace(err)
  	}
  
  	if negative {
  		// negative result
  		if res > math.MaxInt64+1 {
  			return 0, ErrOverflow.GenWithStackByArgs("BIGINT", fmt.Sprintf("(%d, %d)", a, b))
  		}
  
  		return -int64(res), nil
  	}
  
  	// positive result
  	if res > math.MaxInt64 {
  		return 0, ErrOverflow.GenWithStackByArgs("BIGINT", fmt.Sprintf("(%d, %d)", a, b))
  	}
  
  	return int64(res), nil
  }
docs: // MulInt64 multiplies int64 a and b and returns int64 if no overflow error.