// File: /workspace/github_cpp_makefile_star2_O1/lemire[P]runningmaxmin/./runningmaxmin.h
// Function: GilKimmel::GilKimmel(std::vector<double, std::allocator<double>>&, int)
GilKimmel(std::vector<floattype> & array, int width)
        : maxvalues(array.size() - width + 1),
          minvalues(array.size() - width + 1) {
        std::vector<floattype> R(array.size() + 1);
        std::vector<floattype> S(array.size() + 1);
        computePrefixSuffixMax(R, S, array,
                               width); // implements the cut in the middle trick
        for (int j = 0; j < static_cast<int>(array.size()) - width + 1;
             j += width) {
            const int endofblock =
                std::min(j + width, static_cast<int>(array.size()) - width + 1);
            int begin = j;
            int end = endofblock;
            int midpoint = (end - begin + 1) / 2 + begin;
            while (midpoint != end) {
                if (S[midpoint + width - 1] <= R[midpoint]) {
                    begin = midpoint;
                    midpoint = (end - begin + 1) / 2 + begin;
                } else {
                    end = midpoint;
                    midpoint = (end - begin + 1) / 2 + begin;
                }
            }
            for (int jj = j; jj < midpoint; ++jj) {
                maxvalues[jj] = R[jj];
            }
            for (int jj = midpoint; jj < endofblock; ++jj) {
                maxvalues[jj] = S[jj + width - 1];
            }
        }
        computePrefixSuffixMin(R, S, array,
                               width); // implements the cut in the middle trick
        for (int j = 0; j < static_cast<int>(array.size()) - width + 1;
             j += width) {
            const int endofblock =
                std::min(j + width, static_cast<int>(array.size()) - width + 1);
            int begin = j;
            int end = endofblock;
            int midpoint = (end - begin + 1) / 2 + begin;
            while (midpoint != end) {
                if (S[midpoint + width - 1] >= R[midpoint]) {
                    begin = midpoint;
                    midpoint = (end - begin + 1) / 2 + begin;
                } else {
                    end = midpoint;
                    midpoint = (end - begin + 1) / 2 + begin;
                }
            }
            for (int jj = j; jj < midpoint; ++jj) {
                minvalues[jj] = R[jj];
            }
            for (int jj = midpoint; jj < endofblock; ++jj) {
                minvalues[jj] = S[jj + width - 1];
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x6653(%rip), %rax      # 0xac98
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq 0x8(%rsi), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
movslq %edx, %r14
subq %r14, %rsi
incq %rsi
leaq 0x28(%rsp), %rdx
movq %rdi, 0x20(%rsp)
callq 0x555c
movq 0x8(%r15), %rsi
subq (%r15), %rsi
leaq 0x20(%r12), %rdi
sarq $0x3, %rsi
movq %r14, 0x10(%rsp)
subq %r14, %rsi
incq %rsi
leaq 0x28(%rsp), %rdx
movq %rdi, 0x18(%rsp)
callq 0x555c
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
incq %rsi
leaq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x555c
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
incq %rsi
leaq 0x40(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x555c
leaq 0x28(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r12, 0x60(%rsp)
movq %r12, %rdi
movq %r15, %rcx
movl %ebx, %r8d
callq 0x5cb2
movq 0x8(%r15), %rax
movq %r15, 0x58(%rsp)
subq (%r15), %rax
shrq $0x3, %rax
subl %ebx, %eax
js 0x47fb
leal 0x1(%rax), %ecx
movq 0x40(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdi
movq (%rdi), %rdi
movq 0x10(%rsp), %r8
leaq (%rdx,%r8,8), %r8
addq $-0x8, %r8
xorl %r9d, %r9d
movq %r9, %r11
movq 0x10(%rsp), %r9
addq %r11, %r9
cmpl %r9d, %ecx
movl %r9d, %r12d
cmovll %ecx, %r12d
movl %r12d, %r10d
subl %r11d, %r10d
movl %r10d, %r14d
incl %r14d
shrl $0x1f, %r14d
addl %r10d, %r14d
incl %r14d
sarl %r14d
addl %r11d, %r14d
movl %r12d, %r13d
movl %r11d, %r15d
cmpl %r12d, %r14d
je 0x47b7
leal (%r14,%rbx), %r10d
movslq %r10d, %r10
movslq %r14d, %rbp
vmovsd (%rsi,%rbp,8), %xmm0
vucomisd -0x8(%rdx,%r10,8), %xmm0
jb 0x4796
movl %r13d, %r10d
subl %r14d, %r10d
incl %r10d
movl %r14d, %r15d
movl %r13d, %r14d
jmp 0x479f
movl %r14d, %r10d
subl %r15d, %r10d
incl %r10d
movl %r14d, %r13d
movl %r10d, %r14d
shrl $0x1f, %r14d
addl %r10d, %r14d
sarl %r14d
addl %r15d, %r14d
cmpl %r13d, %r14d
jne 0x476d
cmpl %r11d, %r14d
jle 0x47d3
movslq %r14d, %r10
vmovsd (%rsi,%r11,8), %xmm0
vmovsd %xmm0, (%rdi,%r11,8)
incq %r11
cmpq %r10, %r11
jl 0x47bf
cmpl %r12d, %r14d
jge 0x47f2
movslq %r14d, %r10
movslq %r12d, %r11
vmovsd (%r8,%r10,8), %xmm0
vmovsd %xmm0, (%rdi,%r10,8)
incq %r10
cmpq %r11, %r10
jl 0x47de
cmpl %r9d, %eax
jge 0x4731
leaq 0x28(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r14
movq %r14, %rcx
movl %ebx, %r8d
callq 0x5fa6
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x3, %rax
subl %ebx, %eax
js 0x491d
leal 0x1(%rax), %ecx
movq 0x40(%rsp), %rdx
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq (%rdi), %rdi
movq 0x10(%rsp), %r8
leaq (%rdx,%r8,8), %r8
addq $-0x8, %r8
xorl %r9d, %r9d
movq %r9, %r11
movq 0x10(%rsp), %r9
addq %r11, %r9
cmpl %r9d, %ecx
movl %r9d, %r10d
cmovll %ecx, %r10d
movl %r10d, %r14d
subl %r11d, %r14d
movl %r14d, %r15d
incl %r15d
shrl $0x1f, %r15d
addl %r15d, %r14d
incl %r14d
sarl %r14d
addl %r11d, %r14d
movl %r10d, %r12d
movl %r11d, %r15d
cmpl %r10d, %r14d
je 0x48d9
leal (%r14,%rbx), %ebp
movslq %ebp, %r13
vmovsd -0x8(%rdx,%r13,8), %xmm0
movslq %r14d, %r13
vucomisd (%rsi,%r13,8), %xmm0
jb 0x48b8
movl %r12d, %r13d
subl %r14d, %r13d
incl %r13d
movl %r14d, %r15d
movl %r12d, %r14d
jmp 0x48c1
movl %r14d, %r13d
subl %r15d, %r13d
incl %r13d
movl %r14d, %r12d
movl %r13d, %r14d
shrl $0x1f, %r14d
addl %r13d, %r14d
sarl %r14d
addl %r15d, %r14d
cmpl %r12d, %r14d
jne 0x488e
cmpl %r11d, %r14d
jle 0x48f5
movslq %r14d, %r15
vmovsd (%rsi,%r11,8), %xmm0
vmovsd %xmm0, (%rdi,%r11,8)
incq %r11
cmpq %r15, %r11
jl 0x48e1
cmpl %r10d, %r14d
jge 0x4914
movslq %r14d, %r11
movslq %r10d, %r10
vmovsd (%r8,%r11,8), %xmm0
vmovsd %xmm0, (%rdi,%r11,8)
incq %r11
cmpq %r10, %r11
jl 0x4900
cmpl %r9d, %eax
jge 0x4852
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x492c
callq 0x20e0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x493b
callq 0x20e0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x496b
movq %rax, %rbx
jmp 0x497a
movq %rax, %rbx
jmp 0x498c
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x496b
callq 0x20e0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x497a
callq 0x20e0
movq 0x18(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x498c
callq 0x20e0
movq 0x20(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x499e
callq 0x20e0
movq %rbx, %rdi
callq 0x2190