 +  if (0 == r_qname) {
 +    r_qname = (b1->core.l_qname - b2->core.l_qname);
 +  }
-+#if defined(DEBUG_POS)
++#if 0 && defined(DEBUG_POS)
 +  if (dump) {
 +    fprintf(stderr, "(I) cmpfunc read %.*s %c %.*s\n",  (int)len1, str1, r_qname==0?'=':(r_qname>0?'<':'>'), (int)len2, str2);
 +  }

+
+#define MAX_LINE_LENGTH		4096	// max length of each line
+#define MAX_BLOCK_SEQID		(UINT32_MAX>>2)	// 1G 64KB blocks (64TB file size) (the first 2 bits are reserved for bamid_cmpfunc)
+
+#if defined(DO_PREFETCH)
+#define PREFETCH_BLKREAD_RW_LOCALITY3(a)	__builtin_prefetch(a, 1 /* rw */, 3 /* temporal locality*/)

+          }
+        }
+      } // for bp
+#if 0
+if(found){
+int ii;
+for(ii=0; ii<2; ii++) {
+fprintf(stderr, "%p -> %p\n", arr[ii], bamptr_get_mate(arr[ii]));
+}
+}
+#endif
+#else
+      int j;
+      for(j=0; j<arr_idx; j++) {
