 +          } // if qnameid == qnameid2
 +        } // for prev2,bp2
 +        if (NULL == bp2) {
++          bamptr_set_mate(bp, NULL);
++
 +          short const flag = bamptr_get_flag(bp);
 +          if ((flag & BAM_FPAIRED) && !(flag & BAM_FMUNMAP)) {
 +            char qname[128];

+/*  bam_sam2bam.c -- format converter framework
+
+    Author: Takeshi Ogasawara <takeshi@jp.ibm.com>
+	$Rev: 82 $
+	$Date: 2016-10-24 19:29:24 +0900 (Mon, 24 Oct 2016) $
+
+	*/
+

+    qname_hash_bucket = md_malloc(sizeof(*qname_hash_bucket)*QNAME_HASH_SIZE, mem_bamGetQnameId1, 1);
+}
+PROFILE_MEM_INIT();
+fprintf(stderr, "(I) sam-to-bam $Rev: 83 $\n");
+#if !defined(DEBUG_POS)
+fprintf(stderr, "(I) **** built with no DEBUG_POS feature\n");
+#endif
