// Original function: GetHobListFromSystemTable
// Address: 0x8CC
// Signature: __int64 __fastcall GetHobListFromSystemTable(__int64 ImageHandle)

__int64 __fastcall GetHobListFromSystemTable(__int64 ImageHandle)
{
  __int64 result; // rax
  __int64 SystemTable; // rdi
  unsigned __int64 Index; // rbx
  __int64 Protocol; // rsi

  result = qword_1230; /*0x8db*/
  if ( !qword_1230 ) /*0x8e5*/
  {
    SystemTable = SystemTable; /*0x8eb*/
    Index = 0; /*0x8f2*/
    qword_1230 = 0; /*0x8f4*/
    if ( *(_QWORD *)(SystemTable + 104) ) /*0x8fb*/
    {
      Protocol = 0; /*0x901*/
      while ( !(unsigned __int8)GuidCompare(ImageHandle, Protocol + *(_QWORD *)(SystemTable + 112)) ) /*0x911*/
      {
        ++Index; /*0x913*/
        Protocol += 24; /*0x916*/
        if ( Index >= *(_QWORD *)(SystemTable + 104) ) /*0x91e*/
          goto LABEL_6; /*0x91e*/
      }
      result = *(_QWORD *)(*(_QWORD *)(SystemTable + 112) + 24 * Index + 16); /*0x994*/
      qword_1230 = result; /*0x999*/
    }
    else
    {
LABEL_6:
      DebugAssertError(0x80000000LL, "\nASSERT_EFI_ERROR (Status = %r)\n", 0x800000000000000EuLL); /*0x920*/
      DebugPrintAssert((__int64)"e:\\hs\\MdePkg\\Library\\DxeHobLib\\HobLib.c", 54, (__int64)"!EFI_ERROR (Status)"); /*0x94e*/
      result = qword_1230; /*0x953*/
    }
    if ( !result ) /*0x95d*/
    {
      DebugPrintAssert((__int64)"e:\\hs\\MdePkg\\Library\\DxeHobLib\\HobLib.c", 55, (__int64)"mHobList != ((void *) 0)"); /*0x970*/
      return qword_1230; /*0x975*/
    }
  }
  return result; /*0x986*/
}
