// SetupVariableReadback - decompiled from Platform.efi
__int64 SetupVariableReadback(const void *SourceBuffer, unsigned __int64 n209, const void *Length, ...)
{
  __int64 v6; // rax
  __int64 v8; // rsi
  UINTN v9; // rax
  UINTN v10; // rbx
  __int64 v11; // rax
  void *v12; // [rsp+68h] [rbp+20h] BYREF
  va_list va; // [rsp+68h] [rbp+20h]
  va_list va1; // [rsp+70h] [rbp+28h] BYREF

  va_start(va1, Length);
  va_start(va, Length);
  v12 = va_arg(va1, void *); /*0x82d0*/
  if ( !SourceBuffer || !Length ) /*0x8301*/
    return 0x8000000000000002uLL; /*0x8301*/
  v6 = SetupBufferOps(SourceBuffer, n209, (UINTN)Length); /*0x8307*/
  if ( v6 == -1 ) /*0x8310*/
    return 0x800000000000000EuLL; /*0x831c*/
  v8 = 3 * v6; /*0x8321*/
  if ( n209 > (unsigned __int64)*(&off_FD00 + 3 * v6 + 2) ) /*0x8334*/
    return 0x8000000000000002uLL; /*0x83f9*/
  v9 = SetupPolicyInit((__int64)*(&off_FD00 + 3 * v6 + 1), va, (__int64)*(&off_FD00 + 3 * v6)); /*0x8348*/
  v10 = v9; /*0x834d*/
  if ( !v9 ) /*0x8353*/
  {
    Assert((__int64)"e:\\hs\\PurleyRpPkg\\Library\\SetupLib\\DxeSetupLib.c", 310, (__int64)"Variable != ((void *) 0)"); /*0x8368*/
    return 0x800000000000000EuLL; /*0x836d*/
  }
  CopyMem((void *)(v9 + n209), Length, 1u); /*0x837c*/
  v11 = (*(__int64 (__fastcall **)(_QWORD, const void *, _QWORD, _QWORD, UINTN))(RuntimeServices + 88))( /*0x839f*/
          *(&off_FD00 + v8 + 1),
          SourceBuffer,
          (unsigned int)v12,
          *(&off_FD00 + v8 + 2),
          v10);
  if ( v11 < 0 ) /*0x83a5*/
  {
    DebugPrint(0x80000000, "\nASSERT_EFI_ERROR (Status = %r)\n", v11); /*0x83b6*/
    Assert((__int64)"e:\\hs\\PurleyRpPkg\\Library\\SetupLib\\DxeSetupLib.c", 316, (__int64)"!EFI_ERROR (Status)"); /*0x83ce*/
  }
  if ( byte_FF20 ) /*0x83dd*/
    (*(void (__fastcall **)(UINTN))(qword_FF18 + 88))(v10); /*0x83e6*/
  else
    (*(void (__fastcall **)(UINTN))(BootServices + 72))(v10); /*0x83f2*/
  return 0; /*0x8412*/
}
