// File: /workspace/github_c_makefile_star2_O0/chriso[P]columnix/lib/writer.c
// Function: cx_row_group_writer_put_column
static bool cx_row_group_writer_put_column(struct cx_row_group_writer *writer,
                                           const struct cx_column *column,
                                           const struct cx_index *index,
                                           struct cx_column_header *header,
                                           enum cx_compression_type compression,
                                           int compression_level)
{
    size_t column_size;
    const void *buffer = cx_column_export(column, &column_size);
    header->decompressed_size = column_size;
    header->offset = cx_write_align(cx_row_group_writer_offset(writer));
    header->encoding = cx_column_encoding(column);
    memcpy(&header->index, index, sizeof(*index));
    size_t compressed_size = 0;
    void *compressed = NULL;
    if (compression && column_size) {
        compressed = cx_compress(compression, compression_level, buffer,
                                 column_size, &compressed_size);
        if (!compressed)
            goto error;
        // fallback if the compression leads to an increase in size
        if (compressed_size >= column_size) {
            header->compression = CX_COMPRESSION_NONE;
        } else {
            header->compression = compression;
            buffer = compressed;
            column_size = compressed_size;
        }
    }
    header->size = column_size;
    if (!cx_row_group_writer_write(writer, buffer, column_size))
        goto error;
    if (compressed)
        free(compressed);
    return true;
error:
    if (compressed)
        free(compressed);
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5170
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0xfaa0
movq %rax, %rdi
callq 0xfc20
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x50f0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x20(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x28(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x30(%rax)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0xfbbd
cmpq $0x0, -0x38(%rbp)
je 0xfbbd
movl -0x2c(%rbp), %edi
movl -0x30(%rbp), %esi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x58e0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0xfb8a
jmp 0xfbf6
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jb 0xfba1
movq -0x28(%rbp), %rax
movl $0x0, 0x18(%rax)
jmp 0xfbbb
movl -0x2c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xfbbd
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0xfc60
testb $0x1, %al
jne 0xfbe0
jmp 0xfbf6
cmpq $0x0, -0x50(%rbp)
je 0xfbf0
movq -0x50(%rbp), %rdi
callq 0x50a0
movb $0x1, -0x1(%rbp)
jmp 0xfc0a
cmpq $0x0, -0x50(%rbp)
je 0xfc06
movq -0x50(%rbp), %rdi
callq 0x50a0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)