/* Find string ID of option if its value equals to given value. */
EFI_STRING_ID OrderedListOptionValueToStringId(IN HII_STATEMENT *HiiStatement, IN UINT64 Value)
/* Find string ID of option if its value equals to given value. */
EFI_STRING_ID OrderedListOptionValueToStringId(IN HII_STATEMENT *HiiStatement, IN UINT64 Value)
{
  LIST_ENTRY           *Link;
  HII_QUESTION_OPTION  *Option;
  UINT64               CurrentValue;
  if (HiiStatement == NULL) {
    return 0;
  }
  if (HiiStatement->Operand != EFI_IFR_ORDERED_LIST_OP) {
    return 0;
  }
  if (IsListEmpty (&HiiStatement->OptionListHead)) {
    return 0;
  }
  Link = GetFirstNode (&HiiStatement->OptionListHead);
  while (!IsNull (&HiiStatement->OptionListHead, Link)) {
    Option = HII_QUESTION_OPTION_FROM_LINK (Link);
    CurrentValue = ExtendHiiValueToU64 (&Option->Value);
    if (Value == CurrentValue) {
      return Option->Text;
    }
    Link = GetNextNode (&HiiStatement->OptionListHead, Link);
  }
  return 0;
}