// File: /workspace/github_cpp_makefile_star2_O2/lemire[P]runningmaxmin/./runningmaxmin.h
// Function: lemiremaxmin::lemiremaxmin(std::vector<double, std::allocator<double>>&, unsigned int)
lemiremaxmin(std::vector<floattype> & array, uint width)
        : maxvalues(array.size() - width + 1),
          minvalues(array.size() - width + 1) {
        std::deque<int> maxfifo, minfifo;
        for (uint i = 1; i < width; ++i) {
            if (array[i] > array[i - 1]) { // overshoot
                minfifo.push_back(i - 1);
                while (!maxfifo.empty()) {
                    if (array[i] <= array[maxfifo.back()]) {
                        if (i == width + maxfifo.front())
                            maxfifo.pop_front();
                        break;
                    }
                    maxfifo.pop_back();
                }
            } else {
                maxfifo.push_back(i - 1);
                while (!minfifo.empty()) {
                    if (array[i] >= array[minfifo.back()]) {
                        if (i == width + minfifo.front())
                            minfifo.pop_front();
                        break;
                    }
                    minfifo.pop_back();
                }
            }
        }
        for (uint i = width; i < array.size(); ++i) {
            maxvalues[i - width] =
                array[maxfifo.empty() ? i - 1 : maxfifo.front()];
            minvalues[i - width] =
                array[minfifo.empty() ? i - 1 : minfifo.front()];
            if (array[i] > array[i - 1]) { // overshoot
                minfifo.push_back(i - 1);
                if (i == width + minfifo.front())
                    minfifo.pop_front();
                while (!maxfifo.empty()) {
                    if (array[i] <= array[maxfifo.back()]) {
                        if (i == width + maxfifo.front())
                            maxfifo.pop_front();
                        break;
                    }
                    maxfifo.pop_back();
                }
            } else {
                maxfifo.push_back(i - 1);
                if (i == width + maxfifo.front())
                    maxfifo.pop_front();
                while (!minfifo.empty()) {
                    if (array[i] >= array[minfifo.back()]) {
                        if (i == width + minfifo.front())
                            minfifo.pop_front();
                        break;
                    }
                    minfifo.pop_back();
                }
            }
        }
        maxvalues[array.size() - width] =
            array[maxfifo.empty() ? array.size() - 1 : maxfifo.front()];
        minvalues[array.size() - width] =
            array[minfifo.empty() ? array.size() - 1 : minfifo.front()];
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x7de4(%rip), %rax      # 0xabc0
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq 0x8(%rsi), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
movl %edx, %r14d
subq %r14, %rsi
incq %rsi
leaq 0x78(%rsp), %rdx
movq %rdi, 0x10(%rsp)
callq 0x4392
movq 0x8(%r15), %rsi
subq (%r15), %rsi
addq $0x20, %rbx
sarq $0x3, %rsi
movq %r14, 0x20(%rsp)
subq %r14, %rsi
incq %rsi
leaq 0x78(%rsp), %rdx
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
callq 0x4392
leaq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0x44a8
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x44a8
pushq $0x1
popq %rbx
movl $0x200, %r13d           # imm = 0x200
cmpq 0x20(%rsp), %rbx
jae 0x2f4a
movq (%r15), %rcx
vmovsd (%rcx,%rbx,8), %xmm0
leaq -0x1(%rbx), %rax
vucomisd -0x8(%rcx,%rbx,8), %xmm0
jbe 0x2ed8
movl %eax, 0xc(%rsp)
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
callq 0x46b0
movq 0x88(%rsp), %rax
movq 0xa8(%rsp), %rcx
cmpq %rax, %rcx
je 0x2f42
cmpq 0xb0(%rsp), %rcx
jne 0x2ebb
movq 0xc0(%rsp), %rcx
movq -0x8(%rcx), %rcx
addq %r13, %rcx
movq (%r15), %rdx
movslq -0x4(%rcx), %rcx
vmovsd (%rdx,%rcx,8), %xmm0
vucomisd (%rdx,%rbx,8), %xmm0
jae 0x2f28
movq %r14, %rdi
callq 0x4472
jmp 0x2e89
movl %eax, 0xc(%rsp)
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0x46b0
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq %rax, %rcx
je 0x2f42
cmpq 0x60(%rsp), %rcx
jne 0x2f0b
movq 0x70(%rsp), %rcx
movq -0x8(%rcx), %rcx
addq %r13, %rcx
movq (%r15), %rdx
vmovsd (%rdx,%rbx,8), %xmm0
movslq -0x4(%rcx), %rcx
vucomisd (%rdx,%rcx,8), %xmm0
jae 0x2f31
movq %r12, %rdi
callq 0x4472
jmp 0x2ee9
movl (%rax), %eax
addl %ebp, %eax
movq %r14, %rdi
jmp 0x2f38
movl (%rax), %eax
addl %ebp, %eax
movq %r12, %rdi
cmpq %rax, %rbx
jne 0x2f42
callq 0x4454
incq %rbx
jmp 0x2e59
leaq 0x28(%rsp), %r12
movl $0x200, %r13d           # imm = 0x200
leaq 0x78(%rsp), %r14
movl %ebp, %ebx
movl %ebx, %ebx
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movq 0x88(%rsp), %rdx
movq 0xa8(%rsp), %rsi
cmpq %rbx, %rcx
jbe 0x30e0
cmpq %rdx, %rsi
je 0x2f8e
movl (%rdx), %ecx
jmp 0x2f91
leal -0x1(%rbx), %ecx
movl %ecx, %ecx
vmovsd (%rax,%rcx,8), %xmm0
movl %ebx, %ecx
subl %ebp, %ecx
movq 0x10(%rsp), %rdx
movq (%rdx), %rdx
vmovsd %xmm0, (%rdx,%rcx,8)
movq 0x38(%rsp), %rdx
cmpq %rdx, 0x58(%rsp)
je 0x2fbc
movl (%rdx), %esi
leal -0x1(%rbx), %edx
jmp 0x2fc1
leal -0x1(%rbx), %edx
movl %edx, %esi
movl %esi, %esi
vmovsd (%rax,%rsi,8), %xmm0
movq 0x18(%rsp), %rsi
movq (%rsi), %rsi
vmovsd %xmm0, (%rsi,%rcx,8)
vmovsd (%rax,%rbx,8), %xmm0
movl %edx, %ecx
vucomisd (%rax,%rcx,8), %xmm0
jbe 0x3058
movl %edx, 0xc(%rsp)
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
callq 0x46b0
movq 0x38(%rsp), %rax
movl (%rax), %eax
addl %ebp, %eax
cmpl %eax, %ebx
jne 0x3009
movq %r12, %rdi
callq 0x4454
movq 0x88(%rsp), %rax
movq 0xa8(%rsp), %rcx
cmpq %rax, %rcx
je 0x30d9
cmpq 0xb0(%rsp), %rcx
jne 0x303b
movq 0xc0(%rsp), %rcx
movq -0x8(%rcx), %rcx
addq %r13, %rcx
movq (%r15), %rdx
movslq -0x4(%rcx), %rcx
vmovsd (%rdx,%rcx,8), %xmm0
vucomisd (%rdx,%rbx,8), %xmm0
jae 0x30c0
movq %r14, %rdi
callq 0x4472
jmp 0x3009
movl %edx, 0xc(%rsp)
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0x46b0
movq 0x88(%rsp), %rax
movl (%rax), %eax
addl %ebp, %eax
cmpl %eax, %ebx
jne 0x3081
movq %r14, %rdi
callq 0x4454
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq %rax, %rcx
je 0x30d9
cmpq 0x60(%rsp), %rcx
jne 0x30a3
movq 0x70(%rsp), %rcx
movq -0x8(%rcx), %rcx
addq %r13, %rcx
movq (%r15), %rdx
vmovsd (%rdx,%rbx,8), %xmm0
movslq -0x4(%rcx), %rcx
vucomisd (%rdx,%rcx,8), %xmm0
jae 0x30c9
movq %r12, %rdi
callq 0x4472
jmp 0x3081
movl (%rax), %eax
addl %ebp, %eax
movq %r14, %rdi
jmp 0x30d0
movl (%rax), %eax
addl %ebp, %eax
movq %r12, %rdi
cmpl %eax, %ebx
jne 0x30d9
callq 0x4454
incl %ebx
jmp 0x2f5c
cmpq %rdx, %rsi
je 0x30ea
movslq (%rdx), %rdx
jmp 0x30ee
leaq -0x1(%rcx), %rdx
vmovsd (%rax,%rdx,8), %xmm0
movq %rcx, %rdx
subq 0x20(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq (%rsi), %rsi
vmovsd %xmm0, (%rsi,%rdx,8)
movq 0x38(%rsp), %rsi
cmpq %rsi, 0x58(%rsp)
je 0x3119
movslq (%rsi), %rcx
jmp 0x311c
decq %rcx
vmovsd (%rax,%rcx,8), %xmm0
movq 0x18(%rsp), %rax
movq (%rax), %rax
vmovsd %xmm0, (%rax,%rdx,8)
leaq 0x28(%rsp), %rdi
callq 0x4942
leaq 0x78(%rsp), %rdi
callq 0x4942
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x3176
movq %rax, %r14
jmp 0x3180
movq %rax, %r14
jmp 0x318a
jmp 0x3169
jmp 0x3169
jmp 0x3169
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x4942
leaq 0x78(%rsp), %rdi
callq 0x4942
movq 0x18(%rsp), %rdi
callq 0x60f0
movq 0x10(%rsp), %rdi
callq 0x60f0
movq %r14, %rdi
callq 0x2160