// File: lemire[P]runningmaxmin/unit.cpp
// Function: unit()
void unit() {
    uint size = 20;
    std::vector<floattype> data(size);
    for (uint k = 0; k < size; ++k)
        data[k] = size - k;
    test(data, 6);
    test(data, 2);
    test(data, 3);
    test(data, 4);
    test(data, 5);
    for (uint k = 0; k < size; ++k)
        data[k] = k;
    test(data, 2);
    test(data, 3);
    test(data, 4);
    test(data, 5);
    for (uint j = 0; j < 1000; ++j) {
        for (uint k = 0; k < size; ++k)
            data[k] = rand();
        test(data, 2);
        test(data, 3);
        test(data, 4);
        test(data, 5);
    }
}

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movl $0x14, 0x1a4(%rsp)
movl 0x1a4(%rsp), %eax
movq %rax, 0x18(%rsp)
leaq 0x187(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x74c0
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x188(%rsp), %rdi
callq 0x74d0
jmp 0x2d69
leaq 0x187(%rsp), %rdi
callq 0x7550
movl $0x0, 0x170(%rsp)
movl 0x170(%rsp), %eax
cmpl 0x1a4(%rsp), %eax
jae 0x2e05
movl 0x1a4(%rsp), %eax
movl 0x170(%rsp), %ecx
subl %ecx, %eax
vcvtsi2sd %rax, %xmm0, %xmm0
vmovsd %xmm0, 0x10(%rsp)
movl 0x170(%rsp), %eax
movl %eax, %esi
leaq 0x188(%rsp), %rdi
callq 0x3430
vmovsd 0x10(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x170(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x170(%rsp)
jmp 0x2d81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x187(%rsp), %rdi
callq 0x7550
jmp 0x33bf
leaq 0x158(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x2e1c
leaq 0x158(%rsp), %rdi
movl $0x6, %esi
callq 0x2440
jmp 0x2e30
leaq 0x158(%rsp), %rdi
callq 0x7660
leaq 0x140(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x2e54
leaq 0x140(%rsp), %rdi
movl $0x2, %esi
callq 0x2440
jmp 0x2e68
leaq 0x140(%rsp), %rdi
callq 0x7660
leaq 0x128(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x2e8c
leaq 0x128(%rsp), %rdi
movl $0x3, %esi
callq 0x2440
jmp 0x2ea0
leaq 0x128(%rsp), %rdi
callq 0x7660
leaq 0x110(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x2ec4
leaq 0x110(%rsp), %rdi
movl $0x4, %esi
callq 0x2440
jmp 0x2ed8
leaq 0x110(%rsp), %rdi
callq 0x7660
leaq 0xf8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x2efc
leaq 0xf8(%rsp), %rdi
movl $0x5, %esi
callq 0x2440
jmp 0x2f10
leaq 0xf8(%rsp), %rdi
callq 0x7660
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
cmpl 0x1a4(%rsp), %eax
jae 0x3058
movl 0xf4(%rsp), %eax
vcvtsi2sd %rax, %xmm0, %xmm0
vmovsd %xmm0, 0x8(%rsp)
movl 0xf4(%rsp), %eax
movl %eax, %esi
leaq 0x188(%rsp), %rdi
callq 0x3430
vmovsd 0x8(%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
jmp 0x2f28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x128(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x7660
jmp 0x33b2
leaq 0xd8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x306f
leaq 0xd8(%rsp), %rdi
movl $0x2, %esi
callq 0x2440
jmp 0x3083
leaq 0xd8(%rsp), %rdi
callq 0x7660
leaq 0xc0(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x30a7
leaq 0xc0(%rsp), %rdi
movl $0x3, %esi
callq 0x2440
jmp 0x30bb
leaq 0xc0(%rsp), %rdi
callq 0x7660
leaq 0xa8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x30df
leaq 0xa8(%rsp), %rdi
movl $0x4, %esi
callq 0x2440
jmp 0x30f3
leaq 0xa8(%rsp), %rdi
callq 0x7660
leaq 0x90(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x3117
leaq 0x90(%rsp), %rdi
movl $0x5, %esi
callq 0x2440
jmp 0x312b
leaq 0x90(%rsp), %rdi
callq 0x7660
movl $0x0, 0x8c(%rsp)
cmpl $0x3e8, 0x8c(%rsp) # imm = 0x3E8
jae 0x339d
movl $0x0, 0x88(%rsp)
movl 0x88(%rsp), %eax
cmpl 0x1a4(%rsp), %eax
jae 0x324b
callq 0x2030
vcvtsi2sd %eax, %xmm0, %xmm0
vmovsd %xmm0, (%rsp)
movl 0x88(%rsp), %eax
movl %eax, %esi
leaq 0x188(%rsp), %rdi
callq 0x3430
vmovsd (%rsp), %xmm0
vmovsd %xmm0, (%rax)
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
jmp 0x315f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x7660
jmp 0x33b2
leaq 0x70(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x325f
leaq 0x70(%rsp), %rdi
movl $0x2, %esi
callq 0x2440
jmp 0x3270
leaq 0x70(%rsp), %rdi
callq 0x7660
leaq 0x58(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x328e
leaq 0x58(%rsp), %rdi
movl $0x3, %esi
callq 0x2440
jmp 0x329f
leaq 0x58(%rsp), %rdi
callq 0x7660
leaq 0x40(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x32bd
leaq 0x40(%rsp), %rdi
movl $0x4, %esi
callq 0x2440
jmp 0x32ce
leaq 0x40(%rsp), %rdi
callq 0x7660
leaq 0x28(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x7560
jmp 0x32ec
leaq 0x28(%rsp), %rdi
movl $0x5, %esi
callq 0x2440
jmp 0x32fd
leaq 0x28(%rsp), %rdi
callq 0x7660
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x3143
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x7660
jmp 0x33b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x7660
jmp 0x33b2
leaq 0x188(%rsp), %rdi
callq 0x7660
addq $0x1a8, %rsp            # imm = 0x1A8
retq
leaq 0x188(%rsp), %rdi
callq 0x7660
movq 0x178(%rsp), %rdi
callq 0x2160
nopl (%rax)