// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x5450
testq %rax, %rax
je 0x64df
movq %rax, %rbx
movq %r15, %rdi
callq 0x53b0
testq %rax, %rax
je 0x64d7
movq %rax, %r14
movq %r15, %rdi
callq 0x5470
cmpl $0x5, %eax
ja 0x674a
movl %eax, %eax
leaq 0x5e07(%rip), %rcx      # 0xc25c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, 0x8(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x674a
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5620
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x679d
addq %rdx, (%rbx)
movq (%rax), %rdi
movb 0x8(%rbx), %sil
movb 0x10(%rbx), %al
xorl %ecx, %ecx
movl $0x1, %r8d
shlq %cl, %r8
testq %r8, %rdi
setne %r8b
andb %r8b, %sil
orb %r8b, %al
incq %rcx
cmpq %rcx, %rdx
jne 0x649f
andb $0x1, %al
movb %sil, 0x8(%rbx)
movb %al, 0x10(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x6477
jmp 0x674a
movq %rbx, %rdi
callq 0x5080
xorl %ebx, %ebx
jmp 0x6752
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x674a
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x51b0
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x675f
addq %rcx, (%rbx)
movsd 0x8(%rbx), %xmm0
movsd 0x10(%rbx), %xmm1
xorl %edx, %edx
movsd (%rax,%rdx,8), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x6545
movsd %xmm2, 0x10(%rbx)
movapd %xmm2, %xmm1
ucomisd %xmm2, %xmm0
jbe 0x6554
movsd %xmm2, 0x8(%rbx)
movapd %xmm2, %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0x6531
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x6509
jmp 0x674a
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x674a
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5260
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x677e
addq %rcx, (%rbx)
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rdi
xorl %esi, %esi
movq (%rax,%rsi,8), %r8
cmpq %rdi, %r8
jle 0x65c6
movq %r8, 0x10(%rbx)
movq %r8, %rdi
cmpq %rdx, %r8
jge 0x65d2
movq %r8, 0x8(%rbx)
movq %r8, %rdx
incq %rsi
cmpq %rsi, %rcx
jne 0x65b6
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x6590
jmp 0x674a
movl $0x7f7fffff, 0x8(%rbx)  # imm = 0x7F7FFFFF
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x674a
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5370
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x67bc
addq %rcx, (%rbx)
movss 0x8(%rbx), %xmm0
movss 0x10(%rbx), %xmm1
xorl %edx, %edx
movss (%rax,%rdx,4), %xmm2
ucomiss %xmm1, %xmm2
jbe 0x6641
movss %xmm2, 0x10(%rbx)
movaps %xmm2, %xmm1
ucomiss %xmm2, %xmm0
jbe 0x664e
movss %xmm2, 0x8(%rbx)
movaps %xmm2, %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0x662f
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x6607
jmp 0x674a
movl $0x7fffffff, 0x8(%rbx)  # imm = 0x7FFFFFFF
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x674a
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x53f0
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x67db
addq %rcx, (%rbx)
movl 0x8(%rbx), %edx
movl 0x10(%rbx), %edi
xorl %esi, %esi
movl (%rax,%rsi,4), %r8d
cmpl %edi, %r8d
jle 0x66b7
movl %r8d, 0x10(%rbx)
movl %r8d, %edi
cmpl %edx, %r8d
jge 0x66c3
movl %r8d, 0x8(%rbx)
movl %r8d, %edx
incq %rsi
cmpq %rsi, %rcx
jne 0x66a7
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x6683
jmp 0x674a
movq $-0x1, 0x8(%rbx)
movq %r14, %rdi
callq 0x52c0
testb %al, %al
je 0x674a
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5400
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x67fa
addq %rcx, (%rbx)
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rsi
addq $0x8, %rax
movq (%rax), %rdi
cmpq %rsi, %rdi
jbe 0x6729
movq %rdi, 0x10(%rbx)
movq %rdi, %rsi
cmpq %rdx, %rdi
jae 0x6735
movq %rdi, 0x8(%rbx)
movq %rdi, %rdx
addq $0x10, %rax
decq %rcx
jne 0x671a
movq %r14, %rdi
callq 0x52c0
testb %al, %al
jne 0x66f2
movq %r14, %rdi
callq 0x5870
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x6949(%rip), %rdi      # 0xd0af
leaq 0x5b07(%rip), %rsi      # 0xc274
leaq 0x5c24(%rip), %rcx      # 0xc398
movl $0x8b, %edx
callq 0x5350
leaq 0x692a(%rip), %rdi      # 0xd0af
leaq 0x5ae8(%rip), %rsi      # 0xc274
leaq 0x5b77(%rip), %rcx      # 0xc30a
movl $0x67, %edx
callq 0x5350
leaq 0x690b(%rip), %rdi      # 0xd0af
leaq 0x5ac9(%rip), %rsi      # 0xc274
leaq 0x5aca(%rip), %rcx      # 0xc27c
movl $0x45, %edx
callq 0x5350
leaq 0x68ec(%rip), %rdi      # 0xd0af
leaq 0x5aaa(%rip), %rsi      # 0xc274
leaq 0x5b80(%rip), %rcx      # 0xc351
movl $0x79, %edx
callq 0x5350
leaq 0x68cd(%rip), %rdi      # 0xd0af
leaq 0x5a8b(%rip), %rsi      # 0xc274
leaq 0x5ad3(%rip), %rcx      # 0xc2c3
movl $0x55, %edx
callq 0x5350
leaq 0x68ae(%rip), %rdi      # 0xd0af
leaq 0x5a6c(%rip), %rsi      # 0xc274
leaq 0x5bd0(%rip), %rcx      # 0xc3df
movl $0x9e, %edx
callq 0x5350