// File: /workspace/github_c_makefile_star2_O3/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, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x5450
testq %rax, %rax
je 0x64fc
movq %rax, %rbx
movq %r15, %rdi
callq 0x53b0
testq %rax, %rax
je 0x64f4
movq %rax, %r14
movq %r15, %rdi
callq 0x5470
cmpl $0x5, %eax
ja 0x67b8
movl %eax, %eax
leaq 0x5e0e(%rip), %rcx      # 0xc27c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, 0x8(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x67b8
movb $0x1, %bpl
xorl %r12d, %r12d
movq %rsp, %r15
xorl %r13d, %r13d
movq %r14, %rdi
movq %r15, %rsi
callq 0x5620
movq (%rsp), %rdx
testq %rdx, %rdx
je 0x6810
addq %rdx, %r13
movq %r13, (%rbx)
movq (%rax), %rax
xorl %ecx, %ecx
movl $0x1, %esi
shlq %cl, %rsi
testq %rsi, %rax
setne %sil
andb %sil, %bpl
orb %sil, %r12b
incq %rcx
cmpq %rcx, %rdx
jne 0x64ba
movl %r12d, %eax
andb $0x1, %al
movb %bpl, 0x8(%rbx)
movb %al, 0x10(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x6497
jmp 0x67b8
movq %rbx, %rdi
callq 0x5080
xorl %ebx, %ebx
jmp 0x67c0
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x67b8
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x5d3e(%rip), %xmm0     # 0xc270
movsd %xmm0, 0x8(%rsp)
xorl %r12d, %r12d
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x51b0
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x67d2
addq %rcx, %r12
movq %r12, (%rbx)
xorl %edx, %edx
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movsd (%rax,%rdx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x657e
movsd %xmm0, 0x10(%rbx)
movapd %xmm0, %xmm1
ucomisd %xmm0, %xmm2
jbe 0x658d
movsd %xmm0, 0x8(%rbx)
movapd %xmm0, %xmm2
incq %rdx
cmpq %rdx, %rcx
jne 0x656a
movsd %xmm2, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x653e
jmp 0x67b8
movabsq $0x7fffffffffffffff, %r12 # imm = 0x7FFFFFFFFFFFFFFF
movq %r12, 0x8(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x67b8
xorl %r13d, %r13d
movq %rsp, %r15
xorl %ebp, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0x5260
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x67f1
addq %rcx, %rbp
movq %rbp, (%rbx)
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
cmpq %r13, %rsi
jle 0x6608
movq %rsi, 0x10(%rbx)
movq %rsi, %r13
cmpq %r12, %rsi
jge 0x6614
movq %rsi, 0x8(%rbx)
movq %rsi, %r12
incq %rdx
cmpq %rdx, %rcx
jne 0x65f8
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x65d8
jmp 0x67b8
movl $0x7f7fffff, 0x8(%rbx)  # imm = 0x7F7FFFFF
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x67b8
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x5c23(%rip), %xmm0     # 0xc278
movss %xmm0, 0x8(%rsp)
xorl %r12d, %r12d
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5370
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x682f
addq %rcx, %r12
movq %r12, (%rbx)
xorl %edx, %edx
movss 0x10(%rsp), %xmm1
movss 0x8(%rsp), %xmm2
movss (%rax,%rdx,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x669f
movss %xmm0, 0x10(%rbx)
movaps %xmm0, %xmm1
ucomiss %xmm0, %xmm2
jbe 0x66ac
movss %xmm0, 0x8(%rbx)
movaps %xmm0, %xmm2
incq %rdx
cmpq %rdx, %rcx
jne 0x668d
movss %xmm2, 0x8(%rsp)
movss %xmm1, 0x10(%rsp)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x6661
jmp 0x67b8
movl $0x7fffffff, 0x8(%rbx)  # imm = 0x7FFFFFFF
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x67b8
xorl %r12d, %r12d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq %rsp, %r15
xorl %r13d, %r13d
movq %r14, %rdi
movq %r15, %rsi
callq 0x53f0
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x684e
addq %rcx, %r13
movq %r13, (%rbx)
xorl %edx, %edx
movl (%rax,%rdx,4), %esi
cmpl %r12d, %esi
jle 0x6724
movl %esi, 0x10(%rbx)
movl %esi, %r12d
cmpl %ebp, %esi
jge 0x672d
movl %esi, 0x8(%rbx)
movl %esi, %ebp
incq %rdx
cmpq %rdx, %rcx
jne 0x6716
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x66f6
jmp 0x67b8
movq $-0x1, 0x8(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x67b8
movq $-0x1, %r12
xorl %r13d, %r13d
movq %rsp, %r15
xorl %ebp, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0x5400
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x686d
addq %rcx, %rbp
movq %rbp, (%rbx)
addq $0x8, %rax
movq (%rax), %rdx
cmpq %r13, %rdx
jbe 0x6797
movq %rdx, 0x10(%rbx)
movq %rdx, %r13
cmpq %r12, %rdx
jae 0x67a3
movq %rdx, 0x8(%rbx)
movq %rdx, %r12
addq $0x10, %rax
decq %rcx
jne 0x6788
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x6766
movq %r14, %rdi
callq 0x5870
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x68f6(%rip), %rdi      # 0xd0cf
leaq 0x5ab4(%rip), %rsi      # 0xc294
leaq 0x5bd1(%rip), %rcx      # 0xc3b8
movl $0x8b, %edx
callq 0x5350
leaq 0x68d7(%rip), %rdi      # 0xd0cf
leaq 0x5a95(%rip), %rsi      # 0xc294
leaq 0x5b24(%rip), %rcx      # 0xc32a
movl $0x67, %edx
callq 0x5350
leaq 0x68b8(%rip), %rdi      # 0xd0cf
leaq 0x5a76(%rip), %rsi      # 0xc294
leaq 0x5a77(%rip), %rcx      # 0xc29c
movl $0x45, %edx
callq 0x5350
leaq 0x6899(%rip), %rdi      # 0xd0cf
leaq 0x5a57(%rip), %rsi      # 0xc294
leaq 0x5b2d(%rip), %rcx      # 0xc371
movl $0x79, %edx
callq 0x5350
leaq 0x687a(%rip), %rdi      # 0xd0cf
leaq 0x5a38(%rip), %rsi      # 0xc294
leaq 0x5a80(%rip), %rcx      # 0xc2e3
movl $0x55, %edx
callq 0x5350
leaq 0x685b(%rip), %rdi      # 0xd0cf
leaq 0x5a19(%rip), %rsi      # 0xc294
leaq 0x5b7d(%rip), %rcx      # 0xc3ff
movl $0x9e, %edx
callq 0x5350