PfpFlushEventBuffers

INT64 __stdcall PfpFlushEventBuffers(){
  struct _SLIST_ENTRY *v0; 
  int v1; 
  PSLIST_ENTRY v2; 
  struct _SLIST_ENTRY *v3; 
  struct _SLIST_ENTRY *v4; 
  INT64 *v5; 
  struct _SLIST_ENTRY *v8; 
  INT64 v9; 
  v0 = 0i64;
  v1 = 0;
  PfFbBufferListFlushStandby();
  v2 = RtlpInterlockedFlushSList((PSLIST_HEADER)&word_140C4FAE0);
  if( v2 )
  {
    do
    {
      v3 = v2;
      v2 = v2->Next;
      v3->Next = v0;
      v0 = v3;
    }
    while( v2 );
    while( 1 )
    {
      v4 = v0;
      v0 = v0->Next;
      v5 = (INT64 *)&v4[3];
      if( *((_DWORD *)&v4[2].Next + 2) )
        break;
LABEL_6:
      if( v1 < 0 )
        goto LABEL_9;
      LODWORD(v9) = 1;
      PfFbBufferListInsertInFree(
        (SLIST_ENTRY *)&stru_140C4FA60,
        v4,
        (unsigned int)(LODWORD(v4[2].Next) - (_DWORD)v4),
        *((unsigned int *)&v4[2].Next + 3),
        v9);
      if( !v0 )
        return(unsigned int)v1;
    }
    while( 1 )
    {
      v1 = PfpCopyEvent(v5);
      if( v1 < 0 )
        break;
      v5 += 2 * ((*(_DWORD *)v5 >> 2) & 0x3FF);
      if( (*((_DWORD *)&v4[2].Next + 2))-- == 1 )
        goto LABEL_6;
    }
LABEL_9:
    memmove((UINT8 *)&v4[3], (UINT8 *)v5, (unsigned int)(LODWORD(v4[2].Next) - (_DWORD)v5));
    PfTFullEventListAdd(v4);
    while( v0 )
    {
      v8 = v0;
      v0 = v0->Next;
      PfTFullEventListAdd(v8);
    }
  }
  return(unsigned int)v1;
}

Referenced by:

PfpFlushBuffers