// File: /workspace/github_cpp_makefile_star2_O2/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, %r14d
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x761c(%rip), %rax      # 0xac98
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, 0x38(%rsp)
movq 0x8(%rsi), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
movslq %edx, %rbp
subq %rbp, %rsi
incq %rsi
leaq 0x40(%rsp), %rdx
callq 0x4392
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
leaq 0x20(%r15), %rdi
sarq $0x3, %rsi
subq %rbp, %rsi
incq %rsi
leaq 0x40(%rsp), %rdx
movq %rdi, 0x18(%rsp)
callq 0x4392
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
incq %rsi
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x4392
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x3, %rsi
incq %rsi
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4392
leaq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %r15, 0x60(%rsp)
movq %r15, %rdi
movq %rbx, %rcx
movl %r14d, %r8d
callq 0x4b48
movq 0x8(%rbx), %rax
movq %rbx, 0x58(%rsp)
subq (%rbx), %rax
shrq $0x3, %rax
subl %r14d, %eax
movq %rax, 0x10(%rsp)
leal 0x1(%rax), %edi
xorl %r9d, %r9d
pushq $0x2
popq %r13
cmpl %r9d, 0x10(%rsp)
jl 0x380e
leaq (%r9,%rbp), %r8
cmpl %r8d, %edi
movl %r8d, %ebx
cmovll %edi, %ebx
movl %ebx, %eax
subl %r9d, %eax
incl %eax
cltd
idivl %r13d
addl %r9d, %eax
movq 0x20(%rsp), %r12
movq 0x40(%rsp), %r11
movl %r9d, %r15d
movl %ebx, %r10d
cmpl %r10d, %eax
je 0x37bd
leal (%rax,%r14), %ecx
movslq %ecx, %rdx
movslq %eax, %rcx
vmovsd (%r11,%rcx,8), %xmm0
movl %eax, %esi
subl %r15d, %esi
incl %esi
movl %r10d, %ecx
subl %eax, %ecx
incl %ecx
vucomisd -0x8(%r12,%rdx,8), %xmm0
cmovbl %esi, %ecx
cmovael %eax, %r15d
cmovbl %eax, %r10d
movl %ecx, %eax
cltd
idivl %r13d
addl %r15d, %eax
jmp 0x377d
movq 0x38(%rsp), %rdx
movq (%rdx), %rcx
movslq %r10d, %rax
cmpq %rax, %r9
jge 0x37de
vmovsd (%r11,%r9,8), %xmm0
vmovsd %xmm0, (%rcx,%r9,8)
incq %r9
jmp 0x37c8
movq 0x20(%rsp), %rsi
movq (%rdx), %rcx
movslq %ebx, %rdx
leaq (%rsi,%rbp,8), %r9
addq $-0x8, %r9
cmpq %rdx, %rax
jge 0x3806
vmovsd (%r9,%rax,8), %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
incq %rax
jmp 0x37f1
movq %r8, %r9
jmp 0x3747
leaq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rbx
movq %rbx, %rcx
movl %r14d, %r8d
callq 0x4cbe
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
subl %r14d, %eax
movq %rax, 0x10(%rsp)
leal 0x1(%rax), %edi
xorl %r9d, %r9d
cmpl %r9d, 0x10(%rsp)
jl 0x3911
leaq (%r9,%rbp), %r8
cmpl %r8d, %edi
movl %r8d, %r10d
cmovll %edi, %r10d
movl %r10d, %eax
subl %r9d, %eax
incl %eax
cltd
idivl %r13d
addl %r9d, %eax
movq 0x20(%rsp), %r15
movq 0x40(%rsp), %r11
movl %r9d, %r12d
movl %r10d, %ebx
cmpl %ebx, %eax
je 0x38bb
leal (%rax,%r14), %ecx
movslq %ecx, %rcx
vmovsd -0x8(%r15,%rcx,8), %xmm0
movslq %eax, %rdx
movl %eax, %esi
subl %r12d, %esi
incl %esi
movl %ebx, %ecx
subl %eax, %ecx
incl %ecx
vucomisd (%r11,%rdx,8), %xmm0
cmovbl %esi, %ecx
cmovael %eax, %r12d
cmovbl %eax, %ebx
movl %ecx, %eax
cltd
idivl %r13d
addl %r12d, %eax
jmp 0x387e
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movslq %ebx, %rax
cmpq %rax, %r9
jge 0x38dc
vmovsd (%r11,%r9,8), %xmm0
vmovsd %xmm0, (%rcx,%r9,8)
incq %r9
jmp 0x38c6
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movslq %r10d, %rdx
leaq (%rsi,%rbp,8), %r9
addq $-0x8, %r9
cmpq %rdx, %rax
jge 0x3909
vmovsd (%r9,%rax,8), %xmm0
vmovsd %xmm0, (%rcx,%rax,8)
incq %rax
jmp 0x38f4
movq %r8, %r9
jmp 0x3846
leaq 0x20(%rsp), %rdi
callq 0x60f0
leaq 0x40(%rsp), %rdi
callq 0x60f0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x3950
movq %rax, %r14
jmp 0x395a
movq %rax, %r14
jmp 0x3964
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x60f0
leaq 0x40(%rsp), %rdi
callq 0x60f0
movq 0x18(%rsp), %rdi
callq 0x60f0
movq 0x38(%rsp), %rdi
callq 0x60f0
movq %r14, %rdi
callq 0x2160