// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]optimal-seed-solver/HashTree.cc
// Function: HashTree::test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void HashTree::test(string DNA) {
	hashVal = hashgen.calculateHash(DNA, hashLength);

	queryCursor = root[hashVal];

	if (queryCursor == NULL) {
		cout << "NULL pointer detected" << endl;
		cout << "DNA: " << DNA << endl;
		cout << "hashLength: " << hashLength << endl;

	}

	TreeNode* nextCursor = queryCursor;

	int i;
	//The depth depends on the length of the string: DNA
	for (i = hashLength; i < DNA.length(); i++) {
		cout << "TreeNode: " << DNA.substr(0, i)
			<< " of frequency: " << queryCursor->getLocNum()
			<< " from chromosome: " << queryCursor->getChrNum()
			<< " at location: " << queryCursor->getLocation()
			<< " isLeaf: " << queryCursor->isLeaf() << endl;

		if (!queryCursor->isLeaf() ) {
			switch (DNA[i]) {
				case 'A':
					nextCursor = queryCursor->getA();
					break;
				case 'C':
					nextCursor = queryCursor->getC();
					break;
				case 'G':
					nextCursor = queryCursor->getG();
					break;
				case 'T':
					nextCursor = queryCursor->getT();
					break;
				default:
					cerr << "unrecognized character: " << DNA[i] << endl;
					break;
			}
		}

		queryCursor = nextCursor;

		if (queryCursor == NULL || queryCursor->isLeaf() )
			break;
	}

	cout << "LastNode: " << DNA.substr(0, i);
		if (queryCursor != NULL)
			cout << " of frequency: " << queryCursor->getLocNum()
				<< " from chromosome: " << queryCursor->getChrNum()
				<< " at location: " << queryCursor->getLocation()
				<< " isLeaf: " << queryCursor->isLeaf() << endl;
		else
			cout << " is NULL." << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x318, %rdi            # imm = 0x318
movl (%rbx), %edx
callq 0x8b72
movl %eax, 0x340(%rbx)
movq 0x320(%rbx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rax
movq %rax, 0x348(%rbx)
testq %rax, %rax
jne 0x6666
movq 0x6a32(%rip), %r15      # 0xcfc8
leaq 0x2d2f(%rip), %rsi      # 0x92cc
movl $0x15, %edx
movq %r15, %rdi
callq 0x32d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
leaq 0x2d0a(%rip), %rsi      # 0x92e2
movl $0x5, %edx
movq %r15, %rdi
callq 0x32d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x32d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
leaq 0x2cc3(%rip), %rsi      # 0x92e8
movl $0xc, %edx
movq %r15, %rdi
callq 0x32d0
movl (%rbx), %esi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
movslq (%rbx), %r15
cmpq %r15, 0x8(%r14)
jbe 0x68c2
movq 0x348(%rbx), %r13
movq 0x6947(%rip), %r12      # 0xcfc8
movl $0xa, %edx
movq %r12, %rdi
leaq 0x2c65(%rip), %rsi      # 0x92f5
callq 0x32d0
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3290
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0x32d0
movq %rax, %rbp
movl $0xf, %edx
movq %rax, %rdi
leaq 0x2c35(%rip), %rsi      # 0x9300
callq 0x32d0
movq 0x348(%rbx), %rax
movl 0x8(%rax), %esi
movq %rbp, %rdi
callq 0x31b0
movq %rax, %rbp
movl $0x12, %edx
movq %rax, %rdi
leaq 0x2c1c(%rip), %rsi      # 0x9310
callq 0x32d0
movq 0x348(%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, %esi
movq %rbp, %rdi
callq 0x31b0
movq %rax, %rbp
movl $0xe, %edx
movq %rax, %rdi
leaq 0x2c01(%rip), %rsi      # 0x9323
callq 0x32d0
movq 0x348(%rbx), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
movl %eax, %esi
movq %rbp, %rdi
callq 0x31b0
movq %rax, %rbp
movl $0x9, %edx
movq %rax, %rdi
leaq 0x2be2(%rip), %rsi      # 0x9332
callq 0x32d0
movq 0x348(%rbx), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
movzbl %al, %esi
movq %rbp, %rdi
callq 0x3400
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x67b3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x348(%rbx), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb %al, %al
je 0x67f8
movq %r13, 0x348(%rbx)
testq %r13, %r13
je 0x68c2
movq (%r13), %rax
movq %r13, %rdi
callq *0x28(%rax)
testb %al, %al
jne 0x68c2
incq %r15
cmpq %r15, 0x8(%r14)
ja 0x6681
jmp 0x68c2
movq (%r14), %rax
movzbl (%rax,%r15), %eax
cmpl $0x46, %eax
jg 0x6820
cmpl $0x41, %eax
je 0x68a2
cmpl $0x43, %eax
jne 0x683b
movq 0x348(%rbx), %rax
movq 0x20(%rax), %r13
jmp 0x67c4
cmpl $0x47, %eax
je 0x68b2
cmpl $0x54, %eax
jne 0x683b
movq 0x348(%rbx), %rax
movq 0x30(%rax), %r13
jmp 0x67c4
movl $0x18, %edx
movq 0x67a9(%rip), %rbp      # 0xcff0
movq %rbp, %rdi
leaq 0x2995(%rip), %rsi      # 0x91e6
callq 0x32d0
movq (%r14), %rax
movb (%rax,%r15), %al
movb %al, 0x8(%rsp)
movl $0x1, %edx
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x32d0
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
jmp 0x67c4
movq 0x348(%rbx), %rax
movq 0x18(%rax), %r13
jmp 0x67c4
movq 0x348(%rbx), %rax
movq 0x28(%rax), %r13
jmp 0x67c4
movq 0x66ff(%rip), %r12      # 0xcfc8
leaq 0x2a6c(%rip), %rsi      # 0x933c
movl $0xa, %edx
movq %r12, %rdi
callq 0x32d0
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3290
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r12, %rdi
callq 0x32d0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x691d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
cmpq $0x0, 0x348(%rbx)
je 0x69e8
movq 0x6696(%rip), %r14      # 0xcfc8
leaq 0x29c7(%rip), %rsi      # 0x9300
movl $0xf, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x348(%rbx), %rax
movl 0x8(%rax), %esi
movq %r14, %rdi
callq 0x31b0
movq %rax, %r14
leaq 0x29ae(%rip), %rsi      # 0x9310
movl $0x12, %edx
movq %rax, %rdi
callq 0x32d0
movq 0x348(%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, %esi
movq %r14, %rdi
callq 0x31b0
movq %rax, %r14
leaq 0x2993(%rip), %rsi      # 0x9323
movl $0xe, %edx
movq %rax, %rdi
callq 0x32d0
movq 0x348(%rbx), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
movl %eax, %esi
movq %r14, %rdi
callq 0x31b0
movq %rax, %r14
leaq 0x2974(%rip), %rsi      # 0x9332
movl $0x9, %edx
movq %rax, %rdi
callq 0x32d0
movq 0x348(%rbx), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
movzbl %al, %esi
movq %r14, %rdi
callq 0x3400
movq %rax, %r12
jmp 0x69fc
leaq 0x2958(%rip), %rsi      # 0x9347
movl $0x9, %edx
movq %r12, %rdi
callq 0x32d0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x6a4e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6a60
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450