// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x734c(%rip), %rax      # 0xace0
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq 0x8(%rsi), %rsi
subq (%r13), %rsi
sarq $0x3, %rsi
movl %edx, 0x14(%rsp)
movslq %edx, %r14
subq %r14, %rsi
incq %rsi
leaq 0x48(%rsp), %rdx
movq %rdi, 0x20(%rsp)
callq 0x4392
movq 0x8(%r13), %rsi
subq (%r13), %rsi
leaq 0x20(%rbx), %rdi
sarq $0x3, %rsi
subq %r14, %rsi
incq %rsi
leaq 0x48(%rsp), %rdx
movq %rdi, 0x28(%rsp)
callq 0x4392
leaq 0x48(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq %r14, %rsi
callq 0x4392
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0x4392
movq %rbx, 0x60(%rsp)
movq (%r13), %rcx
movq 0x8(%r13), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq %r14, %rax
negq %rax
leaq (%rdx,%rax), %r15
incq %r15
movq %rdx, 0x38(%rsp)
decl %edx
movq 0x48(%rsp), %r9
movq 0x70(%rsp), %r10
leal -0x1(%r14,%r14), %eax
movl %eax, 0x10(%rsp)
movl %r14d, %eax
movq %rax, 0x30(%rsp)
decl %r14d
xorl %edi, %edi
xorl %ebx, %ebx
movq %r14, 0x18(%rsp)
movl %r14d, %r13d
movq %r15, 0x40(%rsp)
cmpl %edx, %r13d
movl %edx, %esi
cmovbl %r13d, %esi
movl %r13d, %eax
cmpq %rdx, %rax
cmovaeq %rdx, %rax
movl %ebx, %r14d
cmpq %r14, %r15
jbe 0x3b71
movq %rdi, 0x68(%rsp)
leal (%rsi,%rdi), %r12d
leal 0x1(%rsi), %edi
subl %eax, %esi
cmpl %edx, %r13d
movl %edx, %ebp
cmovbl %r13d, %ebp
movq 0x30(%rsp), %rax
addq %rbx, %rax
leal -0x1(%rax), %r8d
cmpl %r8d, %edx
cmovbl %edx, %r8d
vmovsd (%rcx,%r8,8), %xmm0
vmovsd %xmm0, (%r9)
cmpq %r14, %rbp
jbe 0x3adf
decq %rbp
movl %esi, %r11d
incl %esi
movl %ebp, %r15d
vmovsd (%rcx,%r15,8), %xmm0
vmaxsd (%r9,%r11,8), %xmm0, %xmm0
vmovsd %xmm0, (%r9,%rsi,8)
jmp 0x3abb
vmovsd (%rcx,%r8,8), %xmm0
vmovsd %xmm0, (%r10)
addl 0x10(%rsp), %r14d
movq 0x38(%rsp), %rsi
cmpl %esi, %r14d
cmovael %esi, %r14d
xorl %esi, %esi
movq 0x40(%rsp), %r15
leaq (%rdi,%rsi), %rbp
cmpl %r14d, %ebp
jae 0x3b28
movl %ebp, %r11d
vmovsd (%rcx,%r11,8), %xmm0
vmaxsd (%r10,%rsi,8), %xmm0, %xmm0
incq %rsi
movl %esi, %r11d
vmovsd %xmm0, (%r10,%r11,8)
jmp 0x3b02
subl %r8d, %r14d
movq 0x20(%rsp), %rsi
movq (%rsi), %rsi
xorl %edi, %edi
cmpq %r14, %rdi
jae 0x3b5b
movl %r12d, %r8d
vmovsd (%r9,%r8,8), %xmm0
vmaxsd (%r10,%rdi,8), %xmm0, %xmm0
leal (%rbx,%rdi), %r8d
vmovsd %xmm0, (%rsi,%r8,8)
incq %rdi
decl %r12d
jmp 0x3b35
movl 0x14(%rsp), %esi
addl %esi, %r13d
movq 0x68(%rsp), %rdi
subl %esi, %edi
movq %rax, %rbx
jmp 0x3a67
movq 0x48(%rsp), %r9
movq 0x70(%rsp), %r10
xorl %r11d, %r11d
xorl %ebx, %ebx
movq 0x18(%rsp), %rdi
cmpl %edx, %edi
movl %edx, %r13d
cmovbl %edi, %r13d
movl %edi, %eax
cmpq %rdx, %rax
cmovaeq %rdx, %rax
movl %ebx, %r14d
cmpq %r14, %r15
jbe 0x3c92
movq %rdi, %r8
leal (%r11,%r13), %r12d
leal 0x1(%r13), %edi
subl %eax, %r13d
cmpl %edx, %r8d
movl %edx, %esi
movq %r8, 0x18(%rsp)
cmovbl %r8d, %esi
movq 0x30(%rsp), %rax
addq %rbx, %rax
leal -0x1(%rax), %r8d
cmpl %r8d, %edx
cmovbl %edx, %r8d
vmovsd (%rcx,%r8,8), %xmm0
vmovsd %xmm0, (%r9)
cmpq %r14, %rsi
jbe 0x3c00
decq %rsi
movl %r13d, %r15d
incl %r13d
movl %esi, %ebp
vmovsd (%rcx,%rbp,8), %xmm0
vminsd (%r9,%r15,8), %xmm0, %xmm0
vmovsd %xmm0, (%r9,%r13,8)
jmp 0x3bdd
vmovsd (%rcx,%r8,8), %xmm0
vmovsd %xmm0, (%r10)
addl 0x10(%rsp), %r14d
movq 0x38(%rsp), %rsi
cmpl %esi, %r14d
cmovael %esi, %r14d
xorl %esi, %esi
leaq (%rdi,%rsi), %r13
cmpl %r14d, %r13d
jae 0x3c44
movl %r13d, %r15d
vmovsd (%rcx,%r15,8), %xmm0
vminsd (%r10,%rsi,8), %xmm0, %xmm0
incq %rsi
movl %esi, %r15d
vmovsd %xmm0, (%r10,%r15,8)
jmp 0x3c1e
subl %r8d, %r14d
movq 0x28(%rsp), %rsi
movq (%rsi), %rsi
xorl %edi, %edi
movq 0x40(%rsp), %r15
cmpq %r14, %rdi
jae 0x3c7c
movl %r12d, %r8d
vmovsd (%r9,%r8,8), %xmm0
vminsd (%r10,%rdi,8), %xmm0, %xmm0
leal (%rbx,%rdi), %r8d
vmovsd %xmm0, (%rsi,%r8,8)
incq %rdi
decl %r12d
jmp 0x3c56
movl 0x14(%rsp), %esi
movq 0x18(%rsp), %rdi
addl %esi, %edi
subl %esi, %r11d
movq %rax, %rbx
jmp 0x3b85
movq 0x60(%rsp), %rcx
movq 0x10(%rcx), %rax
subq 0x8(%rcx), %rax
sarq $0x3, %rax
cmpq %r15, %rax
jne 0x3cdf
movq 0x28(%rcx), %rax
subq 0x20(%rcx), %rax
sarq $0x3, %rax
cmpq %r15, %rax
jne 0x3cfe
leaq 0x70(%rsp), %rdi
callq 0x60f0
leaq 0x48(%rsp), %rdi
callq 0x60f0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3425(%rip), %rdi      # 0x710b
leaq 0x344b(%rip), %rsi      # 0x7138
leaq 0x3456(%rip), %rcx      # 0x714a
movl $0xf7, %edx
callq 0x2090
leaq 0x3493(%rip), %rdi      # 0x7198
leaq 0x342c(%rip), %rsi      # 0x7138
leaq 0x3437(%rip), %rcx      # 0x714a
movl $0xf8, %edx
callq 0x2090
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x60f0
jmp 0x3d2f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
callq 0x60f0
jmp 0x3d3e
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0x60f0
movq %rbx, %rdi
callq 0x2160