ProducerConsumerCopyToContextBuffer

VOID __fastcall ProducerConsumerCopyToContextBuffer(CHAR *Src, size_t Size, INT64 a3, CHAR *a4){
  __int64 v6; 
  CHAR *v7; 
  unsigned int v8; 
  int v9; 
  __int64 v10; 
  v6 = *(unsigned int *)(a3 + 8);
  v7 = &a4[-v6];
  if( (unsigned __int64)a4 < v6 + *(_QWORD *)a3 )
    v7 = a4;
  v8 = 0;
  v9 = (_DWORD)v7 - *(_DWORD *)a3;
  if( v9 + (int)Size > (unsigned int)v6 )
  {
    v8 = Size + v9 - v6;
    LODWORD(Size) = v6 - v9;
  }
  v10 = (unsigned int)Size;
  memmove((UINT8 *)v7, (UINT8 *)Src, (unsigned int)Size);
  if( v8 )
    memmove(*(UINT8 **)a3, (UINT8 *)&Src[v10], v8);
}

Referenced by:

PopCountDataAsProduced