 +  str[n++] = ':';
 +  n += snprintf(&str[n], l_qname-n, "%lu", y);
 +  *len = n;
++  if (n + 1/*\0*/ > l_qname) {
++    fprintf(stderr, "(E) length of string buffer %ld must be >=%d\n", l_qname, n + 1);
++    exit(-1);
++  }
 +}
 +
 +static inline void get_qname_illumina18(uint64_t qnameid, char *str, long l_qname, long *len) {

+  uint64_t const org =  (qnameid & (((1UL<<SRA_BITS_ORG) - 1)<<(SRA_BITS_ACC+SRA_BITS_SPOT)))>>(SRA_BITS_ACC+SRA_BITS_SPOT); 
+  //               12345678901234567890		20 digits
+  //  ULONG_MAX    18446744073709551615 UL
+  if (l_qname < 3/*xRR*/+20+1/*.*/+20+1) {
+    fprintf(stderr, "(E) length of string buffer %ld must be >=%d\n", l_qname, 3+20+1+20+1);
+    exit(-1);
+  }
+  int n = 3;
+  str[0] = (org==0 ? 'S' : (org==1 ? 'E' : 'D'));
+  str[1] = 'R';

+  int const instID = getIlluminaFieldID(ilmInst, qn, s);
+  if (instID != -1) {
+    uint64_t vl = strtol(s+1, &endp, 10);
+    if ((s+1 < endp && ':' == *endp) && vl-1 <= ILM_MAX_LANE){ // v is lane
+      char * endp2;
+      uint64_t vn = strtol(endp+1, &endp2, 10);
+      if ((endp+1 < endp2 && ':' == *endp2) && vn <= ILM_MAX_TILE){ // v is number within lane
+        char * endp3;
+        uint64_t vx = strtol(endp2+1, &endp3, 10);
+        if ((endp2+1 < endp3 && ':' == *endp3) && vx <= ILM_MAX_X){ // v is x
+          char * endp4;
+          uint64_t vy = strtol(endp3+1, &endp4, 10);
+          if (endp3+1 < endp4 && vy <= ILM_MAX_Y){ // v is y
+	    // | instrument id | lane no. | tile no. | x       | y       | 
+	    // |       8 bits  | 5 bits   | 14 bits  | 17 bits | 20 bits |
+  	    c = ((uint64_t)instID)<<(ILM_BITS_LANE+ILM_BITS_TILE+ILM_BITS_X+ILM_BITS_Y)
