// File: lemire[P]runningmaxmin/./runningmaxmin.h
// Function: vanHerkGilWermanmaxmin::vanHerkGilWermanmaxmin(std::vector<double, std::allocator<double>>&, int)
vanHerkGilWermanmaxmin(std::vector<floattype> & array, int width)
        : maxvalues(array.size() - width + 1),
          minvalues(array.size() - width + 1) {
        std::vector<floattype> R(width);
        std::vector<floattype> S(width);
        for (uint j = 0; j < array.size() - width + 1; j += width) {
            uint Rpos = std::min(j + width - 1,
                                 static_cast<unsigned>(array.size() - 1));
            R[0] = array[Rpos];
            for (uint i = Rpos - 1; i + 1 > j; i -= 1)
                R[Rpos - i] = std::max(R[Rpos - i - 1], array[i]);
            S[0] = array[Rpos];
            uint m1 = std::min(j + 2 * width - 1,
                               static_cast<unsigned>(array.size()));
            for (uint i = Rpos + 1; i < m1; ++i) {
                S[i - Rpos] = std::max(S[i - Rpos - 1], array[i]);
            }
            for (uint i = 0; i < m1 - Rpos; i += 1)
                maxvalues[j + i] = std::max(S[i], R[(Rpos - j + 1) - i - 1]);
        }
        for (uint j = 0; j < array.size() - width + 1; j += width) {
            uint Rpos = std::min(j + width - 1,
                                 static_cast<unsigned>(array.size() - 1));
            R[0] = array[Rpos];
            for (uint i = Rpos - 1; i + 1 > j; i -= 1)
                R[Rpos - i] = std::min(R[Rpos - i - 1], array[i]);
            S[0] = array[Rpos];
            uint m1 = std::min(j + 2 * width - 1,
                               static_cast<unsigned>(array.size()));
            for (uint i = Rpos + 1; i < m1; ++i) {
                S[i - Rpos] = std::min(S[i - Rpos - 1], array[i]);
            }
            for (uint i = 0; i < m1 - Rpos; i += 1)
                minvalues[j + i] = std::min(S[i], R[(Rpos - j + 1) - i - 1]);
        }
        assert(maxvalues.size() == array.size() - width + 1);
        assert(minvalues.size() == array.size() - width + 1);
    }

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1d0(%rsp)
movq %rsi, 0x1c8(%rsp)
movl %edx, 0x1c4(%rsp)
movq 0x1d0(%rsp), %rdi
movq %rdi, 0x100(%rsp)
callq 0x77c0
movq 0x100(%rsp), %rax
leaq 0xe536(%rip), %rcx      # 0x13cd8
addq $0x10, %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, 0x108(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movslq 0x1c4(%rsp), %rcx
subq %rcx, %rax
incq %rax
movq %rax, 0x110(%rsp)
leaq 0x1c3(%rsp), %rdi
movq %rdi, 0x118(%rsp)
callq 0x74c0
movq 0x108(%rsp), %rdi
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
callq 0x74d0
jmp 0x580c
leaq 0x1c3(%rsp), %rdi
callq 0x7550
movq 0x100(%rsp), %rax
addq $0x20, %rax
movq %rax, 0xe8(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movslq 0x1c4(%rsp), %rcx
subq %rcx, %rax
incq %rax
movq %rax, 0xf0(%rsp)
leaq 0x1b3(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
callq 0x74c0
movq 0xe8(%rsp), %rdi
movq 0xf0(%rsp), %rsi
movq 0xf8(%rsp), %rdx
callq 0x74d0
jmp 0x5884
leaq 0x1b3(%rsp), %rdi
callq 0x7550
movslq 0x1c4(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0x197(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0x74c0
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
leaq 0x198(%rsp), %rdi
callq 0x74d0
jmp 0x58d5
leaq 0x197(%rsp), %rdi
callq 0x7550
movslq 0x1c4(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0x177(%rsp), %rdi
movq %rdi, 0xd0(%rsp)
callq 0x74c0
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
leaq 0x178(%rsp), %rdi
callq 0x74d0
jmp 0x5926
leaq 0x177(%rsp), %rdi
callq 0x7550
movl $0x0, 0x170(%rsp)
movl 0x170(%rsp), %eax
movq %rax, 0xc0(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movq %rax, %rcx
movq 0xc0(%rsp), %rax
movslq 0x1c4(%rsp), %rdx
subq %rdx, %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jae 0x5df1
movl 0x170(%rsp), %edx
movl 0x1c4(%rsp), %eax
movl %eax, %ecx
movl %edx, %eax
leal -0x1(%rax,%rcx), %eax
movl %eax, 0x168(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
decl %eax
movl %eax, 0x164(%rsp)
leaq 0x168(%rsp), %rdi
leaq 0x164(%rsp), %rsi
callq 0xa060
movq %rax, 0xb8(%rsp)
jmp 0x59cf
movq 0xb8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x16c(%rsp)
movq 0x1c8(%rsp), %rdi
movl 0x16c(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0xb0(%rsp)
leaq 0x198(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0xb0(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x16c(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x160(%rsp)
movl 0x160(%rsp), %eax
addl $0x1, %eax
cmpl 0x170(%rsp), %eax
jbe 0x5ba6
movl 0x16c(%rsp), %eax
subl 0x160(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x198(%rsp), %rdi
callq 0x3430
movq %rax, 0xa0(%rsp)
movq 0x1c8(%rsp), %rdi
movl 0x160(%rsp), %eax
movl %eax, %esi
callq 0x3430
movq 0xa0(%rsp), %rdi
movq %rax, %rsi
callq 0x9fe0
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0xa8(%rsp)
movl 0x16c(%rsp), %eax
subl 0x160(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x198(%rsp), %rdi
callq 0x3430
vmovsd 0xa8(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x160(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x160(%rsp)
jmp 0x5a32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x1c3(%rsp), %rdi
callq 0x7550
jmp 0x62c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x1b3(%rsp), %rdi
callq 0x7550
jmp 0x62b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x197(%rsp), %rdi
callq 0x7550
jmp 0x62aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x177(%rsp), %rdi
callq 0x7550
jmp 0x629d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x178(%rsp), %rdi
callq 0x7660
jmp 0x629d
movq 0x1c8(%rsp), %rdi
movl 0x16c(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x90(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x178(%rsp), %rdi
callq 0x3430
vmovsd 0x90(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x170(%rsp), %edx
movl 0x1c4(%rsp), %eax
movl %eax, %ecx
movl %edx, %eax
leal -0x1(%rax,%rcx,2), %eax
movl %eax, 0x158(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movl %eax, 0x154(%rsp)
leaq 0x158(%rsp), %rdi
leaq 0x154(%rsp), %rsi
callq 0xa060
movq %rax, 0x98(%rsp)
jmp 0x5c37
movq 0x98(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x15c(%rsp)
movl 0x16c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x150(%rsp)
movl 0x150(%rsp), %eax
cmpl 0x15c(%rsp), %eax
jae 0x5d0c
movl 0x150(%rsp), %eax
subl 0x16c(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x178(%rsp), %rdi
callq 0x3430
movq %rax, 0x80(%rsp)
movq 0x1c8(%rsp), %rdi
movl 0x150(%rsp), %eax
movl %eax, %esi
callq 0x3430
movq 0x80(%rsp), %rdi
movq %rax, %rsi
callq 0x9fe0
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x88(%rsp)
movl 0x150(%rsp), %eax
subl 0x16c(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x178(%rsp), %rdi
callq 0x3430
vmovsd 0x88(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x150(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x150(%rsp)
jmp 0x5c59
movl $0x0, 0x14c(%rsp)
movl 0x14c(%rsp), %eax
movl 0x15c(%rsp), %ecx
subl 0x16c(%rsp), %ecx
cmpl %ecx, %eax
jae 0x5dd5
movl 0x14c(%rsp), %eax
movl %eax, %esi
leaq 0x178(%rsp), %rdi
callq 0x3430
movq %rax, 0x70(%rsp)
movl 0x16c(%rsp), %eax
subl 0x170(%rsp), %eax
addl $0x1, %eax
subl 0x14c(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x198(%rsp), %rdi
callq 0x3430
movq 0x70(%rsp), %rdi
movq %rax, %rsi
callq 0x9fe0
movq 0x100(%rsp), %rdi
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x78(%rsp)
addq $0x8, %rdi
movl 0x170(%rsp), %eax
addl 0x14c(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x78(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x14c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14c(%rsp)
jmp 0x5d17
jmp 0x5dd7
movl 0x1c4(%rsp), %eax
addl 0x170(%rsp), %eax
movl %eax, 0x170(%rsp)
jmp 0x593e
movl $0x0, 0x148(%rsp)
movl 0x148(%rsp), %eax
movq %rax, 0x68(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movq %rax, %rcx
movq 0x68(%rsp), %rax
movslq 0x1c4(%rsp), %rdx
subq %rdx, %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jae 0x61bb
movl 0x148(%rsp), %edx
movl 0x1c4(%rsp), %eax
movl %eax, %ecx
movl %edx, %eax
leal -0x1(%rax,%rcx), %eax
movl %eax, 0x140(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
decl %eax
movl %eax, 0x13c(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x13c(%rsp), %rsi
callq 0xa060
movq %rax, 0x60(%rsp)
jmp 0x5e84
movq 0x60(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x144(%rsp)
movq 0x1c8(%rsp), %rdi
movl 0x144(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x58(%rsp)
leaq 0x198(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x58(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x144(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x138(%rsp)
movl 0x138(%rsp), %eax
addl $0x1, %eax
cmpl 0x148(%rsp), %eax
jbe 0x5f88
movl 0x144(%rsp), %eax
subl 0x138(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x198(%rsp), %rdi
callq 0x3430
movq %rax, 0x48(%rsp)
movq 0x1c8(%rsp), %rdi
movl 0x138(%rsp), %eax
movl %eax, %esi
callq 0x3430
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0xa020
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x50(%rsp)
movl 0x144(%rsp), %eax
subl 0x138(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x198(%rsp), %rdi
callq 0x3430
vmovsd 0x50(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x138(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x138(%rsp)
jmp 0x5ede
movq 0x1c8(%rsp), %rdi
movl 0x144(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x38(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x178(%rsp), %rdi
callq 0x3430
vmovsd 0x38(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x148(%rsp), %edx
movl 0x1c4(%rsp), %eax
movl %eax, %ecx
movl %edx, %eax
leal -0x1(%rax,%rcx,2), %eax
movl %eax, 0x130(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movl %eax, 0x12c(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x12c(%rsp), %rsi
callq 0xa060
movq %rax, 0x40(%rsp)
jmp 0x6010
movq 0x40(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x134(%rsp)
movl 0x144(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x128(%rsp)
movl 0x128(%rsp), %eax
cmpl 0x134(%rsp), %eax
jae 0x60d6
movl 0x128(%rsp), %eax
subl 0x144(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x178(%rsp), %rdi
callq 0x3430
movq %rax, 0x28(%rsp)
movq 0x1c8(%rsp), %rdi
movl 0x128(%rsp), %eax
movl %eax, %esi
callq 0x3430
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0xa020
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x30(%rsp)
movl 0x128(%rsp), %eax
subl 0x144(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x178(%rsp), %rdi
callq 0x3430
vmovsd 0x30(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x128(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x128(%rsp)
jmp 0x602f
movl $0x0, 0x124(%rsp)
movl 0x124(%rsp), %eax
movl 0x134(%rsp), %ecx
subl 0x144(%rsp), %ecx
cmpl %ecx, %eax
jae 0x619f
movl 0x124(%rsp), %eax
movl %eax, %esi
leaq 0x178(%rsp), %rdi
callq 0x3430
movq %rax, 0x18(%rsp)
movl 0x144(%rsp), %eax
subl 0x148(%rsp), %eax
addl $0x1, %eax
subl 0x124(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x198(%rsp), %rdi
callq 0x3430
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0xa020
movq 0x100(%rsp), %rdi
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x20(%rsp)
addq $0x20, %rdi
movl 0x148(%rsp), %eax
addl 0x124(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x20(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x124(%rsp)
jmp 0x60e1
jmp 0x61a1
movl 0x1c4(%rsp), %eax
addl 0x148(%rsp), %eax
movl %eax, 0x148(%rsp)
jmp 0x5dfc
movq 0x100(%rsp), %rdi
addq $0x8, %rdi
callq 0x3410
movq %rax, 0x10(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movq %rax, %rcx
movq 0x10(%rsp), %rax
movslq 0x1c4(%rsp), %rdx
subq %rdx, %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x61fc
jmp 0x621b
leaq 0x8f08(%rip), %rdi      # 0xf10b
leaq 0x8f2e(%rip), %rsi      # 0xf138
movl $0xf7, %edx
leaq 0x8f34(%rip), %rcx      # 0xf14a
callq 0x2090
movq 0x100(%rsp), %rdi
addq $0x20, %rdi
callq 0x3410
movq %rax, 0x8(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0x3410
movq %rax, %rcx
movq 0x8(%rsp), %rax
movslq 0x1c4(%rsp), %rdx
subq %rdx, %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x625c
jmp 0x627b
leaq 0x8f35(%rip), %rdi      # 0xf198
leaq 0x8ece(%rip), %rsi      # 0xf138
movl $0xf8, %edx
leaq 0x8ed4(%rip), %rcx      # 0xf14a
callq 0x2090
leaq 0x178(%rsp), %rdi
callq 0x7660
leaq 0x198(%rsp), %rdi
callq 0x7660
addq $0x1d8, %rsp            # imm = 0x1D8
retq
leaq 0x198(%rsp), %rdi
callq 0x7660
movq 0xe8(%rsp), %rdi
callq 0x7660
movq 0x108(%rsp), %rdi
callq 0x7660
movq 0x100(%rsp), %rdi
callq 0x7830
movq 0x1b8(%rsp), %rdi
callq 0x2160
nop