// File: lemire[P]runningmaxmin/./runningmaxmin.h
// Function: monowedgewrap::monowedgewrap(std::vector<double, std::allocator<double>>&, unsigned int)
monowedgewrap(std::vector<floattype> & array, uint width)
        : maxvalues(array.size() - width + 1),
          minvalues(array.size() - width + 1) {
        std::deque<Sample> max_wedge;
        std::deque<Sample> min_wedge;
        for (uint i = 0; i < width - 1; ++i) {
            Sample sample = {array[i], i};
            mono_wedge::max_wedge_update(max_wedge, sample);
            mono_wedge::min_wedge_update(min_wedge, sample);
        }
        for (uint i = width; i < array.size(); ++i) {
            Sample sample = {array[i], i};
            mono_wedge::max_wedge_update(max_wedge, sample);
            mono_wedge::min_wedge_update(min_wedge, sample);
            while (max_wedge.front().time <= i-width) max_wedge.pop_front();
            while (min_wedge.front().time <= i-width) min_wedge.pop_front();
            maxvalues[i - width + 1] = max_wedge.front().value;
            minvalues[i - width + 1] = min_wedge.front().value;
        }
    }

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movl %edx, 0x134(%rsp)
movq 0x140(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x77c0
movq 0x30(%rsp), %rax
leaq 0xcefc(%rip), %rcx      # 0x13d68
addq $0x10, %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, 0x38(%rsp)
movq 0x138(%rsp), %rdi
callq 0x3410
movl 0x134(%rsp), %ecx
subq %rcx, %rax
incq %rax
movq %rax, 0x40(%rsp)
leaq 0x133(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x74c0
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x74d0
jmp 0x6ec3
leaq 0x133(%rsp), %rdi
callq 0x7550
movq 0x30(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x18(%rsp)
movq 0x138(%rsp), %rdi
callq 0x3410
movl 0x134(%rsp), %ecx
subq %rcx, %rax
incq %rax
movq %rax, 0x20(%rsp)
leaq 0x123(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x74c0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x74d0
jmp 0x6f25
leaq 0x123(%rsp), %rdi
callq 0x7550
leaq 0xd0(%rsp), %rdi
callq 0xa140
jmp 0x6f41
leaq 0x80(%rsp), %rdi
callq 0xa140
jmp 0x6f50
movl $0x0, 0x7c(%rsp)
movl 0x7c(%rsp), %eax
movl 0x134(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x706e
movq 0x138(%rsp), %rdi
movl 0x7c(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x68(%rsp)
movl 0x7c(%rsp), %eax
movl %eax, 0x70(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xa150
jmp 0x6fa7
leaq 0x80(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xa180
jmp 0x6fbb
jmp 0x6fbd
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0x6f58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
leaq 0x133(%rsp), %rdi
callq 0x7550
jmp 0x7220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
leaq 0x123(%rsp), %rdi
callq 0x7550
jmp 0x7216
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
jmp 0x720c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
jmp 0x71ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xa250
jmp 0x71ff
movl 0x134(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
movq %rax, 0x10(%rsp)
movq 0x138(%rsp), %rdi
callq 0x3410
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0x71dd
movq 0x138(%rsp), %rdi
movl 0x64(%rsp), %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x50(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x58(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xa150
jmp 0x70d9
leaq 0x80(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xa180
jmp 0x70ed
jmp 0x70ef
leaq 0xd0(%rsp), %rdi
callq 0xa1b0
movl 0x8(%rax), %eax
movl 0x64(%rsp), %ecx
subl 0x134(%rsp), %ecx
cmpl %ecx, %eax
ja 0x711d
leaq 0xd0(%rsp), %rdi
callq 0xa1e0
jmp 0x70ef
jmp 0x711f
leaq 0x80(%rsp), %rdi
callq 0xa1b0
movl 0x8(%rax), %eax
movl 0x64(%rsp), %ecx
subl 0x134(%rsp), %ecx
cmpl %ecx, %eax
ja 0x714d
leaq 0x80(%rsp), %rdi
callq 0xa1e0
jmp 0x711f
leaq 0xd0(%rsp), %rdi
callq 0xa1b0
movq 0x30(%rsp), %rdi
vmovsd (%rax), %xmm0
vmovsd %xmm0, (%rsp)
addq $0x8, %rdi
movl 0x64(%rsp), %eax
subl 0x134(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd (%rsp), %xmm0
vmovsd %xmm0, (%rax)
leaq 0x80(%rsp), %rdi
callq 0xa1b0
movq 0x30(%rsp), %rdi
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x8(%rsp)
addq $0x20, %rdi
movl 0x64(%rsp), %eax
subl 0x134(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x3430
vmovsd 0x8(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x7079
leaq 0x80(%rsp), %rdi
callq 0xa250
leaq 0xd0(%rsp), %rdi
callq 0xa250
addq $0x148, %rsp            # imm = 0x148
retq
leaq 0xd0(%rsp), %rdi
callq 0xa250
movq 0x18(%rsp), %rdi
callq 0x7660
movq 0x38(%rsp), %rdi
callq 0x7660
movq 0x30(%rsp), %rdi
callq 0x7830
movq 0x128(%rsp), %rdi
callq 0x2160
nopw (%rax,%rax)