// SetupVariableGet - decompiled from Platform.efi
__int64 __fastcall SetupVariableGet(const void *Port, __int64 n64)
{
  UINT16 Value; // dx
  UINTN Port_1; // rcx
  __int64 (__fastcall **v5)(_QWORD, __int64 *, __int64 *); // rax
  UINTN Port_2; // rcx
  __int64 (__fastcall **v7)(_QWORD, __int64 *, __int64 *); // rdi
  __int64 *DestinationBuffer_1; // rax
  __int64 *DestinationBuffer; // rbx
  __int64 v11; // rax
  __int64 v12; // rbx
  char v13; // [rsp+20h] [rbp-48h] BYREF
  __int64 n64_1; // [rsp+78h] [rbp+10h] BYREF

  n64_1 = n64; /*0xaf77*/
  DebugPrint(0x40u, "SmmLockBoxDxeLib SetLockBoxAttributes - Enter\n"); /*0xaf94*/
  if ( !Port ) /*0xaf9c*/
    return 0x8000000000000002uLL; /*0xb072*/
  LOWORD(v5) = IoWrite16(Port_1, Value); /*0xafa2*/
  v7 = v5; /*0xafa7*/
  if ( !v5 ) /*0xafad*/
    return 0x8000000000000013uLL; /*0xafaf*/
  LODWORD(DestinationBuffer_1) = IoRead32(Port_2); /*0xafbe*/
  DestinationBuffer = (__int64 *)&v13; /*0xafc6*/
  if ( DestinationBuffer_1 ) /*0xafd8*/
    DestinationBuffer = DestinationBuffer_1; /*0xafd8*/
  CopyMem(DestinationBuffer, &SourceBuffer__13, 0x10u); /*0xafdf*/
  DestinationBuffer[2] = 40; /*0xafed*/
  DestinationBuffer[4] = -1; /*0xaff4*/
  *((_DWORD *)DestinationBuffer + 6) = 4; /*0xaff9*/
  *((_DWORD *)DestinationBuffer + 7) = 40; /*0xb004*/
  CopyMem(DestinationBuffer + 5, Port, 0x10u); /*0xb007*/
  DestinationBuffer[7] = 1; /*0xb00c*/
  n64_1 = 64; /*0xb01c*/
  v11 = (*v7)(v7, DestinationBuffer, &n64_1); /*0xb024*/
  if ( v11 < 0 ) /*0xb029*/
  {
    DebugPrint(0x80000000, "\nASSERT_EFI_ERROR (Status = %r)\n", v11); /*0xb03a*/
    Assert( /*0xb052*/
      (__int64)"e:\\hs\\MdeModulePkg\\Library\\SmmLockBoxLib\\SmmLockBoxDxeLib.c",
      280,
      (__int64)"!EFI_ERROR (Status)");
  }
  v12 = DestinationBuffer[4]; /*0xb057*/
  DebugPrint(0x40u, "SmmLockBoxDxeLib SetLockBoxAttributes - Exit (%r)\n", v12); /*0xb068*/
  return v12; /*0xb08d*/
}
