MiUnlinkSubsectionWaitBlock

void __fastcall MiUnlinkSubsectionWaitBlock(__int64 *a1, __int64 a2, int a3){
  __int64 v3; 
  KIRQL v6; 
  int v7; 
  _QWORD *v8; 
  _QWORD *v9; 
  __int64 v10; 
  v3 = *a1;
  if( a3 == 1 )
    v6 = 17;
  else
    v6 = ExAcquireSpinLockExclusive((PEX_SPIN_LOCK)(v3 + 72));
  if( !*(_DWORD *)(a2 + 12) )
  {
    v7 = *(_DWORD *)(v3 + 56);
    v8 = 0i64;
    if( (v7 & 0x20) != 0 )
      v9 = *(_QWORD **)(v3 + 80);
    else
      v9 = (_QWORD *)a1[3];
    if( !v9 )
      goto LABEL_13;
    do
    {
      if( v9 == (_QWORD *)a2 )
        break;
      v8 = v9;
      v9 = (_QWORD *)*v9;
    }
    while( v9 );
    if( v8 )
    {
      *v8 = *v9;
    }
    else
    {
LABEL_13:
      v10 = *v9;
      if( (v7 & 0x20) != 0 )
        *(_QWORD *)(v3 + 80) = v10;
      else
        a1[3] = v10;
    }
  }
  if( v6 != 17 )
  {
    ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)(v3 + 72));
    __writecr8(v6);
  }
}

Referenced by:

MiAllocateFileExtents
MiChangingSubsectionProtos