// File: /workspace/github_c_makefile_star2_O2/chriso[P]columnix/lib/predicate.c
// Function: cx_index_match_indexes
enum cx_index_match cx_index_match_indexes(const struct cx_predicate *predicate,
                                           const struct cx_row_group *row_group)
{
    if (!cx_row_group_row_count(row_group))
        return CX_INDEX_MATCH_NONE;

    const struct cx_index *index =
        cx_row_group_column_index(row_group, predicate->column);
    enum cx_column_type type =
        cx_row_group_column_type(row_group, predicate->column);
    enum cx_index_match result = CX_INDEX_MATCH_UNKNOWN;
    switch (predicate->type) {
        case CX_PREDICATE_TRUE:
            result = CX_INDEX_MATCH_ALL;
            break;
        case CX_PREDICATE_NULL:
            index = cx_row_group_null_index(row_group, predicate->column);
            result = cx_index_match_bit_eq(index, true);
            break;
        case CX_PREDICATE_EQ:
            result = cx_index_match_index_eq(predicate, type, index);
            break;
        case CX_PREDICATE_LT:
            result = cx_index_match_index_lt(predicate, type, index);
            break;
        case CX_PREDICATE_GT:
            result = cx_index_match_index_gt(predicate, type, index);
            break;
        case CX_PREDICATE_CONTAINS:
            result = cx_index_match_str_contains(index, &predicate->value.str);
            break;
        case CX_PREDICATE_AND:
            result = CX_INDEX_MATCH_ALL;
            for (size_t i = 0;
                 result != CX_INDEX_MATCH_NONE && i < predicate->operand_count;
                 i++) {
                enum cx_index_match operand_match =
                    cx_index_match_indexes(predicate->operands[i], row_group);
                if (operand_match < result)
                    result = operand_match;
            }
            break;
        case CX_PREDICATE_OR:
            result = CX_INDEX_MATCH_NONE;
            for (size_t i = 0;
                 result != CX_INDEX_MATCH_ALL && i < predicate->operand_count;
                 i++) {
                enum cx_index_match operand_match =
                    cx_index_match_indexes(predicate->operands[i], row_group);
                if (operand_match > result)
                    result = operand_match;
            }
            break;
        case CX_PREDICATE_CUSTOM:
            if (predicate->custom.match_index) {
                const struct cx_index *index =
                    cx_row_group_column_index(row_group, predicate->column);
                result = predicate->custom.match_index(type, index,
                                                       predicate->custom.data);
            }
            break;
    }
    return predicate->negate ? -result : result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x5460
testq %rax, %rax
je 0x8104
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x5100
movq %rax, %r14
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x5920
movl %eax, %r12d
movl (%rbx), %eax
xorl %ebp, %ebp
cmpq $0x8, %rax
ja 0x8397
leaq 0x392d(%rip), %rcx      # 0xba20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x1
popq %rbp
jmp 0x8397
pushq $-0x1
popq %rax
jmp 0x83a2
decl %r12d
cmpl $0x3, %r12d
ja 0x8397
leaq 0x3924(%rip), %rax      # 0xba44
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpl $0x1, 0x4(%rbx)
jne 0x83ab
movl 0x10(%rbx), %esi
movq %r14, %rdi
callq 0x53f0
jmp 0x8395
cmpl $0x5, %r12d
ja 0x8397
movl %r12d, %eax
leaq 0x390d(%rip), %rcx      # 0xba64
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x4(%rbx)
jne 0x84a3
movzbl 0x10(%rbx), %esi
movq %r14, %rdi
jmp 0x81f9
decl %r12d
cmpl $0x3, %r12d
ja 0x8397
leaq 0x38ca(%rip), %rax      # 0xba54
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpl $0x1, 0x4(%rbx)
jne 0x8427
movl 0x10(%rbx), %esi
movq %r14, %rdi
callq 0x5810
jmp 0x8395
pushq $-0x1
popq %r14
xorl %r12d, %r12d
pushq $0x1
popq %rbp
cmpl $0x1, %r14d
je 0x8397
cmpq 0x20(%rbx), %r12
jae 0x8273
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x51a0
incq %r12
cmpl %r14d, %eax
cmovgl %eax, %r14d
jmp 0x81b7
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x5510
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x55f0
jmp 0x8395
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x57a0
jmp 0x8395
pushq $0x1
popq %r14
xorl %r12d, %r12d
pushq $-0x1
popq %rbp
cmpl $-0x1, %r14d
je 0x8397
cmpq 0x20(%rbx), %r12
jae 0x8273
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x51a0
incq %r12
cmpl %r14d, %eax
cmovll %eax, %r14d
jmp 0x821e
cmpq $0x0, 0x48(%rbx)
je 0x8397
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x5100
movq 0x58(%rbx), %rdx
movl %r12d, %edi
movq %rax, %rsi
callq *0x48(%rbx)
jmp 0x8395
movl %r14d, %ebp
jmp 0x8397
cmpl $0x3, 0x4(%rbx)
jne 0x83ca
movss 0x10(%rbx), %xmm0
movq %r14, %rdi
callq 0x5250
jmp 0x8395
cmpl $0x4, 0x4(%rbx)
jne 0x83e9
movsd 0x10(%rbx), %xmm0
movq %r14, %rdi
callq 0x5450
jmp 0x8395
cmpl $0x2, 0x4(%rbx)
jne 0x8408
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x51c0
jmp 0x8395
cmpl $0x3, 0x4(%rbx)
jne 0x8446
movss 0x10(%rbx), %xmm0
movq %r14, %rdi
callq 0x5a10
jmp 0x8395
cmpl $0x4, 0x4(%rbx)
jne 0x8465
movsd 0x10(%rbx), %xmm0
movq %r14, %rdi
callq 0x59c0
jmp 0x8395
cmpl $0x2, 0x4(%rbx)
jne 0x8484
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x58d0
jmp 0x8395
cmpl $0x4, 0x4(%rbx)
jne 0x84c2
movsd 0x10(%rbx), %xmm0
movq %r14, %rdi
callq 0x51e0
jmp 0x8395
cmpl $0x2, 0x4(%rbx)
jne 0x84e1
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x54d0
jmp 0x8395
cmpl $0x3, 0x4(%rbx)
jne 0x8500
movss 0x10(%rbx), %xmm0
movq %r14, %rdi
callq 0x5a40
jmp 0x8395
cmpl $0x1, 0x4(%rbx)
jne 0x851f
movl 0x10(%rbx), %esi
movq %r14, %rdi
callq 0x55c0
jmp 0x8395
cmpl $0x5, 0x4(%rbx)
jne 0x853e
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x5790
movl %eax, %ebp
movl %ebp, %eax
negl %eax
cmpb $0x0, 0x3d(%rbx)
cmovel %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3874(%rip), %rdi      # 0xbc26
leaq 0x36fb(%rip), %rsi      # 0xbab4
leaq 0x3ba9(%rip), %rcx      # 0xbf69
movl $0x2a9, %edx            # imm = 0x2A9
callq 0x5380
leaq 0x38a5(%rip), %rdi      # 0xbc76
leaq 0x36dc(%rip), %rsi      # 0xbab4
leaq 0x3b8a(%rip), %rcx      # 0xbf69
movl $0x2b1, %edx            # imm = 0x2B1
callq 0x5380
leaq 0x38ae(%rip), %rdi      # 0xbc9e
leaq 0x36bd(%rip), %rsi      # 0xbab4
leaq 0x3b6b(%rip), %rcx      # 0xbf69
movl $0x2b5, %edx            # imm = 0x2B5
callq 0x5380
leaq 0x383f(%rip), %rdi      # 0xbc4e
leaq 0x369e(%rip), %rsi      # 0xbab4
leaq 0x3b4c(%rip), %rcx      # 0xbf69
movl $0x2ad, %edx            # imm = 0x2AD
callq 0x5380
leaq 0x37f8(%rip), %rdi      # 0xbc26
leaq 0x367f(%rip), %rsi      # 0xbab4
leaq 0x3ab6(%rip), %rcx      # 0xbef2
movl $0x252, %edx            # imm = 0x252
callq 0x5380
leaq 0x3829(%rip), %rdi      # 0xbc76
leaq 0x3660(%rip), %rsi      # 0xbab4
leaq 0x3a97(%rip), %rcx      # 0xbef2
movl $0x25a, %edx            # imm = 0x25A
callq 0x5380
leaq 0x3832(%rip), %rdi      # 0xbc9e
leaq 0x3641(%rip), %rsi      # 0xbab4
leaq 0x3a78(%rip), %rcx      # 0xbef2
movl $0x25e, %edx            # imm = 0x25E
callq 0x5380
leaq 0x37c3(%rip), %rdi      # 0xbc4e
leaq 0x3622(%rip), %rsi      # 0xbab4
leaq 0x3a59(%rip), %rcx      # 0xbef2
movl $0x256, %edx            # imm = 0x256
callq 0x5380
leaq 0x36d1(%rip), %rdi      # 0xbb7b
leaq 0x3603(%rip), %rsi      # 0xbab4
leaq 0x39c3(%rip), %rcx      # 0xbe7b
movl $0x1f5, %edx            # imm = 0x1F5
callq 0x5380
leaq 0x37d5(%rip), %rdi      # 0xbc9e
leaq 0x35e4(%rip), %rsi      # 0xbab4
leaq 0x39a4(%rip), %rcx      # 0xbe7b
movl $0x205, %edx            # imm = 0x205
callq 0x5380
leaq 0x3766(%rip), %rdi      # 0xbc4e
leaq 0x35c5(%rip), %rsi      # 0xbab4
leaq 0x3985(%rip), %rcx      # 0xbe7b
movl $0x1fd, %edx            # imm = 0x1FD
callq 0x5380
leaq 0x376f(%rip), %rdi      # 0xbc76
leaq 0x35a6(%rip), %rsi      # 0xbab4
leaq 0x3966(%rip), %rcx      # 0xbe7b
movl $0x201, %edx            # imm = 0x201
callq 0x5380
leaq 0x3700(%rip), %rdi      # 0xbc26
leaq 0x3587(%rip), %rsi      # 0xbab4
leaq 0x3947(%rip), %rcx      # 0xbe7b
movl $0x1f9, %edx            # imm = 0x1F9
callq 0x5380
leaq 0x3781(%rip), %rdi      # 0xbcc6
leaq 0x3568(%rip), %rsi      # 0xbab4
leaq 0x3928(%rip), %rcx      # 0xbe7b
movl $0x209, %edx            # imm = 0x209
callq 0x5380