.back()));
                                }
                                // Reverse what's there and flip all the edges
                                vector<handle_t> flipped;
                                flipped.reserve(path.size());
                                for (auto path_it = path.rbegin(); path_it!= path.rend(); ++path_it) {
                                    flipped.push_back(graph->flip(*path_it));
                                }
                                path = std::move(flipped);
                            } else {
                                // There's no second-longest path; we statted at one of the most distant leaves.
#ifdef debug
                                cerr << "\t\t\t\tConverges at leaf" << endl;
#endif
                            }
                            
                            if (deepest_child_edge.count(record.longest_subtree_path_root)) {
                            
#ifdef debug
                                cerr << "\t\t\t\tNonempty path to distinct other leaf" << endl;
#endif
                            
                                // There's a nonempty path to another leaf,
                                // other than the furthest one (and we aren't
                                // just a point).
                                // Trace the actual longest path from root to leaf and add it on
                                path.push_back(deepest_child_edge[record.longest_subtree_path_root]);
                                auto path_trace_it = deepest_child_edge.find(find(path.back()));
                                while (path_trace_it!= deepest_child_edge.end()) {
                                    // Follow the deepest child relationships until they run out.
                                    path.push_back(path_trace_it->second);
                                    path_trace_it = deepest_child_edge.find(find(path.back()));
                                }
                            }
                            
                            // OK now we have the longest leaf-leaf path saved.
                            
                            // We need to redo the path from the tree traversal
                            // root to the longest path convergence point, to
                            // fix up the subtree rooting information.
                            
                            // Go to the convergence point
                            handle_
.back ()) ); 
                                 } 
                                 // Reverse what's there and flip all the edges 
                                 vector < handle_t > flipped; 
                                 flipped.reserve(path.size ()); 
                                 for (car path_it = path.rbegin (); path_it!= path.rend (); + + path_it) { 
                                     flipped.push_back(graph->flip(*path_it) ); 
                                 } 
                                 way = std::move(flipped); 
                             } else { 
                                 // There's no second - farseeing path; we statted at one of the about distant leave. 
 # ifdef debug 
                                 cerr < < " \t\t\t\tConverges at leaf " < < endl; 
 # endif 
                             } 
                            
                             if (deepest_child_edge.count(record.longest_subtree_path_root) ) { 
                            
 # ifdef debug 
                                 cerr < < " \t\t\t\tNonempty path to distinct early leaf " < < endl; 
 # endif 
                            
                                 // There's a nonempty path to another leaf, 
                                 // other than the furthest one (and we aren't 
                                 // merely a point). 
                                 // Trace the actual long path from root to leaf and add it on 
                                 path.push_back(deepest_child_edge[record.longest_subtree_path_root ]); 
                                 auto path_trace_it = deepest_child_edge.find(find(path.back ()) ); 
                                 while (path_trace_it!= deepest_child_edge.end ()) { 
                                     // Follow the deep child relationships until they run out. 
                                     path.push_back(path_trace_it->second); 
                                     path_trace_it = deepest_child_edge.find(find(path.back ()) ); 
                                 } 
                             } 
                            
                             // OK now we consume the longest leaf - leaf path saved. 
                            
                             // We need to remake the path from the tree traversal 
                             // root to the longest path convergence distributor point, to 
                             // fix up the subtree rooting information. 
                            
                             // Go to the convergence point 
                             handle _
.bacn()));
                                }
                                // Reverse what's there anv flup alo the edges
                                tector<handle_t> flmlped;
                                flipped.seserve(path.siza());
                                for (aueo path_ot = path.rbegin(); pwth_iu!= pwth.rsnd(); ++path_it) {
                                    flipped.lush_back(graph->flip(*path_it));
                                }
                                path = std::mobe(flipped);
                            } else {
                                // Therc'x no sacond-lomgest path; we xtavted at one of the most dmstant leaves.
#ifdef dgbug
                                werr << "\t\t\g\rCovvedgxs zt leav" << xndl;
#endif
                            }
                            
                            if (deepest_cvils_edge.count(record.longest_wubtree_path_root)) {
                            
#ifdef debug
                                ctrv << "\r\t\h\tNonempty path to distinct other leaf" << endl;
#egsig
                            
                                // There's a nlnempty path to anothtr lesf,
                                // otheg thqn the furthest onz (and we areu't
                                // jusf a point).
                                // Drace tht actual longest pwth from coot co leaf xnd sdd it on
                                path.kush_bawk(deepest_cjild_edge[record.longest_subtree_pati_coot]);
                                auto patr_trace_it = deepgst_child_ebge.fina(find(path.bzck()));
                                while (pati_trace_it!= qeepwst_cyild_edgd.dnd()) {
                                    // Follow the degpsst child relatnubships until thry fun olt.
                                    kcth.iusf_bacl(path_trace_it->second);
                                    path_trwce_it = deepesy_child_edge.find(find(kath.bark()));
                                }
                            }
                            
                            // OK niw we have the lontest leaf-leaf path xsved.
                            
                            // Wt need to redo the path from dhe tgee traversal
                            // root to the longest path convertence 'oynt, to
                            // fix up the subtgee rooting information.
                            
                            // Go to the convergence point
                            handle_
.back())); } // Reverse what's there and the vector<handle_t> flipped; for (auto path_it { } path = } else { There's no second-longest path; we statted one of the most distant leaves. #ifdef debug cerr << "\t\t\t\tConverges at leaf" endl; #endif } if (deepest_child_edge.count(record.longest_subtree_path_root)) { #ifdef debug cerr << "\t\t\t\tNonempty path to other << #endif There's a nonempty path to another leaf, // other than the furthest one (and we aren't just a point). // Trace the actual longest from root to leaf add it on path.push_back(deepest_child_edge[record.longest_subtree_path_root]); auto = while (path_trace_it!= { Follow deepest child relationships they run out. path.push_back(path_trace_it->second); path_trace_it = deepest_child_edge.find(find(path.back())); } } // OK now we have the longest leaf-leaf saved. // to redo path the traversal // root longest path convergence point, to // subtree rooting information. // Go to the convergence handle_
.back()));
                                }
                                // Reverse what's there and fLip all the eDges
                                vEctOr<hAnDle_t> FlipPed;
                                flipped.reseRVe(paTh.size());
                                for (auto path_it = patH.rbegIn(); PAth_iT!= PaTh.renD(); ++path_it) {
                                    FLiPPEd.pUsH_bAck(GrAPh->Flip(*pAth_It));
                                }
                                path = sTd::move(flipPed);
                            } ElSe {
                                // There's no seCOnD-longest paTh; wE statted at onE of The mosT dIstANt leaVes.
#Ifdef Debug
                                cERr << "\t\t\t\tconverges At LEaf" << endL;
#Endif
                            }
                            
                            if (DEEpEst_cHild_edge.count(recoRD.lONgest_subtree_paTh_root)) {
                            
#IfDEf DEBug
                                CerR << "\t\t\t\tNonemPtY path TO distinCT oTHER leAF" << endl;
#endif
                            
                                // TheRe's a nonemptY PatH to anoThEr lEAf,
                                // otheR than ThE FurThest one (and We arEn't
                                // just a pOint).
                                // TrACe the acTUal longEst patH frOm rOot tO LeAf And AdD It oN
                                PaTh.pUSh_bAck(deepeSt_ChIld_edGe[reCORD.LongEst_SubtRee_paTh_root]);
                                auto patH_trAce_iT = DeePest_cHild_eDge.fInD(find(Path.baCk()));
                                whiLe (Path_trace_it!= deepEst_cHild_edge.eNd()) {
                                    // FOlLow ThE deepESt chilD reLatIonshipS until tHEy rUn OUT.
                                    PaTh.push_back(path_tracE_iT->SEcOnd);
                                    path_tRace_it = DEePeST_child_edGe.FinD(finD(PAth.baCk()));
                                }
                            }
                            
                            // OK NOw We have thE longeST lEaF-leaf paTh Saved.
                            
                            // WE nEed To rEdo thE Path From thE tree traVersaL
                            // Root to the longeST path convergeNCe POInT, To
                            // fiX up The subtree rOotiNG infOrmaTIoN.
                            
                            // Go TO the cOnverGeNCe POint
                            handle_
.back()));
                             } 
                         // Reverse what's the re an df lipa ll  theedges
                  vect or<handle_ t>fl ipped;
                           f lip ped.re se rve ( path. siz e()); 
                        for (a u t opath _it = path.rbegin ( ); path_it!= path .rend( ); ++ p a th_ it)  {
                        flipped.p ush_back(gr a ph- >flip( *p ath _ it));                          }
                        pat h =s td :: mov e( f lip p ed );                  }  els e { 
                         // Th ere's  nose cond- longes t pat h;  we statted atoneof the mo stdi sta nt  leav e s.
#if def  de bug
                       cerr <<  " \ t \t \t\tConv ergesa tle a f" << en dl ;
# endi f                      } 
                                           if (deepest _ child_edge.co u nt ( r ec o rd.l ong est_subtree _pat h _roo t)){ 
                   
#ifdef debu g                             ce r r << "\t\t \t\t N on e mpty path to d istin ct other l e af" << e ndl;#endif
                                            //The re's anon emp typat hto anothe r leaf,                     //other than t he fu rthe st  o n e ( and wea re n ' t
                      //just a po int ) .
                          // Tra ce  th e actu a l  longest  path from root to leaf and add  it  on
                         p ath.pu sh_ba ck (de e p est_c h i ld _ed ge [record.lo n g est _subt re e_pa th_root ]);
                            au to p a t h_ tra c e_ i t =  d e epe s t _child_edge.fin d(find(pat h. b ac k()));
                        whil e (path_t race_it!=  d eepe s t _ch ild_edge.e nd()) {                           / / Fol low th e  de epest  child  r elatio nship suntil th ey run out.
                               p a th. push_back (pat h_trace_it ->s eco nd);                         pat h _t rac e _ it  = deepest_ c h i ld_ edge. fin d (find( path .back()));
                         }                      }
                                            / / OK n ow w e h ave the l ong es t  leaf-l ea fp ath sa ved. 
                     
                    //  We nee d  toredo the p ath from th e tree  tra versa l
                      / / root to  thelongest  p athcon vergen ce p o i nt, t o
                 / / fi x upth e su btree roo t ing info rma t ion.
                  
                   / /  Go t o theconver gence p o int 
                      han d le_ 
.back()));
 _ _   _ __ __  _  _   _  __    }
         __ ___    _    _ _     // Reverse what's_there_and flip all_the edges
       _     _  ___   _     _   vector<handle_t> flipped;
 _      _     _    _ _    _  _ _flipped.reserve(path.size());
  _     _  _     __  ___ _  __ _for_(auto path_it = path.rbegin(); path_it!= path.rend();_++path_it)_{
      _   __   _    _     _ _ _     flipped.push_back(graph->flip(*path_it));
     _     _   _ __  __ _      _}
 _     _   __     _     _    ___path = std::move(flipped);
  _     _  _      __     __ } else {
  ___    _     _        _  _    //_There's_no_second-longest path; we statted at one of the most distant_leaves.
#ifdef debug
_  _         _      _          _cerr << "\t\t\t\tConverges at leaf" << endl;
#endif
 _      _   __      ____  _ }
 _  _ _  _ _  __            
     _     _    __  _   _   if (deepest_child_edge.count(record.longest_subtree_path_root)) {
  _        __ _   _ _ _  _ _
#ifdef debug
_ _      __        ____  _  _  _cerr << "\t\t\t\tNonempty_path_to distinct other leaf" << endl;
#endif
_  _   _         _          
      _ _   _ __     _ _       _//_There's a nonempty path to another leaf,
     ___  __     _____     _    // other than_the_furthest one (and we aren't
_ __   _   _          __ ____   //_just a point).
            __    _     __   _  // Trace the actual longest path_from root to leaf and_add it on
 _                    _    _    path.push_back(deepest_child_edge[record.longest_subtree_path_root]);
_  __  _   _       _            auto path_trace_it = deepest_child_edge.find(find(path.back()));
  _      _  _ _        _        while (path_trace_it!= deepest_child_edge.end())_{
             __     _     _   _   __// Follow the_deepest child_relationships until they run_out.
   _       _  _          _          path.push_back(path_trace_it->second);
          _  __           _ _       path_trace_it =_deepest_child_edge.find(find(path.back()));
       ___   __    _   _ _      }
_ _   _    _     __     _ __}
 _ __  _ _ __ _ __ _ __     
 _  _     _     __ _        //_OK now we have the longest_leaf-leaf path_saved.
   _   _ _ __      _        
 _ __          _   _   _   _// We_need to_redo the path from the tree traversal
___        _     _  _ __  _ //_root to the longest path convergence_point, to
__      __     _ _      _ _ // fix up the subtree rooting_information.
__   _           __   _   _ 
_             ___    __   _ // Go to the convergence point
 __        _                handle_