code: function callAdoptionAgency(p, token) {
      for (var i = 0; i < AA_OUTER_LOOP_ITER; i++) {
          var formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry);
  
          if (!formattingElementEntry)
              break;
  
          var furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry);
  
          if (!furthestBlock)
              break;
  
          p.activeFormattingElements.bookmark = formattingElementEntry;
  
          var lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element),
              commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element);
  
          p.treeAdapter.detachNode(lastElement);
          aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement);
          aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry);
      }
  }
docs: Algorithm entry point