// File: /workspace/github_c_makefile_star2_O2/chriso[P]columnix/lib/index.c
// Function: cx_index_new
struct cx_index *cx_index_new(const struct cx_column *column)
{
    struct cx_index *index = calloc(1, sizeof(*index));
    if (!index)
        return NULL;
    struct cx_column_cursor *cursor = cx_column_cursor_new(column);
    if (!cursor)
        goto error;
    switch (cx_column_type(column)) {
        case CX_COLUMN_BIT:
            index->min.bit = true;
            cx_index_update_bit(index, cursor);
            break;
        case CX_COLUMN_I32:
            index->min.i32 = INT32_MAX;
            cx_index_update_i32(index, cursor);
            break;
        case CX_COLUMN_I64:
            index->min.i64 = INT64_MAX;
            cx_index_update_i64(index, cursor);
            break;
        case CX_COLUMN_FLT:
            index->min.flt = FLT_MAX;
            cx_index_update_flt(index, cursor);
            break;
        case CX_COLUMN_DBL:
            index->min.dbl = DBL_MAX;
            cx_index_update_dbl(index, cursor);
            break;
        case CX_COLUMN_STR:
            index->min.len = UINT64_MAX;
            cx_index_update_str(index, cursor);
            break;
    }
    cx_column_cursor_free(cursor);
    return index;
error:
    free(index);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r12
pushq $0x1
popq %r15
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0x5480
testq %rax, %rax
je 0x6416
movq %rax, %rbx
movq %r12, %rdi
callq 0x53e0
testq %rax, %rax
je 0x640e
movq %rax, %r14
movq %r12, %rdi
callq 0x54b0
cmpl $0x5, %eax
ja 0x668e
movl %eax, %eax
leaq 0x4ee2(%rip), %rcx      # 0xb27c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, 0x8(%rbx)
movb $0x1, %bpl
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x52f0
testb %al, %al
je 0x668e
movq %r14, %rdi
movq %rsp, %rsi
callq 0x5660
movq (%rsp), %rdx
testq %rdx, %rdx
je 0x66a8
addq %rdx, %r12
movq %r12, (%rbx)
movq (%rax), %rax
xorl %ecx, %ecx
cmpq %rcx, %rdx
je 0x6404
movq %r15, %rsi
shlq %cl, %rsi
testq %rsi, %rax
setne %sil
andb %sil, %bpl
orb %sil, %r13b
andb $0x1, %r13b
incq %rcx
jmp 0x63e3
movb %bpl, 0x8(%rbx)
movb %r13b, 0x10(%rbx)
jmp 0x63b0
movq %rbx, %rdi
callq 0x5090
xorl %ebx, %ebx
jmp 0x6696
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x4e34(%rip), %xmm0     # 0xb270
movsd %xmm0, 0x8(%rsp)
xorl %r12d, %r12d
movq %rsp, %r15
movq %r14, %rdi
callq 0x52f0
testb %al, %al
je 0x668e
movq %r14, %rdi
movq %r15, %rsi
callq 0x51d0
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x66c1
addq %rcx, %r12
movq %r12, (%rbx)
xorl %edx, %edx
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
cmpq %rdx, %rcx
je 0x64b1
movsd (%rax,%rdx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x649d
movsd %xmm0, 0x10(%rbx)
movapd %xmm0, %xmm1
ucomisd %xmm0, %xmm2
jbe 0x64ac
movsd %xmm0, 0x8(%rbx)
movapd %xmm0, %xmm2
incq %rdx
jmp 0x6484
movsd %xmm2, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
jmp 0x6448
movabsq $0x7fffffffffffffff, %r12 # imm = 0x7FFFFFFFFFFFFFFF
movq %r12, 0x8(%rbx)
xorl %r13d, %r13d
movq %rsp, %r15
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x52f0
testb %al, %al
je 0x668e
movq %r14, %rdi
movq %r15, %rsi
callq 0x5290
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x66e0
addq %rcx, %rbp
movq %rbp, (%rbx)
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x64d5
movq (%rax,%rdx,8), %rsi
cmpq %r13, %rsi
jle 0x651a
movq %rsi, 0x10(%rbx)
movq %rsi, %r13
cmpq %r12, %rsi
jge 0x6526
movq %rsi, 0x8(%rbx)
movq %rsi, %r12
incq %rdx
jmp 0x6505
movl $0x7f7fffff, 0x8(%rbx)  # imm = 0x7F7FFFFF
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x4d35(%rip), %xmm0     # 0xb278
movss %xmm0, 0x8(%rsp)
xorl %r12d, %r12d
movq %rsp, %r15
movq %r14, %rdi
callq 0x52f0
testb %al, %al
je 0x668e
movq %r14, %rdi
movq %r15, %rsi
callq 0x53a0
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x66f9
addq %rcx, %r12
movq %r12, (%rbx)
xorl %edx, %edx
movss 0x10(%rsp), %xmm1
movss 0x8(%rsp), %xmm2
cmpq %rdx, %rcx
je 0x65b4
movss (%rax,%rdx,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x65a2
movss %xmm0, 0x10(%rbx)
movaps %xmm0, %xmm1
ucomiss %xmm0, %xmm2
jbe 0x65af
movss %xmm0, 0x8(%rbx)
movaps %xmm0, %xmm2
incq %rdx
jmp 0x658b
movss %xmm2, 0x8(%rsp)
movss %xmm1, 0x10(%rsp)
jmp 0x654f
movl $0x7fffffff, 0x8(%rbx)  # imm = 0x7FFFFFFF
xorl %r12d, %r12d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq %rsp, %r15
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x52f0
testb %al, %al
je 0x668e
movq %r14, %rdi
movq %r15, %rsi
callq 0x5420
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x6712
addq %rcx, %r13
movq %r13, (%rbx)
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x65d7
movl (%rax,%rdx,4), %esi
cmpl %r12d, %esi
jle 0x661a
movl %esi, 0x10(%rbx)
movl %esi, %r12d
cmpl %ebp, %esi
jge 0x6623
movl %esi, 0x8(%rbx)
movl %esi, %ebp
incq %rdx
jmp 0x6607
orq $-0x1, 0x8(%rbx)
pushq $-0x1
popq %r12
xorl %r13d, %r13d
movq %rsp, %r15
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x52f0
testb %al, %al
je 0x668e
movq %r14, %rdi
movq %r15, %rsi
callq 0x5430
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x672f
addq %rcx, %rbp
movq %rbp, (%rbx)
addq $0x8, %rax
subq $0x1, %rcx
jb 0x6639
movq (%rax), %rdx
cmpq %r13, %rdx
jbe 0x667c
movq %rdx, 0x10(%rbx)
movq %rdx, %r13
cmpq %r12, %rdx
jae 0x6688
movq %rdx, 0x8(%rbx)
movq %rdx, %r12
addq $0x10, %rax
jmp 0x6667
movq %r14, %rdi
callq 0x58c0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5a20(%rip), %rdi      # 0xc0cf
leaq 0x4bde(%rip), %rsi      # 0xb294
leaq 0x4bdf(%rip), %rcx      # 0xb29c
pushq $0x45
jmp 0x6729
leaq 0x5a07(%rip), %rdi      # 0xc0cf
leaq 0x4bc5(%rip), %rsi      # 0xb294
leaq 0x4ce2(%rip), %rcx      # 0xb3b8
movl $0x8b, %edx
callq 0x5380
leaq 0x59e8(%rip), %rdi      # 0xc0cf
leaq 0x4ba6(%rip), %rsi      # 0xb294
leaq 0x4c35(%rip), %rcx      # 0xb32a
pushq $0x67
jmp 0x6729
leaq 0x59cf(%rip), %rdi      # 0xc0cf
leaq 0x4b8d(%rip), %rsi      # 0xb294
leaq 0x4c63(%rip), %rcx      # 0xb371
pushq $0x79
jmp 0x6729
leaq 0x59b6(%rip), %rdi      # 0xc0cf
leaq 0x4b74(%rip), %rsi      # 0xb294
leaq 0x4bbc(%rip), %rcx      # 0xb2e3
pushq $0x55
popq %rdx
callq 0x5380
leaq 0x5999(%rip), %rdi      # 0xc0cf
leaq 0x4b57(%rip), %rsi      # 0xb294
leaq 0x4cbb(%rip), %rcx      # 0xb3ff
movl $0x9e, %edx
callq 0x5380