RtlDelete

RTL_SPLAY_LINKS *__stdcall RtlDelete(RTL_SPLAY_LINKS *Links){
  RTL_SPLAY_LINKS *result; 
  _RTL_SPLAY_LINKS *Parent; 
  _RTL_SPLAY_LINKS *v4; 
  __int64 v5; 
  RTL_SPLAY_LINKS *v6; 
  __int64 v7; 
  result = Links->LeftChild;
  if( result )
  {
    if( Links->RightChild )
    {
      v6 = RtlSubtreePredecessor(Links);
      SwapSplayLinks(v6, Links);
      result = Links->LeftChild;
    }
    if( result )
      goto LABEL_3;
  }
  result = Links->RightChild;
  if( result )
  {
LABEL_3:
    Parent = Links->Parent;
    if( Links->Parent == Links )
    {
      result->Parent = result;
      return result;
    }
    v7 = 8i64;
    if( Parent->LeftChild != Links )
      v7 = 16i64;
    *(_RTL_SPLAY_LINKS **)((char *)&Parent->Parent + v7) = result;
    v4 = Links->Parent;
    result->Parent = Links->Parent;
  }
  else
  {
    v4 = Links->Parent;
    if( Links->Parent == Links )
      return 0i64;
    v5 = 8i64;
    if( v4->LeftChild != Links )
      v5 = 16i64;
    *(_RTL_SPLAY_LINKS **)((char *)&v4->Parent + v5) = 0i64;
  }
  return RtlSplay(v4);
}

Referenced by:

FsRtlFastUnlockSingleExclusive
FsRtlFastUnlockSingleShared
FsRtlPrivateFastUnlockAll
FsRtlRemoveNodeFromTunnel
PfxRemovePrefix
RtlDeleteElementGenericTable
RtlRemoveUnicodePrefix