while (samread(bam_in, b) >= 0) {
if (b->core.flag & 0x0004) continue;
if (b->core.tid != cur_tid) {
if (cur_tid >= 0) { used[cur_tid] = true; processor.process(wiggle); }
cur_tid = b->core.tid;
while (samread(bam_in, b) >= 0) {
if (b->core.flag & 0x0004) continue;
if (b->core.tid != cur_tid) {
if (cur_tid >= 0) { used[cur_tid] = true; processor.process(wiggle); }
cur_tid = b->core.tid;