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

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1d0(%rsp)
movq %rsi, 0x1c8(%rsp)
movl %edx, 0x1c4(%rsp)
movq 0x1d0(%rsp), %rdi
movq %rdi, 0xd0(%rsp)
callq 0x77c0
movq 0xd0(%rsp), %rax
leaq 0xf646(%rip), %rcx      # 0x13c48
addq $0x10, %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, 0xd8(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movl 0x1c4(%rsp), %ecx
subq %rcx, %rax
incq %rax
movq %rax, 0xe0(%rsp)
leaq 0x1c3(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x74c0
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
callq 0x74d0
jmp 0x466b
leaq 0x1c3(%rsp), %rdi
callq 0x7550
movq 0xd0(%rsp), %rax
addq $0x20, %rax
movq %rax, 0xb8(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movl 0x1c4(%rsp), %ecx
subq %rcx, %rax
incq %rax
movq %rax, 0xc0(%rsp)
leaq 0x1b3(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0x74c0
movq 0xb8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
callq 0x74d0
jmp 0x46e2
leaq 0x1b3(%rsp), %rdi
callq 0x7550
leaq 0x160(%rsp), %rdi
callq 0x7850
jmp 0x46fe
leaq 0x110(%rsp), %rdi
callq 0x7850
jmp 0x470d
movl $0x0, 0x10c(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0x10c(%rsp), %rsi
callq 0x7860
jmp 0x472f
movl $0x0, 0x108(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x7860
jmp 0x4751
movl $0x1, 0x104(%rsp)
movl 0x104(%rsp), %eax
cmpl 0x1c4(%rsp), %eax
jae 0x4a06
movq 0x1c8(%rsp), %rdi
movl 0x104(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0xb0(%rsp)
movq 0x1c8(%rsp), %rdi
movl 0x104(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0xb0(%rsp), %xmm0
vucomisd (%rax), %xmm0
jbe 0x490d
leaq 0x160(%rsp), %rdi
callq 0x7980
leaq 0x160(%rsp), %rdi
callq 0x7890
xorb $-0x1, %al
testb $0x1, %al
jne 0x47e6
jmp 0x4908
movq 0x1c8(%rsp), %rdi
movl 0x104(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0xa8(%rsp)
movq 0x1c8(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x78b0
movq 0xa0(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
vmovsd 0xa8(%rsp), %xmm1
vmovsd (%rax), %xmm0
vucomisd %xmm1, %xmm0
jb 0x48f6
jmp 0x4908
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x1c3(%rsp), %rdi
callq 0x7550
jmp 0x4e7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x1b3(%rsp), %rdi
callq 0x7550
jmp 0x4e70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4e63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4e56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x79f0
jmp 0x4e56
leaq 0x160(%rsp), %rdi
callq 0x7980
jmp 0x47ce
jmp 0x49a4
leaq 0x110(%rsp), %rdi
callq 0x7980
leaq 0x110(%rsp), %rdi
callq 0x7890
xorb $-0x1, %al
testb $0x1, %al
jne 0x492f
jmp 0x49a2
movq 0x1c8(%rsp), %rdi
movl 0x104(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x98(%rsp)
movq 0x1c8(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x78b0
movq 0x90(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
vmovsd 0x98(%rsp), %xmm0
vucomisd (%rax), %xmm0
jb 0x4990
jmp 0x49a2
leaq 0x110(%rsp), %rdi
callq 0x7980
jmp 0x491a
jmp 0x49a4
movl 0x104(%rsp), %eax
movl %eax, 0x100(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x7860
jmp 0x49c9
movl 0x104(%rsp), %eax
movl %eax, 0xfc(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0xfc(%rsp), %rsi
callq 0x7860
jmp 0x49ee
jmp 0x49f0
movl 0x104(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x104(%rsp)
jmp 0x475c
movl 0x1c4(%rsp), %eax
movl %eax, 0xf8(%rsp)
movl 0xf8(%rsp), %eax
movq %rax, 0x88(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movq %rax, %rcx
movq 0x88(%rsp), %rax
cmpq %rcx, %rax
jae 0x4d50
movq 0x1c8(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x78e0
movq 0x60(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
movq 0xd0(%rsp), %rdi
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x68(%rsp)
addq $0x8, %rdi
movl 0xf8(%rsp), %eax
subl 0x1c4(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x68(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movq 0x1c8(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x78e0
movq 0x70(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
movq 0xd0(%rsp), %rdi
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x78(%rsp)
addq $0x20, %rdi
movl 0xf8(%rsp), %eax
subl 0x1c4(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x78(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movq 0x1c8(%rsp), %rdi
movl 0xf8(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x80(%rsp)
movq 0x1c8(%rsp), %rdi
movl 0xf8(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x80(%rsp), %xmm0
vucomisd (%rax), %xmm0
jbe 0x4be0
leaq 0x160(%rsp), %rdi
callq 0x7980
leaq 0x160(%rsp), %rdi
callq 0x7890
xorb $-0x1, %al
testb $0x1, %al
jne 0x4b73
jmp 0x4bdb
movq 0x1c8(%rsp), %rdi
movl 0xf8(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x58(%rsp)
movq 0x1c8(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x78b0
movq 0x50(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
vmovsd 0x58(%rsp), %xmm1
vmovsd (%rax), %xmm0
vucomisd %xmm1, %xmm0
jb 0x4bcc
jmp 0x4bdb
leaq 0x160(%rsp), %rdi
callq 0x7980
jmp 0x4b5e
jmp 0x4c68
leaq 0x110(%rsp), %rdi
callq 0x7980
leaq 0x110(%rsp), %rdi
callq 0x7890
xorb $-0x1, %al
testb $0x1, %al
jne 0x4c02
jmp 0x4c66
movq 0x1c8(%rsp), %rdi
movl 0xf8(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
movq 0x1c8(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x78b0
movq 0x40(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
vmovsd 0x48(%rsp), %xmm0
vucomisd (%rax), %xmm0
jb 0x4c57
jmp 0x4c66
leaq 0x110(%rsp), %rdi
callq 0x7980
jmp 0x4bed
jmp 0x4c68
movl 0xf8(%rsp), %eax
movl %eax, 0xf4(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0xf4(%rsp), %rsi
callq 0x7860
jmp 0x4c8d
movl 0xf8(%rsp), %eax
movl %eax, 0xf0(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x7860
jmp 0x4cb2
movl 0xf8(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl 0x1c4(%rsp), %eax
movl %eax, 0x38(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x78e0
movl 0x38(%rsp), %ecx
movq %rax, %rdx
movl 0x3c(%rsp), %eax
addl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x4cf5
leaq 0x160(%rsp), %rdi
callq 0x7910
jmp 0x4d38
movl 0xf8(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x1c4(%rsp), %eax
movl %eax, 0x30(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x78e0
movl 0x30(%rsp), %ecx
movq %rax, %rdx
movl 0x34(%rsp), %eax
addl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x4d36
leaq 0x110(%rsp), %rdi
callq 0x7910
jmp 0x4d38
jmp 0x4d3a
movl 0xf8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf8(%rsp)
jmp 0x4a14
movq 0x1c8(%rsp), %rax
movq %rax, (%rsp)
leaq 0x160(%rsp), %rdi
callq 0x78e0
movq (%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
movq %rax, %rcx
movq 0xd0(%rsp), %rax
vmovsd (%rcx), %xmm0
vmovsd %xmm0, 0x10(%rsp)
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl 0x1c4(%rsp), %eax
subq %rax, %rsi
callq 0x3430
vmovsd 0x10(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movq 0x1c8(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x78e0
movq 0x18(%rsp), %rdi
movslq (%rax), %rsi
callq 0x3430
movq %rax, %rcx
movq 0xd0(%rsp), %rax
vmovsd (%rcx), %xmm0
vmovsd %xmm0, 0x28(%rsp)
addq $0x20, %rax
movq %rax, 0x20(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movl 0x1c4(%rsp), %eax
subq %rax, %rsi
callq 0x3430
vmovsd 0x28(%rsp), %xmm0
vmovsd %xmm0, (%rax)
leaq 0x110(%rsp), %rdi
callq 0x79f0
leaq 0x160(%rsp), %rdi
callq 0x79f0
addq $0x1d8, %rsp            # imm = 0x1D8
retq
leaq 0x160(%rsp), %rdi
callq 0x79f0
movq 0xb8(%rsp), %rdi
callq 0x7660
movq 0xd8(%rsp), %rdi
callq 0x7660
movq 0xd0(%rsp), %rdi
callq 0x7830
movq 0x1b8(%rsp), %rdi
callq 0x2160
nopw (%rax,%rax)