// File: /workspace/github_cpp_makefile_star2_O1/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 0xa54(%rip), %xmm0      # 0x2008
movl $0x63, %eax
movapd %xmm0, %xmm2
movapd %xmm2, %xmm3
cmpq $0x63, %rax
je 0x15cb
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 0x15bd
ucomisd 0xa2b(%rip), %xmm1      # 0x2020
jne 0x179b
jp 0x179b
xorpd %xmm0, %xmm0
movl $0xf4240, %eax          # imm = 0xF4240
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movapd %xmm1, %xmm2
cmpq $0xf4240, %rax          # imm = 0xF4240
je 0x1621
movapd %xmm0, %xmm2
movapd %xmm2, %xmm0
cmplesd %xmm1, %xmm0
movapd %xmm0, %xmm3
andnpd %xmm2, %xmm3
andpd %xmm1, %xmm0
orpd %xmm3, %xmm0
decq %rax
jne 0x160a
ucomisd 0x9e1(%rip), %xmm0      # 0x2028
jne 0x17ba
jp 0x17ba
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 0x167b
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 0x165e
ucomisd 0x98e(%rip), %xmm0      # 0x2030
jne 0x17d9
jp 0x17d9
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 0x16ff
movapd -0x20(%rbp), %xmm1
movapd %xmm1, %xmm2
cmplesd %xmm0, %xmm2
andpd %xmm2, %xmm0
andnpd %xmm1, %xmm2
orpd %xmm0, %xmm2
decq %rbx
jne 0x16b7
movsd 0x917(%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 0x172e
ucomisd 0x8a8(%rip), %xmm1      # 0x2038
jne 0x17f8
jp 0x17f8
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
leaq 0x980(%rip), %rdi       # 0x2122
leaq 0x917(%rip), %rsi       # 0x20c0
leaq 0x962(%rip), %rcx       # 0x2112
movl $0x32, %edx
callq 0x1040
leaq 0x96d(%rip), %rdi       # 0x212e
leaq 0x8f8(%rip), %rsi       # 0x20c0
leaq 0x943(%rip), %rcx       # 0x2112
movl $0x37, %edx
callq 0x1040
leaq 0x95f(%rip), %rdi       # 0x213f
leaq 0x8d9(%rip), %rsi       # 0x20c0
leaq 0x924(%rip), %rcx       # 0x2112
movl $0x3c, %edx
callq 0x1040
leaq 0x950(%rip), %rdi       # 0x214f
leaq 0x8ba(%rip), %rsi       # 0x20c0
leaq 0x905(%rip), %rcx       # 0x2112
movl $0x44, %edx
callq 0x1040