// File: /workspace/github_c_makefile_star2_O2/sheneman[P]clearcut/dist.c
// Function: NJ_DNA_count_tt
void
NJ_DNA_count_tt(NJ_alignment *alignment,
		long int x,
		long int y,
		long int *transitions,
		long int *transversions,
		long int *residues) {

  long int tmp_transitions   = 0;
  long int tmp_transversions = 0;
  long int tmp_residues      = 0;
  char a, b;
  long int i;

  for(i=0;i<alignment->length;i++) {

    a = toupper(alignment->data[x*alignment->length+i]);
    b = toupper(alignment->data[y*alignment->length+i]);
    
    if( (a == 'A' && b == 'T') ||
	(a == 'T' && b == 'A') ||
	(a == 'A' && b == 'C') ||
	(a == 'C' && b == 'A') ||
	(a == 'T' && b == 'G') ||
	(a == 'G' && b == 'T') ||
	(a == 'C' && b == 'G') ||
	(a == 'G' && b == 'C') ) {
      tmp_transversions++;
    }
	
    if( (a == 'C' && b == 'T') ||
	(a == 'T' && b == 'C') ||
	(a == 'G' && b == 'A') ||
	(a == 'A' && b == 'G') ) {
      tmp_transitions++;
    }

    /* count the number of residues */
    if(a != NJ_AMBIGUITY_CHAR &&
       b != NJ_AMBIGUITY_CHAR ) {
      tmp_residues++;
    }

  }
  
  *transitions   = tmp_transitions;
  *transversions = tmp_transversions;
  
  if(residues) {
    *residues = tmp_residues;
  }
  
  return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, 0x20(%rsp)
movq 0x8(%rdi), %r15
imulq %r15, %r13
imulq %r15, %r12
xorl %r14d, %r14d
testq %r15, %r15
cmovleq %r14, %r15
xorl %ebx, %ebx
xorl %ebp, %ebp
subq $0x1, %r15
jb 0x484b
callq 0x2030
movq (%rax), %rcx
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rdx
movsbq (%rdx,%r13), %rax
movl (%rcx,%rax,4), %eax
movsbq (%rdx,%r12), %rdx
movl (%rcx,%rdx,4), %ecx
shll $0x18, %eax
shll $0x18, %ecx
cmpl $0x41000000, %eax       # imm = 0x41000000
jne 0x4748
cmpl $0x54000000, %ecx       # imm = 0x54000000
je 0x4784
cmpl $0x54000000, %eax       # imm = 0x54000000
jne 0x4757
cmpl $0x41000000, %ecx       # imm = 0x41000000
je 0x4784
cmpl $0x41000000, %eax       # imm = 0x41000000
jne 0x4766
cmpl $0x43000000, %ecx       # imm = 0x43000000
je 0x4784
cmpl $0x43000000, %eax       # imm = 0x43000000
jne 0x4775
cmpl $0x41000000, %ecx       # imm = 0x41000000
je 0x4784
cmpl $0x54000000, %eax       # imm = 0x54000000
jne 0x47fb
cmpl $0x47000000, %ecx       # imm = 0x47000000
jne 0x47fb
incq %rbx
cmpl $0x43000000, %eax       # imm = 0x43000000
jne 0x4796
cmpl $0x54000000, %ecx       # imm = 0x54000000
je 0x47a5
cmpl $0x54000000, %eax       # imm = 0x54000000
jne 0x47ca
cmpl $0x43000000, %ecx       # imm = 0x43000000
jne 0x47ca
incq %rbp
movl $0x3f000000, %edx       # imm = 0x3F000000
cmpl %edx, %eax
setne %al
cmpl %edx, %ecx
setne %cl
andb %al, %cl
movzbl %cl, %eax
addq %rax, %r14
incq %r12
incq %r13
jmp 0x4708
movl %eax, %edx
movl $0x41000000, %r8d       # imm = 0x41000000
xorl %r8d, %edx
movl %eax, %esi
movl $0x47000000, %r9d       # imm = 0x47000000
xorl %r9d, %esi
movl %ecx, %edi
xorl %r8d, %edi
movl %ecx, %r8d
xorl %r9d, %r8d
orl %edx, %r8d
sete %dl
orl %esi, %edi
je 0x47a5
testb %dl, %dl
je 0x47a8
jmp 0x47a5
movl %ecx, %edi
movl $0x47000000, %esi       # imm = 0x47000000
xorl %esi, %edi
movl %eax, %r8d
movl $0x43000000, %edx       # imm = 0x43000000
xorl %edx, %r8d
cmpl %edx, %ecx
sete %dl
cmpl $0x54000000, %ecx       # imm = 0x54000000
sete %r9b
cmpl %esi, %eax
sete %sil
orl %edi, %r8d
sete %dil
testb %r9b, %sil
jne 0x4784
testb %dil, %dil
jne 0x4784
andb %dl, %sil
je 0x4787
jmp 0x4784
movq 0x8(%rsp), %rax
movq %rbp, (%rax)
movq 0x10(%rsp), %rax
movq %rbx, (%rax)
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x4868
movq %r14, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop