vsnprintf_s

int __cdecl vsnprintf_s(char *DstBuf, size_t SizeInBytes, size_t MaxCount, const char *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 *)&SizeInBytes )
      return 0;
    goto LABEL_12;
  }
  if( !*(_QWORD *)&SizeInBytes )
    goto LABEL_12;
  if( *(_QWORD *)&SizeInBytes > *(_QWORD *)&MaxCount )
  {
    result = soutput_s(DstBuf, *(_QWORD *)&MaxCount + 1i64, (char *)Format, (int *)ArgList);
    if( result == -2 )
      return -1;
    goto LABEL_10;
  }
  result = soutput_s(DstBuf, *(unsigned __int64 *)&SizeInBytes, (char *)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:

snprintf_s