sub_14065D374

INT64 __fastcall sub_14065D374(INT64 a1, INT64 a2, UINT64 a3, INT64 a4, _QWORD *a5){
  int v5; 
  int v6; 
  INT64 v9; 
  LODWORD(v9) = a4;
  v5 = 0;
  v6 = a4;
  if( (_DWORD)a4 != -1 )
    goto LABEL_4;
  v5 = sub_14065EB58(a1, a2, a3, a5, &v9);
  if( v5 >= 0 )
  {
    v6 = v9;
LABEL_4:
    memmove(
      (UINT8 *)(*(_QWORD *)(a1 + 16) + (unsigned int)(v6 * *(_DWORD *)a1)),
      (UINT8 *)(*(_QWORD *)(a1 + 16) + (unsigned int)(*(_DWORD *)a1 * (v6 + 1))),
      (unsigned int)(*(_DWORD *)a1 * (*(_DWORD *)(a1 + 4) - v6 - 1)));
    --*(_DWORD *)(a1 + 4);
  }
  return(unsigned int)v5;
}

Referenced by:

WbHeapExecutionUnloadModule
WbInPlaceEncryptionUnloadModule
WbReleaseLeastRecentlyUsedHeapExecutedBlocks
WbRemoveWarbirdProcess