RtlLargeIntegerToUnicode

NTSTATUS __stdcall RtlLargeIntegerToUnicode(_LARGE_INTEGER *Value, UINT64 OutputLength, WCHAR *String, WCHAR *a4){
  WCHAR *v4; 
  int v5; 
  char *v6; 
  unsigned __int64 QuadPart; 
  char v8; 
  __int64 v9; 
  bool v10; 
  __int64 v11; 
  WCHAR *v12; 
  __int64 i; 
  char v15[14]; 

  v4 = a4;
  v5 = (int)String;
  v6 = v15;
  QuadPart = Value->QuadPart;
  do
  {
    v8 = QuadPart;
    QuadPart >>= 4;
    v6 -= 2;
    *(_WORD *)v6 = RtlpIntegerWChars[v8 & 0xF];
  }
  while( QuadPart );
  v9 = (v15 - v6) >> 1;
  if( (int)String < 0 )
  {
    v5 = -(int)String;
    v10 = (int)v9 <= -(int)String;
    if( (int)v9 >= -(int)String )
      goto LABEL_10;
    v11 = (unsigned int)(v5 - v9);
    v12 = a4;
    for( i = (unsigned int)v11; i; --i )
      *v12++ = 48;
    v5 = (v15 - v6) >> 1;
    v4 = &a4[v11];
  }
  v10 = (int)v9 <= v5;
LABEL_10:
  if( !v10 )
    return -2147483643;
  memmove(v4, v6, 2 * v9);
  if( (int)v9 < v5 )
    v4[(unsigned int)v9] = 0;
  return 0;
}

Referenced by:

RtlConvertSidToUnicodeString