1 module bio.sam.utils.fastrecordparser;
2 
3 #line 1 "sam_alignment.rl"
4 /*
5     This file is part of BioD.
6     Copyright (C) 2012    Artem Tarasov <lomereiter@gmail.com>
7 
8     Permission is hereby granted, free of charge, to any person obtaining a
9     copy of this software and associated documentation files (the "Software"),
10     to deal in the Software without restriction, including without limitation
11     the rights to use, copy, modify, merge, publish, distribute, sublicense,
12     and/or sell copies of the Software, and to permit persons to whom the
13     Software is furnished to do so, subject to the following conditions:
14 
15     The above copyright notice and this permission notice shall be included in
16     all copies or substantial portions of the Software.
17 
18     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24     DEALINGS IN THE SOFTWARE.
25 
26 */
27 
28 #line 28 "sam_alignment.d"
29 static const int sam_alignment_start = 1;
30 static const int sam_alignment_first_final = 191;
31 static const int sam_alignment_error = 0;
32 
33 static const int sam_alignment_en_recover_from_invalid_qname = 169;
34 static const int sam_alignment_en_recover_from_invalid_flag = 170;
35 static const int sam_alignment_en_recover_from_invalid_rname = 171;
36 static const int sam_alignment_en_recover_from_invalid_pos = 172;
37 static const int sam_alignment_en_recover_from_invalid_mapq = 173;
38 static const int sam_alignment_en_recover_from_invalid_cigar = 174;
39 static const int sam_alignment_en_recover_from_invalid_rnext = 175;
40 static const int sam_alignment_en_recover_from_invalid_pnext = 176;
41 static const int sam_alignment_en_recover_from_invalid_tlen = 177;
42 static const int sam_alignment_en_recover_from_invalid_seq = 178;
43 static const int sam_alignment_en_recover_from_invalid_qual = 179;
44 static const int sam_alignment_en_recover_from_invalid_tag = 180;
45 static const int sam_alignment_en_alignment = 1;
46 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_flag_parsing = 181;
47 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_rname_parsing = 182;
48 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_pos_parsing = 183;
49 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_mapq_parsing = 184;
50 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_cigar_parsing = 185;
51 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_rnext_parsing = 186;
52 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_pnext_parsing = 187;
53 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_tlen_parsing = 188;
54 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_seq_parsing = 189;
55 static const int sam_alignment_en_alignment_field_parsing_mandatoryfields_qual_parsing = 190;
56 static const int sam_alignment_en_alignment_tag_parsing = 251;
57 
58 
59 #line 419 "sam_alignment.rl"
60 
61 
62 import bio.sam.header;
63 import bio.bam.cigar;
64 import bio.bam.read;
65 import bio.bam.bai.bin;
66 import bio.core.utils.outbuffer;
67 import bio.core.base;
68 import std.conv;
69 import std.array;
70 import std.exception;
71 
72 BamRead parseAlignmentLine(string line, SamHeader header, OutBuffer buffer=null) {
73     char* p = cast(char*)line.ptr;
74     char* pe = p + line.length;
75     char* eof = pe;
76     int cs;
77 
78     if (buffer is null)
79         buffer = new OutBuffer(8192);
80     else
81         buffer.clear();
82 
83     size_t rollback_size; // needed in case of invalid data
84 
85     byte current_sign = 1;
86 
87     size_t read_name_beg; // position of beginning of QNAME
88 
89     size_t sequence_beg; // position of SEQ start
90     int l_seq;           // sequence length
91 
92     uint cigar_op_len;   // length of CIGAR operation
93     char cigar_op_chr;   // CIGAR operation
94 
95     size_t quals_length;  // number of QUAL characters
96     char quals_last_char; // needed in order to handle '*' correctly
97 
98     size_t cigar_op_len_start; // position of start of CIGAR operation
99 
100     long int_value;                      // for storing temporary integers
101     float float_value;                   // for storing temporary floats
102     size_t float_beg;                    // position of start of current float
103     char arraytype;                      // type of last array tag value
104     size_t tag_array_length_offset;      // where the length is stored in the buffer
105 
106     string read_name;
107     ushort flag;
108     int pos = -1;
109     int end_pos; // for bin calculation
110     int mate_pos = -1;
111     ubyte mapping_quality = 255;
112     int template_length = 0;
113 
114     size_t tag_key_beg, tagvalue_beg;
115     ubyte[] tag_key;
116     size_t rname_beg, rnext_beg;
117 
118     int ref_id = -1;
119 
120     
121 #line 121 "sam_alignment.d"
122 	{
123 	cs = sam_alignment_start;
124 	}
125 
126 #line 480 "sam_alignment.rl"
127     
128 #line 128 "sam_alignment.d"
129 	{
130 	if ( p == pe )
131 		goto _test_eof;
132 	switch ( cs )
133 	{
134 goto case; case 1:
135 	if ( (*p) == 9u )
136 		goto tr1;
137 	if ( (*p) > 63u ) {
138 		if ( 65u <= (*p) && (*p) <= 126u )
139 			goto tr2;
140 	} else if ( (*p) >= 33u )
141 		goto tr2;
142 	goto tr0;
143 tr0:
144 #line 50 "sam_alignment.rl"
145 	{ p--; {if (true) goto st169;} }
146 	goto st0;
147 tr3:
148 #line 58 "sam_alignment.rl"
149 	{ p--; {if (true) goto st170;} }
150 	goto st0;
151 tr7:
152 #line 67 "sam_alignment.rl"
153 	{ p--; {if (true) goto st171;} }
154 	goto st0;
155 tr12:
156 #line 75 "sam_alignment.rl"
157 	{ p--; {if (true) goto st172;} }
158 	goto st0;
159 tr16:
160 #line 81 "sam_alignment.rl"
161 	{ p--; {if (true) goto st173;} }
162 	goto st0;
163 tr20:
164 #line 124 "sam_alignment.rl"
165 	{
166         auto ptr = cast(uint*)(buffer.data.ptr + 3 * uint.sizeof);
167         *ptr = (*ptr) & 0xFFFF0000;
168         buffer.shrink(rollback_size);
169         end_pos = pos + 1;
170         p--; {if (true) goto st174;}
171     }
172 	goto st0;
173 tr24:
174 #line 162 "sam_alignment.rl"
175 	{ p--; {if (true) goto st175;} }
176 	goto st0;
177 tr30:
178 #line 175 "sam_alignment.rl"
179 	{ p--; {if (true) goto st176;} }
180 	goto st0;
181 tr34:
182 #line 187 "sam_alignment.rl"
183 	{ p--; {if (true) goto st177;} }
184 	goto st0;
185 tr39:
186 #line 217 "sam_alignment.rl"
187 	{
188         rollback_size = buffer.length;
189         p--; {if (true) goto st178;}
190     }
191 	goto st0;
192 tr43:
193 #line 243 "sam_alignment.rl"
194 	{
195         buffer.shrink(rollback_size);
196         for (size_t i = 0; i < l_seq; ++i)
197             buffer.putUnsafe!ubyte(0xFF);
198         rollback_size = buffer.length;
199         p--; {if (true) goto st179;}
200     }
201 	goto st0;
202 tr49:
203 #line 403 "sam_alignment.rl"
204 	{
205         buffer.shrink(rollback_size);
206         p--; {if (true) goto st180;}
207     }
208 	goto st0;
209 #line 209 "sam_alignment.d"
210 st0:
211 cs = 0;
212 	goto _out;
213 tr1:
214 #line 48 "sam_alignment.rl"
215 	{ read_name_beg = p - line.ptr; }
216 #line 49 "sam_alignment.rl"
217 	{ read_name = line[read_name_beg .. p - line.ptr]; }
218 	goto st2;
219 tr206:
220 #line 49 "sam_alignment.rl"
221 	{ read_name = line[read_name_beg .. p - line.ptr]; }
222 	goto st2;
223 st2:
224 	if ( ++p == pe )
225 		goto _test_eof2;
226 goto case; case 2:
227 #line 227 "sam_alignment.d"
228 	if ( 48u <= (*p) && (*p) <= 57u )
229 		goto tr4;
230 	goto tr3;
231 tr4:
232 #line 28 "sam_alignment.rl"
233 	{ int_value = 0; }
234 #line 29 "sam_alignment.rl"
235 	{ int_value *= 10; int_value += (*p) - '0'; }
236 	goto st3;
237 st3:
238 	if ( ++p == pe )
239 		goto _test_eof3;
240 goto case; case 3:
241 #line 241 "sam_alignment.d"
242 	if ( (*p) == 9u )
243 		goto tr5;
244 	if ( 48u <= (*p) && (*p) <= 57u )
245 		goto tr6;
246 	goto tr3;
247 tr5:
248 #line 56 "sam_alignment.rl"
249 	{ flag = to!ushort(int_value); }
250 	goto st4;
251 st4:
252 	if ( ++p == pe )
253 		goto _test_eof4;
254 goto case; case 4:
255 #line 255 "sam_alignment.d"
256 	if ( (*p) == 42u )
257 		goto st150;
258 	if ( (*p) > 60u ) {
259 		if ( 62u <= (*p) && (*p) <= 126u )
260 			goto tr8;
261 	} else if ( (*p) >= 33u )
262 		goto tr8;
263 	goto tr7;
264 tr8:
265 #line 62 "sam_alignment.rl"
266 	{ rname_beg = p - line.ptr; }
267 	goto st5;
268 st5:
269 	if ( ++p == pe )
270 		goto _test_eof5;
271 goto case; case 5:
272 #line 272 "sam_alignment.d"
273 	if ( (*p) == 9u )
274 		goto tr10;
275 	if ( 33u <= (*p) && (*p) <= 126u )
276 		goto st5;
277 	goto tr7;
278 tr10:
279 #line 63 "sam_alignment.rl"
280 	{
281         ref_id = header.getSequenceIndex(line[rname_beg .. p - line.ptr]);
282     }
283 	goto st6;
284 st6:
285 	if ( ++p == pe )
286 		goto _test_eof6;
287 goto case; case 6:
288 #line 288 "sam_alignment.d"
289 	if ( 48u <= (*p) && (*p) <= 57u )
290 		goto tr13;
291 	goto tr12;
292 tr13:
293 #line 28 "sam_alignment.rl"
294 	{ int_value = 0; }
295 #line 29 "sam_alignment.rl"
296 	{ int_value *= 10; int_value += (*p) - '0'; }
297 	goto st7;
298 st7:
299 	if ( ++p == pe )
300 		goto _test_eof7;
301 goto case; case 7:
302 #line 302 "sam_alignment.d"
303 	if ( (*p) == 9u )
304 		goto tr14;
305 	if ( 48u <= (*p) && (*p) <= 57u )
306 		goto tr15;
307 	goto tr12;
308 tr14:
309 #line 73 "sam_alignment.rl"
310 	{ end_pos = pos = to!uint(int_value); }
311 	goto st8;
312 st8:
313 	if ( ++p == pe )
314 		goto _test_eof8;
315 goto case; case 8:
316 #line 316 "sam_alignment.d"
317 	if ( 48u <= (*p) && (*p) <= 57u )
318 		goto tr17;
319 	goto tr16;
320 tr17:
321 #line 28 "sam_alignment.rl"
322 	{ int_value = 0; }
323 #line 29 "sam_alignment.rl"
324 	{ int_value *= 10; int_value += (*p) - '0'; }
325 	goto st9;
326 st9:
327 	if ( ++p == pe )
328 		goto _test_eof9;
329 goto case; case 9:
330 #line 330 "sam_alignment.d"
331 	if ( (*p) == 9u )
332 		goto tr18;
333 	if ( 48u <= (*p) && (*p) <= 57u )
334 		goto tr19;
335 	goto tr16;
336 tr18:
337 #line 79 "sam_alignment.rl"
338 	{ mapping_quality = to!ubyte(int_value); }
339 #line 85 "sam_alignment.rl"
340 	{
341         buffer.capacity = 32 + read_name.length + 1;
342         buffer.putUnsafe!int(ref_id);
343         buffer.putUnsafe!int(pos - 1);
344 
345         enforce(read_name.length + 1 <= 255, "Read name " ~ read_name ~ " is too long!");
346 
347         // bin will be set later
348         auto bin_mq_nl = ((cast(uint)mapping_quality) << 8) | (read_name.length + 1);
349         buffer.putUnsafe(cast(uint)bin_mq_nl);
350 
351         // number of CIGAR operations will be set later
352         buffer.putUnsafe!uint(flag << 16);
353 
354         buffer.putUnsafe!int(0);
355         buffer.putUnsafe!int(-1); // mate ref. id
356         buffer.putUnsafe!int(-1); // mate pos
357         buffer.putUnsafe!int(0);  // tlen
358 
359         buffer.putUnsafe(cast(ubyte[])read_name);
360         buffer.putUnsafe!ubyte(0);
361 
362         rollback_size = buffer.length;
363     }
364 	goto st10;
365 tr235:
366 #line 85 "sam_alignment.rl"
367 	{
368         buffer.capacity = 32 + read_name.length + 1;
369         buffer.putUnsafe!int(ref_id);
370         buffer.putUnsafe!int(pos - 1);
371 
372         enforce(read_name.length + 1 <= 255, "Read name " ~ read_name ~ " is too long!");
373 
374         // bin will be set later
375         auto bin_mq_nl = ((cast(uint)mapping_quality) << 8) | (read_name.length + 1);
376         buffer.putUnsafe(cast(uint)bin_mq_nl);
377 
378         // number of CIGAR operations will be set later
379         buffer.putUnsafe!uint(flag << 16);
380 
381         buffer.putUnsafe!int(0);
382         buffer.putUnsafe!int(-1); // mate ref. id
383         buffer.putUnsafe!int(-1); // mate pos
384         buffer.putUnsafe!int(0);  // tlen
385 
386         buffer.putUnsafe(cast(ubyte[])read_name);
387         buffer.putUnsafe!ubyte(0);
388 
389         rollback_size = buffer.length;
390     }
391 	goto st10;
392 st10:
393 	if ( ++p == pe )
394 		goto _test_eof10;
395 goto case; case 10:
396 #line 396 "sam_alignment.d"
397 	if ( (*p) == 42u )
398 		goto st11;
399 	if ( 48u <= (*p) && (*p) <= 57u )
400 		goto tr22;
401 	goto tr20;
402 st11:
403 	if ( ++p == pe )
404 		goto _test_eof11;
405 goto case; case 11:
406 	if ( (*p) == 9u )
407 		goto tr23;
408 	goto tr20;
409 tr23:
410 #line 137 "sam_alignment.rl"
411 	{
412         if (end_pos == pos)
413             ++end_pos;
414         {
415         auto bin = reg2bin(pos - 1, end_pos - 1); // 0-based [) interval
416         auto ptr = cast(uint*)(buffer.data.ptr + 2 * uint.sizeof);
417         *ptr = (*ptr) | ((cast(uint)bin) << 16);
418         }
419     }
420 	goto st12;
421 tr155:
422 #line 113 "sam_alignment.rl"
423 	{
424         auto op = CigarOperation(cigar_op_len, cigar_op_chr);
425         if (op.is_reference_consuming)
426             end_pos += op.length;
427         buffer.put!CigarOperation(op);
428         {
429         auto ptr = cast(uint*)(buffer.data.ptr + 3 * uint.sizeof);
430         *ptr = (*ptr) + 1;
431         }
432     }
433 #line 137 "sam_alignment.rl"
434 	{
435         if (end_pos == pos)
436             ++end_pos;
437         {
438         auto bin = reg2bin(pos - 1, end_pos - 1); // 0-based [) interval
439         auto ptr = cast(uint*)(buffer.data.ptr + 2 * uint.sizeof);
440         *ptr = (*ptr) | ((cast(uint)bin) << 16);
441         }
442     }
443 	goto st12;
444 st12:
445 	if ( ++p == pe )
446 		goto _test_eof12;
447 goto case; case 12:
448 #line 448 "sam_alignment.d"
449 	switch( (*p) ) {
450 		case 42u: goto st95;
451 		case 61u: goto st96;
452 		default: break;
453 	}
454 	if ( 33u <= (*p) && (*p) <= 126u )
455 		goto tr25;
456 	goto tr24;
457 tr25:
458 #line 155 "sam_alignment.rl"
459 	{ rnext_beg = p - line.ptr; }
460 	goto st13;
461 st13:
462 	if ( ++p == pe )
463 		goto _test_eof13;
464 goto case; case 13:
465 #line 465 "sam_alignment.d"
466 	if ( (*p) == 9u )
467 		goto tr28;
468 	if ( 33u <= (*p) && (*p) <= 126u )
469 		goto st13;
470 	goto tr24;
471 tr28:
472 #line 156 "sam_alignment.rl"
473 	{
474         {
475         auto ptr = cast(int*)(buffer.data.ptr + 5 * int.sizeof);
476         *ptr = header.getSequenceIndex(line[rnext_beg .. p - line.ptr]);
477         }
478     }
479 	goto st14;
480 tr136:
481 #line 148 "sam_alignment.rl"
482 	{
483         {
484         auto ptr = cast(int*)(buffer.data.ptr + 5 * int.sizeof);
485         *ptr = ref_id;
486         }
487     }
488 	goto st14;
489 st14:
490 	if ( ++p == pe )
491 		goto _test_eof14;
492 goto case; case 14:
493 #line 493 "sam_alignment.d"
494 	if ( 48u <= (*p) && (*p) <= 57u )
495 		goto tr31;
496 	goto tr30;
497 tr31:
498 #line 28 "sam_alignment.rl"
499 	{ int_value = 0; }
500 #line 29 "sam_alignment.rl"
501 	{ int_value *= 10; int_value += (*p) - '0'; }
502 	goto st15;
503 st15:
504 	if ( ++p == pe )
505 		goto _test_eof15;
506 goto case; case 15:
507 #line 507 "sam_alignment.d"
508 	if ( (*p) == 9u )
509 		goto tr32;
510 	if ( 48u <= (*p) && (*p) <= 57u )
511 		goto tr33;
512 	goto tr30;
513 tr32:
514 #line 169 "sam_alignment.rl"
515 	{
516         {
517         auto ptr = cast(int*)(buffer.data.ptr + 6 * int.sizeof);
518         *ptr = to!int(int_value) - 1;
519         }
520     }
521 	goto st16;
522 st16:
523 	if ( ++p == pe )
524 		goto _test_eof16;
525 goto case; case 16:
526 #line 526 "sam_alignment.d"
527 	switch( (*p) ) {
528 		case 43u: goto tr35;
529 		case 45u: goto tr35;
530 		default: break;
531 	}
532 	if ( 48u <= (*p) && (*p) <= 57u )
533 		goto tr36;
534 	goto tr34;
535 tr35:
536 #line 27 "sam_alignment.rl"
537 	{ current_sign = (*p) == '-' ? -1 : 1; }
538 	goto st17;
539 st17:
540 	if ( ++p == pe )
541 		goto _test_eof17;
542 goto case; case 17:
543 #line 543 "sam_alignment.d"
544 	if ( 48u <= (*p) && (*p) <= 57u )
545 		goto tr36;
546 	goto tr34;
547 tr36:
548 #line 28 "sam_alignment.rl"
549 	{ int_value = 0; }
550 #line 29 "sam_alignment.rl"
551 	{ int_value *= 10; int_value += (*p) - '0'; }
552 	goto st18;
553 st18:
554 	if ( ++p == pe )
555 		goto _test_eof18;
556 goto case; case 18:
557 #line 557 "sam_alignment.d"
558 	if ( (*p) == 9u )
559 		goto tr37;
560 	if ( 48u <= (*p) && (*p) <= 57u )
561 		goto tr38;
562 	goto tr34;
563 tr37:
564 #line 30 "sam_alignment.rl"
565 	{ int_value *= current_sign; current_sign = 1; }
566 #line 181 "sam_alignment.rl"
567 	{
568         {
569         auto ptr = cast(int*)(buffer.data.ptr + 7 * int.sizeof);
570         *ptr = to!int(int_value);
571         }
572     }
573 	goto st19;
574 st19:
575 	if ( ++p == pe )
576 		goto _test_eof19;
577 goto case; case 19:
578 #line 578 "sam_alignment.d"
579 	switch( (*p) ) {
580 		case 42u: goto st20;
581 		case 46u: goto tr41;
582 		case 61u: goto tr41;
583 		default: break;
584 	}
585 	if ( (*p) > 90u ) {
586 		if ( 97u <= (*p) && (*p) <= 122u )
587 			goto tr41;
588 	} else if ( (*p) >= 65u )
589 		goto tr41;
590 	goto tr39;
591 st20:
592 	if ( ++p == pe )
593 		goto _test_eof20;
594 goto case; case 20:
595 	if ( (*p) == 9u )
596 		goto tr42;
597 	goto tr39;
598 tr42:
599 #line 223 "sam_alignment.rl"
600 	{
601         rollback_size = buffer.length;
602     }
603 	goto st21;
604 tr101:
605 #line 194 "sam_alignment.rl"
606 	{
607         auto data = cast(ubyte[])line[sequence_beg .. p - line.ptr];
608         l_seq = cast(int)data.length;
609         auto raw_len = (l_seq + 1) / 2;
610 
611         // reserve space for base qualities, too
612         buffer.capacity = buffer.length + raw_len + l_seq;
613 
614         for (size_t i = 0; i < raw_len; ++i) {
615             auto b = cast(ubyte)(Base(data[2 * i]).internal_code << 4);
616             if (2 * i + 1 < l_seq)
617                 b |= cast(ubyte)(Base(data[2 * i + 1]).internal_code);
618             buffer.putUnsafe!ubyte(b);
619         }
620 
621         // set l_seq
622         {
623         auto ptr = cast(int*)(buffer.data.ptr + 4 * int.sizeof);
624         *ptr = l_seq;
625         }
626 
627         rollback_size = buffer.length;
628     }
629 	goto st21;
630 st21:
631 	if ( ++p == pe )
632 		goto _test_eof21;
633 goto case; case 21:
634 #line 634 "sam_alignment.d"
635 	if ( 33u <= (*p) && (*p) <= 126u )
636 		goto tr44;
637 	goto tr43;
638 tr44:
639 #line 230 "sam_alignment.rl"
640 	{
641         ++quals_length;
642         quals_last_char = (*p);
643         buffer.putUnsafe!ubyte(cast(ubyte)((*p) - 33));
644     }
645 	goto st191;
646 st191:
647 	if ( ++p == pe )
648 		goto _test_eof191;
649 goto case; case 191:
650 #line 650 "sam_alignment.d"
651 	if ( (*p) == 9u )
652 		goto tr239;
653 	if ( 33u <= (*p) && (*p) <= 126u )
654 		goto tr44;
655 	goto tr43;
656 tr239:
657 #line 236 "sam_alignment.rl"
658 	{
659         // '*' may correspond either to a one-base long sequence
660         // or to absence of information
661         if (quals_length == 1 && quals_last_char == '*' && l_seq == 0)
662             buffer.shrink(rollback_size);
663     }
664 #line 253 "sam_alignment.rl"
665 	{
666         if (buffer.length - rollback_size != l_seq) {
667             buffer.shrink(rollback_size);
668             for (size_t i = 0; i < l_seq; ++i)
669                 buffer.putUnsafe!ubyte(0xFF);
670         }
671         rollback_size = buffer.length;
672     }
673 	goto st22;
674 tr240:
675 #line 410 "sam_alignment.rl"
676 	{ rollback_size = buffer.length; }
677 	goto st22;
678 tr241:
679 #line 30 "sam_alignment.rl"
680 	{ int_value *= current_sign; current_sign = 1; }
681 #line 362 "sam_alignment.rl"
682 	{
683         // here, we assume that compiler is smart enough to move switch out of loop.
684         switch (arraytype) {
685             case 'c': buffer.put(to!byte(int_value)); break;
686             case 'C': buffer.put(to!ubyte(int_value)); break;
687             case 's': buffer.put(to!short(int_value)); break;
688             case 'S': buffer.put(to!ushort(int_value)); break;
689             case 'i': buffer.put(to!int(int_value)); break;
690             case 'I': buffer.put(to!uint(int_value)); break;
691             default: assert(0);
692         }
693         {
694             auto ptr = cast(uint*)(buffer.data.ptr + tag_array_length_offset);
695             ++*ptr;
696         }
697     }
698 #line 410 "sam_alignment.rl"
699 	{ rollback_size = buffer.length; }
700 	goto st22;
701 tr260:
702 #line 38 "sam_alignment.rl"
703 	{
704         float_value = to!float(line[float_beg .. p - line.ptr]);
705     }
706 #line 379 "sam_alignment.rl"
707 	{
708         buffer.put!float(float_value);
709         {
710             auto ptr = cast(uint*)(buffer.data.ptr + tag_array_length_offset);
711             ++*ptr;
712         }
713     }
714 #line 410 "sam_alignment.rl"
715 	{ rollback_size = buffer.length; }
716 	goto st22;
717 tr263:
718 #line 337 "sam_alignment.rl"
719 	{
720         {
721         auto data = cast(ubyte[])(line[tagvalue_beg .. p - line.ptr]);
722         buffer.capacity = buffer.length + 4 + data.length;
723         buffer.putUnsafe(tag_key);
724         buffer.putUnsafe!char('H');
725         buffer.putUnsafe(data);
726         buffer.putUnsafe!ubyte(0);
727         }
728     }
729 #line 410 "sam_alignment.rl"
730 	{ rollback_size = buffer.length; }
731 	goto st22;
732 tr265:
733 #line 326 "sam_alignment.rl"
734 	{
735         {
736         auto data = cast(ubyte[])(line[tagvalue_beg .. p - line.ptr]);
737         buffer.capacity = buffer.length + 4 + data.length;
738         buffer.putUnsafe(tag_key);
739         buffer.putUnsafe!char('Z');
740         buffer.putUnsafe(data);
741         buffer.putUnsafe!ubyte(0);
742         }
743     }
744 #line 410 "sam_alignment.rl"
745 	{ rollback_size = buffer.length; }
746 	goto st22;
747 tr267:
748 #line 38 "sam_alignment.rl"
749 	{
750         float_value = to!float(line[float_beg .. p - line.ptr]);
751     }
752 #line 319 "sam_alignment.rl"
753 	{
754         buffer.capacity = buffer.length + 7;
755         buffer.putUnsafe(tag_key);
756         buffer.putUnsafe!char('f');
757         buffer.putUnsafe!float(float_value);
758     }
759 #line 410 "sam_alignment.rl"
760 	{ rollback_size = buffer.length; }
761 	goto st22;
762 tr269:
763 #line 30 "sam_alignment.rl"
764 	{ int_value *= current_sign; current_sign = 1; }
765 #line 285 "sam_alignment.rl"
766 	{
767         buffer.capacity = buffer.length + 7;
768         buffer.putUnsafe(tag_key);
769         if (int_value < 0) {
770             if (int_value >= byte.min) {
771                 buffer.putUnsafe!char('c');
772                 buffer.putUnsafe(cast(byte)int_value);
773             } else if (int_value >= short.min) {
774                 buffer.putUnsafe!char('s');
775                 buffer.putUnsafe(cast(short)int_value);
776             } else if (int_value >= int.min) {
777                 buffer.putUnsafe!char('i');
778                 buffer.putUnsafe(cast(int)int_value);
779             } else {
780                 throw new Exception("integer out of range");
781             }
782         } else {
783             if (int_value <= ubyte.max) {
784                 buffer.putUnsafe!char('C');
785                 buffer.putUnsafe(cast(ubyte)int_value);
786             } else if (int_value <= ushort.max) {
787                 buffer.putUnsafe!char('S');
788                 buffer.putUnsafe(cast(ushort)int_value);
789             } else if (int_value <= uint.max) {
790                 buffer.putUnsafe!char('I');
791                 buffer.putUnsafe(cast(uint)int_value);
792             } else {
793                 throw new Exception("integer out of range");
794             }
795         }
796     }
797 #line 410 "sam_alignment.rl"
798 	{ rollback_size = buffer.length; }
799 	goto st22;
800 st22:
801 	if ( ++p == pe )
802 		goto _test_eof22;
803 goto case; case 22:
804 #line 804 "sam_alignment.d"
805 	if ( (*p) > 90u ) {
806 		if ( 97u <= (*p) && (*p) <= 122u )
807 			goto tr45;
808 	} else if ( (*p) >= 65u )
809 		goto tr45;
810 	goto st0;
811 tr45:
812 #line 400 "sam_alignment.rl"
813 	{ tag_key_beg = p - line.ptr; }
814 	goto st23;
815 st23:
816 	if ( ++p == pe )
817 		goto _test_eof23;
818 goto case; case 23:
819 #line 819 "sam_alignment.d"
820 	if ( (*p) < 65u ) {
821 		if ( 48u <= (*p) && (*p) <= 57u )
822 			goto st24;
823 	} else if ( (*p) > 90u ) {
824 		if ( 97u <= (*p) && (*p) <= 122u )
825 			goto st24;
826 	} else
827 		goto st24;
828 	goto st0;
829 st24:
830 	if ( ++p == pe )
831 		goto _test_eof24;
832 goto case; case 24:
833 	if ( (*p) == 58u )
834 		goto tr48;
835 	goto st0;
836 tr48:
837 #line 401 "sam_alignment.rl"
838 	{ tag_key = cast(ubyte[])(line[tag_key_beg .. p - line.ptr]); }
839 	goto st25;
840 st25:
841 	if ( ++p == pe )
842 		goto _test_eof25;
843 goto case; case 25:
844 #line 844 "sam_alignment.d"
845 	switch( (*p) ) {
846 		case 65u: goto st26;
847 		case 66u: goto st28;
848 		case 72u: goto st43;
849 		case 90u: goto st45;
850 		case 102u: goto st47;
851 		case 105u: goto st57;
852 		default: break;
853 	}
854 	goto tr49;
855 st26:
856 	if ( ++p == pe )
857 		goto _test_eof26;
858 goto case; case 26:
859 	if ( (*p) == 58u )
860 		goto st27;
861 	goto tr49;
862 st27:
863 	if ( ++p == pe )
864 		goto _test_eof27;
865 goto case; case 27:
866 	if ( 33u <= (*p) && (*p) <= 126u )
867 		goto tr57;
868 	goto tr49;
869 tr57:
870 #line 278 "sam_alignment.rl"
871 	{
872         buffer.capacity = buffer.length + 4;
873         buffer.putUnsafe(tag_key);
874         buffer.putUnsafe!char('A');
875         buffer.putUnsafe!char((*p));
876     }
877 	goto st192;
878 st192:
879 	if ( ++p == pe )
880 		goto _test_eof192;
881 goto case; case 192:
882 #line 882 "sam_alignment.d"
883 	if ( (*p) == 9u )
884 		goto tr240;
885 	goto tr49;
886 st28:
887 	if ( ++p == pe )
888 		goto _test_eof28;
889 goto case; case 28:
890 	if ( (*p) == 58u )
891 		goto st29;
892 	goto tr49;
893 st29:
894 	if ( ++p == pe )
895 		goto _test_eof29;
896 goto case; case 29:
897 	switch( (*p) ) {
898 		case 67u: goto tr59;
899 		case 73u: goto tr59;
900 		case 83u: goto tr59;
901 		case 99u: goto tr59;
902 		case 102u: goto tr60;
903 		case 105u: goto tr59;
904 		case 115u: goto tr59;
905 		default: break;
906 	}
907 	goto tr49;
908 tr59:
909 #line 352 "sam_alignment.rl"
910 	{
911         arraytype = (*p);
912         buffer.capacity = buffer.length + 8;
913         buffer.putUnsafe(tag_key);
914         buffer.putUnsafe!char('B');
915         buffer.putUnsafe!char(arraytype);
916         buffer.putUnsafe!uint(0);
917         tag_array_length_offset = buffer.length - uint.sizeof;
918     }
919 	goto st30;
920 st30:
921 	if ( ++p == pe )
922 		goto _test_eof30;
923 goto case; case 30:
924 #line 924 "sam_alignment.d"
925 	if ( (*p) == 44u )
926 		goto st31;
927 	goto tr49;
928 tr242:
929 #line 30 "sam_alignment.rl"
930 	{ int_value *= current_sign; current_sign = 1; }
931 #line 362 "sam_alignment.rl"
932 	{
933         // here, we assume that compiler is smart enough to move switch out of loop.
934         switch (arraytype) {
935             case 'c': buffer.put(to!byte(int_value)); break;
936             case 'C': buffer.put(to!ubyte(int_value)); break;
937             case 's': buffer.put(to!short(int_value)); break;
938             case 'S': buffer.put(to!ushort(int_value)); break;
939             case 'i': buffer.put(to!int(int_value)); break;
940             case 'I': buffer.put(to!uint(int_value)); break;
941             default: assert(0);
942         }
943         {
944             auto ptr = cast(uint*)(buffer.data.ptr + tag_array_length_offset);
945             ++*ptr;
946         }
947     }
948 	goto st31;
949 st31:
950 	if ( ++p == pe )
951 		goto _test_eof31;
952 goto case; case 31:
953 #line 953 "sam_alignment.d"
954 	switch( (*p) ) {
955 		case 43u: goto tr62;
956 		case 45u: goto tr62;
957 		default: break;
958 	}
959 	if ( 48u <= (*p) && (*p) <= 57u )
960 		goto tr63;
961 	goto tr49;
962 tr62:
963 #line 27 "sam_alignment.rl"
964 	{ current_sign = (*p) == '-' ? -1 : 1; }
965 	goto st32;
966 st32:
967 	if ( ++p == pe )
968 		goto _test_eof32;
969 goto case; case 32:
970 #line 970 "sam_alignment.d"
971 	if ( 48u <= (*p) && (*p) <= 57u )
972 		goto tr63;
973 	goto tr49;
974 tr63:
975 #line 28 "sam_alignment.rl"
976 	{ int_value = 0; }
977 #line 29 "sam_alignment.rl"
978 	{ int_value *= 10; int_value += (*p) - '0'; }
979 	goto st193;
980 st193:
981 	if ( ++p == pe )
982 		goto _test_eof193;
983 goto case; case 193:
984 #line 984 "sam_alignment.d"
985 	switch( (*p) ) {
986 		case 9u: goto tr241;
987 		case 44u: goto tr242;
988 		default: break;
989 	}
990 	if ( 48u <= (*p) && (*p) <= 57u )
991 		goto tr243;
992 	goto tr49;
993 tr243:
994 #line 29 "sam_alignment.rl"
995 	{ int_value *= 10; int_value += (*p) - '0'; }
996 	goto st194;
997 st194:
998 	if ( ++p == pe )
999 		goto _test_eof194;
1000 goto case; case 194:
1001 #line 1001 "sam_alignment.d"
1002 	switch( (*p) ) {
1003 		case 9u: goto tr241;
1004 		case 44u: goto tr242;
1005 		default: break;
1006 	}
1007 	if ( 48u <= (*p) && (*p) <= 57u )
1008 		goto tr244;
1009 	goto tr49;
1010 tr244:
1011 #line 29 "sam_alignment.rl"
1012 	{ int_value *= 10; int_value += (*p) - '0'; }
1013 	goto st195;
1014 st195:
1015 	if ( ++p == pe )
1016 		goto _test_eof195;
1017 goto case; case 195:
1018 #line 1018 "sam_alignment.d"
1019 	switch( (*p) ) {
1020 		case 9u: goto tr241;
1021 		case 44u: goto tr242;
1022 		default: break;
1023 	}
1024 	if ( 48u <= (*p) && (*p) <= 57u )
1025 		goto tr245;
1026 	goto tr49;
1027 tr245:
1028 #line 29 "sam_alignment.rl"
1029 	{ int_value *= 10; int_value += (*p) - '0'; }
1030 	goto st196;
1031 st196:
1032 	if ( ++p == pe )
1033 		goto _test_eof196;
1034 goto case; case 196:
1035 #line 1035 "sam_alignment.d"
1036 	switch( (*p) ) {
1037 		case 9u: goto tr241;
1038 		case 44u: goto tr242;
1039 		default: break;
1040 	}
1041 	if ( 48u <= (*p) && (*p) <= 57u )
1042 		goto tr246;
1043 	goto tr49;
1044 tr246:
1045 #line 29 "sam_alignment.rl"
1046 	{ int_value *= 10; int_value += (*p) - '0'; }
1047 	goto st197;
1048 st197:
1049 	if ( ++p == pe )
1050 		goto _test_eof197;
1051 goto case; case 197:
1052 #line 1052 "sam_alignment.d"
1053 	switch( (*p) ) {
1054 		case 9u: goto tr241;
1055 		case 44u: goto tr242;
1056 		default: break;
1057 	}
1058 	if ( 48u <= (*p) && (*p) <= 57u )
1059 		goto tr247;
1060 	goto tr49;
1061 tr247:
1062 #line 29 "sam_alignment.rl"
1063 	{ int_value *= 10; int_value += (*p) - '0'; }
1064 	goto st198;
1065 st198:
1066 	if ( ++p == pe )
1067 		goto _test_eof198;
1068 goto case; case 198:
1069 #line 1069 "sam_alignment.d"
1070 	switch( (*p) ) {
1071 		case 9u: goto tr241;
1072 		case 44u: goto tr242;
1073 		default: break;
1074 	}
1075 	if ( 48u <= (*p) && (*p) <= 57u )
1076 		goto tr248;
1077 	goto tr49;
1078 tr248:
1079 #line 29 "sam_alignment.rl"
1080 	{ int_value *= 10; int_value += (*p) - '0'; }
1081 	goto st199;
1082 st199:
1083 	if ( ++p == pe )
1084 		goto _test_eof199;
1085 goto case; case 199:
1086 #line 1086 "sam_alignment.d"
1087 	switch( (*p) ) {
1088 		case 9u: goto tr241;
1089 		case 44u: goto tr242;
1090 		default: break;
1091 	}
1092 	if ( 48u <= (*p) && (*p) <= 57u )
1093 		goto tr249;
1094 	goto tr49;
1095 tr249:
1096 #line 29 "sam_alignment.rl"
1097 	{ int_value *= 10; int_value += (*p) - '0'; }
1098 	goto st200;
1099 st200:
1100 	if ( ++p == pe )
1101 		goto _test_eof200;
1102 goto case; case 200:
1103 #line 1103 "sam_alignment.d"
1104 	switch( (*p) ) {
1105 		case 9u: goto tr241;
1106 		case 44u: goto tr242;
1107 		default: break;
1108 	}
1109 	if ( 48u <= (*p) && (*p) <= 57u )
1110 		goto tr250;
1111 	goto tr49;
1112 tr250:
1113 #line 29 "sam_alignment.rl"
1114 	{ int_value *= 10; int_value += (*p) - '0'; }
1115 	goto st201;
1116 st201:
1117 	if ( ++p == pe )
1118 		goto _test_eof201;
1119 goto case; case 201:
1120 #line 1120 "sam_alignment.d"
1121 	switch( (*p) ) {
1122 		case 9u: goto tr241;
1123 		case 44u: goto tr242;
1124 		default: break;
1125 	}
1126 	if ( 48u <= (*p) && (*p) <= 57u )
1127 		goto tr251;
1128 	goto tr49;
1129 tr251:
1130 #line 29 "sam_alignment.rl"
1131 	{ int_value *= 10; int_value += (*p) - '0'; }
1132 	goto st202;
1133 st202:
1134 	if ( ++p == pe )
1135 		goto _test_eof202;
1136 goto case; case 202:
1137 #line 1137 "sam_alignment.d"
1138 	switch( (*p) ) {
1139 		case 9u: goto tr241;
1140 		case 44u: goto tr242;
1141 		default: break;
1142 	}
1143 	if ( 48u <= (*p) && (*p) <= 57u )
1144 		goto tr252;
1145 	goto tr49;
1146 tr252:
1147 #line 29 "sam_alignment.rl"
1148 	{ int_value *= 10; int_value += (*p) - '0'; }
1149 	goto st203;
1150 st203:
1151 	if ( ++p == pe )
1152 		goto _test_eof203;
1153 goto case; case 203:
1154 #line 1154 "sam_alignment.d"
1155 	switch( (*p) ) {
1156 		case 9u: goto tr241;
1157 		case 44u: goto tr242;
1158 		default: break;
1159 	}
1160 	if ( 48u <= (*p) && (*p) <= 57u )
1161 		goto tr253;
1162 	goto tr49;
1163 tr253:
1164 #line 29 "sam_alignment.rl"
1165 	{ int_value *= 10; int_value += (*p) - '0'; }
1166 	goto st204;
1167 st204:
1168 	if ( ++p == pe )
1169 		goto _test_eof204;
1170 goto case; case 204:
1171 #line 1171 "sam_alignment.d"
1172 	switch( (*p) ) {
1173 		case 9u: goto tr241;
1174 		case 44u: goto tr242;
1175 		default: break;
1176 	}
1177 	if ( 48u <= (*p) && (*p) <= 57u )
1178 		goto tr254;
1179 	goto tr49;
1180 tr254:
1181 #line 29 "sam_alignment.rl"
1182 	{ int_value *= 10; int_value += (*p) - '0'; }
1183 	goto st205;
1184 st205:
1185 	if ( ++p == pe )
1186 		goto _test_eof205;
1187 goto case; case 205:
1188 #line 1188 "sam_alignment.d"
1189 	switch( (*p) ) {
1190 		case 9u: goto tr241;
1191 		case 44u: goto tr242;
1192 		default: break;
1193 	}
1194 	if ( 48u <= (*p) && (*p) <= 57u )
1195 		goto tr255;
1196 	goto tr49;
1197 tr255:
1198 #line 29 "sam_alignment.rl"
1199 	{ int_value *= 10; int_value += (*p) - '0'; }
1200 	goto st206;
1201 st206:
1202 	if ( ++p == pe )
1203 		goto _test_eof206;
1204 goto case; case 206:
1205 #line 1205 "sam_alignment.d"
1206 	switch( (*p) ) {
1207 		case 9u: goto tr241;
1208 		case 44u: goto tr242;
1209 		default: break;
1210 	}
1211 	if ( 48u <= (*p) && (*p) <= 57u )
1212 		goto tr256;
1213 	goto tr49;
1214 tr256:
1215 #line 29 "sam_alignment.rl"
1216 	{ int_value *= 10; int_value += (*p) - '0'; }
1217 	goto st207;
1218 st207:
1219 	if ( ++p == pe )
1220 		goto _test_eof207;
1221 goto case; case 207:
1222 #line 1222 "sam_alignment.d"
1223 	switch( (*p) ) {
1224 		case 9u: goto tr241;
1225 		case 44u: goto tr242;
1226 		default: break;
1227 	}
1228 	if ( 48u <= (*p) && (*p) <= 57u )
1229 		goto tr257;
1230 	goto tr49;
1231 tr257:
1232 #line 29 "sam_alignment.rl"
1233 	{ int_value *= 10; int_value += (*p) - '0'; }
1234 	goto st208;
1235 st208:
1236 	if ( ++p == pe )
1237 		goto _test_eof208;
1238 goto case; case 208:
1239 #line 1239 "sam_alignment.d"
1240 	switch( (*p) ) {
1241 		case 9u: goto tr241;
1242 		case 44u: goto tr242;
1243 		default: break;
1244 	}
1245 	if ( 48u <= (*p) && (*p) <= 57u )
1246 		goto tr258;
1247 	goto tr49;
1248 tr258:
1249 #line 29 "sam_alignment.rl"
1250 	{ int_value *= 10; int_value += (*p) - '0'; }
1251 	goto st209;
1252 st209:
1253 	if ( ++p == pe )
1254 		goto _test_eof209;
1255 goto case; case 209:
1256 #line 1256 "sam_alignment.d"
1257 	switch( (*p) ) {
1258 		case 9u: goto tr241;
1259 		case 44u: goto tr242;
1260 		default: break;
1261 	}
1262 	if ( 48u <= (*p) && (*p) <= 57u )
1263 		goto tr259;
1264 	goto tr49;
1265 tr259:
1266 #line 29 "sam_alignment.rl"
1267 	{ int_value *= 10; int_value += (*p) - '0'; }
1268 	goto st210;
1269 st210:
1270 	if ( ++p == pe )
1271 		goto _test_eof210;
1272 goto case; case 210:
1273 #line 1273 "sam_alignment.d"
1274 	switch( (*p) ) {
1275 		case 9u: goto tr241;
1276 		case 44u: goto tr242;
1277 		default: break;
1278 	}
1279 	goto tr49;
1280 tr60:
1281 #line 352 "sam_alignment.rl"
1282 	{
1283         arraytype = (*p);
1284         buffer.capacity = buffer.length + 8;
1285         buffer.putUnsafe(tag_key);
1286         buffer.putUnsafe!char('B');
1287         buffer.putUnsafe!char(arraytype);
1288         buffer.putUnsafe!uint(0);
1289         tag_array_length_offset = buffer.length - uint.sizeof;
1290     }
1291 	goto st33;
1292 st33:
1293 	if ( ++p == pe )
1294 		goto _test_eof33;
1295 goto case; case 33:
1296 #line 1296 "sam_alignment.d"
1297 	if ( (*p) == 44u )
1298 		goto st34;
1299 	goto tr49;
1300 tr261:
1301 #line 38 "sam_alignment.rl"
1302 	{
1303         float_value = to!float(line[float_beg .. p - line.ptr]);
1304     }
1305 #line 379 "sam_alignment.rl"
1306 	{
1307         buffer.put!float(float_value);
1308         {
1309             auto ptr = cast(uint*)(buffer.data.ptr + tag_array_length_offset);
1310             ++*ptr;
1311         }
1312     }
1313 	goto st34;
1314 st34:
1315 	if ( ++p == pe )
1316 		goto _test_eof34;
1317 goto case; case 34:
1318 #line 1318 "sam_alignment.d"
1319 	switch( (*p) ) {
1320 		case 43u: goto tr65;
1321 		case 45u: goto tr65;
1322 		case 46u: goto tr66;
1323 		case 105u: goto tr68;
1324 		case 110u: goto tr69;
1325 		default: break;
1326 	}
1327 	if ( 48u <= (*p) && (*p) <= 57u )
1328 		goto tr67;
1329 	goto tr49;
1330 tr65:
1331 #line 37 "sam_alignment.rl"
1332 	{ float_beg = p - line.ptr; }
1333 	goto st35;
1334 st35:
1335 	if ( ++p == pe )
1336 		goto _test_eof35;
1337 goto case; case 35:
1338 #line 1338 "sam_alignment.d"
1339 	switch( (*p) ) {
1340 		case 46u: goto st36;
1341 		case 105u: goto st39;
1342 		default: break;
1343 	}
1344 	if ( 48u <= (*p) && (*p) <= 57u )
1345 		goto st213;
1346 	goto tr49;
1347 tr66:
1348 #line 37 "sam_alignment.rl"
1349 	{ float_beg = p - line.ptr; }
1350 	goto st36;
1351 st36:
1352 	if ( ++p == pe )
1353 		goto _test_eof36;
1354 goto case; case 36:
1355 #line 1355 "sam_alignment.d"
1356 	if ( 48u <= (*p) && (*p) <= 57u )
1357 		goto st211;
1358 	goto tr49;
1359 st211:
1360 	if ( ++p == pe )
1361 		goto _test_eof211;
1362 goto case; case 211:
1363 	switch( (*p) ) {
1364 		case 9u: goto tr260;
1365 		case 44u: goto tr261;
1366 		case 69u: goto st37;
1367 		case 101u: goto st37;
1368 		default: break;
1369 	}
1370 	if ( 48u <= (*p) && (*p) <= 57u )
1371 		goto st211;
1372 	goto tr49;
1373 st37:
1374 	if ( ++p == pe )
1375 		goto _test_eof37;
1376 goto case; case 37:
1377 	switch( (*p) ) {
1378 		case 43u: goto st38;
1379 		case 45u: goto st38;
1380 		default: break;
1381 	}
1382 	if ( 48u <= (*p) && (*p) <= 57u )
1383 		goto st212;
1384 	goto tr49;
1385 st38:
1386 	if ( ++p == pe )
1387 		goto _test_eof38;
1388 goto case; case 38:
1389 	if ( 48u <= (*p) && (*p) <= 57u )
1390 		goto st212;
1391 	goto tr49;
1392 st212:
1393 	if ( ++p == pe )
1394 		goto _test_eof212;
1395 goto case; case 212:
1396 	switch( (*p) ) {
1397 		case 9u: goto tr260;
1398 		case 44u: goto tr261;
1399 		default: break;
1400 	}
1401 	if ( 48u <= (*p) && (*p) <= 57u )
1402 		goto st212;
1403 	goto tr49;
1404 tr67:
1405 #line 37 "sam_alignment.rl"
1406 	{ float_beg = p - line.ptr; }
1407 	goto st213;
1408 st213:
1409 	if ( ++p == pe )
1410 		goto _test_eof213;
1411 goto case; case 213:
1412 #line 1412 "sam_alignment.d"
1413 	switch( (*p) ) {
1414 		case 9u: goto tr260;
1415 		case 44u: goto tr261;
1416 		case 46u: goto st36;
1417 		case 69u: goto st37;
1418 		case 101u: goto st37;
1419 		default: break;
1420 	}
1421 	if ( 48u <= (*p) && (*p) <= 57u )
1422 		goto st213;
1423 	goto tr49;
1424 tr68:
1425 #line 37 "sam_alignment.rl"
1426 	{ float_beg = p - line.ptr; }
1427 	goto st39;
1428 st39:
1429 	if ( ++p == pe )
1430 		goto _test_eof39;
1431 goto case; case 39:
1432 #line 1432 "sam_alignment.d"
1433 	if ( (*p) == 110u )
1434 		goto st40;
1435 	goto tr49;
1436 st40:
1437 	if ( ++p == pe )
1438 		goto _test_eof40;
1439 goto case; case 40:
1440 	if ( (*p) == 102u )
1441 		goto st214;
1442 	goto tr49;
1443 st214:
1444 	if ( ++p == pe )
1445 		goto _test_eof214;
1446 goto case; case 214:
1447 	switch( (*p) ) {
1448 		case 9u: goto tr260;
1449 		case 44u: goto tr261;
1450 		default: break;
1451 	}
1452 	goto tr49;
1453 tr69:
1454 #line 37 "sam_alignment.rl"
1455 	{ float_beg = p - line.ptr; }
1456 	goto st41;
1457 st41:
1458 	if ( ++p == pe )
1459 		goto _test_eof41;
1460 goto case; case 41:
1461 #line 1461 "sam_alignment.d"
1462 	if ( (*p) == 97u )
1463 		goto st42;
1464 	goto tr49;
1465 st42:
1466 	if ( ++p == pe )
1467 		goto _test_eof42;
1468 goto case; case 42:
1469 	if ( (*p) == 110u )
1470 		goto st214;
1471 	goto tr49;
1472 st43:
1473 	if ( ++p == pe )
1474 		goto _test_eof43;
1475 goto case; case 43:
1476 	if ( (*p) == 58u )
1477 		goto st44;
1478 	goto tr49;
1479 st44:
1480 	if ( ++p == pe )
1481 		goto _test_eof44;
1482 goto case; case 44:
1483 	if ( (*p) < 65u ) {
1484 		if ( 48u <= (*p) && (*p) <= 57u )
1485 			goto tr80;
1486 	} else if ( (*p) > 70u ) {
1487 		if ( 97u <= (*p) && (*p) <= 102u )
1488 			goto tr80;
1489 	} else
1490 		goto tr80;
1491 	goto tr49;
1492 tr80:
1493 #line 317 "sam_alignment.rl"
1494 	{ tagvalue_beg = p - line.ptr; }
1495 	goto st215;
1496 st215:
1497 	if ( ++p == pe )
1498 		goto _test_eof215;
1499 goto case; case 215:
1500 #line 1500 "sam_alignment.d"
1501 	if ( (*p) == 9u )
1502 		goto tr263;
1503 	if ( (*p) < 65u ) {
1504 		if ( 48u <= (*p) && (*p) <= 57u )
1505 			goto st215;
1506 	} else if ( (*p) > 70u ) {
1507 		if ( 97u <= (*p) && (*p) <= 102u )
1508 			goto st215;
1509 	} else
1510 		goto st215;
1511 	goto tr49;
1512 st45:
1513 	if ( ++p == pe )
1514 		goto _test_eof45;
1515 goto case; case 45:
1516 	if ( (*p) == 58u )
1517 		goto st46;
1518 	goto tr49;
1519 st46:
1520 	if ( ++p == pe )
1521 		goto _test_eof46;
1522 goto case; case 46:
1523 	if ( 32u <= (*p) && (*p) <= 126u )
1524 		goto tr82;
1525 	goto tr49;
1526 tr82:
1527 #line 317 "sam_alignment.rl"
1528 	{ tagvalue_beg = p - line.ptr; }
1529 	goto st216;
1530 st216:
1531 	if ( ++p == pe )
1532 		goto _test_eof216;
1533 goto case; case 216:
1534 #line 1534 "sam_alignment.d"
1535 	if ( (*p) == 9u )
1536 		goto tr265;
1537 	if ( 32u <= (*p) && (*p) <= 126u )
1538 		goto st216;
1539 	goto tr49;
1540 st47:
1541 	if ( ++p == pe )
1542 		goto _test_eof47;
1543 goto case; case 47:
1544 	if ( (*p) == 58u )
1545 		goto st48;
1546 	goto tr49;
1547 st48:
1548 	if ( ++p == pe )
1549 		goto _test_eof48;
1550 goto case; case 48:
1551 	switch( (*p) ) {
1552 		case 43u: goto tr84;
1553 		case 45u: goto tr84;
1554 		case 46u: goto tr85;
1555 		case 105u: goto tr87;
1556 		case 110u: goto tr88;
1557 		default: break;
1558 	}
1559 	if ( 48u <= (*p) && (*p) <= 57u )
1560 		goto tr86;
1561 	goto tr49;
1562 tr84:
1563 #line 37 "sam_alignment.rl"
1564 	{ float_beg = p - line.ptr; }
1565 	goto st49;
1566 st49:
1567 	if ( ++p == pe )
1568 		goto _test_eof49;
1569 goto case; case 49:
1570 #line 1570 "sam_alignment.d"
1571 	switch( (*p) ) {
1572 		case 46u: goto st50;
1573 		case 105u: goto st53;
1574 		default: break;
1575 	}
1576 	if ( 48u <= (*p) && (*p) <= 57u )
1577 		goto st219;
1578 	goto tr49;
1579 tr85:
1580 #line 37 "sam_alignment.rl"
1581 	{ float_beg = p - line.ptr; }
1582 	goto st50;
1583 st50:
1584 	if ( ++p == pe )
1585 		goto _test_eof50;
1586 goto case; case 50:
1587 #line 1587 "sam_alignment.d"
1588 	if ( 48u <= (*p) && (*p) <= 57u )
1589 		goto st217;
1590 	goto tr49;
1591 st217:
1592 	if ( ++p == pe )
1593 		goto _test_eof217;
1594 goto case; case 217:
1595 	switch( (*p) ) {
1596 		case 9u: goto tr267;
1597 		case 69u: goto st51;
1598 		case 101u: goto st51;
1599 		default: break;
1600 	}
1601 	if ( 48u <= (*p) && (*p) <= 57u )
1602 		goto st217;
1603 	goto tr49;
1604 st51:
1605 	if ( ++p == pe )
1606 		goto _test_eof51;
1607 goto case; case 51:
1608 	switch( (*p) ) {
1609 		case 43u: goto st52;
1610 		case 45u: goto st52;
1611 		default: break;
1612 	}
1613 	if ( 48u <= (*p) && (*p) <= 57u )
1614 		goto st218;
1615 	goto tr49;
1616 st52:
1617 	if ( ++p == pe )
1618 		goto _test_eof52;
1619 goto case; case 52:
1620 	if ( 48u <= (*p) && (*p) <= 57u )
1621 		goto st218;
1622 	goto tr49;
1623 st218:
1624 	if ( ++p == pe )
1625 		goto _test_eof218;
1626 goto case; case 218:
1627 	if ( (*p) == 9u )
1628 		goto tr267;
1629 	if ( 48u <= (*p) && (*p) <= 57u )
1630 		goto st218;
1631 	goto tr49;
1632 tr86:
1633 #line 37 "sam_alignment.rl"
1634 	{ float_beg = p - line.ptr; }
1635 	goto st219;
1636 st219:
1637 	if ( ++p == pe )
1638 		goto _test_eof219;
1639 goto case; case 219:
1640 #line 1640 "sam_alignment.d"
1641 	switch( (*p) ) {
1642 		case 9u: goto tr267;
1643 		case 46u: goto st50;
1644 		case 69u: goto st51;
1645 		case 101u: goto st51;
1646 		default: break;
1647 	}
1648 	if ( 48u <= (*p) && (*p) <= 57u )
1649 		goto st219;
1650 	goto tr49;
1651 tr87:
1652 #line 37 "sam_alignment.rl"
1653 	{ float_beg = p - line.ptr; }
1654 	goto st53;
1655 st53:
1656 	if ( ++p == pe )
1657 		goto _test_eof53;
1658 goto case; case 53:
1659 #line 1659 "sam_alignment.d"
1660 	if ( (*p) == 110u )
1661 		goto st54;
1662 	goto tr49;
1663 st54:
1664 	if ( ++p == pe )
1665 		goto _test_eof54;
1666 goto case; case 54:
1667 	if ( (*p) == 102u )
1668 		goto st220;
1669 	goto tr49;
1670 st220:
1671 	if ( ++p == pe )
1672 		goto _test_eof220;
1673 goto case; case 220:
1674 	if ( (*p) == 9u )
1675 		goto tr267;
1676 	goto tr49;
1677 tr88:
1678 #line 37 "sam_alignment.rl"
1679 	{ float_beg = p - line.ptr; }
1680 	goto st55;
1681 st55:
1682 	if ( ++p == pe )
1683 		goto _test_eof55;
1684 goto case; case 55:
1685 #line 1685 "sam_alignment.d"
1686 	if ( (*p) == 97u )
1687 		goto st56;
1688 	goto tr49;
1689 st56:
1690 	if ( ++p == pe )
1691 		goto _test_eof56;
1692 goto case; case 56:
1693 	if ( (*p) == 110u )
1694 		goto st220;
1695 	goto tr49;
1696 st57:
1697 	if ( ++p == pe )
1698 		goto _test_eof57;
1699 goto case; case 57:
1700 	if ( (*p) == 58u )
1701 		goto st58;
1702 	goto tr49;
1703 st58:
1704 	if ( ++p == pe )
1705 		goto _test_eof58;
1706 goto case; case 58:
1707 	switch( (*p) ) {
1708 		case 43u: goto tr99;
1709 		case 45u: goto tr99;
1710 		default: break;
1711 	}
1712 	if ( 48u <= (*p) && (*p) <= 57u )
1713 		goto tr100;
1714 	goto tr49;
1715 tr99:
1716 #line 27 "sam_alignment.rl"
1717 	{ current_sign = (*p) == '-' ? -1 : 1; }
1718 	goto st59;
1719 st59:
1720 	if ( ++p == pe )
1721 		goto _test_eof59;
1722 goto case; case 59:
1723 #line 1723 "sam_alignment.d"
1724 	if ( 48u <= (*p) && (*p) <= 57u )
1725 		goto tr100;
1726 	goto tr49;
1727 tr100:
1728 #line 28 "sam_alignment.rl"
1729 	{ int_value = 0; }
1730 #line 29 "sam_alignment.rl"
1731 	{ int_value *= 10; int_value += (*p) - '0'; }
1732 	goto st221;
1733 st221:
1734 	if ( ++p == pe )
1735 		goto _test_eof221;
1736 goto case; case 221:
1737 #line 1737 "sam_alignment.d"
1738 	if ( (*p) == 9u )
1739 		goto tr269;
1740 	if ( 48u <= (*p) && (*p) <= 57u )
1741 		goto tr270;
1742 	goto tr49;
1743 tr270:
1744 #line 29 "sam_alignment.rl"
1745 	{ int_value *= 10; int_value += (*p) - '0'; }
1746 	goto st222;
1747 st222:
1748 	if ( ++p == pe )
1749 		goto _test_eof222;
1750 goto case; case 222:
1751 #line 1751 "sam_alignment.d"
1752 	if ( (*p) == 9u )
1753 		goto tr269;
1754 	if ( 48u <= (*p) && (*p) <= 57u )
1755 		goto tr271;
1756 	goto tr49;
1757 tr271:
1758 #line 29 "sam_alignment.rl"
1759 	{ int_value *= 10; int_value += (*p) - '0'; }
1760 	goto st223;
1761 st223:
1762 	if ( ++p == pe )
1763 		goto _test_eof223;
1764 goto case; case 223:
1765 #line 1765 "sam_alignment.d"
1766 	if ( (*p) == 9u )
1767 		goto tr269;
1768 	if ( 48u <= (*p) && (*p) <= 57u )
1769 		goto tr272;
1770 	goto tr49;
1771 tr272:
1772 #line 29 "sam_alignment.rl"
1773 	{ int_value *= 10; int_value += (*p) - '0'; }
1774 	goto st224;
1775 st224:
1776 	if ( ++p == pe )
1777 		goto _test_eof224;
1778 goto case; case 224:
1779 #line 1779 "sam_alignment.d"
1780 	if ( (*p) == 9u )
1781 		goto tr269;
1782 	if ( 48u <= (*p) && (*p) <= 57u )
1783 		goto tr273;
1784 	goto tr49;
1785 tr273:
1786 #line 29 "sam_alignment.rl"
1787 	{ int_value *= 10; int_value += (*p) - '0'; }
1788 	goto st225;
1789 st225:
1790 	if ( ++p == pe )
1791 		goto _test_eof225;
1792 goto case; case 225:
1793 #line 1793 "sam_alignment.d"
1794 	if ( (*p) == 9u )
1795 		goto tr269;
1796 	if ( 48u <= (*p) && (*p) <= 57u )
1797 		goto tr274;
1798 	goto tr49;
1799 tr274:
1800 #line 29 "sam_alignment.rl"
1801 	{ int_value *= 10; int_value += (*p) - '0'; }
1802 	goto st226;
1803 st226:
1804 	if ( ++p == pe )
1805 		goto _test_eof226;
1806 goto case; case 226:
1807 #line 1807 "sam_alignment.d"
1808 	if ( (*p) == 9u )
1809 		goto tr269;
1810 	if ( 48u <= (*p) && (*p) <= 57u )
1811 		goto tr275;
1812 	goto tr49;
1813 tr275:
1814 #line 29 "sam_alignment.rl"
1815 	{ int_value *= 10; int_value += (*p) - '0'; }
1816 	goto st227;
1817 st227:
1818 	if ( ++p == pe )
1819 		goto _test_eof227;
1820 goto case; case 227:
1821 #line 1821 "sam_alignment.d"
1822 	if ( (*p) == 9u )
1823 		goto tr269;
1824 	if ( 48u <= (*p) && (*p) <= 57u )
1825 		goto tr276;
1826 	goto tr49;
1827 tr276:
1828 #line 29 "sam_alignment.rl"
1829 	{ int_value *= 10; int_value += (*p) - '0'; }
1830 	goto st228;
1831 st228:
1832 	if ( ++p == pe )
1833 		goto _test_eof228;
1834 goto case; case 228:
1835 #line 1835 "sam_alignment.d"
1836 	if ( (*p) == 9u )
1837 		goto tr269;
1838 	if ( 48u <= (*p) && (*p) <= 57u )
1839 		goto tr277;
1840 	goto tr49;
1841 tr277:
1842 #line 29 "sam_alignment.rl"
1843 	{ int_value *= 10; int_value += (*p) - '0'; }
1844 	goto st229;
1845 st229:
1846 	if ( ++p == pe )
1847 		goto _test_eof229;
1848 goto case; case 229:
1849 #line 1849 "sam_alignment.d"
1850 	if ( (*p) == 9u )
1851 		goto tr269;
1852 	if ( 48u <= (*p) && (*p) <= 57u )
1853 		goto tr278;
1854 	goto tr49;
1855 tr278:
1856 #line 29 "sam_alignment.rl"
1857 	{ int_value *= 10; int_value += (*p) - '0'; }
1858 	goto st230;
1859 st230:
1860 	if ( ++p == pe )
1861 		goto _test_eof230;
1862 goto case; case 230:
1863 #line 1863 "sam_alignment.d"
1864 	if ( (*p) == 9u )
1865 		goto tr269;
1866 	if ( 48u <= (*p) && (*p) <= 57u )
1867 		goto tr279;
1868 	goto tr49;
1869 tr279:
1870 #line 29 "sam_alignment.rl"
1871 	{ int_value *= 10; int_value += (*p) - '0'; }
1872 	goto st231;
1873 st231:
1874 	if ( ++p == pe )
1875 		goto _test_eof231;
1876 goto case; case 231:
1877 #line 1877 "sam_alignment.d"
1878 	if ( (*p) == 9u )
1879 		goto tr269;
1880 	if ( 48u <= (*p) && (*p) <= 57u )
1881 		goto tr280;
1882 	goto tr49;
1883 tr280:
1884 #line 29 "sam_alignment.rl"
1885 	{ int_value *= 10; int_value += (*p) - '0'; }
1886 	goto st232;
1887 st232:
1888 	if ( ++p == pe )
1889 		goto _test_eof232;
1890 goto case; case 232:
1891 #line 1891 "sam_alignment.d"
1892 	if ( (*p) == 9u )
1893 		goto tr269;
1894 	if ( 48u <= (*p) && (*p) <= 57u )
1895 		goto tr281;
1896 	goto tr49;
1897 tr281:
1898 #line 29 "sam_alignment.rl"
1899 	{ int_value *= 10; int_value += (*p) - '0'; }
1900 	goto st233;
1901 st233:
1902 	if ( ++p == pe )
1903 		goto _test_eof233;
1904 goto case; case 233:
1905 #line 1905 "sam_alignment.d"
1906 	if ( (*p) == 9u )
1907 		goto tr269;
1908 	if ( 48u <= (*p) && (*p) <= 57u )
1909 		goto tr282;
1910 	goto tr49;
1911 tr282:
1912 #line 29 "sam_alignment.rl"
1913 	{ int_value *= 10; int_value += (*p) - '0'; }
1914 	goto st234;
1915 st234:
1916 	if ( ++p == pe )
1917 		goto _test_eof234;
1918 goto case; case 234:
1919 #line 1919 "sam_alignment.d"
1920 	if ( (*p) == 9u )
1921 		goto tr269;
1922 	if ( 48u <= (*p) && (*p) <= 57u )
1923 		goto tr283;
1924 	goto tr49;
1925 tr283:
1926 #line 29 "sam_alignment.rl"
1927 	{ int_value *= 10; int_value += (*p) - '0'; }
1928 	goto st235;
1929 st235:
1930 	if ( ++p == pe )
1931 		goto _test_eof235;
1932 goto case; case 235:
1933 #line 1933 "sam_alignment.d"
1934 	if ( (*p) == 9u )
1935 		goto tr269;
1936 	if ( 48u <= (*p) && (*p) <= 57u )
1937 		goto tr284;
1938 	goto tr49;
1939 tr284:
1940 #line 29 "sam_alignment.rl"
1941 	{ int_value *= 10; int_value += (*p) - '0'; }
1942 	goto st236;
1943 st236:
1944 	if ( ++p == pe )
1945 		goto _test_eof236;
1946 goto case; case 236:
1947 #line 1947 "sam_alignment.d"
1948 	if ( (*p) == 9u )
1949 		goto tr269;
1950 	if ( 48u <= (*p) && (*p) <= 57u )
1951 		goto tr285;
1952 	goto tr49;
1953 tr285:
1954 #line 29 "sam_alignment.rl"
1955 	{ int_value *= 10; int_value += (*p) - '0'; }
1956 	goto st237;
1957 st237:
1958 	if ( ++p == pe )
1959 		goto _test_eof237;
1960 goto case; case 237:
1961 #line 1961 "sam_alignment.d"
1962 	if ( (*p) == 9u )
1963 		goto tr269;
1964 	if ( 48u <= (*p) && (*p) <= 57u )
1965 		goto tr286;
1966 	goto tr49;
1967 tr286:
1968 #line 29 "sam_alignment.rl"
1969 	{ int_value *= 10; int_value += (*p) - '0'; }
1970 	goto st238;
1971 st238:
1972 	if ( ++p == pe )
1973 		goto _test_eof238;
1974 goto case; case 238:
1975 #line 1975 "sam_alignment.d"
1976 	if ( (*p) == 9u )
1977 		goto tr269;
1978 	goto tr49;
1979 tr41:
1980 #line 193 "sam_alignment.rl"
1981 	{ sequence_beg = p - line.ptr; }
1982 	goto st60;
1983 st60:
1984 	if ( ++p == pe )
1985 		goto _test_eof60;
1986 goto case; case 60:
1987 #line 1987 "sam_alignment.d"
1988 	switch( (*p) ) {
1989 		case 9u: goto tr101;
1990 		case 46u: goto st60;
1991 		case 61u: goto st60;
1992 		default: break;
1993 	}
1994 	if ( (*p) > 90u ) {
1995 		if ( 97u <= (*p) && (*p) <= 122u )
1996 			goto st60;
1997 	} else if ( (*p) >= 65u )
1998 		goto st60;
1999 	goto tr39;
2000 tr38:
2001 #line 29 "sam_alignment.rl"
2002 	{ int_value *= 10; int_value += (*p) - '0'; }
2003 	goto st61;
2004 st61:
2005 	if ( ++p == pe )
2006 		goto _test_eof61;
2007 goto case; case 61:
2008 #line 2008 "sam_alignment.d"
2009 	if ( (*p) == 9u )
2010 		goto tr37;
2011 	if ( 48u <= (*p) && (*p) <= 57u )
2012 		goto tr103;
2013 	goto tr34;
2014 tr103:
2015 #line 29 "sam_alignment.rl"
2016 	{ int_value *= 10; int_value += (*p) - '0'; }
2017 	goto st62;
2018 st62:
2019 	if ( ++p == pe )
2020 		goto _test_eof62;
2021 goto case; case 62:
2022 #line 2022 "sam_alignment.d"
2023 	if ( (*p) == 9u )
2024 		goto tr37;
2025 	if ( 48u <= (*p) && (*p) <= 57u )
2026 		goto tr104;
2027 	goto tr34;
2028 tr104:
2029 #line 29 "sam_alignment.rl"
2030 	{ int_value *= 10; int_value += (*p) - '0'; }
2031 	goto st63;
2032 st63:
2033 	if ( ++p == pe )
2034 		goto _test_eof63;
2035 goto case; case 63:
2036 #line 2036 "sam_alignment.d"
2037 	if ( (*p) == 9u )
2038 		goto tr37;
2039 	if ( 48u <= (*p) && (*p) <= 57u )
2040 		goto tr105;
2041 	goto tr34;
2042 tr105:
2043 #line 29 "sam_alignment.rl"
2044 	{ int_value *= 10; int_value += (*p) - '0'; }
2045 	goto st64;
2046 st64:
2047 	if ( ++p == pe )
2048 		goto _test_eof64;
2049 goto case; case 64:
2050 #line 2050 "sam_alignment.d"
2051 	if ( (*p) == 9u )
2052 		goto tr37;
2053 	if ( 48u <= (*p) && (*p) <= 57u )
2054 		goto tr106;
2055 	goto tr34;
2056 tr106:
2057 #line 29 "sam_alignment.rl"
2058 	{ int_value *= 10; int_value += (*p) - '0'; }
2059 	goto st65;
2060 st65:
2061 	if ( ++p == pe )
2062 		goto _test_eof65;
2063 goto case; case 65:
2064 #line 2064 "sam_alignment.d"
2065 	if ( (*p) == 9u )
2066 		goto tr37;
2067 	if ( 48u <= (*p) && (*p) <= 57u )
2068 		goto tr107;
2069 	goto tr34;
2070 tr107:
2071 #line 29 "sam_alignment.rl"
2072 	{ int_value *= 10; int_value += (*p) - '0'; }
2073 	goto st66;
2074 st66:
2075 	if ( ++p == pe )
2076 		goto _test_eof66;
2077 goto case; case 66:
2078 #line 2078 "sam_alignment.d"
2079 	if ( (*p) == 9u )
2080 		goto tr37;
2081 	if ( 48u <= (*p) && (*p) <= 57u )
2082 		goto tr108;
2083 	goto tr34;
2084 tr108:
2085 #line 29 "sam_alignment.rl"
2086 	{ int_value *= 10; int_value += (*p) - '0'; }
2087 	goto st67;
2088 st67:
2089 	if ( ++p == pe )
2090 		goto _test_eof67;
2091 goto case; case 67:
2092 #line 2092 "sam_alignment.d"
2093 	if ( (*p) == 9u )
2094 		goto tr37;
2095 	if ( 48u <= (*p) && (*p) <= 57u )
2096 		goto tr109;
2097 	goto tr34;
2098 tr109:
2099 #line 29 "sam_alignment.rl"
2100 	{ int_value *= 10; int_value += (*p) - '0'; }
2101 	goto st68;
2102 st68:
2103 	if ( ++p == pe )
2104 		goto _test_eof68;
2105 goto case; case 68:
2106 #line 2106 "sam_alignment.d"
2107 	if ( (*p) == 9u )
2108 		goto tr37;
2109 	if ( 48u <= (*p) && (*p) <= 57u )
2110 		goto tr110;
2111 	goto tr34;
2112 tr110:
2113 #line 29 "sam_alignment.rl"
2114 	{ int_value *= 10; int_value += (*p) - '0'; }
2115 	goto st69;
2116 st69:
2117 	if ( ++p == pe )
2118 		goto _test_eof69;
2119 goto case; case 69:
2120 #line 2120 "sam_alignment.d"
2121 	if ( (*p) == 9u )
2122 		goto tr37;
2123 	if ( 48u <= (*p) && (*p) <= 57u )
2124 		goto tr111;
2125 	goto tr34;
2126 tr111:
2127 #line 29 "sam_alignment.rl"
2128 	{ int_value *= 10; int_value += (*p) - '0'; }
2129 	goto st70;
2130 st70:
2131 	if ( ++p == pe )
2132 		goto _test_eof70;
2133 goto case; case 70:
2134 #line 2134 "sam_alignment.d"
2135 	if ( (*p) == 9u )
2136 		goto tr37;
2137 	if ( 48u <= (*p) && (*p) <= 57u )
2138 		goto tr112;
2139 	goto tr34;
2140 tr112:
2141 #line 29 "sam_alignment.rl"
2142 	{ int_value *= 10; int_value += (*p) - '0'; }
2143 	goto st71;
2144 st71:
2145 	if ( ++p == pe )
2146 		goto _test_eof71;
2147 goto case; case 71:
2148 #line 2148 "sam_alignment.d"
2149 	if ( (*p) == 9u )
2150 		goto tr37;
2151 	if ( 48u <= (*p) && (*p) <= 57u )
2152 		goto tr113;
2153 	goto tr34;
2154 tr113:
2155 #line 29 "sam_alignment.rl"
2156 	{ int_value *= 10; int_value += (*p) - '0'; }
2157 	goto st72;
2158 st72:
2159 	if ( ++p == pe )
2160 		goto _test_eof72;
2161 goto case; case 72:
2162 #line 2162 "sam_alignment.d"
2163 	if ( (*p) == 9u )
2164 		goto tr37;
2165 	if ( 48u <= (*p) && (*p) <= 57u )
2166 		goto tr114;
2167 	goto tr34;
2168 tr114:
2169 #line 29 "sam_alignment.rl"
2170 	{ int_value *= 10; int_value += (*p) - '0'; }
2171 	goto st73;
2172 st73:
2173 	if ( ++p == pe )
2174 		goto _test_eof73;
2175 goto case; case 73:
2176 #line 2176 "sam_alignment.d"
2177 	if ( (*p) == 9u )
2178 		goto tr37;
2179 	if ( 48u <= (*p) && (*p) <= 57u )
2180 		goto tr115;
2181 	goto tr34;
2182 tr115:
2183 #line 29 "sam_alignment.rl"
2184 	{ int_value *= 10; int_value += (*p) - '0'; }
2185 	goto st74;
2186 st74:
2187 	if ( ++p == pe )
2188 		goto _test_eof74;
2189 goto case; case 74:
2190 #line 2190 "sam_alignment.d"
2191 	if ( (*p) == 9u )
2192 		goto tr37;
2193 	if ( 48u <= (*p) && (*p) <= 57u )
2194 		goto tr116;
2195 	goto tr34;
2196 tr116:
2197 #line 29 "sam_alignment.rl"
2198 	{ int_value *= 10; int_value += (*p) - '0'; }
2199 	goto st75;
2200 st75:
2201 	if ( ++p == pe )
2202 		goto _test_eof75;
2203 goto case; case 75:
2204 #line 2204 "sam_alignment.d"
2205 	if ( (*p) == 9u )
2206 		goto tr37;
2207 	if ( 48u <= (*p) && (*p) <= 57u )
2208 		goto tr117;
2209 	goto tr34;
2210 tr117:
2211 #line 29 "sam_alignment.rl"
2212 	{ int_value *= 10; int_value += (*p) - '0'; }
2213 	goto st76;
2214 st76:
2215 	if ( ++p == pe )
2216 		goto _test_eof76;
2217 goto case; case 76:
2218 #line 2218 "sam_alignment.d"
2219 	if ( (*p) == 9u )
2220 		goto tr37;
2221 	if ( 48u <= (*p) && (*p) <= 57u )
2222 		goto tr118;
2223 	goto tr34;
2224 tr118:
2225 #line 29 "sam_alignment.rl"
2226 	{ int_value *= 10; int_value += (*p) - '0'; }
2227 	goto st77;
2228 st77:
2229 	if ( ++p == pe )
2230 		goto _test_eof77;
2231 goto case; case 77:
2232 #line 2232 "sam_alignment.d"
2233 	if ( (*p) == 9u )
2234 		goto tr37;
2235 	goto tr34;
2236 tr33:
2237 #line 29 "sam_alignment.rl"
2238 	{ int_value *= 10; int_value += (*p) - '0'; }
2239 	goto st78;
2240 st78:
2241 	if ( ++p == pe )
2242 		goto _test_eof78;
2243 goto case; case 78:
2244 #line 2244 "sam_alignment.d"
2245 	if ( (*p) == 9u )
2246 		goto tr32;
2247 	if ( 48u <= (*p) && (*p) <= 57u )
2248 		goto tr119;
2249 	goto tr30;
2250 tr119:
2251 #line 29 "sam_alignment.rl"
2252 	{ int_value *= 10; int_value += (*p) - '0'; }
2253 	goto st79;
2254 st79:
2255 	if ( ++p == pe )
2256 		goto _test_eof79;
2257 goto case; case 79:
2258 #line 2258 "sam_alignment.d"
2259 	if ( (*p) == 9u )
2260 		goto tr32;
2261 	if ( 48u <= (*p) && (*p) <= 57u )
2262 		goto tr120;
2263 	goto tr30;
2264 tr120:
2265 #line 29 "sam_alignment.rl"
2266 	{ int_value *= 10; int_value += (*p) - '0'; }
2267 	goto st80;
2268 st80:
2269 	if ( ++p == pe )
2270 		goto _test_eof80;
2271 goto case; case 80:
2272 #line 2272 "sam_alignment.d"
2273 	if ( (*p) == 9u )
2274 		goto tr32;
2275 	if ( 48u <= (*p) && (*p) <= 57u )
2276 		goto tr121;
2277 	goto tr30;
2278 tr121:
2279 #line 29 "sam_alignment.rl"
2280 	{ int_value *= 10; int_value += (*p) - '0'; }
2281 	goto st81;
2282 st81:
2283 	if ( ++p == pe )
2284 		goto _test_eof81;
2285 goto case; case 81:
2286 #line 2286 "sam_alignment.d"
2287 	if ( (*p) == 9u )
2288 		goto tr32;
2289 	if ( 48u <= (*p) && (*p) <= 57u )
2290 		goto tr122;
2291 	goto tr30;
2292 tr122:
2293 #line 29 "sam_alignment.rl"
2294 	{ int_value *= 10; int_value += (*p) - '0'; }
2295 	goto st82;
2296 st82:
2297 	if ( ++p == pe )
2298 		goto _test_eof82;
2299 goto case; case 82:
2300 #line 2300 "sam_alignment.d"
2301 	if ( (*p) == 9u )
2302 		goto tr32;
2303 	if ( 48u <= (*p) && (*p) <= 57u )
2304 		goto tr123;
2305 	goto tr30;
2306 tr123:
2307 #line 29 "sam_alignment.rl"
2308 	{ int_value *= 10; int_value += (*p) - '0'; }
2309 	goto st83;
2310 st83:
2311 	if ( ++p == pe )
2312 		goto _test_eof83;
2313 goto case; case 83:
2314 #line 2314 "sam_alignment.d"
2315 	if ( (*p) == 9u )
2316 		goto tr32;
2317 	if ( 48u <= (*p) && (*p) <= 57u )
2318 		goto tr124;
2319 	goto tr30;
2320 tr124:
2321 #line 29 "sam_alignment.rl"
2322 	{ int_value *= 10; int_value += (*p) - '0'; }
2323 	goto st84;
2324 st84:
2325 	if ( ++p == pe )
2326 		goto _test_eof84;
2327 goto case; case 84:
2328 #line 2328 "sam_alignment.d"
2329 	if ( (*p) == 9u )
2330 		goto tr32;
2331 	if ( 48u <= (*p) && (*p) <= 57u )
2332 		goto tr125;
2333 	goto tr30;
2334 tr125:
2335 #line 29 "sam_alignment.rl"
2336 	{ int_value *= 10; int_value += (*p) - '0'; }
2337 	goto st85;
2338 st85:
2339 	if ( ++p == pe )
2340 		goto _test_eof85;
2341 goto case; case 85:
2342 #line 2342 "sam_alignment.d"
2343 	if ( (*p) == 9u )
2344 		goto tr32;
2345 	if ( 48u <= (*p) && (*p) <= 57u )
2346 		goto tr126;
2347 	goto tr30;
2348 tr126:
2349 #line 29 "sam_alignment.rl"
2350 	{ int_value *= 10; int_value += (*p) - '0'; }
2351 	goto st86;
2352 st86:
2353 	if ( ++p == pe )
2354 		goto _test_eof86;
2355 goto case; case 86:
2356 #line 2356 "sam_alignment.d"
2357 	if ( (*p) == 9u )
2358 		goto tr32;
2359 	if ( 48u <= (*p) && (*p) <= 57u )
2360 		goto tr127;
2361 	goto tr30;
2362 tr127:
2363 #line 29 "sam_alignment.rl"
2364 	{ int_value *= 10; int_value += (*p) - '0'; }
2365 	goto st87;
2366 st87:
2367 	if ( ++p == pe )
2368 		goto _test_eof87;
2369 goto case; case 87:
2370 #line 2370 "sam_alignment.d"
2371 	if ( (*p) == 9u )
2372 		goto tr32;
2373 	if ( 48u <= (*p) && (*p) <= 57u )
2374 		goto tr128;
2375 	goto tr30;
2376 tr128:
2377 #line 29 "sam_alignment.rl"
2378 	{ int_value *= 10; int_value += (*p) - '0'; }
2379 	goto st88;
2380 st88:
2381 	if ( ++p == pe )
2382 		goto _test_eof88;
2383 goto case; case 88:
2384 #line 2384 "sam_alignment.d"
2385 	if ( (*p) == 9u )
2386 		goto tr32;
2387 	if ( 48u <= (*p) && (*p) <= 57u )
2388 		goto tr129;
2389 	goto tr30;
2390 tr129:
2391 #line 29 "sam_alignment.rl"
2392 	{ int_value *= 10; int_value += (*p) - '0'; }
2393 	goto st89;
2394 st89:
2395 	if ( ++p == pe )
2396 		goto _test_eof89;
2397 goto case; case 89:
2398 #line 2398 "sam_alignment.d"
2399 	if ( (*p) == 9u )
2400 		goto tr32;
2401 	if ( 48u <= (*p) && (*p) <= 57u )
2402 		goto tr130;
2403 	goto tr30;
2404 tr130:
2405 #line 29 "sam_alignment.rl"
2406 	{ int_value *= 10; int_value += (*p) - '0'; }
2407 	goto st90;
2408 st90:
2409 	if ( ++p == pe )
2410 		goto _test_eof90;
2411 goto case; case 90:
2412 #line 2412 "sam_alignment.d"
2413 	if ( (*p) == 9u )
2414 		goto tr32;
2415 	if ( 48u <= (*p) && (*p) <= 57u )
2416 		goto tr131;
2417 	goto tr30;
2418 tr131:
2419 #line 29 "sam_alignment.rl"
2420 	{ int_value *= 10; int_value += (*p) - '0'; }
2421 	goto st91;
2422 st91:
2423 	if ( ++p == pe )
2424 		goto _test_eof91;
2425 goto case; case 91:
2426 #line 2426 "sam_alignment.d"
2427 	if ( (*p) == 9u )
2428 		goto tr32;
2429 	if ( 48u <= (*p) && (*p) <= 57u )
2430 		goto tr132;
2431 	goto tr30;
2432 tr132:
2433 #line 29 "sam_alignment.rl"
2434 	{ int_value *= 10; int_value += (*p) - '0'; }
2435 	goto st92;
2436 st92:
2437 	if ( ++p == pe )
2438 		goto _test_eof92;
2439 goto case; case 92:
2440 #line 2440 "sam_alignment.d"
2441 	if ( (*p) == 9u )
2442 		goto tr32;
2443 	if ( 48u <= (*p) && (*p) <= 57u )
2444 		goto tr133;
2445 	goto tr30;
2446 tr133:
2447 #line 29 "sam_alignment.rl"
2448 	{ int_value *= 10; int_value += (*p) - '0'; }
2449 	goto st93;
2450 st93:
2451 	if ( ++p == pe )
2452 		goto _test_eof93;
2453 goto case; case 93:
2454 #line 2454 "sam_alignment.d"
2455 	if ( (*p) == 9u )
2456 		goto tr32;
2457 	if ( 48u <= (*p) && (*p) <= 57u )
2458 		goto tr134;
2459 	goto tr30;
2460 tr134:
2461 #line 29 "sam_alignment.rl"
2462 	{ int_value *= 10; int_value += (*p) - '0'; }
2463 	goto st94;
2464 st94:
2465 	if ( ++p == pe )
2466 		goto _test_eof94;
2467 goto case; case 94:
2468 #line 2468 "sam_alignment.d"
2469 	if ( (*p) == 9u )
2470 		goto tr32;
2471 	goto tr30;
2472 st95:
2473 	if ( ++p == pe )
2474 		goto _test_eof95;
2475 goto case; case 95:
2476 	if ( (*p) == 9u )
2477 		goto st14;
2478 	goto tr24;
2479 st96:
2480 	if ( ++p == pe )
2481 		goto _test_eof96;
2482 goto case; case 96:
2483 	if ( (*p) == 9u )
2484 		goto tr136;
2485 	goto tr24;
2486 tr22:
2487 #line 28 "sam_alignment.rl"
2488 	{ int_value = 0; }
2489 #line 29 "sam_alignment.rl"
2490 	{ int_value *= 10; int_value += (*p) - '0'; }
2491 	goto st97;
2492 tr156:
2493 #line 113 "sam_alignment.rl"
2494 	{
2495         auto op = CigarOperation(cigar_op_len, cigar_op_chr);
2496         if (op.is_reference_consuming)
2497             end_pos += op.length;
2498         buffer.put!CigarOperation(op);
2499         {
2500         auto ptr = cast(uint*)(buffer.data.ptr + 3 * uint.sizeof);
2501         *ptr = (*ptr) + 1;
2502         }
2503     }
2504 #line 28 "sam_alignment.rl"
2505 	{ int_value = 0; }
2506 #line 29 "sam_alignment.rl"
2507 	{ int_value *= 10; int_value += (*p) - '0'; }
2508 	goto st97;
2509 st97:
2510 	if ( ++p == pe )
2511 		goto _test_eof97;
2512 goto case; case 97:
2513 #line 2513 "sam_alignment.d"
2514 	switch( (*p) ) {
2515 		case 61u: goto tr138;
2516 		case 68u: goto tr138;
2517 		case 80u: goto tr138;
2518 		case 83u: goto tr138;
2519 		case 88u: goto tr138;
2520 		default: break;
2521 	}
2522 	if ( (*p) < 72u ) {
2523 		if ( 48u <= (*p) && (*p) <= 57u )
2524 			goto tr137;
2525 	} else if ( (*p) > 73u ) {
2526 		if ( 77u <= (*p) && (*p) <= 78u )
2527 			goto tr138;
2528 	} else
2529 		goto tr138;
2530 	goto tr20;
2531 tr137:
2532 #line 29 "sam_alignment.rl"
2533 	{ int_value *= 10; int_value += (*p) - '0'; }
2534 	goto st98;
2535 st98:
2536 	if ( ++p == pe )
2537 		goto _test_eof98;
2538 goto case; case 98:
2539 #line 2539 "sam_alignment.d"
2540 	switch( (*p) ) {
2541 		case 61u: goto tr138;
2542 		case 68u: goto tr138;
2543 		case 80u: goto tr138;
2544 		case 83u: goto tr138;
2545 		case 88u: goto tr138;
2546 		default: break;
2547 	}
2548 	if ( (*p) < 72u ) {
2549 		if ( 48u <= (*p) && (*p) <= 57u )
2550 			goto tr139;
2551 	} else if ( (*p) > 73u ) {
2552 		if ( 77u <= (*p) && (*p) <= 78u )
2553 			goto tr138;
2554 	} else
2555 		goto tr138;
2556 	goto tr20;
2557 tr139:
2558 #line 29 "sam_alignment.rl"
2559 	{ int_value *= 10; int_value += (*p) - '0'; }
2560 	goto st99;
2561 st99:
2562 	if ( ++p == pe )
2563 		goto _test_eof99;
2564 goto case; case 99:
2565 #line 2565 "sam_alignment.d"
2566 	switch( (*p) ) {
2567 		case 61u: goto tr138;
2568 		case 68u: goto tr138;
2569 		case 80u: goto tr138;
2570 		case 83u: goto tr138;
2571 		case 88u: goto tr138;
2572 		default: break;
2573 	}
2574 	if ( (*p) < 72u ) {
2575 		if ( 48u <= (*p) && (*p) <= 57u )
2576 			goto tr140;
2577 	} else if ( (*p) > 73u ) {
2578 		if ( 77u <= (*p) && (*p) <= 78u )
2579 			goto tr138;
2580 	} else
2581 		goto tr138;
2582 	goto tr20;
2583 tr140:
2584 #line 29 "sam_alignment.rl"
2585 	{ int_value *= 10; int_value += (*p) - '0'; }
2586 	goto st100;
2587 st100:
2588 	if ( ++p == pe )
2589 		goto _test_eof100;
2590 goto case; case 100:
2591 #line 2591 "sam_alignment.d"
2592 	switch( (*p) ) {
2593 		case 61u: goto tr138;
2594 		case 68u: goto tr138;
2595 		case 80u: goto tr138;
2596 		case 83u: goto tr138;
2597 		case 88u: goto tr138;
2598 		default: break;
2599 	}
2600 	if ( (*p) < 72u ) {
2601 		if ( 48u <= (*p) && (*p) <= 57u )
2602 			goto tr141;
2603 	} else if ( (*p) > 73u ) {
2604 		if ( 77u <= (*p) && (*p) <= 78u )
2605 			goto tr138;
2606 	} else
2607 		goto tr138;
2608 	goto tr20;
2609 tr141:
2610 #line 29 "sam_alignment.rl"
2611 	{ int_value *= 10; int_value += (*p) - '0'; }
2612 	goto st101;
2613 st101:
2614 	if ( ++p == pe )
2615 		goto _test_eof101;
2616 goto case; case 101:
2617 #line 2617 "sam_alignment.d"
2618 	switch( (*p) ) {
2619 		case 61u: goto tr138;
2620 		case 68u: goto tr138;
2621 		case 80u: goto tr138;
2622 		case 83u: goto tr138;
2623 		case 88u: goto tr138;
2624 		default: break;
2625 	}
2626 	if ( (*p) < 72u ) {
2627 		if ( 48u <= (*p) && (*p) <= 57u )
2628 			goto tr142;
2629 	} else if ( (*p) > 73u ) {
2630 		if ( 77u <= (*p) && (*p) <= 78u )
2631 			goto tr138;
2632 	} else
2633 		goto tr138;
2634 	goto tr20;
2635 tr142:
2636 #line 29 "sam_alignment.rl"
2637 	{ int_value *= 10; int_value += (*p) - '0'; }
2638 	goto st102;
2639 st102:
2640 	if ( ++p == pe )
2641 		goto _test_eof102;
2642 goto case; case 102:
2643 #line 2643 "sam_alignment.d"
2644 	switch( (*p) ) {
2645 		case 61u: goto tr138;
2646 		case 68u: goto tr138;
2647 		case 80u: goto tr138;
2648 		case 83u: goto tr138;
2649 		case 88u: goto tr138;
2650 		default: break;
2651 	}
2652 	if ( (*p) < 72u ) {
2653 		if ( 48u <= (*p) && (*p) <= 57u )
2654 			goto tr143;
2655 	} else if ( (*p) > 73u ) {
2656 		if ( 77u <= (*p) && (*p) <= 78u )
2657 			goto tr138;
2658 	} else
2659 		goto tr138;
2660 	goto tr20;
2661 tr143:
2662 #line 29 "sam_alignment.rl"
2663 	{ int_value *= 10; int_value += (*p) - '0'; }
2664 	goto st103;
2665 st103:
2666 	if ( ++p == pe )
2667 		goto _test_eof103;
2668 goto case; case 103:
2669 #line 2669 "sam_alignment.d"
2670 	switch( (*p) ) {
2671 		case 61u: goto tr138;
2672 		case 68u: goto tr138;
2673 		case 80u: goto tr138;
2674 		case 83u: goto tr138;
2675 		case 88u: goto tr138;
2676 		default: break;
2677 	}
2678 	if ( (*p) < 72u ) {
2679 		if ( 48u <= (*p) && (*p) <= 57u )
2680 			goto tr144;
2681 	} else if ( (*p) > 73u ) {
2682 		if ( 77u <= (*p) && (*p) <= 78u )
2683 			goto tr138;
2684 	} else
2685 		goto tr138;
2686 	goto tr20;
2687 tr144:
2688 #line 29 "sam_alignment.rl"
2689 	{ int_value *= 10; int_value += (*p) - '0'; }
2690 	goto st104;
2691 st104:
2692 	if ( ++p == pe )
2693 		goto _test_eof104;
2694 goto case; case 104:
2695 #line 2695 "sam_alignment.d"
2696 	switch( (*p) ) {
2697 		case 61u: goto tr138;
2698 		case 68u: goto tr138;
2699 		case 80u: goto tr138;
2700 		case 83u: goto tr138;
2701 		case 88u: goto tr138;
2702 		default: break;
2703 	}
2704 	if ( (*p) < 72u ) {
2705 		if ( 48u <= (*p) && (*p) <= 57u )
2706 			goto tr145;
2707 	} else if ( (*p) > 73u ) {
2708 		if ( 77u <= (*p) && (*p) <= 78u )
2709 			goto tr138;
2710 	} else
2711 		goto tr138;
2712 	goto tr20;
2713 tr145:
2714 #line 29 "sam_alignment.rl"
2715 	{ int_value *= 10; int_value += (*p) - '0'; }
2716 	goto st105;
2717 st105:
2718 	if ( ++p == pe )
2719 		goto _test_eof105;
2720 goto case; case 105:
2721 #line 2721 "sam_alignment.d"
2722 	switch( (*p) ) {
2723 		case 61u: goto tr138;
2724 		case 68u: goto tr138;
2725 		case 80u: goto tr138;
2726 		case 83u: goto tr138;
2727 		case 88u: goto tr138;
2728 		default: break;
2729 	}
2730 	if ( (*p) < 72u ) {
2731 		if ( 48u <= (*p) && (*p) <= 57u )
2732 			goto tr146;
2733 	} else if ( (*p) > 73u ) {
2734 		if ( 77u <= (*p) && (*p) <= 78u )
2735 			goto tr138;
2736 	} else
2737 		goto tr138;
2738 	goto tr20;
2739 tr146:
2740 #line 29 "sam_alignment.rl"
2741 	{ int_value *= 10; int_value += (*p) - '0'; }
2742 	goto st106;
2743 st106:
2744 	if ( ++p == pe )
2745 		goto _test_eof106;
2746 goto case; case 106:
2747 #line 2747 "sam_alignment.d"
2748 	switch( (*p) ) {
2749 		case 61u: goto tr138;
2750 		case 68u: goto tr138;
2751 		case 80u: goto tr138;
2752 		case 83u: goto tr138;
2753 		case 88u: goto tr138;
2754 		default: break;
2755 	}
2756 	if ( (*p) < 72u ) {
2757 		if ( 48u <= (*p) && (*p) <= 57u )
2758 			goto tr147;
2759 	} else if ( (*p) > 73u ) {
2760 		if ( 77u <= (*p) && (*p) <= 78u )
2761 			goto tr138;
2762 	} else
2763 		goto tr138;
2764 	goto tr20;
2765 tr147:
2766 #line 29 "sam_alignment.rl"
2767 	{ int_value *= 10; int_value += (*p) - '0'; }
2768 	goto st107;
2769 st107:
2770 	if ( ++p == pe )
2771 		goto _test_eof107;
2772 goto case; case 107:
2773 #line 2773 "sam_alignment.d"
2774 	switch( (*p) ) {
2775 		case 61u: goto tr138;
2776 		case 68u: goto tr138;
2777 		case 80u: goto tr138;
2778 		case 83u: goto tr138;
2779 		case 88u: goto tr138;
2780 		default: break;
2781 	}
2782 	if ( (*p) < 72u ) {
2783 		if ( 48u <= (*p) && (*p) <= 57u )
2784 			goto tr148;
2785 	} else if ( (*p) > 73u ) {
2786 		if ( 77u <= (*p) && (*p) <= 78u )
2787 			goto tr138;
2788 	} else
2789 		goto tr138;
2790 	goto tr20;
2791 tr148:
2792 #line 29 "sam_alignment.rl"
2793 	{ int_value *= 10; int_value += (*p) - '0'; }
2794 	goto st108;
2795 st108:
2796 	if ( ++p == pe )
2797 		goto _test_eof108;
2798 goto case; case 108:
2799 #line 2799 "sam_alignment.d"
2800 	switch( (*p) ) {
2801 		case 61u: goto tr138;
2802 		case 68u: goto tr138;
2803 		case 80u: goto tr138;
2804 		case 83u: goto tr138;
2805 		case 88u: goto tr138;
2806 		default: break;
2807 	}
2808 	if ( (*p) < 72u ) {
2809 		if ( 48u <= (*p) && (*p) <= 57u )
2810 			goto tr149;
2811 	} else if ( (*p) > 73u ) {
2812 		if ( 77u <= (*p) && (*p) <= 78u )
2813 			goto tr138;
2814 	} else
2815 		goto tr138;
2816 	goto tr20;
2817 tr149:
2818 #line 29 "sam_alignment.rl"
2819 	{ int_value *= 10; int_value += (*p) - '0'; }
2820 	goto st109;
2821 st109:
2822 	if ( ++p == pe )
2823 		goto _test_eof109;
2824 goto case; case 109:
2825 #line 2825 "sam_alignment.d"
2826 	switch( (*p) ) {
2827 		case 61u: goto tr138;
2828 		case 68u: goto tr138;
2829 		case 80u: goto tr138;
2830 		case 83u: goto tr138;
2831 		case 88u: goto tr138;
2832 		default: break;
2833 	}
2834 	if ( (*p) < 72u ) {
2835 		if ( 48u <= (*p) && (*p) <= 57u )
2836 			goto tr150;
2837 	} else if ( (*p) > 73u ) {
2838 		if ( 77u <= (*p) && (*p) <= 78u )
2839 			goto tr138;
2840 	} else
2841 		goto tr138;
2842 	goto tr20;
2843 tr150:
2844 #line 29 "sam_alignment.rl"
2845 	{ int_value *= 10; int_value += (*p) - '0'; }
2846 	goto st110;
2847 st110:
2848 	if ( ++p == pe )
2849 		goto _test_eof110;
2850 goto case; case 110:
2851 #line 2851 "sam_alignment.d"
2852 	switch( (*p) ) {
2853 		case 61u: goto tr138;
2854 		case 68u: goto tr138;
2855 		case 80u: goto tr138;
2856 		case 83u: goto tr138;
2857 		case 88u: goto tr138;
2858 		default: break;
2859 	}
2860 	if ( (*p) < 72u ) {
2861 		if ( 48u <= (*p) && (*p) <= 57u )
2862 			goto tr151;
2863 	} else if ( (*p) > 73u ) {
2864 		if ( 77u <= (*p) && (*p) <= 78u )
2865 			goto tr138;
2866 	} else
2867 		goto tr138;
2868 	goto tr20;
2869 tr151:
2870 #line 29 "sam_alignment.rl"
2871 	{ int_value *= 10; int_value += (*p) - '0'; }
2872 	goto st111;
2873 st111:
2874 	if ( ++p == pe )
2875 		goto _test_eof111;
2876 goto case; case 111:
2877 #line 2877 "sam_alignment.d"
2878 	switch( (*p) ) {
2879 		case 61u: goto tr138;
2880 		case 68u: goto tr138;
2881 		case 80u: goto tr138;
2882 		case 83u: goto tr138;
2883 		case 88u: goto tr138;
2884 		default: break;
2885 	}
2886 	if ( (*p) < 72u ) {
2887 		if ( 48u <= (*p) && (*p) <= 57u )
2888 			goto tr152;
2889 	} else if ( (*p) > 73u ) {
2890 		if ( 77u <= (*p) && (*p) <= 78u )
2891 			goto tr138;
2892 	} else
2893 		goto tr138;
2894 	goto tr20;
2895 tr152:
2896 #line 29 "sam_alignment.rl"
2897 	{ int_value *= 10; int_value += (*p) - '0'; }
2898 	goto st112;
2899 st112:
2900 	if ( ++p == pe )
2901 		goto _test_eof112;
2902 goto case; case 112:
2903 #line 2903 "sam_alignment.d"
2904 	switch( (*p) ) {
2905 		case 61u: goto tr138;
2906 		case 68u: goto tr138;
2907 		case 80u: goto tr138;
2908 		case 83u: goto tr138;
2909 		case 88u: goto tr138;
2910 		default: break;
2911 	}
2912 	if ( (*p) < 72u ) {
2913 		if ( 48u <= (*p) && (*p) <= 57u )
2914 			goto tr153;
2915 	} else if ( (*p) > 73u ) {
2916 		if ( 77u <= (*p) && (*p) <= 78u )
2917 			goto tr138;
2918 	} else
2919 		goto tr138;
2920 	goto tr20;
2921 tr153:
2922 #line 29 "sam_alignment.rl"
2923 	{ int_value *= 10; int_value += (*p) - '0'; }
2924 	goto st113;
2925 st113:
2926 	if ( ++p == pe )
2927 		goto _test_eof113;
2928 goto case; case 113:
2929 #line 2929 "sam_alignment.d"
2930 	switch( (*p) ) {
2931 		case 61u: goto tr138;
2932 		case 68u: goto tr138;
2933 		case 80u: goto tr138;
2934 		case 83u: goto tr138;
2935 		case 88u: goto tr138;
2936 		default: break;
2937 	}
2938 	if ( (*p) < 72u ) {
2939 		if ( 48u <= (*p) && (*p) <= 57u )
2940 			goto tr154;
2941 	} else if ( (*p) > 73u ) {
2942 		if ( 77u <= (*p) && (*p) <= 78u )
2943 			goto tr138;
2944 	} else
2945 		goto tr138;
2946 	goto tr20;
2947 tr154:
2948 #line 29 "sam_alignment.rl"
2949 	{ int_value *= 10; int_value += (*p) - '0'; }
2950 	goto st114;
2951 st114:
2952 	if ( ++p == pe )
2953 		goto _test_eof114;
2954 goto case; case 114:
2955 #line 2955 "sam_alignment.d"
2956 	switch( (*p) ) {
2957 		case 61u: goto tr138;
2958 		case 68u: goto tr138;
2959 		case 80u: goto tr138;
2960 		case 83u: goto tr138;
2961 		case 88u: goto tr138;
2962 		default: break;
2963 	}
2964 	if ( (*p) > 73u ) {
2965 		if ( 77u <= (*p) && (*p) <= 78u )
2966 			goto tr138;
2967 	} else if ( (*p) >= 72u )
2968 		goto tr138;
2969 	goto tr20;
2970 tr138:
2971 #line 111 "sam_alignment.rl"
2972 	{ cigar_op_len = to!uint(int_value); }
2973 #line 112 "sam_alignment.rl"
2974 	{ cigar_op_chr = (*p); }
2975 	goto st115;
2976 st115:
2977 	if ( ++p == pe )
2978 		goto _test_eof115;
2979 goto case; case 115:
2980 #line 2980 "sam_alignment.d"
2981 	if ( (*p) == 9u )
2982 		goto tr155;
2983 	if ( 48u <= (*p) && (*p) <= 57u )
2984 		goto tr156;
2985 	goto tr20;
2986 tr19:
2987 #line 29 "sam_alignment.rl"
2988 	{ int_value *= 10; int_value += (*p) - '0'; }
2989 	goto st116;
2990 st116:
2991 	if ( ++p == pe )
2992 		goto _test_eof116;
2993 goto case; case 116:
2994 #line 2994 "sam_alignment.d"
2995 	if ( (*p) == 9u )
2996 		goto tr18;
2997 	if ( 48u <= (*p) && (*p) <= 57u )
2998 		goto tr157;
2999 	goto tr16;
3000 tr157:
3001 #line 29 "sam_alignment.rl"
3002 	{ int_value *= 10; int_value += (*p) - '0'; }
3003 	goto st117;
3004 st117:
3005 	if ( ++p == pe )
3006 		goto _test_eof117;
3007 goto case; case 117:
3008 #line 3008 "sam_alignment.d"
3009 	if ( (*p) == 9u )
3010 		goto tr18;
3011 	if ( 48u <= (*p) && (*p) <= 57u )
3012 		goto tr158;
3013 	goto tr16;
3014 tr158:
3015 #line 29 "sam_alignment.rl"
3016 	{ int_value *= 10; int_value += (*p) - '0'; }
3017 	goto st118;
3018 st118:
3019 	if ( ++p == pe )
3020 		goto _test_eof118;
3021 goto case; case 118:
3022 #line 3022 "sam_alignment.d"
3023 	if ( (*p) == 9u )
3024 		goto tr18;
3025 	if ( 48u <= (*p) && (*p) <= 57u )
3026 		goto tr159;
3027 	goto tr16;
3028 tr159:
3029 #line 29 "sam_alignment.rl"
3030 	{ int_value *= 10; int_value += (*p) - '0'; }
3031 	goto st119;
3032 st119:
3033 	if ( ++p == pe )
3034 		goto _test_eof119;
3035 goto case; case 119:
3036 #line 3036 "sam_alignment.d"
3037 	if ( (*p) == 9u )
3038 		goto tr18;
3039 	if ( 48u <= (*p) && (*p) <= 57u )
3040 		goto tr160;
3041 	goto tr16;
3042 tr160:
3043 #line 29 "sam_alignment.rl"
3044 	{ int_value *= 10; int_value += (*p) - '0'; }
3045 	goto st120;
3046 st120:
3047 	if ( ++p == pe )
3048 		goto _test_eof120;
3049 goto case; case 120:
3050 #line 3050 "sam_alignment.d"
3051 	if ( (*p) == 9u )
3052 		goto tr18;
3053 	if ( 48u <= (*p) && (*p) <= 57u )
3054 		goto tr161;
3055 	goto tr16;
3056 tr161:
3057 #line 29 "sam_alignment.rl"
3058 	{ int_value *= 10; int_value += (*p) - '0'; }
3059 	goto st121;
3060 st121:
3061 	if ( ++p == pe )
3062 		goto _test_eof121;
3063 goto case; case 121:
3064 #line 3064 "sam_alignment.d"
3065 	if ( (*p) == 9u )
3066 		goto tr18;
3067 	if ( 48u <= (*p) && (*p) <= 57u )
3068 		goto tr162;
3069 	goto tr16;
3070 tr162:
3071 #line 29 "sam_alignment.rl"
3072 	{ int_value *= 10; int_value += (*p) - '0'; }
3073 	goto st122;
3074 st122:
3075 	if ( ++p == pe )
3076 		goto _test_eof122;
3077 goto case; case 122:
3078 #line 3078 "sam_alignment.d"
3079 	if ( (*p) == 9u )
3080 		goto tr18;
3081 	if ( 48u <= (*p) && (*p) <= 57u )
3082 		goto tr163;
3083 	goto tr16;
3084 tr163:
3085 #line 29 "sam_alignment.rl"
3086 	{ int_value *= 10; int_value += (*p) - '0'; }
3087 	goto st123;
3088 st123:
3089 	if ( ++p == pe )
3090 		goto _test_eof123;
3091 goto case; case 123:
3092 #line 3092 "sam_alignment.d"
3093 	if ( (*p) == 9u )
3094 		goto tr18;
3095 	if ( 48u <= (*p) && (*p) <= 57u )
3096 		goto tr164;
3097 	goto tr16;
3098 tr164:
3099 #line 29 "sam_alignment.rl"
3100 	{ int_value *= 10; int_value += (*p) - '0'; }
3101 	goto st124;
3102 st124:
3103 	if ( ++p == pe )
3104 		goto _test_eof124;
3105 goto case; case 124:
3106 #line 3106 "sam_alignment.d"
3107 	if ( (*p) == 9u )
3108 		goto tr18;
3109 	if ( 48u <= (*p) && (*p) <= 57u )
3110 		goto tr165;
3111 	goto tr16;
3112 tr165:
3113 #line 29 "sam_alignment.rl"
3114 	{ int_value *= 10; int_value += (*p) - '0'; }
3115 	goto st125;
3116 st125:
3117 	if ( ++p == pe )
3118 		goto _test_eof125;
3119 goto case; case 125:
3120 #line 3120 "sam_alignment.d"
3121 	if ( (*p) == 9u )
3122 		goto tr18;
3123 	if ( 48u <= (*p) && (*p) <= 57u )
3124 		goto tr166;
3125 	goto tr16;
3126 tr166:
3127 #line 29 "sam_alignment.rl"
3128 	{ int_value *= 10; int_value += (*p) - '0'; }
3129 	goto st126;
3130 st126:
3131 	if ( ++p == pe )
3132 		goto _test_eof126;
3133 goto case; case 126:
3134 #line 3134 "sam_alignment.d"
3135 	if ( (*p) == 9u )
3136 		goto tr18;
3137 	if ( 48u <= (*p) && (*p) <= 57u )
3138 		goto tr167;
3139 	goto tr16;
3140 tr167:
3141 #line 29 "sam_alignment.rl"
3142 	{ int_value *= 10; int_value += (*p) - '0'; }
3143 	goto st127;
3144 st127:
3145 	if ( ++p == pe )
3146 		goto _test_eof127;
3147 goto case; case 127:
3148 #line 3148 "sam_alignment.d"
3149 	if ( (*p) == 9u )
3150 		goto tr18;
3151 	if ( 48u <= (*p) && (*p) <= 57u )
3152 		goto tr168;
3153 	goto tr16;
3154 tr168:
3155 #line 29 "sam_alignment.rl"
3156 	{ int_value *= 10; int_value += (*p) - '0'; }
3157 	goto st128;
3158 st128:
3159 	if ( ++p == pe )
3160 		goto _test_eof128;
3161 goto case; case 128:
3162 #line 3162 "sam_alignment.d"
3163 	if ( (*p) == 9u )
3164 		goto tr18;
3165 	if ( 48u <= (*p) && (*p) <= 57u )
3166 		goto tr169;
3167 	goto tr16;
3168 tr169:
3169 #line 29 "sam_alignment.rl"
3170 	{ int_value *= 10; int_value += (*p) - '0'; }
3171 	goto st129;
3172 st129:
3173 	if ( ++p == pe )
3174 		goto _test_eof129;
3175 goto case; case 129:
3176 #line 3176 "sam_alignment.d"
3177 	if ( (*p) == 9u )
3178 		goto tr18;
3179 	if ( 48u <= (*p) && (*p) <= 57u )
3180 		goto tr170;
3181 	goto tr16;
3182 tr170:
3183 #line 29 "sam_alignment.rl"
3184 	{ int_value *= 10; int_value += (*p) - '0'; }
3185 	goto st130;
3186 st130:
3187 	if ( ++p == pe )
3188 		goto _test_eof130;
3189 goto case; case 130:
3190 #line 3190 "sam_alignment.d"
3191 	if ( (*p) == 9u )
3192 		goto tr18;
3193 	if ( 48u <= (*p) && (*p) <= 57u )
3194 		goto tr171;
3195 	goto tr16;
3196 tr171:
3197 #line 29 "sam_alignment.rl"
3198 	{ int_value *= 10; int_value += (*p) - '0'; }
3199 	goto st131;
3200 st131:
3201 	if ( ++p == pe )
3202 		goto _test_eof131;
3203 goto case; case 131:
3204 #line 3204 "sam_alignment.d"
3205 	if ( (*p) == 9u )
3206 		goto tr18;
3207 	if ( 48u <= (*p) && (*p) <= 57u )
3208 		goto tr172;
3209 	goto tr16;
3210 tr172:
3211 #line 29 "sam_alignment.rl"
3212 	{ int_value *= 10; int_value += (*p) - '0'; }
3213 	goto st132;
3214 st132:
3215 	if ( ++p == pe )
3216 		goto _test_eof132;
3217 goto case; case 132:
3218 #line 3218 "sam_alignment.d"
3219 	if ( (*p) == 9u )
3220 		goto tr18;
3221 	goto tr16;
3222 tr15:
3223 #line 29 "sam_alignment.rl"
3224 	{ int_value *= 10; int_value += (*p) - '0'; }
3225 	goto st133;
3226 st133:
3227 	if ( ++p == pe )
3228 		goto _test_eof133;
3229 goto case; case 133:
3230 #line 3230 "sam_alignment.d"
3231 	if ( (*p) == 9u )
3232 		goto tr14;
3233 	if ( 48u <= (*p) && (*p) <= 57u )
3234 		goto tr173;
3235 	goto tr12;
3236 tr173:
3237 #line 29 "sam_alignment.rl"
3238 	{ int_value *= 10; int_value += (*p) - '0'; }
3239 	goto st134;
3240 st134:
3241 	if ( ++p == pe )
3242 		goto _test_eof134;
3243 goto case; case 134:
3244 #line 3244 "sam_alignment.d"
3245 	if ( (*p) == 9u )
3246 		goto tr14;
3247 	if ( 48u <= (*p) && (*p) <= 57u )
3248 		goto tr174;
3249 	goto tr12;
3250 tr174:
3251 #line 29 "sam_alignment.rl"
3252 	{ int_value *= 10; int_value += (*p) - '0'; }
3253 	goto st135;
3254 st135:
3255 	if ( ++p == pe )
3256 		goto _test_eof135;
3257 goto case; case 135:
3258 #line 3258 "sam_alignment.d"
3259 	if ( (*p) == 9u )
3260 		goto tr14;
3261 	if ( 48u <= (*p) && (*p) <= 57u )
3262 		goto tr175;
3263 	goto tr12;
3264 tr175:
3265 #line 29 "sam_alignment.rl"
3266 	{ int_value *= 10; int_value += (*p) - '0'; }
3267 	goto st136;
3268 st136:
3269 	if ( ++p == pe )
3270 		goto _test_eof136;
3271 goto case; case 136:
3272 #line 3272 "sam_alignment.d"
3273 	if ( (*p) == 9u )
3274 		goto tr14;
3275 	if ( 48u <= (*p) && (*p) <= 57u )
3276 		goto tr176;
3277 	goto tr12;
3278 tr176:
3279 #line 29 "sam_alignment.rl"
3280 	{ int_value *= 10; int_value += (*p) - '0'; }
3281 	goto st137;
3282 st137:
3283 	if ( ++p == pe )
3284 		goto _test_eof137;
3285 goto case; case 137:
3286 #line 3286 "sam_alignment.d"
3287 	if ( (*p) == 9u )
3288 		goto tr14;
3289 	if ( 48u <= (*p) && (*p) <= 57u )
3290 		goto tr177;
3291 	goto tr12;
3292 tr177:
3293 #line 29 "sam_alignment.rl"
3294 	{ int_value *= 10; int_value += (*p) - '0'; }
3295 	goto st138;
3296 st138:
3297 	if ( ++p == pe )
3298 		goto _test_eof138;
3299 goto case; case 138:
3300 #line 3300 "sam_alignment.d"
3301 	if ( (*p) == 9u )
3302 		goto tr14;
3303 	if ( 48u <= (*p) && (*p) <= 57u )
3304 		goto tr178;
3305 	goto tr12;
3306 tr178:
3307 #line 29 "sam_alignment.rl"
3308 	{ int_value *= 10; int_value += (*p) - '0'; }
3309 	goto st139;
3310 st139:
3311 	if ( ++p == pe )
3312 		goto _test_eof139;
3313 goto case; case 139:
3314 #line 3314 "sam_alignment.d"
3315 	if ( (*p) == 9u )
3316 		goto tr14;
3317 	if ( 48u <= (*p) && (*p) <= 57u )
3318 		goto tr179;
3319 	goto tr12;
3320 tr179:
3321 #line 29 "sam_alignment.rl"
3322 	{ int_value *= 10; int_value += (*p) - '0'; }
3323 	goto st140;
3324 st140:
3325 	if ( ++p == pe )
3326 		goto _test_eof140;
3327 goto case; case 140:
3328 #line 3328 "sam_alignment.d"
3329 	if ( (*p) == 9u )
3330 		goto tr14;
3331 	if ( 48u <= (*p) && (*p) <= 57u )
3332 		goto tr180;
3333 	goto tr12;
3334 tr180:
3335 #line 29 "sam_alignment.rl"
3336 	{ int_value *= 10; int_value += (*p) - '0'; }
3337 	goto st141;
3338 st141:
3339 	if ( ++p == pe )
3340 		goto _test_eof141;
3341 goto case; case 141:
3342 #line 3342 "sam_alignment.d"
3343 	if ( (*p) == 9u )
3344 		goto tr14;
3345 	if ( 48u <= (*p) && (*p) <= 57u )
3346 		goto tr181;
3347 	goto tr12;
3348 tr181:
3349 #line 29 "sam_alignment.rl"
3350 	{ int_value *= 10; int_value += (*p) - '0'; }
3351 	goto st142;
3352 st142:
3353 	if ( ++p == pe )
3354 		goto _test_eof142;
3355 goto case; case 142:
3356 #line 3356 "sam_alignment.d"
3357 	if ( (*p) == 9u )
3358 		goto tr14;
3359 	if ( 48u <= (*p) && (*p) <= 57u )
3360 		goto tr182;
3361 	goto tr12;
3362 tr182:
3363 #line 29 "sam_alignment.rl"
3364 	{ int_value *= 10; int_value += (*p) - '0'; }
3365 	goto st143;
3366 st143:
3367 	if ( ++p == pe )
3368 		goto _test_eof143;
3369 goto case; case 143:
3370 #line 3370 "sam_alignment.d"
3371 	if ( (*p) == 9u )
3372 		goto tr14;
3373 	if ( 48u <= (*p) && (*p) <= 57u )
3374 		goto tr183;
3375 	goto tr12;
3376 tr183:
3377 #line 29 "sam_alignment.rl"
3378 	{ int_value *= 10; int_value += (*p) - '0'; }
3379 	goto st144;
3380 st144:
3381 	if ( ++p == pe )
3382 		goto _test_eof144;
3383 goto case; case 144:
3384 #line 3384 "sam_alignment.d"
3385 	if ( (*p) == 9u )
3386 		goto tr14;
3387 	if ( 48u <= (*p) && (*p) <= 57u )
3388 		goto tr184;
3389 	goto tr12;
3390 tr184:
3391 #line 29 "sam_alignment.rl"
3392 	{ int_value *= 10; int_value += (*p) - '0'; }
3393 	goto st145;
3394 st145:
3395 	if ( ++p == pe )
3396 		goto _test_eof145;
3397 goto case; case 145:
3398 #line 3398 "sam_alignment.d"
3399 	if ( (*p) == 9u )
3400 		goto tr14;
3401 	if ( 48u <= (*p) && (*p) <= 57u )
3402 		goto tr185;
3403 	goto tr12;
3404 tr185:
3405 #line 29 "sam_alignment.rl"
3406 	{ int_value *= 10; int_value += (*p) - '0'; }
3407 	goto st146;
3408 st146:
3409 	if ( ++p == pe )
3410 		goto _test_eof146;
3411 goto case; case 146:
3412 #line 3412 "sam_alignment.d"
3413 	if ( (*p) == 9u )
3414 		goto tr14;
3415 	if ( 48u <= (*p) && (*p) <= 57u )
3416 		goto tr186;
3417 	goto tr12;
3418 tr186:
3419 #line 29 "sam_alignment.rl"
3420 	{ int_value *= 10; int_value += (*p) - '0'; }
3421 	goto st147;
3422 st147:
3423 	if ( ++p == pe )
3424 		goto _test_eof147;
3425 goto case; case 147:
3426 #line 3426 "sam_alignment.d"
3427 	if ( (*p) == 9u )
3428 		goto tr14;
3429 	if ( 48u <= (*p) && (*p) <= 57u )
3430 		goto tr187;
3431 	goto tr12;
3432 tr187:
3433 #line 29 "sam_alignment.rl"
3434 	{ int_value *= 10; int_value += (*p) - '0'; }
3435 	goto st148;
3436 st148:
3437 	if ( ++p == pe )
3438 		goto _test_eof148;
3439 goto case; case 148:
3440 #line 3440 "sam_alignment.d"
3441 	if ( (*p) == 9u )
3442 		goto tr14;
3443 	if ( 48u <= (*p) && (*p) <= 57u )
3444 		goto tr188;
3445 	goto tr12;
3446 tr188:
3447 #line 29 "sam_alignment.rl"
3448 	{ int_value *= 10; int_value += (*p) - '0'; }
3449 	goto st149;
3450 st149:
3451 	if ( ++p == pe )
3452 		goto _test_eof149;
3453 goto case; case 149:
3454 #line 3454 "sam_alignment.d"
3455 	if ( (*p) == 9u )
3456 		goto tr14;
3457 	goto tr12;
3458 st150:
3459 	if ( ++p == pe )
3460 		goto _test_eof150;
3461 goto case; case 150:
3462 	if ( (*p) == 9u )
3463 		goto st6;
3464 	goto tr7;
3465 tr6:
3466 #line 29 "sam_alignment.rl"
3467 	{ int_value *= 10; int_value += (*p) - '0'; }
3468 	goto st151;
3469 st151:
3470 	if ( ++p == pe )
3471 		goto _test_eof151;
3472 goto case; case 151:
3473 #line 3473 "sam_alignment.d"
3474 	if ( (*p) == 9u )
3475 		goto tr5;
3476 	if ( 48u <= (*p) && (*p) <= 57u )
3477 		goto tr190;
3478 	goto tr3;
3479 tr190:
3480 #line 29 "sam_alignment.rl"
3481 	{ int_value *= 10; int_value += (*p) - '0'; }
3482 	goto st152;
3483 st152:
3484 	if ( ++p == pe )
3485 		goto _test_eof152;
3486 goto case; case 152:
3487 #line 3487 "sam_alignment.d"
3488 	if ( (*p) == 9u )
3489 		goto tr5;
3490 	if ( 48u <= (*p) && (*p) <= 57u )
3491 		goto tr191;
3492 	goto tr3;
3493 tr191:
3494 #line 29 "sam_alignment.rl"
3495 	{ int_value *= 10; int_value += (*p) - '0'; }
3496 	goto st153;
3497 st153:
3498 	if ( ++p == pe )
3499 		goto _test_eof153;
3500 goto case; case 153:
3501 #line 3501 "sam_alignment.d"
3502 	if ( (*p) == 9u )
3503 		goto tr5;
3504 	if ( 48u <= (*p) && (*p) <= 57u )
3505 		goto tr192;
3506 	goto tr3;
3507 tr192:
3508 #line 29 "sam_alignment.rl"
3509 	{ int_value *= 10; int_value += (*p) - '0'; }
3510 	goto st154;
3511 st154:
3512 	if ( ++p == pe )
3513 		goto _test_eof154;
3514 goto case; case 154:
3515 #line 3515 "sam_alignment.d"
3516 	if ( (*p) == 9u )
3517 		goto tr5;
3518 	if ( 48u <= (*p) && (*p) <= 57u )
3519 		goto tr193;
3520 	goto tr3;
3521 tr193:
3522 #line 29 "sam_alignment.rl"
3523 	{ int_value *= 10; int_value += (*p) - '0'; }
3524 	goto st155;
3525 st155:
3526 	if ( ++p == pe )
3527 		goto _test_eof155;
3528 goto case; case 155:
3529 #line 3529 "sam_alignment.d"
3530 	if ( (*p) == 9u )
3531 		goto tr5;
3532 	if ( 48u <= (*p) && (*p) <= 57u )
3533 		goto tr194;
3534 	goto tr3;
3535 tr194:
3536 #line 29 "sam_alignment.rl"
3537 	{ int_value *= 10; int_value += (*p) - '0'; }
3538 	goto st156;
3539 st156:
3540 	if ( ++p == pe )
3541 		goto _test_eof156;
3542 goto case; case 156:
3543 #line 3543 "sam_alignment.d"
3544 	if ( (*p) == 9u )
3545 		goto tr5;
3546 	if ( 48u <= (*p) && (*p) <= 57u )
3547 		goto tr195;
3548 	goto tr3;
3549 tr195:
3550 #line 29 "sam_alignment.rl"
3551 	{ int_value *= 10; int_value += (*p) - '0'; }
3552 	goto st157;
3553 st157:
3554 	if ( ++p == pe )
3555 		goto _test_eof157;
3556 goto case; case 157:
3557 #line 3557 "sam_alignment.d"
3558 	if ( (*p) == 9u )
3559 		goto tr5;
3560 	if ( 48u <= (*p) && (*p) <= 57u )
3561 		goto tr196;
3562 	goto tr3;
3563 tr196:
3564 #line 29 "sam_alignment.rl"
3565 	{ int_value *= 10; int_value += (*p) - '0'; }
3566 	goto st158;
3567 st158:
3568 	if ( ++p == pe )
3569 		goto _test_eof158;
3570 goto case; case 158:
3571 #line 3571 "sam_alignment.d"
3572 	if ( (*p) == 9u )
3573 		goto tr5;
3574 	if ( 48u <= (*p) && (*p) <= 57u )
3575 		goto tr197;
3576 	goto tr3;
3577 tr197:
3578 #line 29 "sam_alignment.rl"
3579 	{ int_value *= 10; int_value += (*p) - '0'; }
3580 	goto st159;
3581 st159:
3582 	if ( ++p == pe )
3583 		goto _test_eof159;
3584 goto case; case 159:
3585 #line 3585 "sam_alignment.d"
3586 	if ( (*p) == 9u )
3587 		goto tr5;
3588 	if ( 48u <= (*p) && (*p) <= 57u )
3589 		goto tr198;
3590 	goto tr3;
3591 tr198:
3592 #line 29 "sam_alignment.rl"
3593 	{ int_value *= 10; int_value += (*p) - '0'; }
3594 	goto st160;
3595 st160:
3596 	if ( ++p == pe )
3597 		goto _test_eof160;
3598 goto case; case 160:
3599 #line 3599 "sam_alignment.d"
3600 	if ( (*p) == 9u )
3601 		goto tr5;
3602 	if ( 48u <= (*p) && (*p) <= 57u )
3603 		goto tr199;
3604 	goto tr3;
3605 tr199:
3606 #line 29 "sam_alignment.rl"
3607 	{ int_value *= 10; int_value += (*p) - '0'; }
3608 	goto st161;
3609 st161:
3610 	if ( ++p == pe )
3611 		goto _test_eof161;
3612 goto case; case 161:
3613 #line 3613 "sam_alignment.d"
3614 	if ( (*p) == 9u )
3615 		goto tr5;
3616 	if ( 48u <= (*p) && (*p) <= 57u )
3617 		goto tr200;
3618 	goto tr3;
3619 tr200:
3620 #line 29 "sam_alignment.rl"
3621 	{ int_value *= 10; int_value += (*p) - '0'; }
3622 	goto st162;
3623 st162:
3624 	if ( ++p == pe )
3625 		goto _test_eof162;
3626 goto case; case 162:
3627 #line 3627 "sam_alignment.d"
3628 	if ( (*p) == 9u )
3629 		goto tr5;
3630 	if ( 48u <= (*p) && (*p) <= 57u )
3631 		goto tr201;
3632 	goto tr3;
3633 tr201:
3634 #line 29 "sam_alignment.rl"
3635 	{ int_value *= 10; int_value += (*p) - '0'; }
3636 	goto st163;
3637 st163:
3638 	if ( ++p == pe )
3639 		goto _test_eof163;
3640 goto case; case 163:
3641 #line 3641 "sam_alignment.d"
3642 	if ( (*p) == 9u )
3643 		goto tr5;
3644 	if ( 48u <= (*p) && (*p) <= 57u )
3645 		goto tr202;
3646 	goto tr3;
3647 tr202:
3648 #line 29 "sam_alignment.rl"
3649 	{ int_value *= 10; int_value += (*p) - '0'; }
3650 	goto st164;
3651 st164:
3652 	if ( ++p == pe )
3653 		goto _test_eof164;
3654 goto case; case 164:
3655 #line 3655 "sam_alignment.d"
3656 	if ( (*p) == 9u )
3657 		goto tr5;
3658 	if ( 48u <= (*p) && (*p) <= 57u )
3659 		goto tr203;
3660 	goto tr3;
3661 tr203:
3662 #line 29 "sam_alignment.rl"
3663 	{ int_value *= 10; int_value += (*p) - '0'; }
3664 	goto st165;
3665 st165:
3666 	if ( ++p == pe )
3667 		goto _test_eof165;
3668 goto case; case 165:
3669 #line 3669 "sam_alignment.d"
3670 	if ( (*p) == 9u )
3671 		goto tr5;
3672 	if ( 48u <= (*p) && (*p) <= 57u )
3673 		goto tr204;
3674 	goto tr3;
3675 tr204:
3676 #line 29 "sam_alignment.rl"
3677 	{ int_value *= 10; int_value += (*p) - '0'; }
3678 	goto st166;
3679 st166:
3680 	if ( ++p == pe )
3681 		goto _test_eof166;
3682 goto case; case 166:
3683 #line 3683 "sam_alignment.d"
3684 	if ( (*p) == 9u )
3685 		goto tr5;
3686 	if ( 48u <= (*p) && (*p) <= 57u )
3687 		goto tr205;
3688 	goto tr3;
3689 tr205:
3690 #line 29 "sam_alignment.rl"
3691 	{ int_value *= 10; int_value += (*p) - '0'; }
3692 	goto st167;
3693 st167:
3694 	if ( ++p == pe )
3695 		goto _test_eof167;
3696 goto case; case 167:
3697 #line 3697 "sam_alignment.d"
3698 	if ( (*p) == 9u )
3699 		goto tr5;
3700 	goto tr3;
3701 tr2:
3702 #line 48 "sam_alignment.rl"
3703 	{ read_name_beg = p - line.ptr; }
3704 	goto st168;
3705 st168:
3706 	if ( ++p == pe )
3707 		goto _test_eof168;
3708 goto case; case 168:
3709 #line 3709 "sam_alignment.d"
3710 	if ( (*p) == 9u )
3711 		goto tr206;
3712 	if ( (*p) > 63u ) {
3713 		if ( 65u <= (*p) && (*p) <= 126u )
3714 			goto st168;
3715 	} else if ( (*p) >= 33u )
3716 		goto st168;
3717 	goto tr0;
3718 st169:
3719 	if ( ++p == pe )
3720 		goto _test_eof169;
3721 goto case; case 169:
3722 	if ( (*p) == 9u )
3723 		goto tr209;
3724 	goto st169;
3725 tr209:
3726 #line 51 "sam_alignment.rl"
3727 	{ p--; {if (true) goto st181;} }
3728 	goto st239;
3729 st239:
3730 	if ( ++p == pe )
3731 		goto _test_eof239;
3732 goto case; case 239:
3733 #line 3733 "sam_alignment.d"
3734 	goto st0;
3735 st170:
3736 	if ( ++p == pe )
3737 		goto _test_eof170;
3738 goto case; case 170:
3739 	if ( (*p) == 9u )
3740 		goto tr211;
3741 	goto st170;
3742 tr211:
3743 #line 59 "sam_alignment.rl"
3744 	{ p--; {if (true) goto st182;} }
3745 	goto st240;
3746 st240:
3747 	if ( ++p == pe )
3748 		goto _test_eof240;
3749 goto case; case 240:
3750 #line 3750 "sam_alignment.d"
3751 	goto st0;
3752 st171:
3753 	if ( ++p == pe )
3754 		goto _test_eof171;
3755 goto case; case 171:
3756 	if ( (*p) == 9u )
3757 		goto tr213;
3758 	goto st171;
3759 tr213:
3760 #line 68 "sam_alignment.rl"
3761 	{ p--; {if (true) goto st183;} }
3762 	goto st241;
3763 st241:
3764 	if ( ++p == pe )
3765 		goto _test_eof241;
3766 goto case; case 241:
3767 #line 3767 "sam_alignment.d"
3768 	goto st0;
3769 st172:
3770 	if ( ++p == pe )
3771 		goto _test_eof172;
3772 goto case; case 172:
3773 	if ( (*p) == 9u )
3774 		goto tr215;
3775 	goto st172;
3776 tr215:
3777 #line 76 "sam_alignment.rl"
3778 	{ p--; {if (true) goto st184;} }
3779 	goto st242;
3780 st242:
3781 	if ( ++p == pe )
3782 		goto _test_eof242;
3783 goto case; case 242:
3784 #line 3784 "sam_alignment.d"
3785 	goto st0;
3786 st173:
3787 	if ( ++p == pe )
3788 		goto _test_eof173;
3789 goto case; case 173:
3790 	if ( (*p) == 9u )
3791 		goto tr217;
3792 	goto st173;
3793 tr217:
3794 #line 82 "sam_alignment.rl"
3795 	{ p--; {if (true) goto st185;} }
3796 	goto st243;
3797 st243:
3798 	if ( ++p == pe )
3799 		goto _test_eof243;
3800 goto case; case 243:
3801 #line 3801 "sam_alignment.d"
3802 	goto st0;
3803 st174:
3804 	if ( ++p == pe )
3805 		goto _test_eof174;
3806 goto case; case 174:
3807 	if ( (*p) == 9u )
3808 		goto tr219;
3809 	goto st174;
3810 tr219:
3811 #line 131 "sam_alignment.rl"
3812 	{ p--; {if (true) goto st186;} }
3813 	goto st244;
3814 st244:
3815 	if ( ++p == pe )
3816 		goto _test_eof244;
3817 goto case; case 244:
3818 #line 3818 "sam_alignment.d"
3819 	goto st0;
3820 st175:
3821 	if ( ++p == pe )
3822 		goto _test_eof175;
3823 goto case; case 175:
3824 	if ( (*p) == 9u )
3825 		goto tr221;
3826 	goto st175;
3827 tr221:
3828 #line 163 "sam_alignment.rl"
3829 	{ p--; {if (true) goto st187;} }
3830 	goto st245;
3831 st245:
3832 	if ( ++p == pe )
3833 		goto _test_eof245;
3834 goto case; case 245:
3835 #line 3835 "sam_alignment.d"
3836 	goto st0;
3837 st176:
3838 	if ( ++p == pe )
3839 		goto _test_eof176;
3840 goto case; case 176:
3841 	if ( (*p) == 9u )
3842 		goto tr223;
3843 	goto st176;
3844 tr223:
3845 #line 176 "sam_alignment.rl"
3846 	{ p--; {if (true) goto st188;} }
3847 	goto st246;
3848 st246:
3849 	if ( ++p == pe )
3850 		goto _test_eof246;
3851 goto case; case 246:
3852 #line 3852 "sam_alignment.d"
3853 	goto st0;
3854 st177:
3855 	if ( ++p == pe )
3856 		goto _test_eof177;
3857 goto case; case 177:
3858 	if ( (*p) == 9u )
3859 		goto tr225;
3860 	goto st177;
3861 tr225:
3862 #line 188 "sam_alignment.rl"
3863 	{ p--; {if (true) goto st189;} }
3864 	goto st247;
3865 st247:
3866 	if ( ++p == pe )
3867 		goto _test_eof247;
3868 goto case; case 247:
3869 #line 3869 "sam_alignment.d"
3870 	goto st0;
3871 st178:
3872 	if ( ++p == pe )
3873 		goto _test_eof178;
3874 goto case; case 178:
3875 	if ( (*p) == 9u )
3876 		goto tr227;
3877 	goto st178;
3878 tr227:
3879 #line 221 "sam_alignment.rl"
3880 	{ p--; {if (true) goto st190;} }
3881 	goto st248;
3882 st248:
3883 	if ( ++p == pe )
3884 		goto _test_eof248;
3885 goto case; case 248:
3886 #line 3886 "sam_alignment.d"
3887 	goto st0;
3888 st179:
3889 	if ( ++p == pe )
3890 		goto _test_eof179;
3891 goto case; case 179:
3892 	if ( (*p) == 9u )
3893 		goto tr229;
3894 	goto st179;
3895 tr229:
3896 #line 251 "sam_alignment.rl"
3897 	{ p--; {if (true) goto st251;} }
3898 	goto st249;
3899 st249:
3900 	if ( ++p == pe )
3901 		goto _test_eof249;
3902 goto case; case 249:
3903 #line 3903 "sam_alignment.d"
3904 	goto st0;
3905 st180:
3906 	if ( ++p == pe )
3907 		goto _test_eof180;
3908 goto case; case 180:
3909 	if ( (*p) == 9u )
3910 		goto tr231;
3911 	goto st180;
3912 tr231:
3913 #line 408 "sam_alignment.rl"
3914 	{ p--; {if (true) goto st251;} }
3915 	goto st250;
3916 st250:
3917 	if ( ++p == pe )
3918 		goto _test_eof250;
3919 goto case; case 250:
3920 #line 3920 "sam_alignment.d"
3921 	goto st0;
3922 st181:
3923 	if ( ++p == pe )
3924 		goto _test_eof181;
3925 goto case; case 181:
3926 	if ( (*p) == 9u )
3927 		goto st2;
3928 	goto st0;
3929 st182:
3930 	if ( ++p == pe )
3931 		goto _test_eof182;
3932 goto case; case 182:
3933 	if ( (*p) == 9u )
3934 		goto st4;
3935 	goto st0;
3936 st183:
3937 	if ( ++p == pe )
3938 		goto _test_eof183;
3939 goto case; case 183:
3940 	if ( (*p) == 9u )
3941 		goto st6;
3942 	goto st0;
3943 st184:
3944 	if ( ++p == pe )
3945 		goto _test_eof184;
3946 goto case; case 184:
3947 	if ( (*p) == 9u )
3948 		goto st8;
3949 	goto st0;
3950 st185:
3951 	if ( ++p == pe )
3952 		goto _test_eof185;
3953 goto case; case 185:
3954 	if ( (*p) == 9u )
3955 		goto tr235;
3956 	goto st0;
3957 st186:
3958 	if ( ++p == pe )
3959 		goto _test_eof186;
3960 goto case; case 186:
3961 	if ( (*p) == 9u )
3962 		goto tr23;
3963 	goto st0;
3964 st187:
3965 	if ( ++p == pe )
3966 		goto _test_eof187;
3967 goto case; case 187:
3968 	if ( (*p) == 9u )
3969 		goto st14;
3970 	goto st0;
3971 st188:
3972 	if ( ++p == pe )
3973 		goto _test_eof188;
3974 goto case; case 188:
3975 	if ( (*p) == 9u )
3976 		goto st16;
3977 	goto st0;
3978 st189:
3979 	if ( ++p == pe )
3980 		goto _test_eof189;
3981 goto case; case 189:
3982 	if ( (*p) == 9u )
3983 		goto st19;
3984 	goto st0;
3985 st190:
3986 	if ( ++p == pe )
3987 		goto _test_eof190;
3988 goto case; case 190:
3989 	if ( (*p) == 9u )
3990 		goto st21;
3991 	goto st0;
3992 st251:
3993 	if ( ++p == pe )
3994 		goto _test_eof251;
3995 goto case; case 251:
3996 	if ( (*p) == 9u )
3997 		goto st22;
3998 	goto st0;
3999 		default: break;
4000 	}
4001 	_test_eof2: cs = 2; goto _test_eof; 
4002 	_test_eof3: cs = 3; goto _test_eof; 
4003 	_test_eof4: cs = 4; goto _test_eof; 
4004 	_test_eof5: cs = 5; goto _test_eof; 
4005 	_test_eof6: cs = 6; goto _test_eof; 
4006 	_test_eof7: cs = 7; goto _test_eof; 
4007 	_test_eof8: cs = 8; goto _test_eof; 
4008 	_test_eof9: cs = 9; goto _test_eof; 
4009 	_test_eof10: cs = 10; goto _test_eof; 
4010 	_test_eof11: cs = 11; goto _test_eof; 
4011 	_test_eof12: cs = 12; goto _test_eof; 
4012 	_test_eof13: cs = 13; goto _test_eof; 
4013 	_test_eof14: cs = 14; goto _test_eof; 
4014 	_test_eof15: cs = 15; goto _test_eof; 
4015 	_test_eof16: cs = 16; goto _test_eof; 
4016 	_test_eof17: cs = 17; goto _test_eof; 
4017 	_test_eof18: cs = 18; goto _test_eof; 
4018 	_test_eof19: cs = 19; goto _test_eof; 
4019 	_test_eof20: cs = 20; goto _test_eof; 
4020 	_test_eof21: cs = 21; goto _test_eof; 
4021 	_test_eof191: cs = 191; goto _test_eof; 
4022 	_test_eof22: cs = 22; goto _test_eof; 
4023 	_test_eof23: cs = 23; goto _test_eof; 
4024 	_test_eof24: cs = 24; goto _test_eof; 
4025 	_test_eof25: cs = 25; goto _test_eof; 
4026 	_test_eof26: cs = 26; goto _test_eof; 
4027 	_test_eof27: cs = 27; goto _test_eof; 
4028 	_test_eof192: cs = 192; goto _test_eof; 
4029 	_test_eof28: cs = 28; goto _test_eof; 
4030 	_test_eof29: cs = 29; goto _test_eof; 
4031 	_test_eof30: cs = 30; goto _test_eof; 
4032 	_test_eof31: cs = 31; goto _test_eof; 
4033 	_test_eof32: cs = 32; goto _test_eof; 
4034 	_test_eof193: cs = 193; goto _test_eof; 
4035 	_test_eof194: cs = 194; goto _test_eof; 
4036 	_test_eof195: cs = 195; goto _test_eof; 
4037 	_test_eof196: cs = 196; goto _test_eof; 
4038 	_test_eof197: cs = 197; goto _test_eof; 
4039 	_test_eof198: cs = 198; goto _test_eof; 
4040 	_test_eof199: cs = 199; goto _test_eof; 
4041 	_test_eof200: cs = 200; goto _test_eof; 
4042 	_test_eof201: cs = 201; goto _test_eof; 
4043 	_test_eof202: cs = 202; goto _test_eof; 
4044 	_test_eof203: cs = 203; goto _test_eof; 
4045 	_test_eof204: cs = 204; goto _test_eof; 
4046 	_test_eof205: cs = 205; goto _test_eof; 
4047 	_test_eof206: cs = 206; goto _test_eof; 
4048 	_test_eof207: cs = 207; goto _test_eof; 
4049 	_test_eof208: cs = 208; goto _test_eof; 
4050 	_test_eof209: cs = 209; goto _test_eof; 
4051 	_test_eof210: cs = 210; goto _test_eof; 
4052 	_test_eof33: cs = 33; goto _test_eof; 
4053 	_test_eof34: cs = 34; goto _test_eof; 
4054 	_test_eof35: cs = 35; goto _test_eof; 
4055 	_test_eof36: cs = 36; goto _test_eof; 
4056 	_test_eof211: cs = 211; goto _test_eof; 
4057 	_test_eof37: cs = 37; goto _test_eof; 
4058 	_test_eof38: cs = 38; goto _test_eof; 
4059 	_test_eof212: cs = 212; goto _test_eof; 
4060 	_test_eof213: cs = 213; goto _test_eof; 
4061 	_test_eof39: cs = 39; goto _test_eof; 
4062 	_test_eof40: cs = 40; goto _test_eof; 
4063 	_test_eof214: cs = 214; goto _test_eof; 
4064 	_test_eof41: cs = 41; goto _test_eof; 
4065 	_test_eof42: cs = 42; goto _test_eof; 
4066 	_test_eof43: cs = 43; goto _test_eof; 
4067 	_test_eof44: cs = 44; goto _test_eof; 
4068 	_test_eof215: cs = 215; goto _test_eof; 
4069 	_test_eof45: cs = 45; goto _test_eof; 
4070 	_test_eof46: cs = 46; goto _test_eof; 
4071 	_test_eof216: cs = 216; goto _test_eof; 
4072 	_test_eof47: cs = 47; goto _test_eof; 
4073 	_test_eof48: cs = 48; goto _test_eof; 
4074 	_test_eof49: cs = 49; goto _test_eof; 
4075 	_test_eof50: cs = 50; goto _test_eof; 
4076 	_test_eof217: cs = 217; goto _test_eof; 
4077 	_test_eof51: cs = 51; goto _test_eof; 
4078 	_test_eof52: cs = 52; goto _test_eof; 
4079 	_test_eof218: cs = 218; goto _test_eof; 
4080 	_test_eof219: cs = 219; goto _test_eof; 
4081 	_test_eof53: cs = 53; goto _test_eof; 
4082 	_test_eof54: cs = 54; goto _test_eof; 
4083 	_test_eof220: cs = 220; goto _test_eof; 
4084 	_test_eof55: cs = 55; goto _test_eof; 
4085 	_test_eof56: cs = 56; goto _test_eof; 
4086 	_test_eof57: cs = 57; goto _test_eof; 
4087 	_test_eof58: cs = 58; goto _test_eof; 
4088 	_test_eof59: cs = 59; goto _test_eof; 
4089 	_test_eof221: cs = 221; goto _test_eof; 
4090 	_test_eof222: cs = 222; goto _test_eof; 
4091 	_test_eof223: cs = 223; goto _test_eof; 
4092 	_test_eof224: cs = 224; goto _test_eof; 
4093 	_test_eof225: cs = 225; goto _test_eof; 
4094 	_test_eof226: cs = 226; goto _test_eof; 
4095 	_test_eof227: cs = 227; goto _test_eof; 
4096 	_test_eof228: cs = 228; goto _test_eof; 
4097 	_test_eof229: cs = 229; goto _test_eof; 
4098 	_test_eof230: cs = 230; goto _test_eof; 
4099 	_test_eof231: cs = 231; goto _test_eof; 
4100 	_test_eof232: cs = 232; goto _test_eof; 
4101 	_test_eof233: cs = 233; goto _test_eof; 
4102 	_test_eof234: cs = 234; goto _test_eof; 
4103 	_test_eof235: cs = 235; goto _test_eof; 
4104 	_test_eof236: cs = 236; goto _test_eof; 
4105 	_test_eof237: cs = 237; goto _test_eof; 
4106 	_test_eof238: cs = 238; goto _test_eof; 
4107 	_test_eof60: cs = 60; goto _test_eof; 
4108 	_test_eof61: cs = 61; goto _test_eof; 
4109 	_test_eof62: cs = 62; goto _test_eof; 
4110 	_test_eof63: cs = 63; goto _test_eof; 
4111 	_test_eof64: cs = 64; goto _test_eof; 
4112 	_test_eof65: cs = 65; goto _test_eof; 
4113 	_test_eof66: cs = 66; goto _test_eof; 
4114 	_test_eof67: cs = 67; goto _test_eof; 
4115 	_test_eof68: cs = 68; goto _test_eof; 
4116 	_test_eof69: cs = 69; goto _test_eof; 
4117 	_test_eof70: cs = 70; goto _test_eof; 
4118 	_test_eof71: cs = 71; goto _test_eof; 
4119 	_test_eof72: cs = 72; goto _test_eof; 
4120 	_test_eof73: cs = 73; goto _test_eof; 
4121 	_test_eof74: cs = 74; goto _test_eof; 
4122 	_test_eof75: cs = 75; goto _test_eof; 
4123 	_test_eof76: cs = 76; goto _test_eof; 
4124 	_test_eof77: cs = 77; goto _test_eof; 
4125 	_test_eof78: cs = 78; goto _test_eof; 
4126 	_test_eof79: cs = 79; goto _test_eof; 
4127 	_test_eof80: cs = 80; goto _test_eof; 
4128 	_test_eof81: cs = 81; goto _test_eof; 
4129 	_test_eof82: cs = 82; goto _test_eof; 
4130 	_test_eof83: cs = 83; goto _test_eof; 
4131 	_test_eof84: cs = 84; goto _test_eof; 
4132 	_test_eof85: cs = 85; goto _test_eof; 
4133 	_test_eof86: cs = 86; goto _test_eof; 
4134 	_test_eof87: cs = 87; goto _test_eof; 
4135 	_test_eof88: cs = 88; goto _test_eof; 
4136 	_test_eof89: cs = 89; goto _test_eof; 
4137 	_test_eof90: cs = 90; goto _test_eof; 
4138 	_test_eof91: cs = 91; goto _test_eof; 
4139 	_test_eof92: cs = 92; goto _test_eof; 
4140 	_test_eof93: cs = 93; goto _test_eof; 
4141 	_test_eof94: cs = 94; goto _test_eof; 
4142 	_test_eof95: cs = 95; goto _test_eof; 
4143 	_test_eof96: cs = 96; goto _test_eof; 
4144 	_test_eof97: cs = 97; goto _test_eof; 
4145 	_test_eof98: cs = 98; goto _test_eof; 
4146 	_test_eof99: cs = 99; goto _test_eof; 
4147 	_test_eof100: cs = 100; goto _test_eof; 
4148 	_test_eof101: cs = 101; goto _test_eof; 
4149 	_test_eof102: cs = 102; goto _test_eof; 
4150 	_test_eof103: cs = 103; goto _test_eof; 
4151 	_test_eof104: cs = 104; goto _test_eof; 
4152 	_test_eof105: cs = 105; goto _test_eof; 
4153 	_test_eof106: cs = 106; goto _test_eof; 
4154 	_test_eof107: cs = 107; goto _test_eof; 
4155 	_test_eof108: cs = 108; goto _test_eof; 
4156 	_test_eof109: cs = 109; goto _test_eof; 
4157 	_test_eof110: cs = 110; goto _test_eof; 
4158 	_test_eof111: cs = 111; goto _test_eof; 
4159 	_test_eof112: cs = 112; goto _test_eof; 
4160 	_test_eof113: cs = 113; goto _test_eof; 
4161 	_test_eof114: cs = 114; goto _test_eof; 
4162 	_test_eof115: cs = 115; goto _test_eof; 
4163 	_test_eof116: cs = 116; goto _test_eof; 
4164 	_test_eof117: cs = 117; goto _test_eof; 
4165 	_test_eof118: cs = 118; goto _test_eof; 
4166 	_test_eof119: cs = 119; goto _test_eof; 
4167 	_test_eof120: cs = 120; goto _test_eof; 
4168 	_test_eof121: cs = 121; goto _test_eof; 
4169 	_test_eof122: cs = 122; goto _test_eof; 
4170 	_test_eof123: cs = 123; goto _test_eof; 
4171 	_test_eof124: cs = 124; goto _test_eof; 
4172 	_test_eof125: cs = 125; goto _test_eof; 
4173 	_test_eof126: cs = 126; goto _test_eof; 
4174 	_test_eof127: cs = 127; goto _test_eof; 
4175 	_test_eof128: cs = 128; goto _test_eof; 
4176 	_test_eof129: cs = 129; goto _test_eof; 
4177 	_test_eof130: cs = 130; goto _test_eof; 
4178 	_test_eof131: cs = 131; goto _test_eof; 
4179 	_test_eof132: cs = 132; goto _test_eof; 
4180 	_test_eof133: cs = 133; goto _test_eof; 
4181 	_test_eof134: cs = 134; goto _test_eof; 
4182 	_test_eof135: cs = 135; goto _test_eof; 
4183 	_test_eof136: cs = 136; goto _test_eof; 
4184 	_test_eof137: cs = 137; goto _test_eof; 
4185 	_test_eof138: cs = 138; goto _test_eof; 
4186 	_test_eof139: cs = 139; goto _test_eof; 
4187 	_test_eof140: cs = 140; goto _test_eof; 
4188 	_test_eof141: cs = 141; goto _test_eof; 
4189 	_test_eof142: cs = 142; goto _test_eof; 
4190 	_test_eof143: cs = 143; goto _test_eof; 
4191 	_test_eof144: cs = 144; goto _test_eof; 
4192 	_test_eof145: cs = 145; goto _test_eof; 
4193 	_test_eof146: cs = 146; goto _test_eof; 
4194 	_test_eof147: cs = 147; goto _test_eof; 
4195 	_test_eof148: cs = 148; goto _test_eof; 
4196 	_test_eof149: cs = 149; goto _test_eof; 
4197 	_test_eof150: cs = 150; goto _test_eof; 
4198 	_test_eof151: cs = 151; goto _test_eof; 
4199 	_test_eof152: cs = 152; goto _test_eof; 
4200 	_test_eof153: cs = 153; goto _test_eof; 
4201 	_test_eof154: cs = 154; goto _test_eof; 
4202 	_test_eof155: cs = 155; goto _test_eof; 
4203 	_test_eof156: cs = 156; goto _test_eof; 
4204 	_test_eof157: cs = 157; goto _test_eof; 
4205 	_test_eof158: cs = 158; goto _test_eof; 
4206 	_test_eof159: cs = 159; goto _test_eof; 
4207 	_test_eof160: cs = 160; goto _test_eof; 
4208 	_test_eof161: cs = 161; goto _test_eof; 
4209 	_test_eof162: cs = 162; goto _test_eof; 
4210 	_test_eof163: cs = 163; goto _test_eof; 
4211 	_test_eof164: cs = 164; goto _test_eof; 
4212 	_test_eof165: cs = 165; goto _test_eof; 
4213 	_test_eof166: cs = 166; goto _test_eof; 
4214 	_test_eof167: cs = 167; goto _test_eof; 
4215 	_test_eof168: cs = 168; goto _test_eof; 
4216 	_test_eof169: cs = 169; goto _test_eof; 
4217 	_test_eof239: cs = 239; goto _test_eof; 
4218 	_test_eof170: cs = 170; goto _test_eof; 
4219 	_test_eof240: cs = 240; goto _test_eof; 
4220 	_test_eof171: cs = 171; goto _test_eof; 
4221 	_test_eof241: cs = 241; goto _test_eof; 
4222 	_test_eof172: cs = 172; goto _test_eof; 
4223 	_test_eof242: cs = 242; goto _test_eof; 
4224 	_test_eof173: cs = 173; goto _test_eof; 
4225 	_test_eof243: cs = 243; goto _test_eof; 
4226 	_test_eof174: cs = 174; goto _test_eof; 
4227 	_test_eof244: cs = 244; goto _test_eof; 
4228 	_test_eof175: cs = 175; goto _test_eof; 
4229 	_test_eof245: cs = 245; goto _test_eof; 
4230 	_test_eof176: cs = 176; goto _test_eof; 
4231 	_test_eof246: cs = 246; goto _test_eof; 
4232 	_test_eof177: cs = 177; goto _test_eof; 
4233 	_test_eof247: cs = 247; goto _test_eof; 
4234 	_test_eof178: cs = 178; goto _test_eof; 
4235 	_test_eof248: cs = 248; goto _test_eof; 
4236 	_test_eof179: cs = 179; goto _test_eof; 
4237 	_test_eof249: cs = 249; goto _test_eof; 
4238 	_test_eof180: cs = 180; goto _test_eof; 
4239 	_test_eof250: cs = 250; goto _test_eof; 
4240 	_test_eof181: cs = 181; goto _test_eof; 
4241 	_test_eof182: cs = 182; goto _test_eof; 
4242 	_test_eof183: cs = 183; goto _test_eof; 
4243 	_test_eof184: cs = 184; goto _test_eof; 
4244 	_test_eof185: cs = 185; goto _test_eof; 
4245 	_test_eof186: cs = 186; goto _test_eof; 
4246 	_test_eof187: cs = 187; goto _test_eof; 
4247 	_test_eof188: cs = 188; goto _test_eof; 
4248 	_test_eof189: cs = 189; goto _test_eof; 
4249 	_test_eof190: cs = 190; goto _test_eof; 
4250 	_test_eof251: cs = 251; goto _test_eof; 
4251 
4252 	_test_eof: {}
4253 	if ( p == eof )
4254 	{
4255 	switch ( cs ) {
4256 	case 1: 
4257 	case 168: 
4258 #line 50 "sam_alignment.rl"
4259 	{ p--; {if (true) goto st169;} }
4260 	break;
4261 	case 2: 
4262 	case 3: 
4263 	case 151: 
4264 	case 152: 
4265 	case 153: 
4266 	case 154: 
4267 	case 155: 
4268 	case 156: 
4269 	case 157: 
4270 	case 158: 
4271 	case 159: 
4272 	case 160: 
4273 	case 161: 
4274 	case 162: 
4275 	case 163: 
4276 	case 164: 
4277 	case 165: 
4278 	case 166: 
4279 	case 167: 
4280 #line 58 "sam_alignment.rl"
4281 	{ p--; {if (true) goto st170;} }
4282 	break;
4283 	case 4: 
4284 	case 5: 
4285 	case 150: 
4286 #line 67 "sam_alignment.rl"
4287 	{ p--; {if (true) goto st171;} }
4288 	break;
4289 	case 6: 
4290 	case 7: 
4291 	case 133: 
4292 	case 134: 
4293 	case 135: 
4294 	case 136: 
4295 	case 137: 
4296 	case 138: 
4297 	case 139: 
4298 	case 140: 
4299 	case 141: 
4300 	case 142: 
4301 	case 143: 
4302 	case 144: 
4303 	case 145: 
4304 	case 146: 
4305 	case 147: 
4306 	case 148: 
4307 	case 149: 
4308 #line 75 "sam_alignment.rl"
4309 	{ p--; {if (true) goto st172;} }
4310 	break;
4311 	case 8: 
4312 	case 9: 
4313 	case 116: 
4314 	case 117: 
4315 	case 118: 
4316 	case 119: 
4317 	case 120: 
4318 	case 121: 
4319 	case 122: 
4320 	case 123: 
4321 	case 124: 
4322 	case 125: 
4323 	case 126: 
4324 	case 127: 
4325 	case 128: 
4326 	case 129: 
4327 	case 130: 
4328 	case 131: 
4329 	case 132: 
4330 #line 81 "sam_alignment.rl"
4331 	{ p--; {if (true) goto st173;} }
4332 	break;
4333 	case 10: 
4334 	case 11: 
4335 	case 97: 
4336 	case 98: 
4337 	case 99: 
4338 	case 100: 
4339 	case 101: 
4340 	case 102: 
4341 	case 103: 
4342 	case 104: 
4343 	case 105: 
4344 	case 106: 
4345 	case 107: 
4346 	case 108: 
4347 	case 109: 
4348 	case 110: 
4349 	case 111: 
4350 	case 112: 
4351 	case 113: 
4352 	case 114: 
4353 	case 115: 
4354 #line 124 "sam_alignment.rl"
4355 	{
4356         auto ptr = cast(uint*)(buffer.data.ptr + 3 * uint.sizeof);
4357         *ptr = (*ptr) & 0xFFFF0000;
4358         buffer.shrink(rollback_size);
4359         end_pos = pos + 1;
4360         p--; {if (true) goto st174;}
4361     }
4362 	break;
4363 	case 12: 
4364 	case 13: 
4365 	case 95: 
4366 	case 96: 
4367 #line 162 "sam_alignment.rl"
4368 	{ p--; {if (true) goto st175;} }
4369 	break;
4370 	case 14: 
4371 	case 15: 
4372 	case 78: 
4373 	case 79: 
4374 	case 80: 
4375 	case 81: 
4376 	case 82: 
4377 	case 83: 
4378 	case 84: 
4379 	case 85: 
4380 	case 86: 
4381 	case 87: 
4382 	case 88: 
4383 	case 89: 
4384 	case 90: 
4385 	case 91: 
4386 	case 92: 
4387 	case 93: 
4388 	case 94: 
4389 #line 175 "sam_alignment.rl"
4390 	{ p--; {if (true) goto st176;} }
4391 	break;
4392 	case 16: 
4393 	case 17: 
4394 	case 18: 
4395 	case 61: 
4396 	case 62: 
4397 	case 63: 
4398 	case 64: 
4399 	case 65: 
4400 	case 66: 
4401 	case 67: 
4402 	case 68: 
4403 	case 69: 
4404 	case 70: 
4405 	case 71: 
4406 	case 72: 
4407 	case 73: 
4408 	case 74: 
4409 	case 75: 
4410 	case 76: 
4411 	case 77: 
4412 #line 187 "sam_alignment.rl"
4413 	{ p--; {if (true) goto st177;} }
4414 	break;
4415 	case 19: 
4416 	case 20: 
4417 	case 60: 
4418 #line 217 "sam_alignment.rl"
4419 	{
4420         rollback_size = buffer.length;
4421         p--; {if (true) goto st178;}
4422     }
4423 	break;
4424 	case 21: 
4425 #line 243 "sam_alignment.rl"
4426 	{
4427         buffer.shrink(rollback_size);
4428         for (size_t i = 0; i < l_seq; ++i)
4429             buffer.putUnsafe!ubyte(0xFF);
4430         rollback_size = buffer.length;
4431         p--; {if (true) goto st179;}
4432     }
4433 	break;
4434 	case 25: 
4435 	case 26: 
4436 	case 27: 
4437 	case 28: 
4438 	case 29: 
4439 	case 30: 
4440 	case 31: 
4441 	case 32: 
4442 	case 33: 
4443 	case 34: 
4444 	case 35: 
4445 	case 36: 
4446 	case 37: 
4447 	case 38: 
4448 	case 39: 
4449 	case 40: 
4450 	case 41: 
4451 	case 42: 
4452 	case 43: 
4453 	case 44: 
4454 	case 45: 
4455 	case 46: 
4456 	case 47: 
4457 	case 48: 
4458 	case 49: 
4459 	case 50: 
4460 	case 51: 
4461 	case 52: 
4462 	case 53: 
4463 	case 54: 
4464 	case 55: 
4465 	case 56: 
4466 	case 57: 
4467 	case 58: 
4468 	case 59: 
4469 #line 403 "sam_alignment.rl"
4470 	{
4471         buffer.shrink(rollback_size);
4472         p--; {if (true) goto st180;}
4473     }
4474 	break;
4475 	case 192: 
4476 #line 410 "sam_alignment.rl"
4477 	{ rollback_size = buffer.length; }
4478 	break;
4479 	case 191: 
4480 #line 236 "sam_alignment.rl"
4481 	{
4482         // '*' may correspond either to a one-base long sequence
4483         // or to absence of information
4484         if (quals_length == 1 && quals_last_char == '*' && l_seq == 0)
4485             buffer.shrink(rollback_size);
4486     }
4487 #line 253 "sam_alignment.rl"
4488 	{
4489         if (buffer.length - rollback_size != l_seq) {
4490             buffer.shrink(rollback_size);
4491             for (size_t i = 0; i < l_seq; ++i)
4492                 buffer.putUnsafe!ubyte(0xFF);
4493         }
4494         rollback_size = buffer.length;
4495     }
4496 	break;
4497 	case 216: 
4498 #line 326 "sam_alignment.rl"
4499 	{
4500         {
4501         auto data = cast(ubyte[])(line[tagvalue_beg .. p - line.ptr]);
4502         buffer.capacity = buffer.length + 4 + data.length;
4503         buffer.putUnsafe(tag_key);
4504         buffer.putUnsafe!char('Z');
4505         buffer.putUnsafe(data);
4506         buffer.putUnsafe!ubyte(0);
4507         }
4508     }
4509 #line 410 "sam_alignment.rl"
4510 	{ rollback_size = buffer.length; }
4511 	break;
4512 	case 215: 
4513 #line 337 "sam_alignment.rl"
4514 	{
4515         {
4516         auto data = cast(ubyte[])(line[tagvalue_beg .. p - line.ptr]);
4517         buffer.capacity = buffer.length + 4 + data.length;
4518         buffer.putUnsafe(tag_key);
4519         buffer.putUnsafe!char('H');
4520         buffer.putUnsafe(data);
4521         buffer.putUnsafe!ubyte(0);
4522         }
4523     }
4524 #line 410 "sam_alignment.rl"
4525 	{ rollback_size = buffer.length; }
4526 	break;
4527 	case 221: 
4528 	case 222: 
4529 	case 223: 
4530 	case 224: 
4531 	case 225: 
4532 	case 226: 
4533 	case 227: 
4534 	case 228: 
4535 	case 229: 
4536 	case 230: 
4537 	case 231: 
4538 	case 232: 
4539 	case 233: 
4540 	case 234: 
4541 	case 235: 
4542 	case 236: 
4543 	case 237: 
4544 	case 238: 
4545 #line 30 "sam_alignment.rl"
4546 	{ int_value *= current_sign; current_sign = 1; }
4547 #line 285 "sam_alignment.rl"
4548 	{
4549         buffer.capacity = buffer.length + 7;
4550         buffer.putUnsafe(tag_key);
4551         if (int_value < 0) {
4552             if (int_value >= byte.min) {
4553                 buffer.putUnsafe!char('c');
4554                 buffer.putUnsafe(cast(byte)int_value);
4555             } else if (int_value >= short.min) {
4556                 buffer.putUnsafe!char('s');
4557                 buffer.putUnsafe(cast(short)int_value);
4558             } else if (int_value >= int.min) {
4559                 buffer.putUnsafe!char('i');
4560                 buffer.putUnsafe(cast(int)int_value);
4561             } else {
4562                 throw new Exception("integer out of range");
4563             }
4564         } else {
4565             if (int_value <= ubyte.max) {
4566                 buffer.putUnsafe!char('C');
4567                 buffer.putUnsafe(cast(ubyte)int_value);
4568             } else if (int_value <= ushort.max) {
4569                 buffer.putUnsafe!char('S');
4570                 buffer.putUnsafe(cast(ushort)int_value);
4571             } else if (int_value <= uint.max) {
4572                 buffer.putUnsafe!char('I');
4573                 buffer.putUnsafe(cast(uint)int_value);
4574             } else {
4575                 throw new Exception("integer out of range");
4576             }
4577         }
4578     }
4579 #line 410 "sam_alignment.rl"
4580 	{ rollback_size = buffer.length; }
4581 	break;
4582 	case 193: 
4583 	case 194: 
4584 	case 195: 
4585 	case 196: 
4586 	case 197: 
4587 	case 198: 
4588 	case 199: 
4589 	case 200: 
4590 	case 201: 
4591 	case 202: 
4592 	case 203: 
4593 	case 204: 
4594 	case 205: 
4595 	case 206: 
4596 	case 207: 
4597 	case 208: 
4598 	case 209: 
4599 	case 210: 
4600 #line 30 "sam_alignment.rl"
4601 	{ int_value *= current_sign; current_sign = 1; }
4602 #line 362 "sam_alignment.rl"
4603 	{
4604         // here, we assume that compiler is smart enough to move switch out of loop.
4605         switch (arraytype) {
4606             case 'c': buffer.put(to!byte(int_value)); break;
4607             case 'C': buffer.put(to!ubyte(int_value)); break;
4608             case 's': buffer.put(to!short(int_value)); break;
4609             case 'S': buffer.put(to!ushort(int_value)); break;
4610             case 'i': buffer.put(to!int(int_value)); break;
4611             case 'I': buffer.put(to!uint(int_value)); break;
4612             default: assert(0);
4613         }
4614         {
4615             auto ptr = cast(uint*)(buffer.data.ptr + tag_array_length_offset);
4616             ++*ptr;
4617         }
4618     }
4619 #line 410 "sam_alignment.rl"
4620 	{ rollback_size = buffer.length; }
4621 	break;
4622 	case 217: 
4623 	case 218: 
4624 	case 219: 
4625 	case 220: 
4626 #line 38 "sam_alignment.rl"
4627 	{
4628         float_value = to!float(line[float_beg .. p - line.ptr]);
4629     }
4630 #line 319 "sam_alignment.rl"
4631 	{
4632         buffer.capacity = buffer.length + 7;
4633         buffer.putUnsafe(tag_key);
4634         buffer.putUnsafe!char('f');
4635         buffer.putUnsafe!float(float_value);
4636     }
4637 #line 410 "sam_alignment.rl"
4638 	{ rollback_size = buffer.length; }
4639 	break;
4640 	case 211: 
4641 	case 212: 
4642 	case 213: 
4643 	case 214: 
4644 #line 38 "sam_alignment.rl"
4645 	{
4646         float_value = to!float(line[float_beg .. p - line.ptr]);
4647     }
4648 #line 379 "sam_alignment.rl"
4649 	{
4650         buffer.put!float(float_value);
4651         {
4652             auto ptr = cast(uint*)(buffer.data.ptr + tag_array_length_offset);
4653             ++*ptr;
4654         }
4655     }
4656 #line 410 "sam_alignment.rl"
4657 	{ rollback_size = buffer.length; }
4658 	break;
4659 #line 4659 "sam_alignment.d"
4660 		default: break;
4661 	}
4662 	}
4663 
4664 	_out: {}
4665 	}
4666 
4667 #line 481 "sam_alignment.rl"
4668 
4669     BamRead read;
4670     read.raw_data = buffer.data[];
4671     return read;
4672 }
4673 
4674 unittest {
4675     import std.algorithm;
4676     import std.math;
4677 
4678     auto line = "ERR016155.15021091\t185\t20\t60033\t25\t66S35M\t=\t60033\t0\tAGAAAAAACTGGAAGTTAATAGAGTGGTGACTCAGATCCAGTGGTGGAAGGGTAAGGGATCTTGGAACCCTATAGAGTTGCTGTGTGCCAGGGCCAGATCC\t#####################################################################################################\tX0:i:1\tX1:i:0\tXC:i:35\tMD:Z:17A8A8\tRG:Z:ERR016155\tAM:i:0\tNM:i:2\tSM:i:25\tXT:A:U\tBQ:Z:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\tY0:B:c,1,2,3\tY1:B:f,13.263,-3.1415,52.63461";
4679 
4680     auto header = new SamHeader("@SQ\tSN:20\tLN:1234567");
4681     auto alignment = parseAlignmentLine(line, header);
4682     assert(alignment.name == "ERR016155.15021091");
4683     assert(equal(alignment.sequence(), "AGAAAAAACTGGAAGTTAATAGAGTGGTGACTCAGATCCAGTGGTGGAAGGGTAAGGGATCTTGGAACCCTATAGAGTTGCTGTGTGCCAGGGCCAGATCC"));
4684     assert(alignment.cigarString() == "66S35M");
4685     assert(alignment.flag == 185);
4686     assert(alignment.position == 60032);
4687     assert(alignment.mapping_quality == 25);
4688     assert(alignment.mate_position == 60032);
4689     assert(alignment.ref_id == 0);
4690     assert(alignment.mate_ref_id == 0);
4691     assert(to!ubyte(alignment["AM"]) == 0);
4692     assert(to!ubyte(alignment["SM"]) == 25);
4693     assert(to!string(alignment["MD"]) == "17A8A8");
4694     assert(equal(to!(byte[])(alignment["Y0"]), [1, 2, 3]));
4695     assert(equal!approxEqual(to!(float[])(alignment["Y1"]), [13.263, -3.1415, 52.63461]));
4696     assert(to!char(alignment["XT"]) == 'U');
4697 
4698     import bio.bam.reference;
4699 
4700     auto info = ReferenceSequenceInfo("20", 1234567);
4701 
4702     auto invalid_cigar_string = "1\t100\t20\t50000\t30\tMZABC\t=\t50000\t0\tACGT\t####";
4703     alignment = parseAlignmentLine(invalid_cigar_string, header);
4704     assert(equal(alignment.sequence(), "ACGT"));
4705 
4706     auto invalid_tag_and_qual = "2\t100\t20\t5\t40\t27M30X5D\t=\t3\t10\tACT\t !\n\tX1:i:7\tX3:i:zzz\tX4:i:5";
4707     alignment = parseAlignmentLine(invalid_tag_and_qual, header);
4708     assert(alignment.base_qualities == [255, 255, 255]); // i.e. invalid
4709     assert(to!ubyte(alignment["X1"]) == 7);
4710     assert(alignment["X3"].is_nothing);
4711     assert(to!ubyte(alignment["X4"]) == 5);
4712 }