// File: /workspace/github_cpp_makefile_star2_O3/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
movb 0x3c(%rdi), %cl
cmpb $0x1, %cl
jne 0xbf6a
movq 0x40(%r14), %rdi
callq 0xd37a
testq %rax, %rax
je 0xc085
movq %rax, %rsi
addq $0xc, %rsi
movb 0x3c(%r14), %cl
movl (%rsi), %r15d
movq %rbx, %rax
testb $0x1, %cl
je 0xbf8e
movq 0x40(%r14), %rdi
movq %rbx, %rsi
callq 0xd37a
testq %rax, %rax
je 0xc085
addq $0xc, %rax
movq (%r14), %rdx
leaq (%r15,%r15,2), %rcx
cmpb $0x0, 0x8(%rdx,%rcx,4)
jne 0xc066
movl (%rax), %eax
leaq (%rax,%rax,2), %rax
cmpb $0x1, 0x8(%rdx,%rax,4)
je 0xc066
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 0xbfe9
movq 0x18(%r14), %rax
movq 0x8(%rax), %r8
subq (%rax), %r8
shrq $0x2, %r8
jmp 0xbff4
incl %r15d
leaq (%r15,%r15,2), %rax
movl (%rdx,%rax,4), %r8d
cmpl %r8d, %ecx
jne 0xc000
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xc060
movl %ecx, %eax
notl %eax
movq 0x18(%r14), %rdx
movq (%rdx), %rdx
movl (%rbx), %esi
addl %eax, %r8d
je 0xc051
movl %r8d, %edi
shrl %edi
xorl %r9d, %r9d
movl %r8d, %r10d
addl %r9d, %edi
leal (%rdi,%rcx), %eax
cmpl %esi, (%rdx,%rax,4)
je 0xc060
jae 0xc031
incl %edi
movl %edi, %r9d
jmp 0xc03c
cmpl $0x2, %r8d
jb 0xbff9
decl %edi
movl %edi, %r10d
movl %r10d, %edi
subl %r9d, %edi
shrl %edi
movl %r10d, %r8d
subl %r9d, %r8d
jne 0xc01d
addl %r9d, %edi
jmp 0xc053
xorl %edi, %edi
addl %ecx, %edi
cmpl %esi, (%rdx,%rdi,4)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovel %edi, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0xd698(%rip), %rdi      # 0x19705
leaq 0xd653(%rip), %rsi      # 0x196c7
leaq 0xd6be(%rip), %rcx      # 0x19739
movl $0xcb, %edx
callq 0x2110
leaq 0xd744(%rip), %rdi      # 0x197d0
callq 0x2280
nop