private Loop NaturalLoopForEdge(FunctionBlock header, FunctionBlock tail)
        {
            Stack<FunctionBlock> workList = new Stack<FunctionBlock>();
            Loop loop;

            loop = new Loop();
            loop.Header = header;
            loop.Blocks.Add(header);

            if (header != tail)
            {
                loop.Blocks.Add(tail);
                workList.Push(tail);
            }

            while (workList.Count != 0)
            {
                FunctionBlock b = workList.Pop();
                foreach (FunctionBlock pred in b.Predecessors)
                {
                    if (loop.Blocks.IndexOf(pred) < 0)
                    {
                        loop.Blocks.Add(pred);
                        workList.Push(pred);
                    }
                }
            }

            loop.Blocks.Sort(Function.FunctionBlockSorter);
            return loop;
        }
 int LoopSortDesc(Loop l1, Loop l2)
 {
     return (int) l2.Blocks[0].StartAddress - (int) l1.Blocks[0].StartAddress;
 }