// File: /workspace/github_c_makefile_star2_O0/chriso[P]columnix/lib/writer.c
// Function: cx_row_group_writer_add_column
bool cx_row_group_writer_add_column(struct cx_row_group_writer *writer,
                                    const char *name, enum cx_column_type type,
                                    enum cx_encoding_type encoding,
                                    enum cx_compression_type compression,
                                    int level)
{
    if (writer->header_written)
        return false;

    if (!writer->columns.count) {
        writer->columns.descriptors =
            malloc(sizeof(*writer->columns.descriptors) * 8);
        if (!writer->columns.descriptors)
            return false;
        writer->columns.size = 8;
    } else if (writer->columns.count == writer->columns.size) {
        size_t new_size = writer->columns.size * 2;
        assert(new_size && new_size > writer->columns.size);
        struct cx_column_descriptor *descriptors = realloc(
            writer->columns.descriptors, new_size * sizeof(*descriptors));
        if (!descriptors)
            return false;
        writer->columns.descriptors = descriptors;
        writer->columns.size = new_size;
    }

    struct cx_column_descriptor *descriptor =
        &writer->columns.descriptors[writer->columns.count++];
    memset(descriptor, 0, sizeof(*descriptor));
    descriptor->type = type;
    descriptor->encoding = encoding;
    descriptor->compression = compression;
    descriptor->compression_level = level;

    return cx_row_group_writer_add_string(writer, name, &descriptor->name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x58(%rax)
je 0xeb81
movb $0x0, -0x1(%rbp)
jmp 0xecd5
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xebc6
movl $0xc0, %edi
callq 0x5630
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xebb5
movb $0x0, -0x1(%rbp)
jmp 0xecd5
movq -0x10(%rbp), %rax
movq $0x8, 0x18(%rax)
jmp 0xec61
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0xec5f
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shlq %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xec02
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jbe 0xec02
jmp 0xec21
leaq 0x2ae3(%rip), %rdi      # 0x116ec
leaq 0x2b08(%rip), %rsi      # 0x11718
movl $0x149, %edx            # imm = 0x149
leaq 0x2b05(%rip), %rcx      # 0x11721
callq 0x53a0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
imulq $0x18, -0x30(%rbp), %rsi
callq 0x5760
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xec47
movb $0x0, -0x1(%rbp)
jmp 0xecd5
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0xec61
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x5400
movl -0x1c(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x20(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x24(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x28(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0xf600
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq