code: func ParseCigar(b []byte) (Cigar, error) {
  	if len(b) == 1 && b[0] == '*' {
  		return nil, nil
  	}
  	var (
  		c   Cigar
  		op  CigarOpType
  		n   int
  		err error
  	)
  	for i := 0; i < len(b); i++ {
  		for j := i; j < len(b); j++ {
  			if b[j] < '0' || '9' < b[j] {
  				n, err = atoi(b[i:j])
  				if err != nil {
  					return nil, err
  				}
  				op = cigarOpTypeLookup[b[j]]
  				i = j
  				break
  			}
  		}
  		if op == lastCigar {
  			return nil, fmt.Errorf("sam: failed to parse cigar string %q: unknown operation %q", b, op)
  		}
  
  		for {
  			c = append(c, NewCigarOp(op, minInt(n, 1<<28-1)))
  			n -= 1<<28 - 1
  			if n <= 0 {
  				break
  			}
  		}
  	}
  	return c, nil
  }
docs: // ParseCigar returns a Cigar parsed from the provided byte slice.
  // ParseCigar will break CIGAR operations longer than 2^28-1 into
  // multiple operations summing to the same length.