__int64 __fastcall CClfsBaseFilePersisted::RemoveContainer(CClfsBaseFilePersisted *this, unsigned int a2)
{
...
                v11 = CClfsBaseFilePersisted::FlushImage((PERESOURCE *)this);
                v9 = v11;
                v16 = v11;
                if ( v11 >= 0 )
                {
                pContainer = *((_QWORD *)containerContext + 3);
                if ( pContainer )
                {
                        *((_QWORD *)containerContext + 3) = 0i64;
                        ExReleaseResourceForThreadLite(*((PERESOURCE *)this + 4), (ERESOURCE_THREAD)KeGetCurrentThread());
                        v4 = 0;
                        (*(void (__fastcall **)(__int64))(*(_QWORD *)pContainer + 0x18i64))(pContainer); // remove method
                        (*(void (__fastcall **)(__int64))(*(_QWORD *)pContainer + 8i64))(pContainer); // release method
                        v9 = v16;
                        goto LABEL_20;
                }
                goto LABEL_19;
                }
...
} v44 = *((_DWORD *)containerContext + 5); // to trigger RemoveContainer one should set this field to -1
if ( v44 == -1 )
{
        *((_QWORD *)containerContext + 3) = 0i64; // pContainer is set to NULL
        v20 = CClfsBaseFilePersisted::RemoveContainer(this, v34);
        v72 = v20;
        if ( v20 < 0 )
                goto LABEL_134;
        v23 = v78;
        v34 = (unsigned int)(v34 + 1);
        v79 = v34;
} ...
// Obtain all container contexts represented in blf
// save pContainer class pointer for each valid container context
for ( i = 0; i < 0x400; ++i )
{
v20 = CClfsBaseFile::AcquireContainerContext(this, i, &v22);
v15 = (char *)this + 8 * i;
if ( v20 >= 0 )
{
        v16 = v22;
        *((_QWORD *)v15 + 56) = *((_QWORD *)v22 + 3); // for each valid container save pContainer
        *((_QWORD *)v16 + 3) = 0i64; // and set the initial pContainer to zero
        CClfsBaseFile::ReleaseContainerContext(this, &v22);
}
else
{
        *((_QWORD *)v15 + 56) = 0i64;
}
}
// Stage [1] enode block, prepare it for writing
ClfsEncodeBlock(
(struct _CLFS_LOG_BLOCK_HEADER *)v9,
*(unsigned __int16 *)(v9 + 4) << 9,
*(_BYTE *)(v9 + 2),
0x10u,
1u);
// write modified data
v10 = CClfsContainer::WriteSector(
                *((CClfsContainer **)this + 19),
                *((struct _KEVENT **)this + 20),
                0i64,
                *(void **)(*((_QWORD *)this + 6) + 24 * v8),
                *(unsigned __int16 *)(v9 + 4),
                &v23);
...
if ( v7 )
{
// Stage [2] Decode file again for futher processing in clfs.sys
ClfsDecodeBlock((struct _CLFS_LOG_BLOCK_HEADER *)v9, *(unsigned __int16 *)(v9 + 4), *(_BYTE *)(v9 + 2), 0x10u, &v21);
// optain new pContainer class pointer
v17 = (_QWORD *)((char *)this + 448);
do
{
        // Stage [3] for each valid container
        // update pContainer field
        if ( *v17 && (int)CClfsBaseFile::AcquireContainerContext(this, v6, &v22) >= 0 )
        {
        *((_QWORD *)v22 + 3) = *v17;
        CClfsBaseFile::ReleaseContainerContext(this, &v22);
        }
        ++v6;
        ++v17;
}
while ( v6 < 0x400 );
}
...