// File: /workspace/github_cpp_makefile_star2_O2/wx-csy[P]librmq/main.cpp
// Function: void functional_test_instance<librmq::rmq_zkw<int>>(int)
void functional_test_instance(int size) {
    static int epoch = 0;
    printf("Running epoch #%d (size=%d) ... ", epoch++, size);
    int *data = new int[size];
    for (int i = 0; i < size; i++) data[i] = gen();
    rmq_st<int> st(size, data);
    TSolver rmqr(size, data);
    for (int i = 0; i < size; i++) {
        int l = gen() % size, r = gen() % size + 1;
        if (l == r) continue;
        if (l > r) std::swap(l, r);
        int res_st = st.query(l, r), res_rmq = rmqr.query(l, r);
        if (data[res_st] != data[res_rmq]) {
            puts("FAIL!");
            std::printf(
                "on query #%d (%d, %d): expected %d(%d), returned %d(%d)\n", 
                i, l, r, data[res_st], res_st, data[res_rmq], res_rmq);
            std::exit(EXIT_FAILURE);
        }
    }
    puts("OK!");
    delete[] data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movl %edi, %ebx
movl 0xf37c2(%rip), %esi     # 0xf5440
leal 0x1(%rsi), %eax
movl %eax, 0xf37b9(%rip)     # 0xf5440
leaq 0xef9ca(%rip), %rdi     # 0xf1658
xorl %r14d, %r14d
movl %ebx, %edx
xorl %eax, %eax
callq 0x1040
movslq %ebx, %r15
leaq (,%r15,4), %rax
testl %r15d, %r15d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movl $0x0, %r12d
cmovgl %r15d, %r12d
callq 0x1030
movq %rax, 0x8(%rsp)
leaq 0xf23ee(%rip), %rbx     # 0xf40b8
cmpq %r14, %r12
je 0x1ce5
movq %rbx, %rdi
callq 0x1e60
movq 0x8(%rsp), %rcx
movl %eax, (%rcx,%r14,4)
incq %r14
jmp 0x1cca
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdx
callq 0x1ec4
leaq 0x28(%rsp), %rdi
movq %r15, 0x20(%rsp)
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1ef8
xorl %ebx, %ebx
leaq 0xf23a0(%rip), %r14     # 0xf40b8
cmpl %ebx, %r12d
je 0x1dac
movq %r14, %rdi
callq 0x1e60
movq %rbx, 0x18(%rsp)
xorl %edx, %edx
movq 0x20(%rsp), %rbx
divq %rbx
movq %rdx, %r13
movq %r14, %r15
movq %r14, %rdi
callq 0x1e60
xorl %edx, %edx
divq %rbx
incl %edx
cmpl %r13d, %edx
je 0x1d9d
movl %r13d, %ebp
cmovll %edx, %ebp
cmovgl %edx, %r13d
movslq %ebp, %rbx
movslq %r13d, %r14
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1fda
movq %rax, 0x10(%rsp)
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2012
movslq 0x10(%rsp), %r14
movq 0x8(%rsp), %rcx
movl (%rcx,%r14,4), %edx
movslq %eax, %rbx
cmpl (%rcx,%rbx,4), %edx
jne 0x1de8
movq 0x18(%rsp), %rbx
incl %ebx
movq %r15, %r14
jmp 0x1d18
leaq 0xef905(%rip), %rdi     # 0xf16b8
callq 0x1100
movq 0x8(%rsp), %rdi
callq 0x10f0
leaq 0x28(%rsp), %rdi
callq 0x2084
leaq 0x48(%rsp), %rdi
callq 0x2092
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
shlq $0x2, %r14
shlq $0x2, %rbx
leaq 0xef882(%rip), %rdi     # 0xf1679
movq %rax, %r15
callq 0x1100
movq 0x8(%rsp), %rax
movl (%rax,%r14), %r8d
movl (%rax,%rbx), %r10d
leaq 0xef86c(%rip), %rdi     # 0xf167f
movq 0x18(%rsp), %rsi
movl %ebp, %edx
movl %r13d, %ecx
movq 0x10(%rsp), %r9
xorl %eax, %eax
pushq %r15
pushq %r10
callq 0x1040
popq %rcx
popq %rdx
pushq $0x1
popq %rdi
callq 0x10e0
movq %rax, %rbx
jmp 0x1e4d
jmp 0x1e40
jmp 0x1e40
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2084
leaq 0x48(%rsp), %rdi
callq 0x2092
movq %rbx, %rdi
callq 0x1120
nop