// SetupInfoRecordsWriter - decompiled from Platform.efi
__int64 __fastcall SetupInfoRecordsWriter(__int64 a1, unsigned __int16 a2, __int64 a3)
{
  __int64 x_UEFI_2; // rax
  __int64 result; // rax
  __int64 v7; // rsi
  _BYTE *x_UEFI_1; // rbx
  _BYTE *x_UEFI; // r15
  unsigned __int64 n0xF4240; // rax
  __int64 v11; // rax
  unsigned __int16 v12; // [rsp+78h] [rbp+10h] BYREF

  v12 = a2; /*0xa592*/
  if ( !a1 ) /*0xa5af*/
    Assert((__int64)"e:\\hs\\MdeModulePkg\\Library\\UefiHiiLib\\HiiString.c", 70, (__int64)"HiiHandle != ((void *) 0)"); /*0xa5c2*/
  if ( !a3 ) /*0xa5ca*/
    Assert((__int64)"e:\\hs\\MdeModulePkg\\Library\\UefiHiiLib\\HiiString.c", 71, (__int64)"String != ((void *) 0)"); /*0xa5de*/
  x_UEFI_2 = SetupIfrOptionLookup(a1); /*0xa5e6*/
  if ( !x_UEFI_2 ) /*0xa5f1*/
    return 0; /*0xa5f3*/
  v7 = 0x8000000000000002uLL; /*0xa5fc*/
  x_UEFI_1 = (_BYTE *)x_UEFI_2; /*0xa606*/
  while ( *x_UEFI_1 )
  {
    x_UEFI = x_UEFI_1; /*0xa612*/
    if ( *x_UEFI_1 ) /*0xa615*/
    {
      do /*0xa622*/
      {
        if ( *x_UEFI_1 == 59 ) /*0xa61d*/
          break; /*0xa61d*/
        ++x_UEFI_1; /*0xa61f*/
      }
      while ( *x_UEFI_1 ); /*0xa622*/
      if ( *x_UEFI_1 ) /*0xa627*/
        *x_UEFI_1++ = 0; /*0xa62c*/
    }
    n0xF4240 = BoolToString("x-UEFI"); /*0xa639*/
    if ( LocateHiiSetupConfig(x_UEFI, "x-UEFI", n0xF4240) )
    {
      v11 = v12
          ? (*(__int64 (__fastcall **)(__int64, __int64, _QWORD, _BYTE *, __int64, _QWORD))(qword_FF68 + 16))(
              qword_FF68,
              a1,
              v12,
              x_UEFI,
              a3,
              0)
          : (*(__int64 (__fastcall **)(__int64, __int64, unsigned __int16 *, _BYTE *, _QWORD, __int64, _QWORD))qword_FF68)(
              qword_FF68,
              a1,
              &v12,
              x_UEFI,
              0,
              a3,
              0);
      v7 = v11; /*0xa696*/
      if ( v11 < 0 ) /*0xa69c*/
        break; /*0xa69c*/
    }
  }
  ExtractConfig(); /*0xa6aa*/
  result = 0; /*0xa6af*/
  if ( v7 >= 0 ) /*0xa6b6*/
    return v12; /*0xa6b8*/
  return result; /*0xa6ca*/
}
