// File: /workspace/github_cpp_makefile_star2_O1/iPapatsoris[P]Maximum-Independent-Set/src/Graph.hpp
// Function: Graph::findEdgeOffset(unsigned int const&, unsigned int const&) const
uint32_t findEdgeOffset(const uint32_t &node, const uint32_t &neighbor) const {
        uint32_t pos = (!mapping ? node : idToPos->at(node));
        uint32_t nPos = (!mapping ? neighbor : idToPos->at(neighbor));
        assert(!nodeIndex[pos].removed && !nodeIndex[nPos].removed);
        uint32_t offset = nodeIndex[pos].offset;
        uint32_t endOffset = (pos == nodeIndex.size()-1 ? edgeBuffer->size() - 1 : nodeIndex[pos+1].offset - 1);
        if (offset == endOffset+1) {
            return NONE;
        }
        uint32_t startIndex = 0;
        uint32_t endIndex = endOffset - offset;
        uint32_t index = (endIndex - startIndex) / 2;
        while (startIndex != endIndex) {
            if ((*edgeBuffer)[offset + startIndex + index] == neighbor) {
                return offset + startIndex + index;
            } else if ((*edgeBuffer)[offset + startIndex + index] < neighbor) {
                startIndex += index + 1;
            } else {
                if (!index) {
                    return NONE;
                }
                endIndex = startIndex + index - 1;
            }
            index = (endIndex - startIndex) / 2;
        }
        return ((*edgeBuffer)[offset + startIndex + index] == neighbor ? offset + startIndex + index : NONE);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
cmpb $0x1, 0x3c(%rdi)
jne 0xc5ff
movq 0x40(%r14), %rdi
callq 0xda16
movq %rax, %rsi
movl (%rsi), %r15d
cmpb $0x1, 0x3c(%r14)
movq %rbx, %rax
jne 0xc618
movq 0x40(%r14), %rdi
movq %rbx, %rsi
callq 0xda16
movq (%r14), %rdx
leaq (%r15,%r15,2), %rcx
cmpb $0x0, 0x8(%rdx,%rcx,4)
jne 0xc6f4
movl (%rax), %eax
leaq (%rax,%rax,2), %rax
cmpb $0x1, 0x8(%rdx,%rax,4)
je 0xc6f4
leaq (%rdx,%rcx,4), %rax
movl (%rax), %ecx
movq 0x8(%r14), %rax
subq %rdx, %rax
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
decq %rsi
cmpq %r15, %rsi
jne 0xc673
movq 0x18(%r14), %rax
movq 0x8(%rax), %rdi
subq (%rax), %rdi
shrq $0x2, %rdi
jmp 0xc67d
incl %r15d
leaq (%r15,%r15,2), %rax
movl (%rdx,%rax,4), %edi
cmpl %edi, %ecx
jne 0xc688
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xc6ee
movl %ecx, %eax
notl %eax
addl %eax, %edi
movl %edi, %esi
shrl %esi
testl %edi, %edi
je 0xc6d4
movq 0x18(%r14), %rax
movq (%rax), %r8
movl (%rbx), %r9d
xorl %edx, %edx
movl %edi, %r10d
leal (%rsi,%rdx), %eax
addl %ecx, %eax
cmpl %r9d, (%r8,%rax,4)
je 0xc6ee
jae 0xc6b8
addl %esi, %edx
incl %edx
jmp 0xc6c4
cmpl $0x2, %edi
jb 0xc681
leal (%rsi,%rdx), %r10d
decl %r10d
movl %r10d, %esi
subl %edx, %esi
shrl %esi
movl %r10d, %edi
subl %edx, %edi
jne 0xc6a5
jmp 0xc6d6
xorl %edx, %edx
addl %esi, %edx
movq 0x18(%r14), %rax
addl %ecx, %edx
movq (%rax), %rax
movl (%rax,%rdx,4), %eax
cmpl (%rbx), %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovel %edx, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0xe00a(%rip), %rdi      # 0x1a705
leaq 0xdfc5(%rip), %rsi      # 0x1a6c7
leaq 0xe030(%rip), %rcx      # 0x1a739
movl $0xcb, %edx
callq 0x2110
nop