FindNodeOrParent

_TABLE_SEARCH_RESULT __stdcall FindNodeOrParent(
        _RTL_GENERIC_TABLE *Table,
        VOID *Buffer,
        _RTL_SPLAY_LINKS **NodeOrParent,
        VOID *a4,
        VOID *NodeOrParenta,
        _RTL_SPLAY_LINKS **a6){
  _RTL_SPLAY_LINKS *Blink; 
  _TABLE_SEARCH_RESULT v11; 
  int v12; 
  _RTL_SPLAY_LINKS *LeftChild; 

  if( !HIDWORD(Table->CompareRoutine) )
    return 0;
  Blink = (_RTL_SPLAY_LINKS *)Table->InsertOrderList.Blink;
  v11 = TableFoundNode;
  while( 1 )
  {
    v12 = ((__int64(__fastcall *)(_RTL_GENERIC_TABLE *, VOID *, _RTL_SPLAY_LINKS **, VOID *))Table[1].TableRoot)(
            Table,
            Buffer,
            &Blink[1].LeftChild,
            a4);
    if( v12 )
      break;
    LeftChild = Blink->LeftChild;
    if( !LeftChild )
    {
      v11 = TableInsertAsLeft;
      goto LABEL_11;
    }
LABEL_7:
    Blink = LeftChild;
  }
  if( v12 != 1 )
    goto LABEL_11;
  LeftChild = Blink->RightChild;
  if( LeftChild )
    goto LABEL_7;
  v11 = TableInsertAsRight;
LABEL_11:
  *NodeOrParent = Blink;
  return v11;
}

Referenced by:

RtlEnumerateGenericTableLikeADirectory
RtlInsertElementGenericTableAvl
RtlLookupFirstMatchingElementGenericTableAvl