// File: /workspace/github_c_makefile_star2_O0/chriso[P]columnix/lib/reader.c
// Function: cx_reader_query
bool cx_reader_query(struct cx_reader *reader, int thread_count, void *data,
                     void (*iter)(struct cx_row_cursor *, pthread_mutex_t *,
                                  void *))
{
    if (thread_count <= 0)
        return false;
    if (!reader->row_group_count)
        return true;
    pthread_t *threads = NULL;
    struct cx_reader_query_context query_context = {
        .reader = reader->reader,
        .predicate = reader->predicate,
        .position = 0,
        .row_group_count = reader->row_group_count,
        .iter = iter,
        .data = data,
        .error = false};
    if (pthread_mutex_init(&query_context.mutex, NULL))
        return false;
    threads = malloc(thread_count * sizeof(pthread_t));
    if (!threads)
        goto error;
    for (int i = 0; i < thread_count; i++)
        if (pthread_create(&threads[i], NULL, cx_reader_query_thread,
                           &query_context))
            goto error;
    for (int i = 0; i < thread_count; i++)
        pthread_join(threads[i], NULL);
    free(threads);
    pthread_mutex_destroy(&query_context.mutex);
    return !query_context.error;
error:
    free(threads);
    pthread_mutex_destroy(&query_context.mutex);
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0xbc99
movb $0x0, -0x1(%rbp)
jmp 0xbe28
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xbcad
movb $0x1, -0x1(%rbp)
jmp 0xbe28
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movb $0x0, -0x60(%rbp)
leaq -0x90(%rbp), %rdi
addq $0x38, %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x5400
leaq -0x90(%rbp), %rdi
addq $0x38, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5a20
cmpl $0x0, %eax
je 0xbd33
movb $0x0, -0x1(%rbp)
jmp 0xbe28
movslq -0x14(%rbp), %rdi
shlq $0x3, %rdi
callq 0x5630
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xbd50
jmp 0xbe0b
movl $0x0, -0x94(%rbp)
movl -0x94(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xbda8
movq -0x30(%rbp), %rdi
movslq -0x94(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xbe(%rip), %rdx        # 0xbe40
leaq -0x90(%rbp), %rcx
callq 0x57d0
cmpl $0x0, %eax
je 0xbd95
jmp 0xbe0b
jmp 0xbd97
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0xbd5a
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xbde6
movq -0x30(%rbp), %rax
movslq -0x98(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x59c0
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0xbdb2
movq -0x30(%rbp), %rdi
callq 0x50a0
leaq -0x90(%rbp), %rdi
addq $0x38, %rdi
callq 0x5370
movb -0x60(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xbe28
movq -0x30(%rbp), %rdi
callq 0x50a0
leaq -0x90(%rbp), %rdi
addq $0x38, %rdi
callq 0x5370
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)