// File: /workspace/github_cpp_makefile_star2_O1/lemire[P]runningmaxmin/runningmaxmin.cpp
// Function: main
int main(int params, char ** args) {
    int whitesize = 0;
    int walksize = 0;
    int times = 1;
    int sinesize = 0;
    floattype sineperiod = 0.0;
    int windowbegin = 10;
    int windowend = 11;
    bool doslow = true;
    bool cininput = false;
    std::vector<floattype> data(0);
    for (int i = 1; i < params; ++i) {
        if (strcmp(args[i], "--skipslow") == 0) {
            doslow = false;
        }
        if (strcmp(args[i], "--pipedata") == 0) {
            cininput = true;
        }
        if (strcmp(args[i], "--unit") == 0) {
            std::cout << "OK " << std::endl;
            return 0;
        }
        if (strcmp(args[i], "--window") == 0) {
            if (params - i > 1) {
                windowbegin = atoi(args[++i]);
                windowend = windowbegin + 1;
            } else {
                std::cerr << "--window expects an integer (length)"
                          << std::endl;
                return -1;
            }
            continue;
        }
        if (strcmp(args[i], "--windowrange") == 0) {
            if (params - i > 2) {
                windowbegin = atoi(args[++i]);
                windowend = atoi(args[++i]) + 1;
            } else {
                std::cerr << "--windowrange expects two integers (length)"
                          << std::endl;
                return -1;
            }
            continue;
        }
        if (strcmp(args[i], "--white") == 0) {
            if (params - i > 1)
                whitesize = atoi(args[++i]);
            else {
                std::cerr << "--white expects an integer (length)" << std::endl;
                return -1;
            }
            continue;
        }
        if (strcmp(args[i], "--walk") == 0) {
            if (params - i > 1)
                walksize = atoi(args[++i]);
            else {
                std::cerr << "--walk expects an integer (length)" << std::endl;
                return -1;
            }
            continue;
        }
        if (strcmp(args[i], "--sine") == 0) {
            if (params - i > 1)
                sinesize = atoi(args[++i]);
            else {
                std::cerr << "--sine expects an integer (length)" << std::endl;
                return -1;
            }
            if (params - i > 1)
                sineperiod = atof(args[++i]);
            else {
                std::cerr << "--sine expects an integer (length) followed by a "
                             "float (freq) "
                          << std::endl;
                return -1;
            }
            continue;
        }
        if (strcmp(args[i], "--times") == 0) {
            if (params - i > 1)
                times = atoi(args[++i]);
            else {
                std::cerr << "--times expects an integer" << std::endl;
                return -1;
            }
            continue;
        }
    }
    std::cout << "# we report timings (in seconds) so lower is better" << std::endl;
    for (int window = windowbegin; window < windowend; ++window) {
        if (whitesize > 0) {
            std::cout << "# window = " << window << " whitesize = " << whitesize
                      << " times = " << times << " doslow = " << doslow
                      << std::endl;
            assert(window + 1 < whitesize);
            timings(window, whitesize, times, doslow);
        } else if (walksize > 0) {
            std::cout << "# window = " << window << " walksize = " << walksize
                      << " times = " << times << " doslow = " << doslow
                      << std::endl;
            walktimings(window, walksize, times, doslow);

        } else if (sinesize > 0) {
            std::cout << "# window = " << window << " sinesize = " << sinesize
                      << " sine period " << sineperiod << " times = " << times
                      << " doslow = " << doslow << std::endl;
            assert(window + 1 < sinesize);
            sinetimings(window, sinesize, sineperiod, times, doslow);
        } else {
            if ((data.empty()) && cininput) {
                data = getcin();
                std::cout << "# window = " << window << " times = " << times
                          << " doslow = " << doslow << std::endl;
                process(data, window, times, doslow);
            } else {
                std::cout << "Generating sine waves." << std::endl;
                for (uint width = 3; width <= 100; ++width) {
                    std::cout << "Using a min/max width of " << width
                              << std::endl;
                    sinetimings(width);
                }
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
cmpl $0x2, %edi
setge 0x3(%rsp)
jl 0x3877
movq %rsi, %r15
movl %edi, %r14d
movl $0x0, 0x10(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 0x28(%rsp)
movl $0xa, %ebx
movl $0xb, 0x24(%rsp)
movb $0x1, %bpl
movl $0x1, %r12d
movl $0x0, 0x4(%rsp)
movl $0x1, 0x8(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x14(%rsp)
movq %rbx, 0x18(%rsp)
movl %r14d, %ebx
movslq %r12d, %r13
movq %r15, %r14
movq (%r15,%r13,8), %r15
movq %r15, %rdi
leaq 0x5ad8(%rip), %rsi      # 0x9124
callq 0x2190
testl %eax, %eax
movzbl %bpl, %ebp
cmovel %eax, %ebp
movq %r15, %rdi
leaq 0x5acb(%rip), %rsi      # 0x912f
callq 0x2190
testl %eax, %eax
movl 0x10(%rsp), %eax
movzbl %al, %eax
movl $0x1, %ecx
cmovel %ecx, %eax
movl %eax, 0x10(%rsp)
movq %r15, %rdi
leaq 0x5ab2(%rip), %rsi      # 0x913a
callq 0x2190
testl %eax, %eax
je 0x38b7
movq %r15, %rdi
leaq 0x5aa6(%rip), %rsi      # 0x9145
callq 0x2190
testl %eax, %eax
je 0x3723
movq %r15, %rdi
leaq 0x5ac1(%rip), %rsi      # 0x9173
callq 0x2190
testl %eax, %eax
je 0x3754
movq %r15, %rdi
leaq 0x5ae4(%rip), %rsi      # 0x91ad
callq 0x2190
testl %eax, %eax
je 0x378d
movq %r15, %rdi
leaq 0x5af9(%rip), %rsi      # 0x91d9
callq 0x2190
testl %eax, %eax
je 0x37b4
movq %r15, %rdi
leaq 0x5b0c(%rip), %rsi      # 0x9203
callq 0x2190
testl %eax, %eax
je 0x37d8
movq %r15, %rdi
leaq 0x5b5e(%rip), %rsi      # 0x926c
callq 0x2190
testl %eax, %eax
je 0x3820
movq %r14, %r15
jmp 0x3842
movl %ebx, %eax
subl %r12d, %eax
cmpl $0x2, %eax
jl 0x391e
incl %r12d
movq %r14, %r15
movq 0x8(%r14,%r13,8), %rdi
callq 0x21c0
movl %eax, %ecx
incl %ecx
movl %ecx, 0x24(%rsp)
movl %ebx, %r14d
movq %rax, %rbx
jmp 0x384a
movl %ebx, %eax
subl %r12d, %eax
cmpl $0x3, %eax
jl 0x392c
movq %r14, %r15
movq 0x8(%r14,%r13,8), %rdi
callq 0x21c0
movq %rax, 0x18(%rsp)
addl $0x2, %r12d
movq 0x10(%r14,%r13,8), %rdi
callq 0x21c0
incl %eax
movl %eax, 0x24(%rsp)
jmp 0x3842
movl %ebx, %eax
subl %r12d, %eax
cmpl $0x2, %eax
jl 0x393a
incl %r12d
movq %r14, %r15
movq 0x8(%r14,%r13,8), %rdi
callq 0x21c0
movl %eax, 0x14(%rsp)
jmp 0x3842
movl %ebx, %eax
subl %r12d, %eax
cmpl $0x2, %eax
jl 0x3948
incl %r12d
movq %r14, %r15
movq 0x8(%r14,%r13,8), %rdi
callq 0x21c0
movl %eax, 0x20(%rsp)
jmp 0x3842
movl %ebx, %eax
subl %r12d, %eax
cmpl $0x2, %eax
jl 0x3ed1
movq %r14, %r15
movq 0x8(%r14,%r13,8), %rdi
callq 0x21c0
movl %eax, 0x4(%rsp)
movl %r12d, %eax
notl %eax
addl %ebx, %eax
cmpl $0x2, %eax
jl 0x3ee4
movl %ebx, %r14d
addl $0x2, %r12d
movq 0x10(%r15,%r13,8), %rdi
callq 0x2170
vmovsd %xmm0, 0x28(%rsp)
jmp 0x3845
movl %ebx, %eax
subl %r12d, %eax
cmpl $0x2, %eax
jl 0x3f29
movq %r14, %r15
incl %r12d
movq 0x8(%r14,%r13,8), %rdi
callq 0x21c0
movl %eax, 0x8(%rsp)
movl %ebx, %r14d
movq 0x18(%rsp), %rbx
incl %r12d
cmpl %r14d, %r12d
setl 0x3(%rsp)
jl 0x3630
movl $0x0, 0xc(%rsp)
movl 0x14(%rsp), %r13d
movl 0x4(%rsp), %r12d
movl 0x10(%rsp), %r14d
jmp 0x39aa
xorl %r13d, %r13d
movb $0x1, %bpl
movl $0xb, 0x24(%rsp)
movl $0xa, %ebx
vxorps %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 0x28(%rsp)
movl $0x1, 0x8(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0xc(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
jmp 0x39aa
movq 0x970a(%rip), %r15      # 0xcfc8
leaq 0x587c(%rip), %rsi      # 0x9141
movl $0x3, %edx
movq %r15, %rdi
callq 0x2150
movl 0x14(%rsp), %r13d
movl 0x4(%rsp), %r12d
movl 0x10(%rsp), %r14d
movq 0x18(%rsp), %rbx
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x96c4(%rip), %rdi      # 0xcfc8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x0, 0xc(%rsp)
jmp 0x39aa
movl $0x24, %edx
leaq 0x5824(%rip), %rsi      # 0x914e
jmp 0x3954
movl $0x2b, %edx
leaq 0x5849(%rip), %rsi      # 0x9181
jmp 0x3954
movl $0x23, %edx
leaq 0x586f(%rip), %rsi      # 0x91b5
jmp 0x3954
movl $0x22, %edx
leaq 0x588c(%rip), %rsi      # 0x91e0
movq 0x9695(%rip), %r15      # 0xcff0
movq %r15, %rdi
callq 0x2150
movl 0x14(%rsp), %r13d
movl 0x4(%rsp), %r12d
movl 0x10(%rsp), %r14d
movq 0x18(%rsp), %rbx
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x965b(%rip), %rdi      # 0xcff0
callq 0x2030
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x20f0
testb $0x1, 0x3(%rsp)
jne 0x3eaf
movq 0x960c(%rip), %r15      # 0xcfc8
leaq 0x58cc(%rip), %rsi      # 0x928f
movl $0x33, %edx
movq %r15, %rdi
callq 0x2150
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x95da(%rip), %rdi      # 0xcfc8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x0, 0xc(%rsp)
cmpl 0x24(%rsp), %ebx
jge 0x3eaf
movl %r12d, 0x4(%rsp)
movzbl %bpl, %r12d
andl $0x1, %r12d
movq 0x95a7(%rip), %rbp      # 0xcfc8
testl %r13d, %r13d
jle 0x3afb
movl $0xb, %edx
movq %rbp, %rdi
leaq 0x588a(%rip), %rsi      # 0x92c3
callq 0x2150
movq %rbp, %rdi
movl %ebx, %esi
callq 0x2210
movq %rax, %r15
movl $0xd, %edx
movq %rax, %rdi
leaq 0x5875(%rip), %rsi      # 0x92cf
callq 0x2150
movq %r15, %rdi
movl %r13d, %esi
callq 0x2210
movq %rax, %r15
movl $0x9, %edx
movq %rax, %rdi
leaq 0x5861(%rip), %rsi      # 0x92dd
callq 0x2150
movq %r15, %rdi
movl 0x8(%rsp), %esi
callq 0x2210
movq %rax, %r15
movl $0xa, %edx
movq %rax, %rdi
leaq 0x5848(%rip), %rsi      # 0x92e7
callq 0x2150
movq %r15, %rdi
movl %r12d, %esi
callq 0x2200
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leal 0x1(%rbx), %eax
cmpl %r13d, %eax
jge 0x3f6e
movl %r13d, %esi
movl %ebx, %edi
movl 0x8(%rsp), %edx
movl %r12d, %ecx
callq 0x2b4d
jmp 0x3ea3
cmpl $0x0, 0x20(%rsp)
jle 0x3bcd
movl $0xb, %edx
movq %rbp, %rdi
leaq 0x57ae(%rip), %rsi      # 0x92c3
callq 0x2150
movq %rbp, %rdi
movl %ebx, %esi
callq 0x2210
movq %rax, %r15
movl $0xc, %edx
movq %rax, %rdi
leaq 0x57fc(%rip), %rsi      # 0x9332
callq 0x2150
movq %r15, %rdi
movl 0x20(%rsp), %esi
callq 0x2210
movq %rax, %r15
movl $0x9, %edx
movq %rax, %rdi
leaq 0x5784(%rip), %rsi      # 0x92dd
callq 0x2150
movq %r15, %rdi
movl 0x8(%rsp), %esi
callq 0x2210
movq %rax, %r15
movl $0xa, %edx
movq %rax, %rdi
leaq 0x576b(%rip), %rsi      # 0x92e7
callq 0x2150
movq %r15, %rdi
movl %r12d, %esi
callq 0x2200
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl %ebx, %edi
movl 0x20(%rsp), %esi
movl 0x8(%rsp), %edx
movl %r12d, %ecx
callq 0x2dae
jmp 0x3ea3
cmpl $0x0, 0x4(%rsp)
jle 0x3cd5
movl $0xb, %edx
movq %rbp, %rdi
leaq 0x56dc(%rip), %rsi      # 0x92c3
callq 0x2150
movq %rbp, %rdi
movl %ebx, %esi
callq 0x2210
movq %rax, %r15
movl $0xc, %edx
movq %rax, %rdi
leaq 0x5737(%rip), %rsi      # 0x933f
callq 0x2150
movq %r15, %rdi
movl 0x4(%rsp), %esi
callq 0x2210
movq %rax, %r15
movl $0xd, %edx
movq %rax, %rdi
leaq 0x5721(%rip), %rsi      # 0x934c
callq 0x2150
movq %r15, %rdi
vmovsd 0x28(%rsp), %xmm0
callq 0x21d0
movq %rax, %r15
movl $0x9, %edx
movq %rax, %rdi
leaq 0x568d(%rip), %rsi      # 0x92dd
callq 0x2150
movq %r15, %rdi
movl 0x8(%rsp), %esi
callq 0x2210
movq %rax, %r15
movl $0xa, %edx
movq %rax, %rdi
leaq 0x5674(%rip), %rsi      # 0x92e7
callq 0x2150
movq %r15, %rdi
movl %r12d, %esi
callq 0x2200
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leal 0x1(%rbx), %eax
movl 0x4(%rsp), %esi
cmpl %esi, %eax
jge 0x3f8d
movl %ebx, %edi
vmovsd 0x28(%rsp), %xmm0
movl 0x8(%rsp), %edx
movl %r12d, %ecx
callq 0x300f
jmp 0x3ea3
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0x3de5
testb $0x1, %r14b
je 0x3de5
leaq 0x50(%rsp), %rdi
callq 0x2467
vmovaps 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rdi
vmovaps %xmm0, 0x30(%rsp)
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
testq %rdi, %rdi
je 0x3d31
callq 0x2120
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x3d40
callq 0x2120
movl $0xb, %edx
movq %rbp, %rdi
leaq 0x5574(%rip), %rsi      # 0x92c3
callq 0x2150
movq %rbp, %rdi
movl %ebx, %esi
callq 0x2210
movq %rax, %r15
movl $0x9, %edx
movq %rax, %rdi
leaq 0x556d(%rip), %rsi      # 0x92dd
callq 0x2150
movq %r15, %rdi
movl 0x8(%rsp), %esi
callq 0x2210
movq %rax, %r15
movl $0xa, %edx
movq %rax, %rdi
leaq 0x5554(%rip), %rsi      # 0x92e7
callq 0x2150
movq %r15, %rdi
movl %r12d, %esi
callq 0x2200
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x30(%rsp), %rdi
movl %ebx, %esi
movl 0x8(%rsp), %edx
movl %r12d, %ecx
callq 0x29ae
jmp 0x3ea3
movl $0x16, %edx
movq %rbp, %rdi
leaq 0x557c(%rip), %rsi      # 0x9370
callq 0x2150
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x3, %r15d
movl $0x19, %edx
movq %rbp, %rdi
leaq 0x5551(%rip), %rsi      # 0x9387
callq 0x2150
movq 0x9186(%rip), %rdi      # 0xcfc8
movq %r15, %rsi
callq 0x20e0
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl %r15d, %edi
movl $0x2710, %esi           # imm = 0x2710
vmovsd 0x51a4(%rip), %xmm0     # 0x9028
movl $0x1f4, %edx            # imm = 0x1F4
movl $0x1, %ecx
callq 0x300f
incq %r15
cmpq $0x65, %r15
movq 0x9127(%rip), %rbp      # 0xcfc8
jne 0x3e27
incl %ebx
cmpl 0x24(%rsp), %ebx
jne 0x3a21
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3ebe
callq 0x2120
movl 0xc(%rsp), %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x22, %edx
movq 0x18(%rsp), %rbx
leaq 0x5328(%rip), %rsi      # 0x920a
jmp 0x3f3a
movq 0x9105(%rip), %rdi      # 0xcff0
leaq 0x533b(%rip), %rsi      # 0x922d
movl $0x3e, %edx
callq 0x2150
movl 0x14(%rsp), %r13d
movl 0x4(%rsp), %r12d
movl 0x10(%rsp), %r14d
movq 0x18(%rsp), %rbx
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movq 0x90d1(%rip), %rdi      # 0xcff0
callq 0x2090
jmp 0x39aa
movl $0x1a, %edx
leaq 0x533f(%rip), %rsi      # 0x9274
movq 0x18(%rsp), %rbx
movq 0x90af(%rip), %rdi      # 0xcff0
callq 0x2150
movl 0x14(%rsp), %r13d
movl 0x4(%rsp), %r12d
movl 0x10(%rsp), %r14d
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movq 0x908c(%rip), %rdi      # 0xcff0
callq 0x2090
jmp 0x39aa
leaq 0x537d(%rip), %rdi      # 0x92f2
leaq 0x538d(%rip), %rsi      # 0x9309
leaq 0x5398(%rip), %rcx      # 0x931b
movl $0x11e, %edx            # imm = 0x11E
callq 0x20c0
leaq 0x53c6(%rip), %rdi      # 0x935a
leaq 0x536e(%rip), %rsi      # 0x9309
leaq 0x5379(%rip), %rcx      # 0x931b
movl $0x12a, %edx            # imm = 0x12A
callq 0x20c0
jmp 0x3fb4
jmp 0x3fb4
jmp 0x3fb4
jmp 0x3fb4
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3fc6
callq 0x2120
movq %rbx, %rdi
callq 0x2220