CmpDestroyVirtualStack

VOID __fastcall CmpDestroyVirtualStack(INT64 a1, UINT64 a2){
  unsigned int v2; 
  int v3; 
  unsigned int v4; 
  UINT64 *v5; 
  UINT64 v6; 

  if( (_DWORD)a2 )
  {
    v2 = a2;
    v3 = a2 - 1;
    v4 = 0;
    v5 = (UINT64 *)(a1 + 24);
    do
    {
      v6 = *(v5 - 1);
      if( v6 )
        CmpDereferenceKeyControlBlock(v6);
      if( v4 == v3 )
      {
        if( *v5 )
          CmpDereferenceKeyControlBlock(*v5);
      }
      ++v4;
      v5 += 6;
    }
    while( v4 < v2 );
  }
}

Referenced by:

CmpReplicateKeyToVirtual