// File: /workspace/github_cpp_makefile_star2_O1/wx-csy[P]librmq/./librmq/block.h
// Function: librmq::rmq_block<int>::rmq_block(unsigned long, int const*)
rmq_block(size_t n, const T *data) :
            n(n), data(data) {
        nr_blocks = (n + BLOCKSZ - 1) / BLOCKSZ;
        size_t *segdata = new size_t[nr_blocks];
        pref = new size_t[nr_blocks * BLOCKSZ]; 
        suf = new size_t[nr_blocks * BLOCKSZ];
        size_t ptr = 0;
        for (size_t si = 0; ptr + BLOCKSZ <= n; ptr += BLOCKSZ, si++) {
            segdata[si] = std::min_element(data + ptr, data + ptr + BLOCKSZ) - data;
            init_block(data + ptr, si);
        }
        if (ptr != n) {
            T rdata[BLOCKSZ] = {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;
            init_block(rdata, nr_blocks - 1);
        }
        st.init(nr_blocks, data, segdata);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq %rsi, (%rdi)
movq %rdx, 0x10(%rdi)
addq $0x28, %rdi
leaq 0x3ff(%rsi), %r12
movq %r12, %r15
shrq $0xa, %r15
movl $0x1f0, %edx            # imm = 0x1F0
movq %rdi, 0x8(%rsp)
xorl %esi, %esi
callq 0x1080
movq %r15, 0x8(%rbx)
leaq (,%r15,8), %rdi
callq 0x1030
movq %rax, (%rsp)
shrq $0x3d, %r12
shlq $0xd, %r15
xorl %ebp, %ebp
negq %r12
sbbq %rbp, %rbp
orq %r15, %rbp
movq %rbp, %rdi
callq 0x1030
movq %rax, 0x18(%rbx)
movq %rbp, %rdi
callq 0x1030
movq %rax, 0x20(%rbx)
cmpq $0x400, %r13            # imm = 0x400
jae 0x305e
xorl %r15d, %r15d
jmp 0x30c1
leaq 0x4(%r14), %r12
movl $0x400, %eax            # imm = 0x400
xorl %ebp, %ebp
xorl %r15d, %r15d
leaq (%r14,%r15,4), %rsi
movq %rax, %r15
xorl %ecx, %ecx
movq %rsi, %rax
movl (%r12,%rcx), %edx
cmpl (%rax), %edx
jge 0x3084
leaq (%r12,%rcx), %rax
addq $0x4, %rcx
cmpq $0xffc, %rcx            # imm = 0xFFC
jne 0x3078
subq %r14, %rax
sarq $0x2, %rax
movq (%rsp), %rcx
movq %rax, (%rcx,%rbp,8)
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x3348
incq %rbp
leaq 0x400(%r15), %rax
addq $0x1000, %r12           # imm = 0x1000
cmpq %r13, %rax
jbe 0x306c
cmpq %r15, %r13
je 0x3168
leaq 0x10(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x1080
movq %r13, %rdx
subq %r15, %rdx
jbe 0x30f5
leaq (%r14,%r15,4), %rsi
shlq $0x2, %rdx
leaq 0x10(%rsp), %rdi
callq 0x10a0
leaq (%r14,%r15,4), %rcx
leaq (%r14,%r13,4), %rdx
cmpq %r15, %r13
sete %sil
leaq (%r14,%r15,4), %rax
addq $0x4, %rax
cmpq %rdx, %rax
sete %dl
orb %sil, %dl
je 0x311c
movq %rcx, %rsi
jmp 0x3144
shlq $0x2, %r13
shlq $0x2, %r15
subq %r15, %r13
addq $-0x4, %r13
movl (%rax), %edx
movq %rax, %rsi
cmpl (%rcx), %edx
jl 0x3137
movq %rcx, %rsi
addq $0x4, %rax
movq %rsi, %rcx
addq $-0x4, %r13
jne 0x312b
subq %r14, %rsi
sarq $0x2, %rsi
movq 0x8(%rbx), %rdx
movq (%rsp), %rax
movq %rsi, -0x8(%rax,%rdx,8)
decq %rdx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x3348
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdi
movq %r14, %rdx
movq (%rsp), %rcx
callq 0x2454
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3191
movq %rax, %r14
movq $-0x1e0, %r15           # imm = 0xFE20
movq 0x210(%rbx,%r15), %rdi
testq %rdi, %rdi
je 0x31ad
callq 0x10e0
addq $0x8, %r15
jne 0x319b
movq %r14, %rdi
callq 0x1110
nop