// File: /workspace/github_cpp_makefile_star2_O3/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 0x8b32
movl %eax, 0x340(%rbx)
movq 0x320(%rbx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rax
movq %rax, 0x348(%rbx)
testq %rax, %rax
jne 0x661c
movq 0x6a7c(%rip), %r15      # 0xcfc8
leaq 0x2d69(%rip), %rsi      # 0x92bc
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 0x2d44(%rip), %rsi      # 0x92d2
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 0x2cfd(%rip), %rsi      # 0x92d8
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 0x6878
movq 0x348(%rbx), %r13
movq 0x6991(%rip), %r12      # 0xcfc8
movl $0xa, %edx
movq %r12, %rdi
leaq 0x2c9f(%rip), %rsi      # 0x92e5
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 0x2c6f(%rip), %rsi      # 0x92f0
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 0x2c56(%rip), %rsi      # 0x9300
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 0x2c3b(%rip), %rsi      # 0x9313
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 0x2c1c(%rip), %rsi      # 0x9322
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 0x6769
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x348(%rbx), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testb %al, %al
je 0x67ae
movq %r13, 0x348(%rbx)
testq %r13, %r13
je 0x6878
movq (%r13), %rax
movq %r13, %rdi
callq *0x28(%rax)
testb %al, %al
jne 0x6878
incq %r15
cmpq %r15, 0x8(%r14)
ja 0x6637
jmp 0x6878
movq (%r14), %rax
movzbl (%rax,%r15), %eax
cmpl $0x46, %eax
jg 0x67d6
cmpl $0x41, %eax
je 0x6858
cmpl $0x43, %eax
jne 0x67f1
movq 0x348(%rbx), %rax
movq 0x20(%rax), %r13
jmp 0x677a
cmpl $0x47, %eax
je 0x6868
cmpl $0x54, %eax
jne 0x67f1
movq 0x348(%rbx), %rax
movq 0x30(%rax), %r13
jmp 0x677a
movl $0x18, %edx
movq 0x67f3(%rip), %rbp      # 0xcff0
movq %rbp, %rdi
leaq 0x29cf(%rip), %rsi      # 0x91d6
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 0x677a
movq 0x348(%rbx), %rax
movq 0x18(%rax), %r13
jmp 0x677a
movq 0x348(%rbx), %rax
movq 0x28(%rax), %r13
jmp 0x677a
movq 0x6749(%rip), %r12      # 0xcfc8
leaq 0x2aa6(%rip), %rsi      # 0x932c
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 0x68d3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
cmpq $0x0, 0x348(%rbx)
je 0x699e
movq 0x66e0(%rip), %r14      # 0xcfc8
leaq 0x2a01(%rip), %rsi      # 0x92f0
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 0x29e8(%rip), %rsi      # 0x9300
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 0x29cd(%rip), %rsi      # 0x9313
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 0x29ae(%rip), %rsi      # 0x9322
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 0x69b2
leaq 0x2992(%rip), %rsi      # 0x9337
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 0x6a04
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6a16
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450