// File: ashlall[P]StreamStats/Test/QDigest_test.cpp
// Function: test_qdigest()
void test_qdigest()
{
	int n = 100; 
	int k = 5000; //compress factor, make an arbitrarily large k for testing 
					// usually the choose of k ranges from 0.3*stream_length  to 0.5*stream_length  in order to get the best query results
	long quantA,quantB,quantC,quantD,quantE,quantF,quantG,quantH;
	bool condA,condB,condC,condD,condE,condF,condG,condH;
    double upper,lower;
    
    int random_fix1 = rand()% RAND_MAX;
    //cout << "random_fix1: " << random_fix1 <<endl;
    int random_fix2 = rand()% RAND_MAX;
    //cout << "random_fix2: " << random_fix2 <<endl;
    int random_fix3 = rand()% RAND_MAX;
    //cout << "random_fix2: " << random_fix3 <<endl;

    
	QDigest a(k);
	QDigest b(k);
	QDigest c(k);
	QDigest d(k);
    QDigest e(k);
	QDigest f(k);
	QDigest g(k);
	QDigest h(k);
	
	for (double j = 0; j <= n; j++) //inserting in decreasing order
    {	
  		a.insert(j); 
    }
	bool condA1;
	int LA = a.get_stream_size(); //test the function get_stream_size()
	condA1= (LA == n+1);
	assert(condA1 == true);
    
	for (int i = n; i >= 0; i--) //inserting in desceding order
    {
  		b.insert(i); 
    }
    bool condB1;
	int LB = b.get_stream_size(); //test the function get_stream_size()
	condB1= (LB == n+1);
	assert(condB1 == true);
	
	for (int m = 1; m <= 3; m++) //create 3 "random" sequences that holds their randomness every time runs the code
  	{
  		 if (m == 1)
  		 {
  		   	 //cout << "sequence 1: " << endl;
  			 for (int i = 0; i <= n; i++)
   			 {
   			 	srand(i);
  				long rand_num=rand()%n;
  				//cout << rand_num << " ";
  				c.insert(rand_num);  //inserting float number from 0 to n
  			 }
  			 //cout << ""<<endl;
  			 bool condC1;
			 int LC = c.get_stream_size(); //test the function get_stream_size()
			 condC1= (LC == n+1);
			 assert(condC1 == true);
  		}
  		
  		else if(m == 2)
  		{
  		 	  //cout << "sequence 2: " << endl;
  			  for (int i = 0; i <= n; i++)
   			 {
   			    srand(i^2);
  				long rand_num=rand()%n;
  				//cout << rand_num << " ";
  				d.insert(rand_num); //inserting float number from 0 to n
  			 }  
  			 //cout << ""<<endl;
  			 bool condD1;
			 int LD = d.get_stream_size(); //test the function get_stream_size()
			 condD1= (LD == n+1);
			 assert(condD1 == true);  			 
  		}	
  		
  		else 
  		{	
  		  	 //cout << "sequence 3: " << endl;
  			  for (int i = 0; i <= n; i++)
   			 {
   			 	srand(n-i);
  				long rand_num=rand()%n;
  				//cout << rand_num << " ";
  				e.insert(rand_num); //inserting float number from 0 to n
  			 }  
  			 //cout <<""<<endl;
  			 bool condE1;
			 int LE = e.get_stream_size(); //test the function get_stream_size()
			 condE1= (LE == n+1);
			 assert(condE1 == true);
  		}
  	}
  	
  	  f.insert(random_fix1); //test corner case where n = 1
  	  g.insert(random_fix2); 
  	  h.insert(random_fix3); 
  	  
  	  bool condF1,condG1,condH1;
	  long LF = f.get_stream_size(); //test the function get_stream_size()
	  long LG = g.get_stream_size();
 	  long LH = h.get_stream_size();
      condF1 = (LF == 1);
      condG1 = (LG == 1);
	  condH1 = (LH == 1);
	  assert(condF1 == true);
	  assert(condG1 == true);
	  assert(condH1 == true);
  	
  for (float i=1;i<=100;i++)
  {
  	  double interval=i/100; //getting each probabilty interval
  	  
  	  quantA=a.getQuantile(interval); //getting quantile for each probability interval
  	  quantB=b.getQuantile(interval);//getting quantile for each probability interval
  	  quantC=c.getQuantile(interval);//getting quantile for each probability interval
  	  quantD=d.getQuantile(interval);
  	  quantE=e.getQuantile(interval);
  	  quantF=f.getQuantile(interval);
  	  quantG=g.getQuantile(interval);
  	  quantH=h.getQuantile(interval);
  	  
  	  lower=(interval-0.04)*n;
  	  upper=(interval+0.04)*n;
  	  
  	  condA= ((lower<=quantA) && (upper>=quantA));
  	  //checking if quantile is within error range
  	  
  	  condB= ((lower<=quantB) && (upper >=quantB));
  	  //checking if quantile is within error range
  	  
  	  condC= ((lower<=quantC) && (upper>=quantC));
  	  condD= ((lower<=quantD) && (upper>=quantD));
  	  condE= ((lower<=quantE) && (upper>=quantE));
  	  //checking if quantile is within error range
  	  
  	  
  	  condF= (random_fix1 == quantF);
  	  condG= (random_fix2 == quantG);
  	  condH= (random_fix3 == quantH);
  	  //checking if the condition holds in the corner case where stream size = 1

  	  
  	  assert(condA==true);
  	  assert(condB==true);
  	  assert(condC==true);
  	  assert(condD==true);
  	  assert(condE==true);
  	  assert(condF==true);
  	  assert(condG==true);
  	  assert(condH==true);
  } 
	/*
	QDigest a(35000);
	for(int i=1; i<=100000; i++)
	{
		a.insert(i);
	}

	cout << "median:" << a.getQuantile(0.5) << endl;
	cout << "0.1: "<<a.getQuantile(0.1) << endl;
	cout << "0.3: "<<a.getQuantile(0.3) << endl;
	cout << "0.4: "<<a.getQuantile(0.4) << endl;
	cout << "0.8: "<<a.getQuantile(0.8) << endl;
	*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x520, %rsp            # imm = 0x520
movl $0x64, -0x4(%rbp)
movl $0x1388, -0x8(%rbp)     # imm = 0x1388
callq 0x2050
movslq %eax, %rdx
movq %rdx, %rcx
shlq $0x1e, %rcx
addq %rcx, %rdx
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x3d, %rdx
addl %ecx, %edx
movl %edx, %ecx
shll $0x1f, %ecx
addl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x64(%rbp)
callq 0x2050
movslq %eax, %rdx
movq %rdx, %rcx
shlq $0x1e, %rcx
addq %rcx, %rdx
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x3d, %rdx
addl %ecx, %edx
movl %edx, %ecx
shll $0x1f, %ecx
addl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x68(%rbp)
callq 0x2050
movslq %eax, %rdx
movq %rdx, %rcx
shlq $0x1e, %rcx
addq %rcx, %rdx
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x3d, %rdx
addl %ecx, %edx
movl %edx, %ecx
shll $0x1f, %ecx
addl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
cvtsi2sdl -0x8(%rbp), %xmm0
leaq -0xe0(%rbp), %rdi
callq 0x23c0
cvtsi2sdl -0x8(%rbp), %xmm0
leaq -0x150(%rbp), %rdi
callq 0x23c0
jmp 0x3a3e
cvtsi2sdl -0x8(%rbp), %xmm0
leaq -0x1d0(%rbp), %rdi
callq 0x23c0
jmp 0x3a51
cvtsi2sdl -0x8(%rbp), %xmm0
leaq -0x240(%rbp), %rdi
callq 0x23c0
jmp 0x3a64
cvtsi2sdl -0x8(%rbp), %xmm0
leaq -0x2b0(%rbp), %rdi
callq 0x23c0
jmp 0x3a77
cvtsi2sdl -0x8(%rbp), %xmm0
leaq -0x320(%rbp), %rdi
callq 0x23c0
jmp 0x3a8a
cvtsi2sdl -0x8(%rbp), %xmm0
leaq -0x390(%rbp), %rdi
callq 0x23c0
jmp 0x3a9d
cvtsi2sdl -0x8(%rbp), %xmm0
leaq -0x400(%rbp), %rdi
callq 0x23c0
jmp 0x3ab0
xorps %xmm0, %xmm0
movsd %xmm0, -0x408(%rbp)
movsd -0x408(%rbp), %xmm1
cvtsi2sdl -0x4(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x3bc8
movsd -0x408(%rbp), %xmm0
leaq -0xe0(%rbp), %rdi
callq 0x2570
jmp 0x3ae8
jmp 0x3aea
movsd 0x9526(%rip), %xmm0     # 0xd018
addsd -0x408(%rbp), %xmm0
movsd %xmm0, -0x408(%rbp)
jmp 0x3abb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
jmp 0x46a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
jmp 0x4694
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
jmp 0x4688
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
jmp 0x467c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
jmp 0x4670
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
jmp 0x4664
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
jmp 0x4658
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x158(%rbp)
movl %eax, -0x15c(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x52b0
jmp 0x4658
leaq -0xe0(%rbp), %rdi
callq 0x5290
movq %rax, -0x4a0(%rbp)
jmp 0x3bdd
movq -0x4a0(%rbp), %rax
movl %eax, -0x410(%rbp)
movl -0x410(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x409(%rbp)
movb -0x409(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x3c15
jmp 0x3c34
leaq 0x9455(%rip), %rdi      # 0xd071
leaq 0x945d(%rip), %rsi      # 0xd080
movl $0x2b, %edx
leaq 0x9462(%rip), %rcx      # 0xd091
callq 0x20c0
movl -0x4(%rbp), %eax
movl %eax, -0x414(%rbp)
cmpl $0x0, -0x414(%rbp)
jl 0x3c6f
cvtsi2sdl -0x414(%rbp), %xmm0
leaq -0x150(%rbp), %rdi
callq 0x2570
jmp 0x3c5c
jmp 0x3c5e
movl -0x414(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x414(%rbp)
jmp 0x3c3d
leaq -0x150(%rbp), %rdi
callq 0x5290
movq %rax, -0x4a8(%rbp)
jmp 0x3c84
movq -0x4a8(%rbp), %rax
movl %eax, -0x41c(%rbp)
movl -0x41c(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x415(%rbp)
movb -0x415(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x3cbc
jmp 0x3cdb
leaq 0x93e2(%rip), %rdi      # 0xd0a5
leaq 0x93b6(%rip), %rsi      # 0xd080
movl $0x34, %edx
leaq 0x93bb(%rip), %rcx      # 0xd091
callq 0x20c0
movl $0x1, -0x420(%rbp)
cmpl $0x3, -0x420(%rbp)
jg 0x3f99
cmpl $0x1, -0x420(%rbp)
jne 0x3dcf
movl $0x0, -0x424(%rbp)
movl -0x424(%rbp), %eax
cmpl -0x4(%rbp), %eax
jg 0x3d5e
movl -0x424(%rbp), %edi
callq 0x2100
callq 0x2050
movl -0x4(%rbp), %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq %rax, -0x430(%rbp)
cvtsi2sdq -0x430(%rbp), %xmm0
leaq -0x1d0(%rbp), %rdi
callq 0x2570
jmp 0x3d4b
jmp 0x3d4d
movl -0x424(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x424(%rbp)
jmp 0x3d09
leaq -0x1d0(%rbp), %rdi
callq 0x5290
movq %rax, -0x4b0(%rbp)
jmp 0x3d73
movq -0x4b0(%rbp), %rax
movl %eax, -0x438(%rbp)
movl -0x438(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x431(%rbp)
movb -0x431(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x3dab
jmp 0x3dca
leaq 0x9302(%rip), %rdi      # 0xd0b4
leaq 0x92c7(%rip), %rsi      # 0xd080
movl $0x46, %edx
leaq 0x92cc(%rip), %rcx      # 0xd091
callq 0x20c0
jmp 0x3f83
cmpl $0x2, -0x420(%rbp)
jne 0x3eaf
movl $0x0, -0x43c(%rbp)
movl -0x43c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jg 0x3e3e
movl -0x43c(%rbp), %edi
xorl $0x2, %edi
callq 0x2100
callq 0x2050
movl -0x4(%rbp), %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq %rax, -0x448(%rbp)
cvtsi2sdq -0x448(%rbp), %xmm0
leaq -0x240(%rbp), %rdi
callq 0x2570
jmp 0x3e2b
jmp 0x3e2d
movl -0x43c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x43c(%rbp)
jmp 0x3de6
leaq -0x240(%rbp), %rdi
callq 0x5290
movq %rax, -0x4b8(%rbp)
jmp 0x3e53
movq -0x4b8(%rbp), %rax
movl %eax, -0x450(%rbp)
movl -0x450(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x449(%rbp)
movb -0x449(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x3e8b
jmp 0x3eaa
leaq 0x9231(%rip), %rdi      # 0xd0c3
leaq 0x91e7(%rip), %rsi      # 0xd080
movl $0x57, %edx
leaq 0x91ec(%rip), %rcx      # 0xd091
callq 0x20c0
jmp 0x3f81
movl $0x0, -0x454(%rbp)
movl -0x454(%rbp), %eax
cmpl -0x4(%rbp), %eax
jg 0x3f13
movl -0x4(%rbp), %edi
movl -0x454(%rbp), %eax
subl %eax, %edi
callq 0x2100
callq 0x2050
movl -0x4(%rbp), %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq %rax, -0x460(%rbp)
cvtsi2sdq -0x460(%rbp), %xmm0
leaq -0x2b0(%rbp), %rdi
callq 0x2570
jmp 0x3f00
jmp 0x3f02
movl -0x454(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x454(%rbp)
jmp 0x3eb9
leaq -0x2b0(%rbp), %rdi
callq 0x5290
movq %rax, -0x4c0(%rbp)
jmp 0x3f28
movq -0x4c0(%rbp), %rax
movl %eax, -0x468(%rbp)
movl -0x468(%rbp), %eax
movl -0x4(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x461(%rbp)
movb -0x461(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x3f60
jmp 0x3f7f
leaq 0x916b(%rip), %rdi      # 0xd0d2
leaq 0x9112(%rip), %rsi      # 0xd080
movl $0x68, %edx
leaq 0x9117(%rip), %rcx      # 0xd091
callq 0x20c0
jmp 0x3f81
jmp 0x3f83
jmp 0x3f85
movl -0x420(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x420(%rbp)
jmp 0x3ce5
cvtsi2sdl -0x64(%rbp), %xmm0
leaq -0x320(%rbp), %rdi
callq 0x2570
jmp 0x3fac
cvtsi2sdl -0x68(%rbp), %xmm0
leaq -0x390(%rbp), %rdi
callq 0x2570
jmp 0x3fbf
cvtsi2sdl -0x6c(%rbp), %xmm0
leaq -0x400(%rbp), %rdi
callq 0x2570
jmp 0x3fd2
leaq -0x320(%rbp), %rdi
callq 0x5290
movq %rax, -0x4c8(%rbp)
jmp 0x3fe7
movq -0x4c8(%rbp), %rax
movq %rax, -0x478(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x5290
movq %rax, -0x4d0(%rbp)
jmp 0x400a
movq -0x4d0(%rbp), %rax
movq %rax, -0x480(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x5290
movq %rax, -0x4d8(%rbp)
jmp 0x402d
movq -0x4d8(%rbp), %rax
movq %rax, -0x488(%rbp)
cmpq $0x1, -0x478(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x469(%rbp)
cmpq $0x1, -0x480(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x46a(%rbp)
cmpq $0x1, -0x488(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x46b(%rbp)
movb -0x469(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4086
jmp 0x40a5
leaq 0x9054(%rip), %rdi      # 0xd0e1
leaq 0x8fec(%rip), %rsi      # 0xd080
movl $0x77, %edx
leaq 0x8ff1(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x46a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x40b7
jmp 0x40d6
leaq 0x9032(%rip), %rdi      # 0xd0f0
leaq 0x8fbb(%rip), %rsi      # 0xd080
movl $0x78, %edx
leaq 0x8fc0(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x46b(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x40e8
jmp 0x4107
leaq 0x9010(%rip), %rdi      # 0xd0ff
leaq 0x8f8a(%rip), %rsi      # 0xd080
movl $0x79, %edx
leaq 0x8f8f(%rip), %rcx      # 0xd091
callq 0x20c0
movss 0x8f31(%rip), %xmm0     # 0xd040
movss %xmm0, -0x48c(%rbp)
movss 0x8f25(%rip), %xmm0     # 0xd044
ucomiss -0x48c(%rbp), %xmm0
jb 0x45ef
movss -0x48c(%rbp), %xmm0
movss 0x8f08(%rip), %xmm1     # 0xd044
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x498(%rbp)
movsd -0x498(%rbp), %xmm0
leaq -0xe0(%rbp), %rdi
callq 0x2840
movsd %xmm0, -0x4e0(%rbp)
jmp 0x416a
movsd -0x4e0(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x10(%rbp)
movsd -0x498(%rbp), %xmm0
leaq -0x150(%rbp), %rdi
callq 0x2840
movsd %xmm0, -0x4e8(%rbp)
jmp 0x4199
movsd -0x4e8(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x18(%rbp)
movsd -0x498(%rbp), %xmm0
leaq -0x1d0(%rbp), %rdi
callq 0x2840
movsd %xmm0, -0x4f0(%rbp)
jmp 0x41c8
movsd -0x4f0(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x20(%rbp)
movsd -0x498(%rbp), %xmm0
leaq -0x240(%rbp), %rdi
callq 0x2840
movsd %xmm0, -0x4f8(%rbp)
jmp 0x41f7
movsd -0x4f8(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x28(%rbp)
movsd -0x498(%rbp), %xmm0
leaq -0x2b0(%rbp), %rdi
callq 0x2840
movsd %xmm0, -0x500(%rbp)
jmp 0x4226
movsd -0x500(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x30(%rbp)
movsd -0x498(%rbp), %xmm0
leaq -0x320(%rbp), %rdi
callq 0x2840
movsd %xmm0, -0x508(%rbp)
jmp 0x4255
movsd -0x508(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x38(%rbp)
movsd -0x498(%rbp), %xmm0
leaq -0x390(%rbp), %rdi
callq 0x2840
movsd %xmm0, -0x510(%rbp)
jmp 0x4284
movsd -0x510(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x40(%rbp)
movsd -0x498(%rbp), %xmm0
leaq -0x400(%rbp), %rdi
callq 0x2840
movsd %xmm0, -0x518(%rbp)
jmp 0x42b3
movsd -0x518(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x48(%rbp)
movsd -0x498(%rbp), %xmm0
movsd 0x8d3c(%rip), %xmm1     # 0xd010
subsd %xmm1, %xmm0
cvtsi2sdl -0x4(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0x8d22(%rip), %xmm0     # 0xd010
addsd -0x498(%rbp), %xmm0
cvtsi2sdl -0x4(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x60(%rbp), %xmm1
cvtsi2sdq -0x10(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x519(%rbp)
jb 0x4335
movsd -0x58(%rbp), %xmm0
cvtsi2sdq -0x10(%rbp), %xmm1
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x519(%rbp)
movb -0x519(%rbp), %al
andb $0x1, %al
movb %al, -0x49(%rbp)
movsd -0x60(%rbp), %xmm1
cvtsi2sdq -0x18(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x51a(%rbp)
jb 0x4371
movsd -0x58(%rbp), %xmm0
cvtsi2sdq -0x18(%rbp), %xmm1
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x51a(%rbp)
movb -0x51a(%rbp), %al
andb $0x1, %al
movb %al, -0x4a(%rbp)
movsd -0x60(%rbp), %xmm1
cvtsi2sdq -0x20(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x51b(%rbp)
jb 0x43ad
movsd -0x58(%rbp), %xmm0
cvtsi2sdq -0x20(%rbp), %xmm1
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x51b(%rbp)
movb -0x51b(%rbp), %al
andb $0x1, %al
movb %al, -0x4b(%rbp)
movsd -0x60(%rbp), %xmm1
cvtsi2sdq -0x28(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x51c(%rbp)
jb 0x43e9
movsd -0x58(%rbp), %xmm0
cvtsi2sdq -0x28(%rbp), %xmm1
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x51c(%rbp)
movb -0x51c(%rbp), %al
andb $0x1, %al
movb %al, -0x4c(%rbp)
movsd -0x60(%rbp), %xmm1
cvtsi2sdq -0x30(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x51d(%rbp)
jb 0x4425
movsd -0x58(%rbp), %xmm0
cvtsi2sdq -0x30(%rbp), %xmm1
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x51d(%rbp)
movb -0x51d(%rbp), %al
andb $0x1, %al
movb %al, -0x4d(%rbp)
movslq -0x64(%rbp), %rax
cmpq -0x38(%rbp), %rax
sete %al
andb $0x1, %al
movb %al, -0x4e(%rbp)
movslq -0x68(%rbp), %rax
cmpq -0x40(%rbp), %rax
sete %al
andb $0x1, %al
movb %al, -0x4f(%rbp)
movslq -0x6c(%rbp), %rax
cmpq -0x48(%rbp), %rax
sete %al
andb $0x1, %al
movb %al, -0x50(%rbp)
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x446f
jmp 0x448e
leaq 0x8c98(%rip), %rdi      # 0xd10e
leaq 0x8c03(%rip), %rsi      # 0xd080
movl $0x9d, %edx
leaq 0x8c08(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x4a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x449d
jmp 0x44bc
leaq 0x8c76(%rip), %rdi      # 0xd11a
leaq 0x8bd5(%rip), %rsi      # 0xd080
movl $0x9e, %edx
leaq 0x8bda(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x4b(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x44cb
jmp 0x44ea
leaq 0x8c54(%rip), %rdi      # 0xd126
leaq 0x8ba7(%rip), %rsi      # 0xd080
movl $0x9f, %edx
leaq 0x8bac(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x4c(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x44f9
jmp 0x4518
leaq 0x8c32(%rip), %rdi      # 0xd132
leaq 0x8b79(%rip), %rsi      # 0xd080
movl $0xa0, %edx
leaq 0x8b7e(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x4d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4527
jmp 0x4546
leaq 0x8c10(%rip), %rdi      # 0xd13e
leaq 0x8b4b(%rip), %rsi      # 0xd080
movl $0xa1, %edx
leaq 0x8b50(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x4e(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4555
jmp 0x4574
leaq 0x8bee(%rip), %rdi      # 0xd14a
leaq 0x8b1d(%rip), %rsi      # 0xd080
movl $0xa2, %edx
leaq 0x8b22(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x4f(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4583
jmp 0x45a2
leaq 0x8bcc(%rip), %rdi      # 0xd156
leaq 0x8aef(%rip), %rsi      # 0xd080
movl $0xa3, %edx
leaq 0x8af4(%rip), %rcx      # 0xd091
callq 0x20c0
movb -0x50(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x45b1
jmp 0x45d0
leaq 0x8baa(%rip), %rdi      # 0xd162
leaq 0x8ac1(%rip), %rsi      # 0xd080
movl $0xa4, %edx
leaq 0x8ac6(%rip), %rcx      # 0xd091
callq 0x20c0
jmp 0x45d2
movss 0x8a66(%rip), %xmm0     # 0xd040
addss -0x48c(%rbp), %xmm0
movss %xmm0, -0x48c(%rbp)
jmp 0x4117
leaq -0x400(%rbp), %rdi
callq 0x52b0
leaq -0x390(%rbp), %rdi
callq 0x52b0
leaq -0x320(%rbp), %rdi
callq 0x52b0
leaq -0x2b0(%rbp), %rdi
callq 0x52b0
leaq -0x240(%rbp), %rdi
callq 0x52b0
leaq -0x1d0(%rbp), %rdi
callq 0x52b0
leaq -0x150(%rbp), %rdi
callq 0x52b0
leaq -0xe0(%rbp), %rdi
callq 0x52b0
addq $0x520, %rsp            # imm = 0x520
popq %rbp
retq
leaq -0x390(%rbp), %rdi
callq 0x52b0
leaq -0x320(%rbp), %rdi
callq 0x52b0
leaq -0x2b0(%rbp), %rdi
callq 0x52b0
leaq -0x240(%rbp), %rdi
callq 0x52b0
leaq -0x1d0(%rbp), %rdi
callq 0x52b0
leaq -0x150(%rbp), %rdi
callq 0x52b0
leaq -0xe0(%rbp), %rdi
callq 0x52b0
movq -0x158(%rbp), %rdi
callq 0x21e0
nopl (%rax,%rax)