// File: /workspace/github_cpp_makefile_star2_O1/kiudee[P]VAHD-Projekt/Node.cpp
// Function: Node::doDebruijnHop(SearchJob*)
bool Node::doDebruijnHop(SearchJob *sj)
{
    if (!isReal) {
        return false;
    }
    double hashedkey = sj->sid;

    if (hashedkey < num) {
        if (fabs(hashedkey - num / 2) < fabs(hashedkey - num)) {
            sj->round++;
            sj->hopcount++;
            if (sj->type == LOOKUP || sj->type == INSERT || sj->type == DELETE) {
                std::cout << "(" << sj->_debugID << ") " << num << "<-doDebruijnHop(" << sj->sid << ") to " << (num / 2) << "\n";
            }
            node0->out->call(Node::Search, sj);
            return true;
        }

    } else if (hashedkey > num) {
        if (fabs(hashedkey - (1 + num) / 2) < fabs(hashedkey - num)) {
            sj->round++;
            sj->hopcount++;
            if (sj->type == LOOKUP || sj->type == INSERT || sj->type == DELETE) {
                std::cout << "(" << sj->_debugID << ") " << num << "<-doDebruijnHop(" << sj->sid << ") to " << ((1 + num) / 2) << "\n";
            }
            node1->out->call(Node::Search, sj);
            return true;
        }
    } else { // hashedkey == num
        FinishSearch(sj);
    }
    return false;//default: if no hop was performed, perform a list hop
}

// Assembly:
cmpb $0x1, 0xb8(%rdi)
jne 0xa929
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movsd 0x20(%rsi), %xmm0
movsd 0xb0(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xa92c
movsd 0x2ba9(%rip), %xmm2     # 0xd3d8
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movapd 0x2ba1(%rip), %xmm3     # 0xd3e0
andpd %xmm3, %xmm2
subsd %xmm1, %xmm0
andpd %xmm3, %xmm0
ucomisd %xmm2, %xmm0
jbe 0xaaa4
incl 0x48(%r14)
incl 0x4c(%r14)
cmpl $0x2, 0x38(%r14)
ja 0xa91d
movq 0x7761(%rip), %r15      # 0x11fd0
leaq 0x2be7(%rip), %rsi      # 0xd45d
movl $0x1, %edx
movq %r15, %rdi
callq 0x31a0
movq (%r14), %rsi
movq %r15, %rdi
callq 0x30e0
movq %rax, %r15
leaq 0x2b9e(%rip), %rsi      # 0xd436
movl $0x2, %edx
movq %rax, %rdi
callq 0x31a0
movsd 0xb0(%rbx), %xmm0
movq %r15, %rdi
callq 0x3230
movq %rax, %r15
leaq 0x2bca(%rip), %rsi      # 0xd489
movl $0x10, %edx
movq %rax, %rdi
callq 0x31a0
movsd 0x20(%r14), %xmm0
movq %r15, %rdi
callq 0x3230
movq %rax, %r15
leaq 0x2bb6(%rip), %rsi      # 0xd49a
movl $0x5, %edx
movq %rax, %rdi
callq 0x31a0
movsd 0xb0(%rbx), %xmm0
mulsd 0x2ab7(%rip), %xmm0     # 0xd3b8
movq %r15, %rdi
callq 0x3230
leaq 0x2b5f(%rip), %rsi      # 0xd46f
movl $0x1, %edx
movq %rax, %rdi
callq 0x31a0
movq 0xd8(%rbx), %rax
jmp 0xaa43
xorl %eax, %eax
retq
ucomisd %xmm1, %xmm0
jbe 0xaa99
movsd 0x2a82(%rip), %xmm2     # 0xd3c0
addsd %xmm1, %xmm2
mulsd 0x2a8e(%rip), %xmm2     # 0xd3d8
addsd %xmm0, %xmm2
movapd 0x2a8a(%rip), %xmm3     # 0xd3e0
andpd %xmm3, %xmm2
subsd %xmm1, %xmm0
andpd %xmm3, %xmm0
ucomisd %xmm2, %xmm0
jbe 0xaaa4
incl 0x48(%r14)
incl 0x4c(%r14)
cmpl $0x2, 0x38(%r14)
ja 0xaa3c
movq 0x764a(%rip), %r15      # 0x11fd0
leaq 0x2ad0(%rip), %rsi      # 0xd45d
movl $0x1, %edx
movq %r15, %rdi
callq 0x31a0
movq (%r14), %rsi
movq %r15, %rdi
callq 0x30e0
movq %rax, %r15
leaq 0x2a87(%rip), %rsi      # 0xd436
movl $0x2, %edx
movq %rax, %rdi
callq 0x31a0
movsd 0xb0(%rbx), %xmm0
movq %r15, %rdi
callq 0x3230
movq %rax, %r15
leaq 0x2ab3(%rip), %rsi      # 0xd489
movl $0x10, %edx
movq %rax, %rdi
callq 0x31a0
movsd 0x20(%r14), %xmm0
movq %r15, %rdi
callq 0x3230
movq %rax, %r15
leaq 0x2a9f(%rip), %rsi      # 0xd49a
movl $0x5, %edx
movq %rax, %rdi
callq 0x31a0
movsd 0xb0(%rbx), %xmm0
addsd 0x29a8(%rip), %xmm0     # 0xd3c0
mulsd 0x2998(%rip), %xmm0     # 0xd3b8
movq %r15, %rdi
callq 0x3230
leaq 0x2a40(%rip), %rsi      # 0xd46f
movl $0x1, %edx
movq %rax, %rdi
callq 0x31a0
movq 0xe0(%rbx), %rax
movq 0x28(%rax), %r15
movl $0x38, %edi
callq 0x3160
leaq 0x7750(%rip), %rcx      # 0x121a8
movq (%rcx), %rdx
movq %rdx, (%rax)
incq %rdx
movq %rdx, (%rcx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rax)
leaq -0x134a(%rip), %rcx     # 0x972a
movq %rcx, 0x18(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movq %r14, 0x28(%rax)
movq %rcx, 0x30(%rax)
movq (%r15), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq *0x8(%rcx)
movb $0x1, %al
jmp 0xaaa6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x998e
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq