// File: WShabti-Team[P]WShabtiPict/wshabtilib/api/deriver.cpp
// Function: pictcore::ExclusionDeriver::consistent(pictcore::Exclusion&, pictcore::Exclusion&)
bool ExclusionDeriver::consistent( Exclusion &aa, Exclusion &bb )
{
    // make sure the smaller one is in the outer loop
    Exclusion *a;
    Exclusion *b;
    if( aa.size() < bb.size() )
    {
        a = &aa;
        b = &bb;
    }
    else
    {
        a = &bb;
        b = &aa;
    }

    Exclusion::iterator ib = b->begin();
    for( Exclusion::iterator ia = a->begin(); ia != a->end(); ++ia )
    {
        if( m_currentParam == ia->first )
            continue;

        // move ib to see if we can find ia's parameter
        // ia and ib are sorted by (i->first)->GetSequence() asc then i->second
        while( ib != b->end() && ( ia->first )->GetSequence() > ( ib->first )->GetSequence() )
            ++ib;

        // end of b, return true
        if( ib == b->end() )
            return true;

        // see if params match; if not, move on
        if( ( ia->first )->GetSequence() != ( ib->first )->GetSequence() )
            continue;

        // params match, what about values
        if( ia->second != ib->second )
            return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0xaa10
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
callq 0xaa10
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0x9d63
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x9d73
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9090
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
callq 0x9090
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x90c0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x9130
testb $0x1, %al
jne 0x9db0
jmp 0x9ed5
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x70(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9160
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq (%rcx), %rax
jne 0x9dd6
jmp 0x9ec7
jmp 0x9dd8
movq -0x30(%rbp), %rdi
callq 0x90c0
movq %rax, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x9130
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x71(%rbp)
jne 0x9e00
jmp 0x9e32
leaq -0x40(%rbp), %rdi
callq 0x9160
movq (%rax), %rdi
callq 0xaa30
movl %eax, -0x78(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9160
movq (%rax), %rdi
callq 0xaa30
movl %eax, %ecx
movl -0x78(%rbp), %eax
cmpl %ecx, %eax
setg %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x9e3b
jmp 0x9e46
leaq -0x38(%rbp), %rdi
callq 0x9210
jmp 0x9dd8
movq -0x30(%rbp), %rdi
callq 0x90c0
movq %rax, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xaa50
testb $0x1, %al
jne 0x9e66
jmp 0x9e6c
movb $0x1, -0x1(%rbp)
jmp 0x9ed9
leaq -0x40(%rbp), %rdi
callq 0x9160
movq (%rax), %rdi
callq 0xaa30
movl %eax, -0x7c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9160
movq (%rax), %rdi
callq 0xaa30
movl %eax, %ecx
movl -0x7c(%rbp), %eax
cmpl %ecx, %eax
je 0x9e9c
jmp 0x9ec7
leaq -0x40(%rbp), %rdi
callq 0x9160
movl 0x8(%rax), %eax
movl %eax, -0x80(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9160
movq %rax, %rcx
movl -0x80(%rbp), %eax
cmpl 0x8(%rcx), %eax
je 0x9ec5
movb $0x0, -0x1(%rbp)
jmp 0x9ed9
jmp 0x9ec7
leaq -0x40(%rbp), %rdi
callq 0x9210
jmp 0x9d8d
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)