// File: gersteinlab[P]MUSIC/src/ms_nucleotide.cpp
// Function: map_nuc_IUPAC_code(char, char&, int&, bool&)
void map_nuc_IUPAC_code(char raw_nuc, 
						char &trans_nuc, 
						int &num, 
						bool& force_unpaired)
{
	if(raw_nuc == 'a' || raw_nuc == 'c' || raw_nuc == 'g' || raw_nuc == 'u' || raw_nuc == 't')
	{
		force_unpaired = true;
	}
	else
	{
		force_unpaired = false;
	}

	if (toupper(raw_nuc) == 'A') 
	{
		trans_nuc = raw_nuc;
		num=1;
	}
	else if(toupper(raw_nuc) == 'B')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'C')
	{
		trans_nuc = raw_nuc;
		num = 2;
	}
	else if(toupper(raw_nuc) == 'D')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'G')
	{
		trans_nuc = raw_nuc;
		num = 3;
	}
	else if(toupper(raw_nuc) == 'H')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'I')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'K')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'M')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'N')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'R')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'S')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'T')
	{
		trans_nuc = raw_nuc;
		num = 4;
	}
	else if(toupper(raw_nuc) == 'U')
	{
		trans_nuc = raw_nuc;
		num = 4;
	}
	else if(toupper(raw_nuc) == 'V')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else if(toupper(raw_nuc) == 'W')
	{
		trans_nuc = 'N';
		num = 0;
	}
        else if(toupper(raw_nuc) == 'X')
        {
                trans_nuc = 'N';
                num = 0;
        }
	else if(toupper(raw_nuc) == 'Y')
	{
		trans_nuc = 'N';
		num = 0;
	}
	else
	{
		trans_nuc = 'N';
		num = 0;
	}

	if(num == 0)
	{
		//printf("Found %c\n", raw_nuc);
		//getc(stdin);
	}
}

// Assembly:
subq $0x28, %rsp
movb %dil, %al
movb %al, 0x27(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movsbl 0x27(%rsp), %eax
cmpl $0x61, %eax
je 0x3fb0c
movsbl 0x27(%rsp), %eax
cmpl $0x63, %eax
je 0x3fb0c
movsbl 0x27(%rsp), %eax
cmpl $0x67, %eax
je 0x3fb0c
movsbl 0x27(%rsp), %eax
cmpl $0x75, %eax
je 0x3fb0c
movsbl 0x27(%rsp), %eax
cmpl $0x74, %eax
jne 0x3fb16
movq 0x8(%rsp), %rax
movb $0x1, (%rax)
jmp 0x3fb1e
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x41, %eax
jne 0x3fb48
movb 0x27(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, (%rax)
movq 0x10(%rsp), %rax
movl $0x1, (%rax)
jmp 0x3fe17
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x42, %eax
jne 0x3fb6f
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe15
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x43, %eax
jne 0x3fb99
movb 0x27(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, (%rax)
movq 0x10(%rsp), %rax
movl $0x2, (%rax)
jmp 0x3fe13
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x44, %eax
jne 0x3fbc0
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe11
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x47, %eax
jne 0x3fbea
movb 0x27(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, (%rax)
movq 0x10(%rsp), %rax
movl $0x3, (%rax)
jmp 0x3fe0f
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x48, %eax
jne 0x3fc11
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe0d
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x49, %eax
jne 0x3fc38
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe0b
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x4b, %eax
jne 0x3fc5f
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe09
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x4d, %eax
jne 0x3fc86
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe07
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x4e, %eax
jne 0x3fcad
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe05
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x52, %eax
jne 0x3fcd4
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe03
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x53, %eax
jne 0x3fcfb
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fe01
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x54, %eax
jne 0x3fd25
movb 0x27(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, (%rax)
movq 0x10(%rsp), %rax
movl $0x4, (%rax)
jmp 0x3fdff
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x55, %eax
jne 0x3fd4f
movb 0x27(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, (%rax)
movq 0x10(%rsp), %rax
movl $0x4, (%rax)
jmp 0x3fdfd
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x56, %eax
jne 0x3fd76
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fdfb
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x57, %eax
jne 0x3fd9a
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fdf9
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x58, %eax
jne 0x3fdbe
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fdf7
movsbl 0x27(%rsp), %edi
callq 0x2350
cmpl $0x59, %eax
jne 0x3fde2
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fdf5
movq 0x18(%rsp), %rax
movb $0x4e, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3fdf7
jmp 0x3fdf9
jmp 0x3fdfb
jmp 0x3fdfd
jmp 0x3fdff
jmp 0x3fe01
jmp 0x3fe03
jmp 0x3fe05
jmp 0x3fe07
jmp 0x3fe09
jmp 0x3fe0b
jmp 0x3fe0d
jmp 0x3fe0f
jmp 0x3fe11
jmp 0x3fe13
jmp 0x3fe15
jmp 0x3fe17
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x3fe23
jmp 0x3fe23
addq $0x28, %rsp
retq
nopl (%rax,%rax)