// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x54a0
cmpq $0x0, %rax
jne 0xac9b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xaece
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x5110
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x5970
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x58(%rbp)
subq $0x8, %rax
ja 0xaeae
movq -0x58(%rbp), %rax
leaq 0x5d4a(%rip), %rcx      # 0x10a34
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, -0x28(%rbp)
jmp 0xaeae
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x5560
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x5650
movl %eax, -0x28(%rbp)
jmp 0xaeae
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0xaee0
movl %eax, -0x28(%rbp)
jmp 0xaeae
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0xb0c0
movl %eax, -0x28(%rbp)
jmp 0xaeae
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0xb220
movl %eax, -0x28(%rbp)
jmp 0xaeae
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0x57f0
movl %eax, -0x28(%rbp)
jmp 0xaeae
movl $0x1, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
xorl %eax, %eax
cmpl $-0x1, -0x28(%rbp)
movb %al, -0x59(%rbp)
je 0xadb7
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
setb %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0xadc0
jmp 0xadfa
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
callq 0x51b0
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0xadea
movl -0x34(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0xadec
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xad9a
jmp 0xaeae
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x40(%rbp)
xorl %eax, %eax
cmpl $0x1, -0x28(%rbp)
movb %al, -0x5a(%rbp)
je 0xae2b
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
setb %al
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %al
testb $0x1, %al
jne 0xae34
jmp 0xae6e
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
callq 0x51b0
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0xae5e
movl -0x44(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0xae60
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xae0e
jmp 0xaeae
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xaeac
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x5110
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x24(%rbp), %edi
movq -0x50(%rbp), %rsi
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rdx
callq *%rax
movl %eax, -0x28(%rbp)
jmp 0xaeae
movq -0x10(%rbp), %rax
testb $0x1, 0x3d(%rax)
je 0xaec2
xorl %eax, %eax
subl -0x28(%rbp), %eax
movl %eax, -0x60(%rbp)
jmp 0xaec8
movl -0x28(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)