// File: /workspace/github_cpp_makefile_star2_O1/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, %rbp
movq %rsi, (%rdi)
movq %rdx, 0x10(%rdi)
leaq 0x20(%rdi), %r12
leaq 0x7(%rsi), %r13
movq %r13, %rbx
shrq $0x3, %rbx
movl $0x1f0, %edx            # imm = 0x1F0
movq %r12, %rdi
xorl %esi, %esi
callq 0x1080
movq %rbp, (%rsp)
movq %rbx, 0x8(%rbp)
andq $-0x8, %r13
movq %r13, %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 0x2a00
xorl %r12d, %r12d
jmp 0x2aa2
leaq 0xf13a1(%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
xorl %r8d, %r8d
movq %rsi, %rdi
movl (%rcx,%r8), %r9d
cmpl (%rdi), %r9d
jge 0x2a32
leaq (%rcx,%r8), %rdi
addq $0x4, %r8
cmpq $0x1c, %r8
jne 0x2a25
subq %r14, %rdi
sarq $0x2, %rdi
movq %rdi, (%r13,%rdx,8)
movl (%rax), %r8d
movq %rax, %rdi
testl %r8d, %r8d
jle 0x2a86
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 0x2a56
movl 0x4(%rdi), %esi
movl %esi, (%rbp,%rdx,4)
incq %rdx
leaq 0x8(%r12), %rdi
addq $0x20, %rcx
cmpq %r15, %rdi
jbe 0x2a18
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 0x2ad8
leaq (%r14,%r12,4), %rsi
shlq $0x2, %rdx
leaq 0x10(%rsp), %rdi
callq 0x10a0
movq %rbx, %rsi
leaq (%r14,%r12,4), %rcx
leaq (%r14,%r15,4), %rdx
cmpq %r12, %r15
sete %dil
leaq (%r14,%r12,4), %rax
addq $0x4, %rax
cmpq %rdx, %rax
sete %dl
orb %dil, %dl
je 0x2aff
movq %rcx, %rdx
jmp 0x2b27
shlq $0x2, %r15
shlq $0x2, %r12
subq %r12, %r15
addq $-0x4, %r15
movl (%rax), %edi
movq %rax, %rdx
cmpl (%rcx), %edi
jl 0x2b1a
movq %rcx, %rdx
addq $0x4, %rax
movq %rdx, %rcx
addq $-0x4, %r15
jne 0x2b0e
subq %r14, %rdx
sarq $0x2, %rdx
movq %rdx, -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 0x2454
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