/* If the requested operation results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeUint64Add(IN UINT64 Augend, IN UINT64 Addend, OUT UINT64 *Result)
/* If the requested operation results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeUint64Add(IN UINT64 Augend, IN UINT64 Addend, OUT UINT64 *Result)
{
  RETURN_STATUS  Status;
  if (Result == NULL) {
    return RETURN_INVALID_PARAMETER;
  }
  if ((Augend + Addend) >= Augend) {
    *Result = (Augend + Addend);
    Status  = RETURN_SUCCESS;
  } else {
    *Result = UINT64_ERROR;
    Status  = RETURN_BUFFER_TOO_SMALL;
  }
  return Status;
}