// File: /workspace/github_cpp_makefile_star2_O3/wx-csy[P]librmq/./librmq/ind.h
// Function: librmq::rmq_ind<int>::rmq_ind(unsigned long, int const*)
rmq_ind(size_t n, const T *data) :
            n(n), data(data) {
        nr_blocks = (n + SEGLEN - 1) / SEGLEN;
        size_t *segdata = new size_t[nr_blocks]; // ownership transferred to ST
        segid = new int[nr_blocks];
        size_t ptr = 0;
        for (size_t i = 0; ptr + SEGLEN <= n; ptr += SEGLEN, i++) {
            segdata[i] = std::min_element(data + ptr, data + ptr + SEGLEN) - data;
            segid[i] = select_segment(data + ptr);
        }
        if (ptr != n) {
            T rdata[SEGLEN] = {0};
            for (size_t i = 0; ptr + i < n; i++) rdata[i] = data[ptr + i];
            segdata[nr_blocks - 1] = std::min_element(data + ptr, data + n) - data;
            segid[nr_blocks - 1] = select_segment(rdata);
        }
        st.init(nr_blocks, data, segdata);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
movq %rsi, (%rdi)
movq %rdx, 0x10(%rdi)
leaq 0x20(%rdi), %r12
movl $0x1f0, %edx            # imm = 0x1F0
movq %r12, %rdi
xorl %esi, %esi
callq 0x1080
leaq 0x7(%r15), %rdi
movq %rdi, %rbx
shrq $0x3, %rbx
movq %r13, (%rsp)
movq %rbx, 0x8(%r13)
andq $-0x8, %rdi
callq 0x1030
movq %rax, %r13
leaq (,%rbx,4), %rdi
callq 0x1030
movq %rax, %rbp
movq %r12, 0x8(%rsp)
movq (%rsp), %rax
movq %rbp, 0x18(%rax)
cmpq $0x8, %r15
jae 0x2a0b
xorl %r12d, %r12d
jmp 0x2ab6
leaq 0xf1396(%rip), %rax     # 0xf3da8
movq (%rax), %rax
leaq 0x4(%r14), %rcx
movl $0x8, %edi
xorl %edx, %edx
xorl %r12d, %r12d
leaq (%r14,%r12,4), %rsi
movq %rdi, %r12
movl (%rsi), %r8d
xorl %r9d, %r9d
movq %rsi, %rdi
leaq (%rcx,%r9), %r10
movl (%rcx,%r9), %r11d
cmpl %r8d, %r11d
cmovll %r11d, %r8d
cmovlq %r10, %rdi
addq $0x4, %r9
cmpq $0x1c, %r9
jne 0x2a33
subq %r14, %rdi
sarq $0x2, %rdi
movq %rdi, (%r13,%rdx,8)
movl (%rax), %r8d
movq %rax, %rdi
testl %r8d, %r8d
jle 0x2a9a
movq %rax, %rdi
movl %r8d, %r9d
shrl $0x3, %r9d
movl (%rsi,%r9,4), %r9d
andl $0x7, %r8d
xorl %r10d, %r10d
cmpl (%rsi,%r8,4), %r9d
setl %r10b
movslq 0x8(%rdi,%r10,4), %r8
shlq $0x4, %r8
leaq (%rax,%r8), %rdi
movl (%rax,%r8), %r8d
testl %r8d, %r8d
jg 0x2a6a
movl 0x4(%rdi), %esi
movl %esi, (%rbp,%rdx,4)
incq %rdx
leaq 0x8(%r12), %rdi
addq $0x20, %rcx
cmpq %r15, %rdi
jbe 0x2a23
cmpq %r12, %r15
movq %rbx, %rsi
je 0x2b7e
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %r15, %rdx
subq %r12, %rdx
jbe 0x2aec
leaq (%r14,%r12,4), %rsi
shlq $0x2, %rdx
leaq 0x10(%rsp), %rdi
callq 0x10a0
movq %rbx, %rsi
leaq (%r14,%r12,4), %rax
leaq (%r14,%r15,4), %rdx
leaq (%r14,%r12,4), %rcx
addq $0x4, %rcx
cmpq %rdx, %rcx
je 0x2b27
movl (%rax), %edx
shlq $0x2, %r15
shlq $0x2, %r12
subq %r12, %r15
addq $-0x4, %r15
movl (%rcx), %edi
cmpl %edx, %edi
cmovll %edi, %edx
cmovlq %rcx, %rax
addq $0x4, %rcx
addq $-0x4, %r15
jne 0x2b12
subq %r14, %rax
sarq $0x2, %rax
movq %rax, -0x8(%r13,%rsi,8)
leaq 0xf126e(%rip), %rax     # 0xf3da8
movq (%rax), %rax
movl (%rax), %edx
testl %edx, %edx
jle 0x2b74
movq %rax, %rcx
movl %edx, %edi
shrl $0x3, %edi
movl 0x10(%rsp,%rdi,4), %r8d
andl $0x7, %edx
xorl %edi, %edi
cmpl 0x10(%rsp,%rdx,4), %r8d
setl %dil
movslq 0x8(%rcx,%rdi,4), %rdx
shlq $0x4, %rdx
leaq (%rax,%rdx), %rcx
movl (%rax,%rdx), %edx
testl %edx, %edx
jg 0x2b46
jmp 0x2b77
movq %rax, %rcx
movl 0x4(%rcx), %eax
movl %eax, -0x4(%rbp,%rsi,4)
movq 0x8(%rsp), %rdi
movq %r14, %rdx
movq %r13, %rcx
callq 0x2456
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2b9f
movq %rax, %r14
movq $-0x1e0, %r15           # imm = 0xFE20
movq (%rsp), %rbx
movq 0x208(%rbx,%r15), %rdi
testq %rdi, %rdi
je 0x2bbf
callq 0x10e0
addq $0x8, %r15
jne 0x2bad
movq %r14, %rdi
callq 0x1110
nop