// File: ashlall[P]StreamStats/Test/BasicStats_test.cpp
// Function: test_MIN()
void test_MIN()
{
  BasicStats a; // tests when there is one item in the stream
  a.insert(3);
  assert(a.MIN()==3);

  BasicStats b; // tests with 100 items in the stream in ascending order
  for (int i=1;i<100;i++)
    b.insert(i);
  assert(b.MIN()==1);

  BasicStats c; // tests with one million items in the stream in descending order 
  for (int i=1000000;i>=1;i--)
    c.insert(i);
  assert(c.MIN()==1);

  BasicStats d; // tests the stream in ascending order
  for (int i=1;i<=100000;i++)
    d.insert(i*3);
  assert(d.MIN()==3);
  
  BasicStats e;
  for(int i=1;i<=10000;i++)
     e.insert(rand()%1000+250); //tests in a randomly generated stream with 100 as minimum
  e.insert(100);
  for(int i=1;i<=1000;i++)
     e.insert(rand()%1000+550);
  assert(e.MIN()==100);
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
leaq -0x28(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x11d0
movq -0x100(%rbp), %rdi
movsd 0x1aee(%rip), %xmm0     # 0x3008
callq 0x12d0
jmp 0x1521
leaq -0x28(%rbp), %rdi
callq 0x1410
movsd 0x1ad6(%rip), %xmm1     # 0x3008
ucomisd %xmm1, %xmm0
jne 0x153c
jp 0x153c
jmp 0x156c
leaq 0x1b55(%rip), %rdi      # 0x3098
leaq 0x1b59(%rip), %rsi      # 0x30a3
movl $0xe, %edx
leaq 0x1b61(%rip), %rcx      # 0x30b7
callq 0x1040
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x18dc
leaq -0x60(%rbp), %rdi
callq 0x11d0
jmp 0x1577
movl $0x1, -0x64(%rbp)
cmpl $0x64, -0x64(%rbp)
jge 0x15b2
cvtsi2sdl -0x64(%rbp), %xmm0
leaq -0x60(%rbp), %rdi
callq 0x12d0
jmp 0x1594
jmp 0x1596
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x157e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x18d3
leaq -0x60(%rbp), %rdi
callq 0x1410
movsd 0x1a4d(%rip), %xmm1     # 0x3010
ucomisd %xmm1, %xmm0
jne 0x15cd
jp 0x15cd
jmp 0x15ec
leaq 0x1af3(%rip), %rdi      # 0x30c7
leaq 0x1ac8(%rip), %rsi      # 0x30a3
movl $0x13, %edx
leaq 0x1ad0(%rip), %rcx      # 0x30b7
callq 0x1040
leaq -0x90(%rbp), %rdi
callq 0x11d0
jmp 0x15fa
movl $0xf4240, -0x94(%rbp)   # imm = 0xF4240
cmpl $0x1, -0x94(%rbp)
jl 0x1647
cvtsi2sdl -0x94(%rbp), %xmm0
leaq -0x90(%rbp), %rdi
callq 0x12d0
jmp 0x1623
jmp 0x1625
movl -0x94(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x1604
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x18c7
leaq -0x90(%rbp), %rdi
callq 0x1410
movsd 0x19b5(%rip), %xmm1     # 0x3010
ucomisd %xmm1, %xmm0
jne 0x1665
jp 0x1665
jmp 0x1684
leaq 0x1a66(%rip), %rdi      # 0x30d2
leaq 0x1a30(%rip), %rsi      # 0x30a3
movl $0x18, %edx
leaq 0x1a38(%rip), %rcx      # 0x30b7
callq 0x1040
leaq -0xc0(%rbp), %rdi
callq 0x11d0
jmp 0x1692
movl $0x1, -0xc4(%rbp)
cmpl $0x186a0, -0xc4(%rbp)   # imm = 0x186A0
jg 0x16e9
movl -0xc4(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
cvtsi2sd %eax, %xmm0
leaq -0xc0(%rbp), %rdi
callq 0x12d0
jmp 0x16c5
jmp 0x16c7
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x169c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x18bb
leaq -0xc0(%rbp), %rdi
callq 0x1410
movsd 0x190b(%rip), %xmm1     # 0x3008
ucomisd %xmm1, %xmm0
jne 0x1707
jp 0x1707
jmp 0x1726
leaq 0x19cf(%rip), %rdi      # 0x30dd
leaq 0x198e(%rip), %rsi      # 0x30a3
movl $0x1d, %edx
leaq 0x1996(%rip), %rcx      # 0x30b7
callq 0x1040
leaq -0xf0(%rbp), %rdi
callq 0x11d0
jmp 0x1734
movl $0x1, -0xf4(%rbp)
cmpl $0x2710, -0xf4(%rbp)    # imm = 0x2710
jg 0x17bd
callq 0x1030
movl %eax, %ecx
movslq %ecx, %rax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rax
addl %edx, %eax
imull $0x3e8, %eax, %edx      # imm = 0x3E8
movl %ecx, %eax
negl %edx
movl %edx, %ecx
leal 0xfa(%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
leaq -0xf0(%rbp), %rdi
callq 0x12d0
jmp 0x178d
jmp 0x178f
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x173e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x22f0
jmp 0x18bb
leaq -0xf0(%rbp), %rdi
movsd 0x184c(%rip), %xmm0     # 0x3018
callq 0x12d0
jmp 0x17d3
movl $0x1, -0xf8(%rbp)
cmpl $0x3e8, -0xf8(%rbp)     # imm = 0x3E8
jg 0x183f
callq 0x1030
movl %eax, %ecx
movslq %ecx, %rax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rax
addl %edx, %eax
imull $0x3e8, %eax, %edx      # imm = 0x3E8
movl %ecx, %eax
negl %edx
movl %edx, %ecx
leal 0x226(%rax,%rcx), %eax
cvtsi2sd %eax, %xmm0
leaq -0xf0(%rbp), %rdi
callq 0x12d0
jmp 0x182c
jmp 0x182e
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0x17dd
leaq -0xf0(%rbp), %rdi
callq 0x1410
movsd 0x17c5(%rip), %xmm1     # 0x3018
ucomisd %xmm1, %xmm0
jne 0x185d
jp 0x185d
jmp 0x187c
leaq 0x1884(%rip), %rdi      # 0x30e8
leaq 0x1838(%rip), %rsi      # 0x30a3
movl $0x25, %edx
leaq 0x1840(%rip), %rcx      # 0x30b7
callq 0x1040
leaq -0xf0(%rbp), %rdi
callq 0x22f0
leaq -0xc0(%rbp), %rdi
callq 0x22f0
leaq -0x90(%rbp), %rdi
callq 0x22f0
leaq -0x60(%rbp), %rdi
callq 0x22f0
leaq -0x28(%rbp), %rdi
callq 0x22f0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0xc0(%rbp), %rdi
callq 0x22f0
leaq -0x90(%rbp), %rdi
callq 0x22f0
leaq -0x60(%rbp), %rdi
callq 0x22f0
leaq -0x28(%rbp), %rdi
callq 0x22f0
movq -0x30(%rbp), %rdi
callq 0x1080
nop