// IoRead32 - decompiled from Platform.efi
UINT32 __cdecl IoRead32(UINTN Port)
{
  UINTN Length; // r8
  UINT32 result; // eax
  __int64 v3; // rbx
  __int64 v4; // rdi
  unsigned int i_1; // r8d
  __int64 v6; // rcx
  unsigned int i; // edx
  __int64 v8; // [rsp+30h] [rbp+8h] BYREF

  result = qword_FFA8; /*0xad8e*/
  v3 = 0; /*0xad95*/
  if ( !qword_FFA8 ) /*0xad9a*/
  {
    if ( (GetDxeServicesTable(&DestinationBuffer__5, &v8, Length) & 0x8000000000000000uLL) == 0LL ) /*0xadb0*/
    {
      v4 = v8; /*0xadb6*/
      if ( !v8 ) /*0xadbe*/
        Assert( /*0xadd1*/
          (__int64)"e:\\hs\\MdeModulePkg\\Library\\SmmLockBoxLib\\SmmLockBoxDxeLib.c",
          105,
          (__int64)"PiSmmCommunicationRegionTable != ((void *) 0)");
      i_1 = *(_DWORD *)(v4 + 4); /*0xadd6*/
      v6 = v4 + 16; /*0xadda*/
      for ( i = 0; i < i_1; v6 += *(unsigned int *)(v4 + 8) ) /*0xade3*/
      {
        if ( *(_DWORD *)v6 == 7 && *(_QWORD *)(v6 + 24) << 12 >= 0x50u ) /*0xadf6*/
          break; /*0xadf6*/
        ++i; /*0xadfb*/
      }
      if ( i < i_1 ) /*0xae08*/
        v3 = *(_QWORD *)(v6 + 8); /*0xae0a*/
      result = v3; /*0xae0e*/
    }
    else
    {
      result = 0; /*0xadb2*/
    }
    qword_FFA8 = v3; /*0xae11*/
  }
  return result; /*0xae1d*/
}
