// File: BenLangmead[P]bowtie/./qual.h
// Function: charToPhred33(char, bool, bool)
inline static char charToPhred33(char c, bool solQuals, bool phred64Quals) {
	if(c == ' ') {
		cerr << "Saw a space but expected an ASCII-encoded quality value." << endl
		     << "Are quality values formatted as integers?  If so, try --integer-quals." << endl;
		throw 1;
	}
	if (solQuals) {
		// Convert solexa-scaled chars to phred
		// http://maq.sourceforge.net/fastq.shtml
		char cc = solexaToPhred((int)c - 64) + 33;
		if (cc < 33) {
			cerr << "Saw ASCII character "
			     << ((int)c)
			     << " but expected 64-based Solexa qual (converts to " << (int)cc << ")." << endl
			     << "Try not specifying --solexa-quals." << endl;
			throw 1;
		}
		c = cc;
	}
	else if(phred64Quals) {
		if (c < 64) {
			cerr << "Saw ASCII character "
			     << ((int)c)
			     << " but expected 64-based Phred qual." << endl
			     << "Try not specifying --solexa1.3-quals/--phred64-quals." << endl;
			throw 1;
		}
		// Convert to 33-based phred
		c -= (64-33);
	}
	else {
		// Keep the phred quality
		if (c < 33) {
			cerr << "Saw ASCII character "
			     << ((int)c)
			     << " but expected 33-based Phred qual." << endl;
			throw 1;
		}
	}
	return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dl, %al
movb %sil, %cl
movb %dil, %dl
movb %dl, -0x1(%rbp)
andb $0x1, %cl
movb %cl, -0x2(%rbp)
andb $0x1, %al
movb %al, -0x3(%rbp)
movsbl -0x1(%rbp), %eax
cmpl $0x20, %eax
jne 0x8037a
movq 0x27cd2(%rip), %rdi     # 0xa7ff0
leaq 0xe298(%rip), %rsi      # 0x8e5bd
callq 0xa5d0
movq %rax, %rdi
movq 0x27c34(%rip), %rsi     # 0xa7f68
callq 0xa640
movq %rax, %rdi
leaq 0xe2b3(%rip), %rsi      # 0x8e5f6
callq 0xa5d0
movq %rax, %rdi
movq 0x27c16(%rip), %rsi     # 0xa7f68
callq 0xa640
movl $0x4, %edi
callq 0xa290
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x27bdf(%rip), %rsi     # 0xa7f50
xorl %eax, %eax
movl %eax, %edx
callq 0xab10
testb $0x1, -0x2(%rbp)
je 0x8044a
movsbl -0x1(%rbp), %edi
subl $0x40, %edi
callq 0x827b0
movzbl %al, %eax
addl $0x21, %eax
movb %al, -0x4(%rbp)
movsbl -0x4(%rbp), %eax
cmpl $0x21, %eax
jge 0x8043f
movq 0x27c43(%rip), %rdi     # 0xa7ff0
leaq 0xe289(%rip), %rsi      # 0x8e63d
callq 0xa5d0
movq %rax, %rdi
movsbl -0x1(%rbp), %esi
callq 0xab40
movq %rax, %rdi
leaq 0xe283(%rip), %rsi      # 0x8e652
callq 0xa5d0
movq %rax, %rdi
movsbl -0x4(%rbp), %esi
callq 0xab40
movq %rax, %rdi
leaq 0xd514(%rip), %rsi      # 0x8d8fe
callq 0xa5d0
movq %rax, %rdi
movq 0x27b6f(%rip), %rsi     # 0xa7f68
callq 0xa640
movq %rax, %rdi
leaq 0xe27b(%rip), %rsi      # 0x8e683
callq 0xa5d0
movq %rax, %rdi
movq 0x27b51(%rip), %rsi     # 0xa7f68
callq 0xa640
movl $0x4, %edi
callq 0xa290
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x27b1a(%rip), %rsi     # 0xa7f50
xorl %eax, %eax
movl %eax, %edx
callq 0xab10
movb -0x4(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x80554
testb $0x1, -0x3(%rbp)
je 0x804e7
movsbl -0x1(%rbp), %eax
cmpl $0x40, %eax
jge 0x804db
movq 0x27b8c(%rip), %rdi     # 0xa7ff0
leaq 0xe1d2(%rip), %rsi      # 0x8e63d
callq 0xa5d0
movq %rax, %rdi
movsbl -0x1(%rbp), %esi
callq 0xab40
movq %rax, %rdi
leaq 0xe220(%rip), %rsi      # 0x8e6a6
callq 0xa5d0
movq %rax, %rdi
movq 0x27ad3(%rip), %rsi     # 0xa7f68
callq 0xa640
movq %rax, %rdi
leaq 0xe225(%rip), %rsi      # 0x8e6c9
callq 0xa5d0
movq %rax, %rdi
movq 0x27ab5(%rip), %rsi     # 0xa7f68
callq 0xa640
movl $0x4, %edi
callq 0xa290
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x27a7e(%rip), %rsi     # 0xa7f50
xorl %eax, %eax
movl %eax, %edx
callq 0xab10
movsbl -0x1(%rbp), %eax
subl $0x1f, %eax
movb %al, -0x1(%rbp)
jmp 0x80552
movsbl -0x1(%rbp), %eax
cmpl $0x21, %eax
jge 0x80550
movq 0x27af9(%rip), %rdi     # 0xa7ff0
leaq 0xe13f(%rip), %rsi      # 0x8e63d
callq 0xa5d0
movq %rax, %rdi
movsbl -0x1(%rbp), %esi
callq 0xab40
movq %rax, %rdi
leaq 0xe1e6(%rip), %rsi      # 0x8e6ff
callq 0xa5d0
movq %rax, %rdi
movq 0x27a40(%rip), %rsi     # 0xa7f68
callq 0xa640
movl $0x4, %edi
callq 0xa290
movq %rax, %rdi
movl $0x1, (%rdi)
movq 0x27a09(%rip), %rsi     # 0xa7f50
xorl %eax, %eax
movl %eax, %edx
callq 0xab10
jmp 0x80552
jmp 0x80554
movb -0x1(%rbp), %al
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)