  }
 diff -rupN -x Xcode -x .git bwa/bwamem.h bwa-mod/bwamem.h
 --- bwa/bwamem.h	2015-07-08 13:14:28.000000000 -0400
-+++ bwa-mod/bwamem.h	2016-07-29 21:04:27.000000000 -0400
-@@ -94,6 +94,10 @@ typedef struct { // This struct is only 
++++ bwa-mod/bwamem.h	2016-07-30 14:46:21.000000000 -0400
+@@ -63,9 +63,11 @@ typedef struct {
+ 	int score;      // best local SW score
+ 	int truesc;     // actual score corresponding to the aligned region; possibly smaller than $score
+ 	int sub;        // 2nd best SW score
++	int osub;       // more liberal 2nd best SW score
+ 	int alt_sc;
+ 	int csub;       // SW score of a tandem hit
+ 	int sub_n;      // approximate number of suboptimal hits
++	int osub_n;     // more liberal approximate number of suboptimal hits
+ 	int w;          // actual band width used in extension
+ 	int seedcov;    // length of regions coverged by seeds
+ 	int secondary;  // index of the parent hit shadowing the current hit; <0 if primary
+@@ -93,7 +95,11 @@ typedef struct { // This struct is only 
+ 	uint32_t *cigar; // CIGAR in the BAM encoding: opLen<<4|op; op to integer mapping: MIDSH=>01234
  	char *XA;        // alternative mappings
  
- 	int score, sub, alt_sc;
+-	int score, sub, alt_sc;
++	int score, sub, osub, alt_sc;
 +	float seedcov, pair_seedcov;
-+	int sub_n, pair_score, pair_sub, pair_nsub;
++	int sub_n, osub_n, pair_score, pair_sub, pair_nsub;
 +	float frac_rep, pair_frac_rep;
 +	int seedlen0, n_comp;
  } mem_aln_t;

 				kputw(p->cigar[i]>>4, str); kputc("MIDSH"[c], str);
 			}
 		} else kputc('*', str); // having a coordinate but unaligned (e.g. when copy_mate is true)
@@ -942,6 +947,50 @@ void mem_aln2sam(const mem_opt_t *opt, c
 		for (i = tmp; i < str->l; ++i) // replace TAB in the comment to SPACE
 			if (str->s[i] == '\t') str->s[i] = ' ';
 	}

 	if (p->rid >= 0) { // with coordinate
 		kputs(bns->anns[p->rid].name, str); kputc('\t', str); // RNAME
 		kputl(p->pos + 1, str); kputc('\t', str); // POS
@@ -847,6 +850,10 @@ void mem_aln2sam(const mem_opt_t *opt, c
 				int c = p->cigar[i]&0xf;
 				if (!(opt->flag&MEM_F_SOFTCLIP) && !p->is_alt && (c == 3 || c == 4))
 					c = which? 4 : 3; // use hard clipping for supplementary alignments
