// File: zimpha[P]MiniSQL/filter.cc
// Function: Filter::test(std::vector<element, std::allocator<element>> const&) const
bool Filter::test(const std::vector<element> &data) const {
    for (size_t i = 0; i < rules.size(); ++ i) {
        const Rule &rule = rules[i];
        assert((size_t)rule.index < data.size());
        switch (rule.type) {
            case 0:
                if (!(data[rule.index] <  rule.val)) return false;
                break;
            case 1:
                if (!(data[rule.index] <= rule.val)) return false;
                break;
            case 2:
                if (!(data[rule.index] == rule.val)) return false;
                break;
            case 3:
                if (!(data[rule.index] >= rule.val)) return false;
                break;
            case 4:
                if (!(data[rule.index] >  rule.val)) return false;
                break;
            case 5:
                if (!(data[rule.index] != rule.val)) return false;
                break;
            default: 
                assert(false);
        }
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x7a50
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x1dafb
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7a80
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8230
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x1d964
jmp 0x1d983
leaq 0x9b9d(%rip), %rdi      # 0x27508
leaq 0x9bb7(%rip), %rsi      # 0x27529
movl $0x12, %edx
leaq 0x9bb5(%rip), %rcx      # 0x27533
callq 0x31f0
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x48(%rbp)
subq $0x5, %rax
ja 0x1dac9
movq -0x48(%rbp), %rax
leaq 0x9b4d(%rip), %rcx      # 0x274f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq (%rax), %rsi
callq 0x8260
movq %rax, %rdi
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
callq 0x24850
testb $0x1, %al
jne 0x1d9d9
movb $0x0, -0x1(%rbp)
jmp 0x1daff
jmp 0x1dae8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq (%rax), %rsi
callq 0x8260
movq %rax, %rdi
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
callq 0x24ae0
testb $0x1, %al
jne 0x1da0b
movb $0x0, -0x1(%rbp)
jmp 0x1daff
jmp 0x1dae8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq (%rax), %rsi
callq 0x8260
movq %rax, %rdi
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
callq 0x24940
testb $0x1, %al
jne 0x1da3d
movb $0x0, -0x1(%rbp)
jmp 0x1daff
jmp 0x1dae8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq (%rax), %rsi
callq 0x8260
movq %rax, %rdi
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
callq 0x24a90
testb $0x1, %al
jne 0x1da6f
movb $0x0, -0x1(%rbp)
jmp 0x1daff
jmp 0x1dae8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq (%rax), %rsi
callq 0x8260
movq %rax, %rdi
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
callq 0x24a40
testb $0x1, %al
jne 0x1da9b
movb $0x0, -0x1(%rbp)
jmp 0x1daff
jmp 0x1dae8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq (%rax), %rsi
callq 0x8260
movq %rax, %rdi
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
callq 0x24b30
testb $0x1, %al
jne 0x1dac7
movb $0x0, -0x1(%rbp)
jmp 0x1daff
jmp 0x1dae8
leaq 0x9693(%rip), %rdi      # 0x27163
leaq 0x9a52(%rip), %rsi      # 0x27529
movl $0x27, %edx
leaq 0x9a50(%rip), %rcx      # 0x27533
callq 0x31f0
jmp 0x1daea
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1d910
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)