UpcaseUnicodeToSingleByteNHelper

NTSTATUS __stdcall UpcaseUnicodeToSingleByteNHelper(
        INT64 a1,
        UINT64 a2,
        UINT64 *a3,
        UINT16 *a4,
        UINT64 a5,
        INT64 a6,
        INT64 a7){
  unsigned int v7; 
  unsigned int v8; 
  unsigned int v9; 
  __int64 v12; 
  UINT16 v13; 

  v7 = a5;
  v8 = a2;
  v9 = a5;
  if( (unsigned int)a5 >= (unsigned int)a2 )
    v9 = a2;
  if( a3 )
    *(_DWORD *)a3 = v9;
  if( v9 )
  {
    v12 = v9;
    do
    {
      v13 = NLS_UPCASE(*(_WORD *)(a7 + 2i64 * *(unsigned __int8 *)(*a4 + a6)));
      ++a1;
      ++a4;
      *(_BYTE *)(a1 - 1) = *(_BYTE *)(v13 + a6);
      --v12;
    }
    while( v12 );
  }
  if( v7 > v8 )
    return -2147483643;
  else
    return 0;
}

Referenced by:

RtlUpcaseUnicodeToMultiByteN
RtlUpcaseUnicodeToOemN