// File: 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:
subq $0x1088, %rsp           # imm = 0x1088
movq %rdi, 0x1080(%rsp)
movq %rsi, 0x1078(%rsp)
movq %rdx, 0x1070(%rsp)
movq 0x1080(%rsp), %rdi
movq %rdi, 0x28(%rsp)
movq 0x1078(%rsp), %rax
movq %rax, (%rdi)
movq 0x1070(%rsp), %rax
movq %rax, 0x10(%rdi)
addq $0x28, %rdi
movq %rdi, 0x20(%rsp)
callq 0x3d00
movq 0x28(%rsp), %rax
movq 0x1078(%rsp), %rcx
addq $0x3ff, %rcx            # imm = 0x3FF
shrq $0xa, %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x1030
movq %rax, 0x30(%rsp)
jmp 0x4303
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x1068(%rsp)
movq 0x8(%rax), %rax
shlq $0xa, %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x1030
movq %rax, 0x18(%rsp)
jmp 0x433f
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq 0x8(%rax), %rax
shlq $0xa, %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x1030
movq %rax, 0x10(%rsp)
jmp 0x4377
movq 0x28(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x20(%rax)
movq $0x0, 0x1050(%rsp)
movq $0x0, 0x1048(%rsp)
movq 0x1050(%rsp), %rax
addq $0x400, %rax            # imm = 0x400
cmpq 0x1078(%rsp), %rax
ja 0x4485
movq 0x1070(%rsp), %rax
movq 0x1050(%rsp), %rcx
leaq (%rax,%rcx,4), %rdi
leaq 0x1000(%rax,%rcx,4), %rsi
callq 0x3d60
movq %rax, 0x8(%rsp)
jmp 0x43e1
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq 0x1070(%rsp), %rax
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x1068(%rsp), %rax
movq 0x1048(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x1070(%rsp), %rax
movq 0x1050(%rsp), %rcx
leaq (%rax,%rcx,4), %rsi
movq 0x1048(%rsp), %rdx
callq 0x4830
jmp 0x4431
jmp 0x4433
movq 0x1050(%rsp), %rax
addq $0x400, %rax            # imm = 0x400
movq %rax, 0x1050(%rsp)
movq 0x1048(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x1048(%rsp)
jmp 0x439d
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1060(%rsp)
movl %eax, 0x105c(%rsp)
callq 0x2e70
jmp 0x4595
movq 0x1050(%rsp), %rax
cmpq 0x1078(%rsp), %rax
je 0x4566
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x10a0
movq $0x0, 0x38(%rsp)
movq 0x1050(%rsp), %rax
addq 0x38(%rsp), %rax
cmpq 0x1078(%rsp), %rax
jae 0x44fd
movq 0x1070(%rsp), %rax
movq 0x1050(%rsp), %rcx
addq 0x38(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x40(%rsp,%rax,4)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x44b5
movq 0x1070(%rsp), %rax
movq 0x1050(%rsp), %rcx
leaq (%rax,%rcx,4), %rdi
movq 0x1078(%rsp), %rcx
leaq (%rax,%rcx,4), %rsi
callq 0x3d60
movq %rax, (%rsp)
jmp 0x4528
movq 0x28(%rsp), %rdi
movq (%rsp), %rdx
movq 0x1070(%rsp), %rax
subq %rax, %rdx
sarq $0x2, %rdx
movq 0x1068(%rsp), %rax
movq 0x8(%rdi), %rcx
movq %rdx, -0x8(%rax,%rcx,8)
movq 0x8(%rdi), %rdx
decq %rdx
leaq 0x40(%rsp), %rsi
callq 0x4830
jmp 0x4564
jmp 0x4566
movq 0x28(%rsp), %rax
movq %rax, %rdi
addq $0x28, %rdi
movq 0x8(%rax), %rsi
movq 0x1070(%rsp), %rdx
movq 0x1068(%rsp), %rcx
callq 0x2ef0
jmp 0x458d
addq $0x1088, %rsp           # imm = 0x1088
retq
movq 0x1060(%rsp), %rdi
callq 0x1120
nopw %cs:(%rax,%rax)
nopl (%rax)