// File: /workspace/github_cpp_makefile_star2_O3/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 0x64df(%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 0x56be
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 0x56be
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
incq %rsi
leaq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x56be
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
incq %rsi
leaq 0x40(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x56be
leaq 0x28(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r12, 0x60(%rsp)
movq %r12, %rdi
movq %r15, %rcx
movl %ebx, %r8d
callq 0x5e38
movq 0x8(%r15), %rax
movq %r15, 0x58(%rsp)
subq (%r15), %rax
shrq $0x3, %rax
subl %ebx, %eax
js 0x4973
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
addq $-0x8, %rdx
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, %r15d
movl %r11d, %r13d
cmpl %r12d, %r14d
je 0x492f
leal (%r14,%rbx), %r10d
movslq %r10d, %r10
movslq %r14d, %rbp
vmovsd (%rsi,%rbp,8), %xmm0
vucomisd (%rdx,%r10,8), %xmm0
jb 0x490d
movl %r15d, %r10d
subl %r14d, %r10d
incl %r10d
movl %r14d, %r13d
movl %r15d, %r14d
jmp 0x4916
movl %r14d, %r10d
subl %r13d, %r10d
incl %r10d
movl %r10d, %ebp
shrl $0x1f, %ebp
addl %r10d, %ebp
sarl %ebp
addl %r13d, %ebp
movl %r14d, %r15d
cmpl %r14d, %ebp
movl %ebp, %r14d
jne 0x48e5
cmpl %r11d, %r15d
jle 0x494b
movslq %r15d, %r10
vmovsd (%rsi,%r11,8), %xmm0
vmovsd %xmm0, (%rdi,%r11,8)
incq %r11
cmpq %r10, %r11
jl 0x4937
cmpl %r12d, %r15d
jge 0x496a
movslq %r15d, %r10
movslq %r12d, %r11
vmovsd (%r8,%r10,8), %xmm0
vmovsd %xmm0, (%rdi,%r10,8)
incq %r10
cmpq %r11, %r10
jl 0x4956
cmpl %r9d, %eax
jge 0x48a9
leaq 0x28(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r14
movq %r14, %rcx
movl %ebx, %r8d
callq 0x612c
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x3, %rax
subl %ebx, %eax
movq 0x40(%rsp), %rdi
js 0x4a9e
leal 0x1(%rax), %ecx
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq (%rsi), %rsi
movq 0x10(%rsp), %r8
leaq (%rdi,%r8,8), %r8
addq $-0x8, %r8
addq $-0x8, %rdi
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, %r15d
movl %r11d, %r12d
cmpl %r10d, %r14d
je 0x4a55
leal (%r14,%rbx), %ebp
movslq %ebp, %r13
vmovsd (%rdi,%r13,8), %xmm0
movslq %r14d, %r13
vucomisd (%rdx,%r13,8), %xmm0
jb 0x4a33
movl %r15d, %r13d
subl %r14d, %r13d
incl %r13d
movl %r14d, %r12d
movl %r15d, %r14d
jmp 0x4a3c
movl %r14d, %r13d
subl %r12d, %r13d
incl %r13d
movl %r13d, %ebp
shrl $0x1f, %ebp
addl %r13d, %ebp
sarl %ebp
addl %r12d, %ebp
movl %r14d, %r15d
cmpl %r14d, %ebp
movl %ebp, %r14d
jne 0x4a0a
cmpl %r11d, %r15d
jle 0x4a71
movslq %r15d, %r14
vmovsd (%rdx,%r11,8), %xmm0
vmovsd %xmm0, (%rsi,%r11,8)
incq %r11
cmpq %r14, %r11
jl 0x4a5d
cmpl %r10d, %r15d
jge 0x4a90
movslq %r15d, %r11
movslq %r10d, %r10
vmovsd (%r8,%r11,8), %xmm0
vmovsd %xmm0, (%rsi,%r11,8)
incq %r11
cmpq %r10, %r11
jl 0x4a7c
cmpl %r9d, %eax
jge 0x49ce
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x4aa8
callq 0x20e0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4ab7
callq 0x20e0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4ae7
movq %rax, %rbx
jmp 0x4af6
movq %rax, %rbx
jmp 0x4b08
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x4ae7
callq 0x20e0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4af6
callq 0x20e0
movq 0x18(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4b08
callq 0x20e0
movq 0x20(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4b1a
callq 0x20e0
movq %rbx, %rdi
callq 0x2190