vsnwprintf_s

int __cdecl vsnwprintf_s(wchar_t *DstBuf, size_t SizeInWords, size_t MaxCount, const wchar_t *Format, va_list ArgList){
  __int64 v5; 
  int result; 

  v5 = *(_QWORD *)&MaxCount;
  if( !Format )
    goto LABEL_12;
  if( *(_QWORD *)&MaxCount )
  {
    if( !DstBuf )
    {
LABEL_12:
      xHalTimerWatchdogStop(0i64, 0i64);
      return -1;
    }
  }
  else if( !DstBuf )
  {
    if( !*(_QWORD *)&SizeInWords )
      return 0;
    goto LABEL_12;
  }
  if( !*(_QWORD *)&SizeInWords )
    goto LABEL_12;
  if( *(_QWORD *)&SizeInWords > *(_QWORD *)&MaxCount )
  {
    result = swoutput_s((char *)DstBuf, *(_QWORD *)&MaxCount + 1i64, (unsigned __int16 *)Format, (int *)ArgList);
    if( result == -2 )
      return -1;
    goto LABEL_10;
  }
  result = swoutput_s((char *)DstBuf, *(unsigned __int64 *)&SizeInWords, (unsigned __int16 *)Format, (int *)ArgList);
  if( result != -2 )
  {
LABEL_10:
    if( result >= 0 )
      return result;
    goto LABEL_11;
  }
  if( v5 == -1 )
    return -1;
LABEL_11:
  *DstBuf = 0;
  if( result == -2 )
    goto LABEL_12;
  return -1;
}

Referenced by:

snwprintf_s