// File: /workspace/github_cpp_makefile_star2_O3/wx-csy[P]librmq/main.cpp
// Function: void functional_test_instance<librmq::rmq_ind<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 $0x428, %rsp            # imm = 0x428
movl %edi, %r12d
movl 0xf2d0c(%rip), %esi     # 0xf543c
leal 0x1(%rsi), %eax
movl %eax, 0xf2d03(%rip)     # 0xf543c
leaq 0xeef78(%rip), %rdi     # 0xf16b8
movl %r12d, %edx
xorl %eax, %eax
callq 0x1040
movslq %r12d, %rbx
leaq (,%rbx,4), %rax
testl %ebx, %ebx
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x1030
movq %rax, %r13
movq %rbx, 0x18(%rsp)
testl %ebx, %ebx
jle 0x2795
movl %r12d, %r14d
xorl %r15d, %r15d
leaq 0xf1930(%rip), %rbx     # 0xf40b0
movq %rbx, %rdi
callq 0x2204
movl %eax, (%r13,%r15,4)
incq %r15
cmpq %r15, %r14
jne 0x2780
leaq 0x30(%rsp), %rdi
movl $0x1e8, %edx            # imm = 0x1E8
xorl %esi, %esi
callq 0x1080
leaq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rbx
movq %rbx, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x2456
leaq 0x218(%rsp), %rdi
movq %rbx, %rsi
movq %r13, 0x8(%rsp)
movq %r13, %rdx
callq 0x2990
testl %r12d, %r12d
jle 0x28a7
xorl %r14d, %r14d
leaq 0xf18c8(%rip), %r15     # 0xf40b0
movl %r12d, 0x14(%rsp)
movq %r15, %rdi
callq 0x2204
movq %r14, 0x20(%rsp)
xorl %edx, %edx
divq %rbx
movq %rdx, %rbp
movq %r15, %rdi
callq 0x2204
xorl %edx, %edx
divq %rbx
incl %edx
cmpl %ebp, %edx
je 0x288a
movl %ebp, %ebx
cmovll %edx, %ebx
cmovgl %edx, %ebp
movslq %ebx, %rsi
movq %rbp, %rax
subq %rsi, %rax
bsrq %rax, %rcx
movl %ecx, %eax
movq 0x30(%rsp,%rax,8), %rax
movl $0x1, %edx
shll %cl, %edx
movq (%rax,%rsi,8), %r15
movslq %edx, %rcx
movq %rbp, %rdx
subq %rcx, %rdx
movq (%rax,%rdx,8), %r13
movq 0x210(%rsp), %rax
movl (%rax,%r15,4), %r14d
movl (%rax,%r13,4), %r12d
leaq 0x218(%rsp), %rdi
movq %rbp, %rdx
callq 0x2bce
cmpl %r12d, %r14d
cmovlq %r15, %r13
movslq %r13d, %r15
movq 0x8(%rsp), %rcx
movl (%rcx,%r15,4), %edx
movslq %eax, %r14
cmpl (%rcx,%r14,4), %edx
movl 0x14(%rsp), %r12d
jne 0x28fd
movq 0x20(%rsp), %r14
incl %r14d
cmpl %r14d, %r12d
movq 0x18(%rsp), %rbx
leaq 0xf180f(%rip), %r15     # 0xf40b0
jne 0x27ed
leaq 0xeee6a(%rip), %rdi     # 0xf1718
callq 0x10f0
movq 0x8(%rsp), %rdi
callq 0x10e0
leaq 0x218(%rsp), %rdi
callq 0x2d1a
movl $0x8, %ebx
movq 0x28(%rsp,%rbx), %rdi
testq %rdi, %rdi
je 0x28de
callq 0x10e0
addq $0x8, %rbx
cmpq $0x1e8, %rbx            # imm = 0x1E8
jne 0x28cf
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
shlq $0x2, %r15
shlq $0x2, %r14
leaq 0xeedcd(%rip), %rdi     # 0xf16d9
movq %rax, %r12
callq 0x10f0
movq 0x8(%rsp), %rax
movl (%rax,%r15), %r8d
movl (%rax,%r14), %r10d
leaq 0xeedb7(%rip), %rdi     # 0xf16df
movq 0x20(%rsp), %rsi
movl %ebx, %edx
movl %ebp, %ecx
movl %r13d, %r9d
xorl %eax, %eax
pushq %r12
pushq %r10
callq 0x1040
addq $0x10, %rsp
movl $0x1, %edi
callq 0x10d0
movq %rax, %rbx
jmp 0x2966
jmp 0x2956
jmp 0x2956
movq %rax, %rbx
leaq 0x218(%rsp), %rdi
callq 0x2d1a
movl $0x8, %r14d
movq 0x28(%rsp,%r14), %rdi
testq %rdi, %rdi
je 0x297b
callq 0x10e0
addq $0x8, %r14
cmpq $0x1e8, %r14            # imm = 0x1E8
jne 0x296c
movq %rbx, %rdi
callq 0x1110