Debian Codegraph @

prefix_tree.cpp

raw symbols SCIP
1 // PatMaN DNA pattern matchercxx . . $ `<file>/prefix_tree.cpp`/
2 // (C) 2007 Kay Pruefer, Udo Stenzel
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or (at
7 // your option) any later version. See the LICENSE file for details.
8
9
10 #include "prefix_tree.h"cxx . . $ `<file>/prefix_tree.h`/
11
12 #include <cassert>
13 #include <iostream>
14 #include <queue>
15 #include <cstdlib>
16
17 using namespace std ;
18
19 // Why a deque? Because allocation of many small objects of
20 // equal size is faster in it and deallocation of the whole
21 // deque is much faster than deallocation of the small objects,
22 // especially with our extremely simple allocation pattern.
23 // This is probably the most sensible way to plug this memory
24 // leak.
25 prefix_treecxx . . $ prefix_tree#::prefix_treecxx . . $ prefix_tree#prefix_tree(49f6e7a06ebc5aa8).( ) : nodescxx . . $ prefix_tree#nodes.()
26 {
27 nodescxx . . $ prefix_tree#nodes..push_backcxx . . $ std/deque#push_back(fe7a8a4d1eddb70).( nodecxx . . $ node#node(49f6e7a06ebc5aa8).() ) ;
28 }
29
30 #ifndef NDEBUGcxx . . $ `<built-in>:482:9`!
31 void prefix_tree::debug( std::ostream& s, const node& n ) const
32 {
33 if( debug_flags & debug_trie )
34 {
35 for( int i = 0 ; i != 5 ; ++i )
36 s << n.label << " -" << "ACGTN"[i] << "> " << n.childs[i]->label << '/' << (int)n.drop[i] << std::endl ;
37 if( n.suffix ) s << n.label << " ==> " << n.suffix->label << '/' << n.drop_suffix << std::endl ;
38
39 for( int i = 0 ; i != 5 ; ++i )
40 if( !n.drop[i] ) debug( s, *n.childs[i] ) ;
41 }
42 }
43 #endif
44
45
46 static mismatch_ptrcxx . . $ mismatch_ptr# *junk_yardcxx . . $ junk_yard. = 0 ;
47
48 static mismatch_ptrcxx . . $ mismatch_ptr# *new_nodecxx . . $ new_node(671b2d84a5a64214).()
49 {
50 if( junk_yardcxx . . $ junk_yard. )
51 {
52 mismatch_ptrcxx . . $ mismatch_ptr# *p = junk_yardcxx . . $ junk_yard. ;
53 junk_yardcxx . . $ junk_yard. = p->nextcxx . . $ mismatch_ptr#next. ;
54 return p ;
55 }
56 else
57 {
58 return new mismatch_ptrcxx . . $ mismatch_ptr# ;
59 }
60 }
61
62 mismatch_ptrcxx . . $ mismatch_ptr# *prefix_treecxx . . $ prefix_tree#::seedcxx . . $ prefix_tree#seed(3606ea0e0471eaa7).() const
63 {
64 // add ptr to the root node
65 mismatch_ptrcxx . . $ mismatch_ptr# *p = new_nodecxx . . $ new_node(671b2d84a5a64214).() ;
66 p->ptrcxx . . $ mismatch_ptr#ptr. = &nodescxx . . $ prefix_tree#nodes.[cxx . . $ std/deque#`operator[]`(7e45a0d3bba141dc).0] ;
67 p->mismatchcxx . . $ mismatch_ptr#mismatch. = 0 ;
68 p->gapscxx . . $ mismatch_ptr#gaps. = 0 ;
69 p->firstcxx . . $ mismatch_ptr#first. = 0 ;
70 p->isgapcxx . . $ mismatch_ptr#isgap. = 0 ;
71 p->matchedcxx . . $ mismatch_ptr#matched. = 0 ;
72 p->nextcxx . . $ mismatch_ptr#next. = 0 ;
73 return p ;
74 }
75
76 mismatch_ptrcxx . . $ mismatch_ptr# *prefix_treecxx . . $ prefix_tree#::initcxx . . $ prefix_tree#init(9f4eb692c23f96cc).( mismatch_ptrcxx . . $ mismatch_ptr# *p ) const
77 {
78 if( p ) {
79 mismatch_ptrcxx . . $ mismatch_ptr# *q = p ;
80 while( p->nextcxx . . $ mismatch_ptr#next. ) p = p->nextcxx . . $ mismatch_ptr#next. ;
81 p->nextcxx . . $ mismatch_ptr#next. = junk_yardcxx . . $ junk_yard. ;
82 junk_yardcxx . . $ junk_yard. = q ;
83 }
84 return seedcxx . . $ prefix_tree#seed(3606ea0e0471eaa7).() ;
85 }
86
87 // creates child node # pos if necessary and returns ptr to this child node
88 nodecxx . . $ node#* prefix_treecxx . . $ prefix_tree#::create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( nodecxx . . $ node#* n, int pos ) {
89 if ( n->childscxx . . $ node#childs.[pos] == 0 ) {
90 nodecxx . . $ node# ocxx . . $ node#node(49f6e7a06ebc5aa8). ;
91 o.depthcxx . . $ node#depth. = n->depthcxx . . $ node#depth. + 1 ;
92 nodescxx . . $ prefix_tree#nodes..push_backcxx . . $ std/deque#push_back(77d9f17553126ecb).( o ) ;
93 nodecxx . . $ node# *next = &nodescxx . . $ prefix_tree#nodes..backcxx . . $ std/deque#back(1c9784b1aa27a05e).() ;
94 n->childscxx . . $ node#childs.[pos] = next ;
95 #ifndef NDEBUGcxx . . $ `<built-in>:482:9`!
96 if( debug_flags & debug_trie )
97 n->childs[pos]->label = n->label + "ACGTN"[pos] ;
98 #endif
99 return next ;
100 } else {
101 return n->childscxx . . $ node#childs.[pos] ;
102 }
103 }
104
105 void prefix_treecxx . . $ prefix_tree#::add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( const stringcxx . . $ std/string#& seq, const stringcxx . . $ std/string#& name, nodecxx . . $ node#* ptr, size_tcxx . . $ size_t# i, char strand )
106 {
107 // is this a leaf?
108 if ( i == seq.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).() ) {
109
110 probe_scxx . . $ probe_s# *probe = new probe_scxx . . $ probe_s#() ;
111 probe->namecxx . . $ probe_s#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). name ;
112 probe->strandcxx . . $ probe_s#strand. = strand ;
113 probe->lengthcxx . . $ probe_s#length. = seq.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).() ;
114 probe->nextcxx . . $ probe_s#next. = ptr->probescxx . . $ node#probes. ;
115 ptr->probescxx . . $ node#probes. = probe ;
116
117 // no leaf -> add
118 } else {
119 switch ( toupper(seq[cxx . . $ std/__cxx11/basic_string#`operator[]`(dd01cf3f78ddc127).i]) ) {
120 case 'A':
121 add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), ++i, strand ) ;
122 break ;
123 case 'C':
124 add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), ++i, strand ) ;
125 break ;
126 case 'G':
127 add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), ++i, strand ) ;
128 break ;
129 case 'T':
130 case 'U':
131 add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), ++i, strand ) ;
132 break ;
133 case 'N':
134 case 'X':
135 add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 4 ), ++i, strand ) ;
136 break ;
137 case '-':
138 break ;
139 default:
140 add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 4 ), ++i, strand ) ;
141 if( debug_flagscxx . . $ debug_flags. & debug_notquietcxx . . $ debug_notquiet. )
142 clogcxx . . $ std/clog. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Warning: Sequence with name " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). name
143 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " has character '" <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). seq[cxx . . $ std/__cxx11/basic_string#`operator[]`(dd01cf3f78ddc127).i]
144 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "' other than ACGTUXN." <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9). ;
145 debug_flagscxx . . $ debug_flags. &= ~debug_notquietcxx . . $ debug_notquiet. ;
146 break ;
147 }
148
149 }
150 }
151
152 /***
153 * Adding the sequence taking into account the ambiguity codes.
154 * i.e. Sequence with "N" will be added to A, C, G and T node
155 */
156 void prefix_treecxx . . $ prefix_tree#::add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( const stringcxx . . $ std/string#& seq, const stringcxx . . $ std/string#& name, nodecxx . . $ node#* ptr, size_tcxx . . $ size_t# i, char strand )
157 {
158 // is this a leaf?
159 if ( i == seq.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).() ) {
160
161 probe_scxx . . $ probe_s# *probe = new probe_scxx . . $ probe_s#() ;
162 probe->namecxx . . $ probe_s#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). name ;
163 probe->strandcxx . . $ probe_s#strand. = strand ;
164 probe->lengthcxx . . $ probe_s#length. = seq.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).() ;
165 probe->nextcxx . . $ probe_s#next. = ptr->probescxx . . $ node#probes. ;
166 ptr->probescxx . . $ node#probes. = probe ;
167
168 // no leaf -> add
169 } else {
170 switch ( toupper(seq[cxx . . $ std/__cxx11/basic_string#`operator[]`(dd01cf3f78ddc127).i]) ) {
171 case 'A':
172 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), i+1, strand ) ;
173 break ;
174 case 'C':
175 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), i+1, strand ) ;
176 break ;
177 case 'G':
178 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), i+1, strand ) ;
179 break ;
180 case 'T':
181 case 'U':
182 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), i+1, strand ) ;
183 break ;
184 case 'N':
185 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), i+1, strand ) ;
186 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), i+1, strand ) ;
187 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), i+1, strand ) ;
188 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), i+1, strand ) ;
189 break ;
190 case 'R':
191 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), i+1, strand ) ;
192 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), i+1, strand ) ;
193 break ;
194 case 'Y':
195 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), i+1, strand ) ;
196 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), i+1, strand ) ;
197 break ;
198 case 'M':
199 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), i+1, strand ) ;
200 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), i+1, strand ) ;
201 break ;
202 case 'K':
203 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), i+1, strand ) ;
204 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), i+1, strand ) ;
205 break ;
206 case 'S':
207 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), i+1, strand ) ;
208 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), i+1, strand ) ;
209 break ;
210 case 'W':
211 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), i+1, strand ) ;
212 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), i+1, strand ) ;
213 break ;
214 case 'B':
215 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), i+1, strand ) ;
216 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), i+1, strand ) ;
217 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), i+1, strand ) ;
218 break ;
219 case 'D':
220 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), i+1, strand ) ;
221 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), i+1, strand ) ;
222 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), i+1, strand ) ;
223 break ;
224 case 'H':
225 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), i+1, strand ) ;
226 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), i+1, strand ) ;
227 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 3 ), i+1, strand ) ;
228 break ;
229 case 'V':
230 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 0 ), i+1, strand ) ;
231 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 1 ), i+1, strand ) ;
232 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 2 ), i+1, strand ) ;
233 break ;
234
235 case '-':
236 break ;
237
238 default:
239 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, create_go_nodecxx . . $ prefix_tree#create_go_node(ded99998152b81f8).( ptr, 4 ), i+1, strand ) ;
240 if( debug_flagscxx . . $ debug_flags. & debug_notquietcxx . . $ debug_notquiet. )
241 clogcxx . . $ std/clog. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Warning: Sequence with name " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). name
242 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " has character '" <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). seq[cxx . . $ std/__cxx11/basic_string#`operator[]`(dd01cf3f78ddc127).i]
243 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "' other than ACGTU, BDH, SWKMRY, or XN." <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9). ;
244 debug_flagscxx . . $ debug_flags. &= ~debug_notquietcxx . . $ debug_notquiet. ;
245 break ;
246 }
247
248 }
249 }
250
251 /* Ambiguity codes:
252 * R = G or A (puRine)
253 * Y = C or T (pYrimidine)
254 * M = A or C (aMine)
255 * K = G or T (Ketone)
256 * S = G or C (Strong coupling)
257 * W = A or T (Weak coupling)
258 * B = not A (C or G or T)
259 * D = not C (A or G or T)
260 * H = not G (A or C or T)
261 * V = not U (A or C or G)
262 * N = A or C or G or T (Nucleotide)
263 */
264
265 /*
266 * reverse complement of a dna sequence, including correct ambiguity mapping
267 */
268 inline static stringcxx . . $ std/string# reverse_complementcxx . . $ reverse_complement(fd626fc03107dd24).( const stringcxx . . $ std/string#& s ) {
269 stringcxx . . $ std/string# retcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391). ;
270 for ( int i = s.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).()-1 ; i >= 0 ; i-- ) {
271 switch ( toupper( s[cxx . . $ std/__cxx11/basic_string#`operator[]`(dd01cf3f78ddc127).i] ) ) {
272 case 'A':
273 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'T' ; break ;
274 case 'C':
275 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'G' ; break ;
276 case 'G':
277 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'C' ; break ;
278 case 'T':
279 case 'U':
280 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'A' ; break ;
281 case 'R':
282 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'Y' ; break ;
283 case 'Y':
284 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'R' ; break ;
285 case 'M':
286 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'K' ; break ;
287 case 'K':
288 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'M' ; break ;
289 case 'B':
290 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'V' ; break ;
291 case 'V':
292 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'B' ; break ;
293 case 'D':
294 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'H' ; break ;
295 case 'H':
296 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). 'D' ; break ;
297 case 'S':
298 case 'W':
299 case 'N':
300 case '-':
301 ret +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). s[cxx . . $ std/__cxx11/basic_string#`operator[]`(dd01cf3f78ddc127).i] ;
302 break ;
303 default:
304 clogcxx . . $ std/clog. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Sequence has invalid character '"
305 <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). s[cxx . . $ std/__cxx11/basic_string#`operator[]`(dd01cf3f78ddc127).i] <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "'." <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). endlcxx . . $ std/endl(345bf97a19cc83a9). ;
306 exit( 1 ) ;
307 }
308 }
309 return retcxx . . $ std/__cxx11/basic_string#basic_string(8f3aaafa33d05d0b). ;
310 }
311
312 void prefix_treecxx . . $ prefix_tree#::add_seqcxx . . $ prefix_tree#add_seq(63deecd705778e94).( const stringcxx . . $ std/string#& seq, const stringcxx . . $ std/string#& name, bool ambi_codes )
313 {
314 nodecxx . . $ node# *ptr = &nodescxx . . $ prefix_tree#nodes.[cxx . . $ std/deque#`operator[]`(aba7754fdb63cabb).0] ;
315 int i = 0 ;
316 if ( ! ambi_codes ) {
317 add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( seq, name, ptr, i, '+' ) ;
318 if ( only_plus_strandcxx . . $ only_plus_strand. != 1 ) {
319 stringcxx . . $ std/string# rev_seq = reverse_complementcxx . . $ reverse_complement(fd626fc03107dd24).( seq ) ;
320 add_recursioncxx . . $ prefix_tree#add_recursion(633306f8a470b339).( rev_seq, name, ptr, i, '-' ) ;
321 }
322 } else {
323 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( seq, name, ptr, i, '+' ) ;
324 if ( only_plus_strandcxx . . $ only_plus_strand. != 1 ) {
325 stringcxx . . $ std/string# rev_seq = reverse_complementcxx . . $ reverse_complement(fd626fc03107dd24).( seq ) ;
326 add_recursion_ambiguitycxx . . $ prefix_tree#add_recursion_ambiguity(633306f8a470b339).( rev_seq, name, ptr, i, '-' ) ;
327 }
328 }
329 }
330
331 // Suffix links. These are only needed as an intermediate step. Each
332 // node gets a suffix link, which points to the node that is the longest
333 // existing true suffix. Given a node that already has a suffix, we
334 // find the suffix of child "A" by following the "A" link from our
335 // suffix and adding the 'drop' values for the "suffix" and the "A"
336 // link. We can then fill in the missing children for this node in the
337 // same fashion. To ensure that any node we visit already has a suffix,
338 // we do a breadth-first search.
339 //
340 // The root never has a suffix. To start the fill-in, each missing
341 // child of the root becomes the root itself with a "drop" of one and
342 // the existing ones get the root as suffix with a drop of one.
343 //
344 // Also, after we added the missing children, we no longer need the
345 // suffix link for anything but accessing query sequences that happen to
346 // be substrings of other queries. So we can optimize these.
347
348 void prefix_treecxx . . $ prefix_tree#::add_suffix_linkscxx . . $ prefix_tree#add_suffix_links(49f6e7a06ebc5aa8).()
349 {
350 stdcxx . . $ std/::queuecxx . . $ std/queue#< nodecxx . . $ node#* > qcxx . . $ std/queue#queue(49f6e7a06ebc5aa8). ;
351 nodecxx . . $ node#& root = nodescxx . . $ prefix_tree#nodes.[cxx . . $ std/deque#`operator[]`(aba7754fdb63cabb).0] ;
352 for( int i = 0 ; i != 5 ; ++i )
353 {
354 if( root.childscxx . . $ node#childs.[i] )
355 {
356 root.childscxx . . $ node#childs.[i]->suffixcxx . . $ node#suffix. = &root ;
357 root.childscxx . . $ node#childs.[i]->drop_suffixcxx . . $ node#drop_suffix. = 1 ;
358 q.pushcxx . . $ std/queue#push(5cd2eaf705c8bad3).( root.childscxx . . $ node#childs.[i] ) ;
359 }
360 else
361 {
362 root.childscxx . . $ node#childs.[i] = &root ;
363 root.dropcxx . . $ node#drop.[i] = 1 ;
364 }
365 }
366
367 while( !q.emptycxx . . $ std/queue#empty(50ce9a9e25b4a850).() )
368 {
369 nodecxx . . $ node#* n = q.frontcxx . . $ std/queue#front(d8c1a3bbdff15733).() ;
370 q.popcxx . . $ std/queue#pop(49f6e7a06ebc5aa8).() ;
371 for( int i = 0 ; i != 5 ; ++i )
372 {
373 if( n->childscxx . . $ node#childs.[i] )
374 {
375 n->childscxx . . $ node#childs.[i]->suffixcxx . . $ node#suffix. = n->suffixcxx . . $ node#suffix.->childscxx . . $ node#childs.[i] ;
376 n->childscxx . . $ node#childs.[i]->drop_suffixcxx . . $ node#drop_suffix. = n->drop_suffixcxx . . $ node#drop_suffix. + n->suffixcxx . . $ node#suffix.->dropcxx . . $ node#drop.[i] ;
377 q.pushcxx . . $ std/queue#push(5cd2eaf705c8bad3).( n->childscxx . . $ node#childs.[i] ) ;
378 }
379 else
380 {
381 n->childscxx . . $ node#childs.[i] = n->suffixcxx . . $ node#suffix.->childscxx . . $ node#childs.[i] ;
382 n->dropcxx . . $ node#drop.[i] = n->drop_suffixcxx . . $ node#drop_suffix. + n->suffixcxx . . $ node#suffix.->dropcxx . . $ node#drop.[i] ;
383 }
384 }
385 if( !n->suffixcxx . . $ node#suffix.->probescxx . . $ node#probes. )
386 {
387 if( n->suffixcxx . . $ node#suffix.->suffixcxx . . $ node#suffix. )
388 {
389 n->drop_suffixcxx . . $ node#drop_suffix. += n->suffixcxx . . $ node#suffix.->drop_suffixcxx . . $ node#drop_suffix. ;
390 n->suffixcxx . . $ node#suffix. = n->suffixcxx . . $ node#suffix.->suffixcxx . . $ node#suffix. ;
391 }
392 else
393 {
394 n->suffixcxx . . $ node#suffix. = 0 ;
395 }
396 }
397 }
398 }
399
400 inline static void outcxx . . $ out(7576e2997aee98f1).( int mm, const nodecxx . . $ node#* n, int mlen )
401 {
402 for( const probe_scxx . . $ probe_s# *probe = n->probescxx . . $ node#probes. ; probe ; probe = probe->nextcxx . . $ probe_s#next. )
403 {
404 ( outputcxx . . $ output. ? *outputcxx . . $ output. : coutcxx . . $ std/cout. )
405 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). genome_namecxx . . $ genome_name. <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). '\t' <<cxx . . $ std/`operator<<`(88df5bef833f7f83). probe->namecxx . . $ probe_s#name. <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). '\t'
406 <<cxx . . $ std/basic_ostream#`operator<<`(761e6a6e6922c86). position_genomecxx . . $ position_genome. - mlen <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). '\t'
407 <<cxx . . $ std/basic_ostream#`operator<<`(761e6a6e6922c86). position_genomecxx . . $ position_genome. - 1 <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). '\t'
408 <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). probe->strandcxx . . $ probe_s#strand. <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). '\t' <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). mm <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). '\n' ;
409 }
410 }
411
412 // Why does this work? Because when we follow suffix links (to print
413 // matches that are completely inside other matches), we know that we
414 // only drop perfectly matching stuff from the beginning. This allows
415 // us to update "mlen".
416
417 inline static void out_reccxx . . $ out_rec(6836a68c9faa9cc4).( int mm, const nodecxx . . $ node#* n, int first, int mlen )
418 {
419 if( n->probescxx . . $ node#probes. ) outcxx . . $ out(7576e2997aee98f1).( mm, n, mlen ) ;
420
421 const nodecxx . . $ node#* nn = n ;
422 while( nn->suffixcxx . . $ node#suffix. && nn->drop_suffixcxx . . $ node#drop_suffix. <= first )
423 {
424 first -= nn->drop_suffixcxx . . $ node#drop_suffix. ;
425 mlen -= nn->drop_suffixcxx . . $ node#drop_suffix. ;
426 nn = nn->suffixcxx . . $ node#suffix. ;
427 if( nn->probescxx . . $ node#probes. ) outcxx . . $ out(7576e2997aee98f1).( mm, nn, mlen ) ;
428 }
429 }
430
431
432 /* Advancing the mismatch pointers.
433 * - We receive a (singly linked) list of mps. There has to be exactly
434 * one mp that didn't encounter any mismatches in its history (keeping
435 * this one ensures that the algorithm reduces to Aho-Corasick if
436 * mismatches aren't allowed). Too avoid to much special treatment,
437 * this special pointer will always be the first in the list. We
438 * process it first, initalize the result list with it or re-seed the
439 * result list, then go into the loop over the rest of the list. This
440 * implies an if-block in the middle of the loop and it also implies
441 * that some pointers are only initialized in the loop.
442 *
443 * - We will keep multiple pointers into the two involved lists: one to
444 * the end of the result list; this is where we splice in pointers to
445 * be queued for the next round. This list is at all time properly
446 * terminated and disconnected from the stuff we're processing this
447 * round.
448 *
449 * - One to the next node to be processed. This one is easy, it is
450 * advanced once per loop, it's the head of the incoming list and
451 * we're done if it becomes null.
452 *
453 * - One several places ahead of the current one. We prefetch the node
454 * pointed to by this one and its next link. Keeping another yet more
455 * advanced pointer to prefetch mismatch pointers is useless because
456 * of the need to follow the chain of next pointers. This one has to
457 * be valid at all times (see next point), so if it would become null,
458 * we don't advance it.
459 *
460 * - When gapping, we need to splice new mps into the queue being
461 * processed. We do this after the node we prefetched last. That
462 * makes sense, because we already have that mp in cache, so we can
463 * splice without penalty. It works fine, as long as there is such a
464 * pointer, and to ensure that, we first handle gaps (in this
465 * direction) while the current node is still in the queue, then
466 * cache the contents of the current node, handle the node itself,
467 * thereby removing and or splicing it, then handle mismatches and/or
468 * gaps.
469 */
470
471 inline static mismatch_ptrcxx . . $ mismatch_ptr# *splice_fresh_aftercxx . . $ splice_fresh_after(918d0b0ba13cd534).( mismatch_ptrcxx . . $ mismatch_ptr# *mp )
472 {
473 if( junk_yardcxx . . $ junk_yard. )
474 {
475 mismatch_ptrcxx . . $ mismatch_ptr# *p0 = junk_yardcxx . . $ junk_yard. ;
476 junk_yardcxx . . $ junk_yard. = junk_yardcxx . . $ junk_yard.->nextcxx . . $ mismatch_ptr#next. ;
477 p0->nextcxx . . $ mismatch_ptr#next. = mp->nextcxx . . $ mismatch_ptr#next. ;
478 mp->nextcxx . . $ mismatch_ptr#next. = p0 ;
479 return p0 ;
480 }
481 else
482 {
483 mismatch_ptrcxx . . $ mismatch_ptr# *p0 = new mismatch_ptrcxx . . $ mismatch_ptr# ;
484 p0->nextcxx . . $ mismatch_ptr#next. = mp->nextcxx . . $ mismatch_ptr#next. ;
485 mp->nextcxx . . $ mismatch_ptr#next. = p0 ;
486 return p0 ;
487 }
488 }
489
490 mismatch_ptrcxx . . $ mismatch_ptr# *prefix_treecxx . . $ prefix_tree#::comparecxx . . $ prefix_tree#compare(b3dcdb8feb03de9).( char c, mismatch_ptrcxx . . $ mismatch_ptr# *ptrs ) const
491 {
492 int pos ;
493 switch( c )
494 {
495 case '-': return ptrs ;
496 case 'A': case 'a': pos = 0 ; break ;
497 case 'C': case 'c': pos = 1 ; break ;
498 case 'G': case 'g': pos = 2 ; break ;
499 case 'T': case 't': pos = 3 ; break ;
500 case 'U': case 'u': pos = 3 ; break ;
501 default: pos = -1 ; break ;
502 }
503
504 bool is_first = true ;
505 mismatch_ptrcxx . . $ mismatch_ptr# *new_head = 0, *last_done = 0 ;
506 mismatch_ptrcxx . . $ mismatch_ptr# *next_in_queue = ptrs ;
507 mismatch_ptrcxx . . $ mismatch_ptr# *next_to_prefetch = ptrs ;
508 for( int i = 0 ; i != do_prefetchcxx . . $ do_prefetch. && next_to_prefetch->nextcxx . . $ mismatch_ptr#next. ; ++i )
509 next_to_prefetch = next_to_prefetch->nextcxx . . $ mismatch_ptr#next. ;
510
511 while( next_in_queue )
512 {
513 ++total_nodescxx . . $ total_nodes. ;
514 if( next_to_prefetch && next_to_prefetch->ptrcxx . . $ mismatch_ptr#ptr. ) __builtin_prefetch( next_to_prefetch->ptrcxx . . $ mismatch_ptr#ptr. ) ;
515 if( next_to_prefetch && next_to_prefetch->nextcxx . . $ mismatch_ptr#next. ) __builtin_prefetch( next_to_prefetch->nextcxx . . $ mismatch_ptr#next. ) ;
516
517 const nodecxx . . $ node#* n = next_in_queue->ptrcxx . . $ mismatch_ptr#ptr. ;
518 size_tcxx . . $ size_t# mm = next_in_queue->mismatchcxx . . $ mismatch_ptr#mismatch. ;
519 size_tcxx . . $ size_t# gg = next_in_queue->gapscxx . . $ mismatch_ptr#gaps. ;
520 int ff = next_in_queue->firstcxx . . $ mismatch_ptr#first. ;
521 int nn = next_in_queue->matchedcxx . . $ mismatch_ptr#matched. ;
522
523 if( !next_in_queue->isgapcxx . . $ mismatch_ptr#isgap. ) out_reccxx . . $ out_rec(6836a68c9faa9cc4).( mm, n, is_first ? 255 : ff, nn ) ;
524
525 // If gaps are allowed, also add gapped nodes for
526 // processing _in_this_iteration_. If
527 // discount_adenine is set, don't gap an A (makes
528 // bookkeeping difficult).
529
530 if( gg < allow_gapscxx . . $ allow_gaps. && mm < cutoffcxx . . $ cutoff. && n->depthcxx . . $ node#depth. > 0 ) {
531 for ( int i = discount_adeninecxx . . $ discount_adenine. ? 1 : 0 ; i != 5 ; i++ ) {
532 int ff_ = is_first ? n->depthcxx . . $ node#depth.-1 : ff ;
533 if( ff_ >= n->dropcxx . . $ node#drop.[i] ) {
534 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!( next_to_prefetch ) ;
535 mismatch_ptrcxx . . $ mismatch_ptr# *mp2 = splice_fresh_aftercxx . . $ splice_fresh_after(918d0b0ba13cd534).( next_to_prefetch ) ;
536 mp2->ptrcxx . . $ mismatch_ptr#ptr. = n->childscxx . . $ node#childs.[i] ;
537 mp2->mismatchcxx . . $ mismatch_ptr#mismatch. = mm + 1 ;
538 mp2->gapscxx . . $ mismatch_ptr#gaps. = gg + 1 ;
539 mp2->firstcxx . . $ mismatch_ptr#first. = ff_ - n->dropcxx . . $ node#drop.[i] ;
540 mp2->isgapcxx . . $ mismatch_ptr#isgap. = 1 ;
541 mp2->matchedcxx . . $ mismatch_ptr#matched. = nn ;
542 }
543 }
544 }
545
546 // Are we gapping As? then queue that up, no matter how many
547 // mismatches we've already accumulated. (Note how this isn't
548 // even considered a gap, note that gapping the root actually
549 // makes a certain kind of sense.)
550
551 if( discount_adeninecxx . . $ discount_adenine. ) {
552 int ff_ = is_first ? n->depthcxx . . $ node#depth.-1 : ff ;
553 if( ff_ >= n->dropcxx . . $ node#drop.[0] && n->dropcxx . . $ node#drop.[0] ) {
554 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!( next_to_prefetch ) ;
555 mismatch_ptrcxx . . $ mismatch_ptr# *mp2 = splice_fresh_aftercxx . . $ splice_fresh_after(918d0b0ba13cd534).( next_to_prefetch ) ;
556 mp2->ptrcxx . . $ mismatch_ptr#ptr. = n->childscxx . . $ node#childs.[0] ;
557 mp2->mismatchcxx . . $ mismatch_ptr#mismatch. = mm ;
558 mp2->gapscxx . . $ mismatch_ptr#gaps. = gg ;
559 mp2->firstcxx . . $ mismatch_ptr#first. = ff_ - n->dropcxx . . $ node#drop.[0] ;
560 mp2->isgapcxx . . $ mismatch_ptr#isgap. = 0 ;
561 mp2->matchedcxx . . $ mismatch_ptr#matched. = nn ;
562 }
563 }
564
565 // No longer is anything enqueued into the old queue, so we no
566 // longer need the next_to_prefetch pointer and can move it
567 // ahead.
568 if( next_to_prefetch->nextcxx . . $ mismatch_ptr#next. ) next_to_prefetch = next_to_prefetch->nextcxx . . $ mismatch_ptr#next. ;
569
570 // At this point, we no longer run into difficulties if the
571 // incoming queue gets emptied. So now we move the pointer to its
572 // matching child and throw it out if dropping the prefix kills
573 // a mismatch. Also, we can move the next_to_prefetch pointer,
574 // since it's not needed anymore in this iteration and might
575 // point to nowhere now. Moreover, if we're at the first node
576 // (the one without any mismatches), this is the place to
577 // initialize the new list.
578
579 int pos_ = pos == -1 ? 4 : pos ;
580 if( is_first ) {
581 next_in_queue = ptrs->nextcxx . . $ mismatch_ptr#next. ;
582 if( pos == -1 ) {
583 new_head = seedcxx . . $ prefix_tree#seed(3606ea0e0471eaa7).() ;
584 ptrs->nextcxx . . $ mismatch_ptr#next. = junk_yardcxx . . $ junk_yard. ;
585 junk_yardcxx . . $ junk_yard. = ptrs ;
586 } else {
587 new_head = ptrs ;
588 new_head->matchedcxx . . $ mismatch_ptr#matched. += 1 - ptrs->ptrcxx . . $ mismatch_ptr#ptr.->dropcxx . . $ node#drop.[pos] ;
589 new_head->ptrcxx . . $ mismatch_ptr#ptr. = ptrs->ptrcxx . . $ mismatch_ptr#ptr.->childscxx . . $ node#childs.[pos] ;
590 new_head->nextcxx . . $ mismatch_ptr#next. = 0 ;
591 }
592 last_done = new_head ;
593 } else if( ff >= n->dropcxx . . $ node#drop.[pos_] ) {
594 next_in_queue->ptrcxx . . $ mismatch_ptr#ptr. = n->childscxx . . $ node#childs.[pos_] ;
595 next_in_queue->firstcxx . . $ mismatch_ptr#first. -= n->dropcxx . . $ node#drop.[pos_] ;
596 next_in_queue->matchedcxx . . $ mismatch_ptr#matched. ++ ;
597 next_in_queue->matchedcxx . . $ mismatch_ptr#matched. -= n->dropcxx . . $ node#drop.[pos_] ;
598 next_in_queue->isgapcxx . . $ mismatch_ptr#isgap. = 0 ;
599 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!( !last_done->next ) ;
600 last_done->nextcxx . . $ mismatch_ptr#next. = next_in_queue ;
601 last_done = next_in_queue ;
602 next_in_queue = next_in_queue->nextcxx . . $ mismatch_ptr#next. ;
603 last_done->nextcxx . . $ mismatch_ptr#next. = 0 ;
604 } else {
605 mismatch_ptrcxx . . $ mismatch_ptr# *p = next_in_queue ;
606 next_in_queue = next_in_queue->nextcxx . . $ mismatch_ptr#next. ;
607 p->nextcxx . . $ mismatch_ptr#next. = junk_yardcxx . . $ junk_yard. ;
608 junk_yardcxx . . $ junk_yard. = p ;
609 }
610
611 // The following always produces new mismatches, so skip it
612 // completely if we're already at the limit.
613
614 if ( mm < cutoffcxx . . $ cutoff. ) {
615 // if gaps are allowed, always keep the node (but don't
616 // uselessly gap the root node)
617 if( gg < allow_gapscxx . . $ allow_gaps. && n->depthcxx . . $ node#depth. > 0 )
618 {
619 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!( last_done ) ;
620 mismatch_ptrcxx . . $ mismatch_ptr# *p = splice_fresh_aftercxx . . $ splice_fresh_after(918d0b0ba13cd534).( last_done ) ;
621 p->ptrcxx . . $ mismatch_ptr#ptr. = n ;
622 p->mismatchcxx . . $ mismatch_ptr#mismatch. = mm + 1 ;
623 p->gapscxx . . $ mismatch_ptr#gaps. = gg + 1 ;
624 p->isgapcxx . . $ mismatch_ptr#isgap. = 1 ;
625 p->firstcxx . . $ mismatch_ptr#first. = is_first ? n->depthcxx . . $ node#depth.-1 : ff ;
626 p->matchedcxx . . $ mismatch_ptr#matched. = nn + 1 ;
627 last_done = p ;
628 }
629
630 // Take care of the children, but not the one that matches.
631 // (That one has already been handled.)
632
633 for ( int i = 0 ; i != 5 ; i++ ) {
634 if( i != pos ) {
635 // The child always exists, but we follow it only
636 // iff the first mismatch would not be forgotten by
637 // following a suffix link.
638 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!( n->childs[i] ) ;
639 int ff_ = is_first ? n->depthcxx . . $ node#depth. : ff ;
640 if( ff_ >= n->dropcxx . . $ node#drop.[i] )
641 {
642 mismatch_ptrcxx . . $ mismatch_ptr# *p = splice_fresh_aftercxx . . $ splice_fresh_after(918d0b0ba13cd534).( last_done ) ;
643 p->ptrcxx . . $ mismatch_ptr#ptr. = n->childscxx . . $ node#childs.[i] ;
644 p->firstcxx . . $ mismatch_ptr#first. = ff_ - n->dropcxx . . $ node#drop.[i] ;
645 p->mismatchcxx . . $ mismatch_ptr#mismatch. = mm + 1 ;
646 p->gapscxx . . $ mismatch_ptr#gaps. = gg ;
647 p->isgapcxx . . $ mismatch_ptr#isgap. = 0 ;
648 p->matchedcxx . . $ mismatch_ptr#matched. = nn + 1 - n->dropcxx . . $ node#drop.[i] ;
649 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!( !p->next ) ;
650 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!( last_done->next == p ) ;
651 last_done = p ;
652 }
653 }
654 }
655 }
656 is_first = false ;
657 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!( !last_done->next ) ;
658 }
659
660 if( debug_flagscxx . . $ debug_flags. & debug_numnodescxx . . $ debug_numnodes. )
661 {
662 int n = 0 ;
663 for( mismatch_ptrcxx . . $ mismatch_ptr# *p = new_head ; p ; p=p->nextcxx . . $ mismatch_ptr#next. ) ++n ;
664 stdcxx . . $ std/::clogcxx . . $ std/clog. <<cxx . . $ std/`operator<<`(dd93bb5737bfac24). '\r' <<cxx . . $ std/basic_ostream#`operator<<`(23b6575433a77e57). n <<cxx . . $ std/basic_ostream#`operator<<`(f46f7e25851d787a). stdcxx . . $ std/::endlcxx . . $ std/endl(345bf97a19cc83a9).;
665 }
666 return new_head ;
667 }
668