// File: 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:
subq $0x218, %rsp            # imm = 0x218
movq %rdi, 0x210(%rsp)
movq %rsi, 0x208(%rsp)
movl %edx, 0x204(%rsp)
movq 0x210(%rsp), %rdi
movq %rdi, 0x118(%rsp)
callq 0x77c0
movq 0x118(%rsp), %rax
leaq 0x10366(%rip), %rcx     # 0x13bb8
addq $0x10, %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, 0x120(%rsp)
movq 0x208(%rsp), %rdi
callq 0x3410
movl 0x204(%rsp), %ecx
subq %rcx, %rax
incq %rax
movq %rax, 0x128(%rsp)
leaq 0x203(%rsp), %rdi
movq %rdi, 0x130(%rsp)
callq 0x74c0
movq 0x120(%rsp), %rdi
movq 0x128(%rsp), %rsi
movq 0x130(%rsp), %rdx
callq 0x74d0
jmp 0x38bb
leaq 0x203(%rsp), %rdi
callq 0x7550
movq 0x118(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x100(%rsp)
movq 0x208(%rsp), %rdi
callq 0x3410
movl 0x204(%rsp), %ecx
subq %rcx, %rax
incq %rax
movq %rax, 0x108(%rsp)
leaq 0x1f3(%rsp), %rdi
movq %rdi, 0x110(%rsp)
callq 0x74c0
movq 0x100(%rsp), %rdi
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rdx
callq 0x74d0
jmp 0x3932
leaq 0x1f3(%rsp), %rdi
callq 0x7550
leaq 0x1a0(%rsp), %rdi
callq 0x7850
jmp 0x394e
leaq 0x150(%rsp), %rdi
callq 0x7850
jmp 0x395d
movl $0x1, 0x14c(%rsp)
movl 0x14c(%rsp), %eax
cmpl 0x204(%rsp), %eax
jae 0x3ca3
movq 0x208(%rsp), %rdi
movl 0x14c(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0xf8(%rsp)
movq 0x208(%rsp), %rdi
movl 0x14c(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0xf8(%rsp), %xmm0
vucomisd (%rax), %xmm0
jbe 0x3b88
movl 0x14c(%rsp), %eax
decl %eax
movl %eax, 0x148(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x7860
jmp 0x39f4
jmp 0x39f6
leaq 0x1a0(%rsp), %rdi
callq 0x7890
xorb $-0x1, %al
testb $0x1, %al
jne 0x3a0e
jmp 0x3b83
movq 0x208(%rsp), %rdi
movl 0x14c(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0xf0(%rsp)
movq 0x208(%rsp), %rax
movq %rax, 0xe8(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x78b0
movq 0xe8(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
vmovsd 0xf0(%rsp), %xmm1
vmovsd (%rax), %xmm0
vucomisd %xmm1, %xmm0
jb 0x3b71
movl 0x14c(%rsp), %eax
movl %eax, 0xe4(%rsp)
movl 0x204(%rsp), %eax
movl %eax, 0xe0(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x78e0
movl 0xe0(%rsp), %ecx
movq %rax, %rdx
movl 0xe4(%rsp), %eax
addl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x3b6f
leaq 0x1a0(%rsp), %rdi
callq 0x7910
jmp 0x3b6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x203(%rsp), %rdi
callq 0x7550
jmp 0x4290
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x1f3(%rsp), %rdi
callq 0x7550
jmp 0x4283
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
jmp 0x4276
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
jmp 0x4269
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x79f0
jmp 0x4269
jmp 0x3b83
leaq 0x1a0(%rsp), %rdi
callq 0x7980
jmp 0x39f6
jmp 0x3c8b
movl 0x14c(%rsp), %eax
decl %eax
movl %eax, 0x144(%rsp)
leaq 0x1a0(%rsp), %rdi
leaq 0x144(%rsp), %rsi
callq 0x7860
jmp 0x3baf
jmp 0x3bb1
leaq 0x150(%rsp), %rdi
callq 0x7890
xorb $-0x1, %al
testb $0x1, %al
jne 0x3bc9
jmp 0x3c89
movq 0x208(%rsp), %rdi
movl 0x14c(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0xd8(%rsp)
movq 0x208(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x78b0
movq 0xd0(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
vmovsd 0xd8(%rsp), %xmm0
vucomisd (%rax), %xmm0
jb 0x3c77
movl 0x14c(%rsp), %eax
movl %eax, 0xcc(%rsp)
movl 0x204(%rsp), %eax
movl %eax, 0xc8(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x78e0
movl 0xc8(%rsp), %ecx
movq %rax, %rdx
movl 0xcc(%rsp), %eax
addl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x3c75
leaq 0x150(%rsp), %rdi
callq 0x7910
jmp 0x3c89
leaq 0x150(%rsp), %rdi
callq 0x7980
jmp 0x3bb1
jmp 0x3c8b
jmp 0x3c8d
movl 0x14c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14c(%rsp)
jmp 0x3968
movl 0x204(%rsp), %eax
movl %eax, 0x140(%rsp)
movl 0x140(%rsp), %eax
movq %rax, 0xc0(%rsp)
movq 0x208(%rsp), %rdi
callq 0x3410
movq %rax, %rcx
movq 0xc0(%rsp), %rax
cmpq %rcx, %rax
jae 0x40f7
movq 0x208(%rsp), %rax
movq %rax, 0xb8(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x7890
testb $0x1, %al
jne 0x3d04
jmp 0x3d17
movl 0x140(%rsp), %eax
subl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x3d2d
leaq 0x1a0(%rsp), %rdi
callq 0x78e0
movl (%rax), %eax
movl %eax, 0xb4(%rsp)
movq 0xb8(%rsp), %rdi
movl 0xb4(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
movq 0x118(%rsp), %rdi
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0xa0(%rsp)
addq $0x8, %rdi
movl 0x140(%rsp), %eax
subl 0x204(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0xa0(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movq 0x208(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x7890
testb $0x1, %al
jne 0x3da5
jmp 0x3db8
movl 0x140(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x3dce
leaq 0x150(%rsp), %rdi
callq 0x78e0
movl (%rax), %eax
movl %eax, 0x9c(%rsp)
movq 0xa8(%rsp), %rdi
movl 0x9c(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
movq 0x118(%rsp), %rdi
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x88(%rsp)
addq $0x20, %rdi
movl 0x140(%rsp), %eax
subl 0x204(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x88(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movq 0x208(%rsp), %rdi
movl 0x140(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x90(%rsp)
movq 0x208(%rsp), %rdi
movl 0x140(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x90(%rsp), %xmm0
vucomisd (%rax), %xmm0
jbe 0x3fb3
movl 0x140(%rsp), %eax
decl %eax
movl %eax, 0x13c(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0x13c(%rsp), %rsi
callq 0x7860
jmp 0x3e9b
movl 0x140(%rsp), %eax
movl %eax, 0x84(%rsp)
movl 0x204(%rsp), %eax
movl %eax, 0x80(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x78e0
movl 0x80(%rsp), %ecx
movq %rax, %rdx
movl 0x84(%rsp), %eax
addl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x3ee8
leaq 0x150(%rsp), %rdi
callq 0x7910
jmp 0x3eea
leaq 0x1a0(%rsp), %rdi
callq 0x7890
xorb $-0x1, %al
testb $0x1, %al
jne 0x3f02
jmp 0x3fae
movq 0x208(%rsp), %rdi
movl 0x140(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x78(%rsp)
movq 0x208(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x78b0
movq 0x70(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
vmovsd 0x78(%rsp), %xmm1
vmovsd (%rax), %xmm0
vucomisd %xmm1, %xmm0
jb 0x3f9c
movl 0x140(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x204(%rsp), %eax
movl %eax, 0x68(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x78e0
movl 0x68(%rsp), %ecx
movq %rax, %rdx
movl 0x6c(%rsp), %eax
addl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x3f9a
leaq 0x1a0(%rsp), %rdi
callq 0x7910
jmp 0x3fae
leaq 0x1a0(%rsp), %rdi
callq 0x7980
jmp 0x3eea
jmp 0x40df
movl 0x140(%rsp), %eax
decl %eax
movl %eax, 0x138(%rsp)
leaq 0x1a0(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x7860
jmp 0x3fda
movl 0x140(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x204(%rsp), %eax
movl %eax, 0x60(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x78e0
movl 0x60(%rsp), %ecx
movq %rax, %rdx
movl 0x64(%rsp), %eax
addl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x401b
leaq 0x1a0(%rsp), %rdi
callq 0x7910
jmp 0x401d
leaq 0x150(%rsp), %rdi
callq 0x7890
xorb $-0x1, %al
testb $0x1, %al
jne 0x4035
jmp 0x40dd
movq 0x208(%rsp), %rdi
movl 0x140(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x58(%rsp)
movq 0x208(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x78b0
movq 0x50(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
vmovsd 0x58(%rsp), %xmm0
vucomisd (%rax), %xmm0
jb 0x40cb
movl 0x140(%rsp), %eax
movl %eax, 0x4c(%rsp)
movl 0x204(%rsp), %eax
movl %eax, 0x48(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x78e0
movl 0x48(%rsp), %ecx
movq %rax, %rdx
movl 0x4c(%rsp), %eax
addl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x40c9
leaq 0x150(%rsp), %rdi
callq 0x7910
jmp 0x40dd
leaq 0x150(%rsp), %rdi
callq 0x7980
jmp 0x401d
jmp 0x40df
jmp 0x40e1
movl 0x140(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x140(%rsp)
jmp 0x3cb1
movq 0x208(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x7890
testb $0x1, %al
jne 0x4117
jmp 0x412f
movq 0x208(%rsp), %rdi
callq 0x3410
subq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x4144
leaq 0x1a0(%rsp), %rdi
callq 0x78e0
movslq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x3430
movq %rax, %rcx
movq 0x118(%rsp), %rax
vmovsd (%rcx), %xmm0
vmovsd %xmm0, 0x28(%rsp)
addq $0x8, %rax
movq %rax, 0x20(%rsp)
movq 0x208(%rsp), %rdi
callq 0x3410
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movl 0x204(%rsp), %eax
subq %rax, %rsi
callq 0x3430
vmovsd 0x28(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movq 0x208(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x7890
testb $0x1, %al
jne 0x41bf
jmp 0x41d7
movq 0x208(%rsp), %rdi
callq 0x3410
subq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x41ec
leaq 0x150(%rsp), %rdi
callq 0x78e0
movslq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x3430
movq %rax, %rcx
movq 0x118(%rsp), %rax
vmovsd (%rcx), %xmm0
vmovsd %xmm0, 0x10(%rsp)
addq $0x20, %rax
movq %rax, 0x8(%rsp)
movq 0x208(%rsp), %rdi
callq 0x3410
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl 0x204(%rsp), %eax
subq %rax, %rsi
callq 0x3430
vmovsd 0x10(%rsp), %xmm0
vmovsd %xmm0, (%rax)
leaq 0x150(%rsp), %rdi
callq 0x79f0
leaq 0x1a0(%rsp), %rdi
callq 0x79f0
addq $0x218, %rsp            # imm = 0x218
retq
leaq 0x1a0(%rsp), %rdi
callq 0x79f0
movq 0x100(%rsp), %rdi
callq 0x7660
movq 0x120(%rsp), %rdi
callq 0x7660
movq 0x118(%rsp), %rdi
callq 0x7830
movq 0x1f8(%rsp), %rdi
callq 0x2160
nopw (%rax,%rax)