anchor.diff:  end;
   
   function TFLREDFA.WorkQueueToCachedState(const WorkQueue:TFLREDFAWorkQueue;Flags:longword):PFLREDFAState;
  - procedure Sort(List:PFLREIntegerArray;const CountItems:longint);
  -  function IntLog2(x:longword):longword; {$ifdef cpu386}assembler; register;
  -  asm
  -   test eax,eax
  -   jz @Done
  -   bsr eax,eax
  -   @Done:
  -  end;
  - {$else}
  -  begin
  -   x:=x or (x shr 1);
  -   x:=x or (x shr 2);
  -   x:=x or (x shr 4);
  -   x:=x or (x shr 8);
  -   x:=x or (x shr 16);
  -   x:=x shr 1;
  -   x:=x-((x shr 1) and $55555555);
  -   x:=((x shr 2) and $33333333)+(x and $33333333);
  -   x:=((x shr 4)+x) and $0f0f0f0f;
  -   x:=x+(x shr 8);
  -   x:=x+(x shr 16);
  -   result:=x and $3f;
  -  end;
  - {$endif}
  -  procedure IntroSort(Left,Right,Depth:longint);
  -   procedure SiftDown(Current,MaxIndex:longint);
  -   var SiftLeft,SiftRight,Largest:longint;
  -       v:longint;
  -   begin
  -    SiftLeft:=Left+(2*(Current-Left))+1;
  -    SiftRight:=Left+(2*(Current-Left))+2;
  -    Largest:=Current;
  -    if (SiftLeft<=MaxIndex) and (List^[SiftLeft]>List^[Largest]) then begin
  -     Largest:=SiftLeft;
  -    end;
  -    if (SiftRight<=MaxIndex) and (List^[SiftRight]>List^[Largest]) then begin
  -     Largest:=SiftRight;
  -    end;
  -    if Largest<>Current then begin
  -     v:=List^[Current];
  -     List^[Current]:=List^[Largest];
  -     List^[Largest]:=v;
  -     SiftDown(Largest,MaxIndex);
  -    end;
  -   end;
  -   procedure InsertionSort;
  -   var i,j:longint;
  -       t:longint;
  -   begin
  -    i:=Left+1;
  -    while i<=Right do begin
  -     t:=List^[i];
  -     j:=i-1;
  -     while (j>=Left) and (t<List^[j]) do begin
  -      List^[j+1]:=List^[j];
  -      dec(j);
  -     end;
  -     List^[j+1]:=t;
  -     inc(i);
  -    end;
  -   end;
  -   procedure HeapSort;
  -   var i:longint;
  -       v:longint;
  -   begin
  -    i:=((Left+Right+1) div 2)-1;
  -    while i>=Left do begin
  -     SiftDown(i,Right);
  -     dec(i);
  -    end;
  -    i:=Right;
  -    while i>=Left+1 do begin
  -     v:=List^[i];
  -     List^[i]:=List^[Left];
  -     List^[Left]:=v;
  -     SiftDown(Left,i-1);
  -     dec(i);
  -    end;
  -   end;
  -   procedure QuickSortWidthMedianOfThreeOptimization;
  -   var Middle,i,j:longint;
  -       Pivot,v:longint;
  -   begin
  -    Middle:=(Left+Right) div 2;
  -    if (Right-Left)>3 then begin
  -     if List^[Left]>List^[Middle] then begin
  -      v:=List^[Left];
  -      List^[Left]:=List^[Middle];
  -      List^[Middle]:=v;
  -     end;
  -     if List^[Left]>List^[Right] then begin
  -      v:=List^[Left];
  -      List^[Left]:=List^[Right];
  -      List^[Right]:=v;
  -     end;
  -     if List^[Middle]>List^[Right] then begin
  -      v:=List^[Middle];
  -      List^[Middle]:=List^[Right];
  -      List^[Right]:=v;
  -     end;
  -    end;
  -    Pivot:=List^[Middle];
  -    i:=Left;
  -    j:=Right;
  -    while true do begin
  -     while (i<j) and (List^[i]<Pivot) do begin
  -      inc(i);
  -     end;
  -     while (j>i) and (List^[j]>Pivot) do begin
  -      dec(j);
  -     end;
  -     if i>j then begin
  -      break;
  -     end;
  -     v:=List^[i];
  -     List^[i]:=List^[j];
  -     List^[j]:=v;
  -     inc(i);
  -     dec(j);
  -    end;
  -    IntroSort(Left,j,Depth-1);
  -    IntroSort(i,Right,Depth-1);
  -   end;
  -  begin
  -   if Left<Right then begin
  -    if (Right-Left)<16 then begin
  -     InsertionSort;
  -    end else if Depth=0 then begin
  -     HeapSort;
  -    end else begin
  -     QuickSortWidthMedianOfThreeOptimization;
  -    end;
  -   end;
  -  end;
  -  procedure QuickSort(L,R:longint);
  -  var Pivot,vL,vR:longint;
  -      v:longint;
  -  begin
  -   if (R-L)<=1 then begin
  -    if (L<R) and (List[R]<List[L]) then begin
  -     v:=List^[L];
  -     List^[L]:=List^[R];
  -     List^[R]:=v;
  -    end;
  -   end else begin
  -    vL:=L;
  -    vR:=R;
  -    Pivot:=L+Random(R-L);
  -    while vL<vR do begin
  -     while (vL<Pivot) and (List^[vL]<=List^[Pivot]) do begin
  -      inc(vL);
  -     end;
  -     while (vR>Pivot) and (List^[vR]>List^[Pivot]) do begin
  -      dec(vR);
  -     end;
  -     v:=List^[vL];
  -     List^[vL]:=List^[vR];
  -     List^[vR]:=v;
  -     if Pivot=vL then begin
  -      Pivot:=vR;
  -     end else if Pivot=vR then begin
  -      Pivot:=vL;
  -     end;
  -    end;
  -    if (Pivot-1)>=L then begin
  -     QuickSort(L,Pivot-1);
  -    end;
  -    if (Pivot+1)<=R then begin
  -     QuickSort(Pivot+1,R);
  -    end;
  -   end;
  -  end;
  -  procedure QuickSortEx(Left,Right:longint);
  -  var Pivot,i,j:longint;
  -      v:longint;
  -  begin
  -   i:=Left;
  -   j:=Right;
  -   Pivot:=List^[(i+j) div 2];
  -   while i<=j do begin
  -    while List^[i]<Pivot do begin
  -     inc(i);
  -    end;
  -    while List^[j]>Pivot do begin
  -     dec(j);
  -    end;
  -    if i<=j then begin
  -     v:=List^[i];
  -     List^[i]:=List^[i];
  -     List^[j]:=v;
  -     inc(i);
  -     dec(j);
  -    end;
  -   end;
  -   if Left<j then begin
  -    QuickSortEx(Left,j);
  -   end;
  -   if i<Right then begin
  -    QuickSortEx(i,Right);
  -   end;
  -  end;
  -  procedure BeRoSort;
  -  var i:longint;
  -      v:longint;
  -  begin
  -   i:=0;
  -   while i<(CountItems-1) do begin
  -    if List^[i]>List^[i+1] then begin
  -     v:=List^[i];
  -     List^[i]:=List^[i+1];
  -     List^[i+1]:=v;
  -     if i>0 then begin
  -      dec(i);
  -     end else begin
  -      inc(i);
  -     end;
  -    end else begin
  -     inc(i);
  -    end;
  -   end;
  -  end;
  - begin
  -  if CountItems>0 then begin
  -   IntroSort(0,CountItems-1,IntLog2(CountItems)*2);
  -  end;
  - end;
   var Index,n,Count:Longint;
       NeedFlags:longword;
       SawMatch,SawMark,First:boolean;
  
positive.code:  end;
  end;
  
  {$ifdef cpuamd64}
  function InterlockedCompareExchange128Ex(Target,NewValue,Comperand:pointer):boolean; assembler; register;
  asm
  
negative.code:     inc(MarkItem);
      inc(Count);
     end;
     IndirectIntroSort(pointer(CurrentItem),0,Count-1,CompareInstruction);
     if PtrUInt(pointer(MarkItem))<PtrUInt(pointer(EndItem)) then begin
      inc(MarkItem);
     end;
  