// File: /workspace/github_cpp_makefile_star2_O3/ashlall[P]StreamStats/Test/BasicStats_test.cpp
// Function: test_MAX()
void test_MAX()
{
 BasicStats a; // tests when there is one item in the stream
  a.insert(3);
  assert(a.MAX()==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.MAX()==99);

  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.MAX()==1000000);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
xorpd %xmm1, %xmm1
movsd 0xa4a(%rip), %xmm0      # 0x2008
movl $0x63, %eax
movapd %xmm0, %xmm2
movapd %xmm2, %xmm3
cmpq $0x63, %rax
je 0x15d5
movapd %xmm1, %xmm3
movapd %xmm3, %xmm1
cmplesd %xmm2, %xmm1
movapd %xmm1, %xmm4
andnpd %xmm3, %xmm4
andpd %xmm2, %xmm1
orpd %xmm4, %xmm1
addsd %xmm0, %xmm2
decq %rax
jne 0x15c7
ucomisd 0xa21(%rip), %xmm1      # 0x2020
jne 0x17a5
jp 0x17a5
xorpd %xmm0, %xmm0
movl $0xf4240, %eax          # imm = 0xF4240
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movapd %xmm1, %xmm2
cmpq $0xf4240, %rax          # imm = 0xF4240
je 0x162b
movapd %xmm0, %xmm2
movapd %xmm2, %xmm0
cmplesd %xmm1, %xmm0
movapd %xmm0, %xmm3
andnpd %xmm2, %xmm3
andpd %xmm1, %xmm0
orpd %xmm3, %xmm0
decq %rax
jne 0x1614
ucomisd 0x9d7(%rip), %xmm0      # 0x2028
jne 0x17c4
jp 0x17c4
xorpd %xmm0, %xmm0
movq $-0x493e0, %rax         # imm = 0xFFFB6C20
leal 0x493e3(%rax), %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
movapd %xmm1, %xmm2
cmpq $-0x493e0, %rax         # imm = 0xFFFB6C20
je 0x1685
movapd %xmm0, %xmm2
movapd %xmm2, %xmm0
cmplesd %xmm1, %xmm0
movapd %xmm0, %xmm3
andnpd %xmm2, %xmm3
andpd %xmm1, %xmm0
orpd %xmm3, %xmm0
addq $0x3, %rax
jne 0x1668
ucomisd 0x984(%rip), %xmm0      # 0x2030
jne 0x17e3
jp 0x17e3
xorpd %xmm2, %xmm2
movl $0x2710, %ebx           # imm = 0x2710
movapd %xmm2, -0x20(%rbp)
callq 0x1030
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
negl %ecx
addl %ecx, %eax
addl $0xfa, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movapd %xmm0, %xmm1
cmpq $0x2710, %rbx           # imm = 0x2710
je 0x1709
movapd -0x20(%rbp), %xmm1
movapd %xmm1, %xmm2
cmplesd %xmm0, %xmm2
andpd %xmm2, %xmm0
andnpd %xmm1, %xmm2
orpd %xmm0, %xmm2
decq %rbx
jne 0x16c1
movsd 0x90d(%rip), %xmm0      # 0x2038
maxsd %xmm2, %xmm0
movl $0x3e8, %ebx            # imm = 0x3E8
movapd %xmm0, %xmm1
movapd %xmm0, -0x30(%rbp)
movapd %xmm1, -0x20(%rbp)
callq 0x1030
movapd -0x20(%rbp), %xmm1
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
negl %ecx
addl %ecx, %eax
addl $0x226, %eax            # imm = 0x226
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
cmplesd %xmm0, %xmm1
andpd %xmm1, %xmm0
andnpd -0x30(%rbp), %xmm1
orpd %xmm0, %xmm1
movapd %xmm1, %xmm0
decl %ebx
jne 0x1738
ucomisd 0x89e(%rip), %xmm1      # 0x2038
jne 0x1802
jp 0x1802
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
leaq 0x976(%rip), %rdi       # 0x2122
leaq 0x90d(%rip), %rsi       # 0x20c0
leaq 0x958(%rip), %rcx       # 0x2112
movl $0x32, %edx
callq 0x1040
leaq 0x963(%rip), %rdi       # 0x212e
leaq 0x8ee(%rip), %rsi       # 0x20c0
leaq 0x939(%rip), %rcx       # 0x2112
movl $0x37, %edx
callq 0x1040
leaq 0x955(%rip), %rdi       # 0x213f
leaq 0x8cf(%rip), %rsi       # 0x20c0
leaq 0x91a(%rip), %rcx       # 0x2112
movl $0x3c, %edx
callq 0x1040
leaq 0x946(%rip), %rdi       # 0x214f
leaq 0x8b0(%rip), %rsi       # 0x20c0
leaq 0x8fb(%rip), %rcx       # 0x2112
movl $0x44, %edx
callq 0x1040