// File: /workspace/github_c_makefile_star2_O0/mincebert[P]maketzx/maketzx.c
// Function: DataRead
dword DataRead(double bit0,double bit1,word explen)
{
  byte value,count,lastval,tolerance,maxpulse;/*=bit1+bit0-tolerance;*/
  word pulse;
  dword amount=0;
  double middle;
  if (spdchk) { bit0*=ecf; bit1*=ecf; }
  middle=(double)(bit1+bit0)/2;
//  if (bit0-bit1+2*tolerance) { bit1++; tolerance++; }
/*  if (maxpulse>pilot.samples)*/
  maxpulse=bit1+(pilot.samples-bit1)/2+1;
  tolerance=(bit1-bit0)/2;
  if (maxpulse>(byte)bit1+(byte)bit0) maxpulse=bit1+bit0-tolerance;
  if (!subblocks && !slocktype || raw) checksum=0;
  for (count=0; count<8; count++) faultybits[count]=0;
  probend=0;
  EndBlock=0;
  DataLoadOK=0;
  printf("Reading data...            \x0d");
  if (!explen)
     {
       do {
	    PushFilePointers();
	    value=0;
	    for (count=0; count<8; count++)
		{
//                byte good=1;
		  pulse=0;
		  if (EndBlock) break;

/*                do {
		       pulse+=FindEdge1();
		       if (currpulse<2) good=0;
		       else good=1;
		     }
		  while (!good && blocktype);
		  do {
		       pulse+=FindEdge1();
		       if (currpulse<2) good=0;
		       else good=1;
		     }
		  while (!good && blocktype); */

//                do pulse+=FindEdge2();
//                while (pulse<bit0-tolerance && blocktype);

		     do {
			  pulse=FindEdge2();
//                        if (pulse<bit0-tolerance && pulse-diff>0 && abs(diff)<5)
//                        pulse-=diff;
			}
		     while (pulse<bit0-tolerance && blocktype);


		  if (((pulse-(int)(middle+.5))<2 && (pulse-2*currpulse)>2) || pulse>maxpulse)
		     {
		       if (currpulse+lastpulse>maxpulse)
			  {
			    if (!count)
			       {
				 mspause+=(pulse/samprate)*1000;
				 EndBlock=1;
				 break;
			       }
			    if (count==7)
			       {
				 mspause+=((pulse-(2*lastpulse))/samprate)*1000;
				 pulse=2*lastpulse;
				 EndBlock=1;
			       }
			    else if ((slocktype>1 && slocktype<5) && blocks>blockskip+1)
				    {
				      PopFilePointers();
				      //RecoverFilePointers();
				      lseek(inpfile.handle,filepos,SEEK_SET);
				      inpfile.bufpoint=0;
				      EndBlock=1; break;
				    }
				 else { EndBlock=1; break; }
			  }
			else {
			       if (loggen) fprintf(logfile,"?- Ambiguous pulse found: %u samples,",pulse);
			       pulse=((currpulse+lastpulse)/2+pulse-middle+(lastpulse<currpulse))*2;
			       if (loggen) {
					     fprintf(logfile," changed to %u (%d)\n",pulse,pulse>middle);
					     fprintf(logfile,"   Position: block %ld, byte %lu, bit %ld, sample %lu\n\n",(dword)blocks,(dword)amount,(dword)7-count,(dword)totalread-pulse);
					   }
			       faultybits[7-count]++;
			      }
		     }

	       /*         if (pulse>bit1+tolerance || pulse>pilot.samples)
		     {
		       if (count==7) {
				       mspause+=((pulse-(2*lastpulse))/samprate)*1000;
				       pulse=2*lastpulse;
				       EndBlock=1;
				     }
		       else if ((slocktype>1 && slocktype<5) && blocks>blockskip+1)
			       {
				 PopFilePointers();
				 lseek(inpfile.handle,filepos,SEEK_SET);
				 inpfile.bufpoint=0;
				 EndBlock=1; break;
			       }
			    else { EndBlock=1; break; }
		     } */
		  if (!blocktype && !count)
		     {
		       if ((alk && blocks>2) || (!checksum && amount)) DataLoadOK=1;
		       return amount;
		     }
		  if (pulse>=bit0-tolerance && pulse<=middle) value<<=1;
		  else if (pulse>middle && pulse<=maxpulse) { value<<=1; value|=0x1; }
		}
	    if (count==8)
	       {
		 amount++;
		 if (amount==1) flag=value;
		 chksum=lastval=value;
		 lastval=value;
		 checksum^=value;
		 if (!checksum) probend=amount;
		 PutData(&tempfile,value,1);
	       }
	    RemoveFilePointers();
	  }
       while (!EndBlock);
//       RecoverFilePointers();
       if ((!checksum && amount) || ((alk || (blocks>blockskip && blockskip && !raw)) || (slocktype>1 && slocktype<5 && blocks>blockskip+1 && blockskip)))
	  {
	    byte bitpoint;
	    byte fbits=0;
	    DataLoadOK=1;
	    if (loggen)
	       {
		 fprintf(logfile,"!- Block %d",blocks);
		 if (subblocks) fprintf(logfile," -> Sub-block %d",subblocks);
		 if (alk)
		    {
		      if (blocks<blockskip) fprintf(logfile," loaded OK\n");
		      else fprintf(logfile," is Alkatraz and cannot be checked\n");
		    }
		 else fprintf(logfile," loaded OK\n");
	       }
	    for (bitpoint=0; bitpoint<8; bitpoint++)
		{
		  if (faultybits[bitpoint]>1) { fbits++; }
		}
	    if (fbits)
	       {
		 if (loggen)
		    {
		      fprintf(logfile,"\n!- WARNING!!! Several ambiguous pulses were found loading bit");
		      if (fbits>1) fprintf(logfile,"s");
		      fprintf(logfile," ");
		    }
		 for (bitpoint=0; bitpoint<8; bitpoint++)
		     if (faultybits[bitpoint]>1)
			   {
			     if (loggen) fprintf(logfile,"%d",bitpoint);
			     fbits--;
			     if (loggen)
				{
				  if (fbits) fprintf(logfile,",");
				  else fprintf(logfile,".\n");
				}
			   }
		 if (loggen)
		    {
		      fprintf(logfile,"   It's strictly recommended that you check that block by loading it on a real\n");
		      fprintf(logfile,"   ZX Spectrum (better solution) or an emulator.\n\n");
		    }
	       }
	  }
       else if (probend && amount-probend<=2)
	    { amount=probend; checksum=0; DataLoadOK=1; }
	    else {
		   char bitpoint;
		   word meanbits[8]={ 0,0,0,0,0,0,0,0 };
		   byte bit,fbits=0;
		   byte dchecksum=checksum;
		   DataLoadOK=0;
		   if (loggen) fprintf(logfile,"X- Bad checksum in block %d (calculated=%d (#%2X), loaded=%d (#%2X))\n",blocks,dchecksum^lastval,dchecksum^lastval,lastval,lastval);
		   for (bitpoint=7; bitpoint>=0; bitpoint--)
		       {
			 if (faultybits[bitpoint])
			    {
			      //bit=pow(2,bitpoint)
			      bit=(int)(1<<bitpoint);
			      if (dchecksum>bit-1)
				 {
				   meanbits[bitpoint]++;
				   fbits++;
				   dchecksum^=bit*(faultybits[bitpoint]==1);
				 }
			    }
			 if (!dchecksum) break;
		       }
		   if (loggen)
		      {
			if (!fbits) fprintf(logfile,"   No ambiguous bits in that block...try resampling and cross your fingers!!!\n");
			else {
			       fprintf(logfile,"   Ambiguous pulses were found in the block ");
			       if (!dchecksum) fprintf(logfile,"and some of them seemed\n   to be determinant:\n");
			       else fprintf(logfile," but none of them was determinant\n   Please try resampling...\n\n");
			     }
		      }
		 }
       if (!mspause && !subblocks) mspause=(pulse/samprate)*1000;
       if (loggen) fprintf(logfile,"\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n");
     }
  else {
	 mspause=0;
	 for (amount=0; amount<explen; amount++)
	     {
//             byte good=1;
	       value=0;
	       for (count=0; count<8; count++)
		   {

		     pulse=0;
/*                   do {
			  pulse+=FindEdge1();
			  if (currpulse<2) good=0;
			  else good=1;
			}
		     while (!good && blocktype);
		     do {
			  pulse+=FindEdge1();
			  if (currpulse<2) good=0;
			  else good=1;
			}
		     while (!good && blocktype); */


		     do {
			  pulse=FindEdge2();
//                        if ((currpulse<2 || lastpulse<2) && abs(currpulse-lastpulse)>4)
//                           do pulse+=FindEdge1();
//                           while (currpulse<2);
			}
		     while (pulse<bit0-tolerance && blocktype);

		     if (!blocktype && !count)
			{
			  if (!checksum) DataLoadOK=1;
			  return amount;
			}
		     if (pulse>=bit0-tolerance && pulse<=middle) value<<=1;
		     else if (pulse>middle && pulse<=maxpulse) { value<<=1; value|=0x1; }
			  else { strcpy(errstring,"Pulse too long"); Error(8); }
		   }
	       if (soft && blocks>blockskip) checksum^=MirrorByte(value);
	       else checksum^=value;
	       if (amount==1) flag=value;
	       if (amount==explen-1)
	       chksum=value;
	       if (amount==0x11d2)
	       amount=amount+1-1;
	       PutData(&tempfile,value,1);
	     }
	 if (!checksum || ((slocktype || zeta) && blocks>blockskip && !SpeedEndBlock) ||
	      (soft)) DataLoadOK=1;
	 expectedlength=0;
       }
  return amount;
}

// Assembly:
subq $0xa8, %rsp
movsd %xmm0, 0x98(%rsp)
movsd %xmm1, 0x90(%rsp)
movl %edi, 0x8c(%rsp)
movq $0x0, 0x78(%rsp)
cmpb $0x0, 0xe3f9(%rip)      # 0x13199
je 0x4dd6
movsd 0xe32e(%rip), %xmm0     # 0x130d8
mulsd 0x98(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movsd 0xe314(%rip), %xmm0     # 0x130d8
mulsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd 0xac3c(%rip), %xmm1     # 0xfa30
mulsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x90(%rsp), %xmm0
movsd 0x1a919(%rip), %xmm2    # 0x1f728
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm0
movsd 0xabcd(%rip), %xmm2     # 0xf9f0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %eax
movb %al, 0x87(%rsp)
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm2
subsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, 0x88(%rsp)
movzbl 0x87(%rsp), %eax
cvttsd2si 0x90(%rsp), %ecx
movzbl %cl, %ecx
cvttsd2si 0x98(%rsp), %edx
movzbl %dl, %edx
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x4eae
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
addsd %xmm1, %xmm0
movzbl 0x88(%rsp), %eax
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, 0x87(%rsp)
cmpl $0x0, 0xe373(%rip)      # 0x13228
jne 0x4ec0
cmpb $0x0, 0xe2d6(%rip)      # 0x13194
je 0x4ecc
movzbl 0xe2cf(%rip), %eax      # 0x13196
cmpl $0x0, %eax
je 0x4ed3
movb $0x0, 0x1acf5(%rip)     # 0x1fbc8
movb $0x0, 0x8a(%rsp)
movzbl 0x8a(%rsp), %eax
cmpl $0x8, %eax
jge 0x4f12
movzbl 0x8a(%rsp), %eax
movl %eax, %ecx
leaq 0xe347(%rip), %rax      # 0x13240
movl $0x0, (%rax,%rcx,4)
movb 0x8a(%rsp), %al
addb $0x1, %al
movb %al, 0x8a(%rsp)
jmp 0x4edb
movq $0x0, 0xe2db(%rip) # 0x131f8
movb $0x0, 0x1a874(%rip)     # 0x1f798
movb $0x0, 0x1ac9e(%rip)     # 0x1fbc9
leaq 0xb2cc(%rip), %rdi      # 0x101fe
movb $0x0, %al
callq 0x1090
cmpl $0x0, 0x8c(%rsp)
jne 0x59cb
jmp 0x4f49
callq 0x18e0
movb $0x0, 0x8b(%rsp)
movb $0x0, 0x8a(%rsp)
movzbl 0x8a(%rsp), %eax
cmpl $0x8, %eax
jge 0x5425
movl $0x0, 0x80(%rsp)
cmpb $0x0, 0x1a817(%rip)     # 0x1f798
je 0x4f88
jmp 0x5425
jmp 0x4f8a
callq 0x3150
movl %eax, 0x80(%rsp)
movl 0x80(%rsp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x98(%rsp), %xmm0
movzbl 0x88(%rsp), %eax
cvtsi2sd %eax, %xmm2
subsd %xmm2, %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, 0x3c(%rsp)
jbe 0x4fd8
movzbl 0x1a6d3(%rip), %eax     # 0x1f6a1
cmpl $0x0, %eax
setne %al
movb %al, 0x3c(%rsp)
movb 0x3c(%rsp), %al
testb $0x1, %al
jne 0x4f8a
movl 0x80(%rsp), %eax
movsd 0xaa41(%rip), %xmm0     # 0xfa30
addsd 0x70(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
subl %ecx, %eax
cmpl $0x2, %eax
jae 0x501a
movl 0x80(%rsp), %eax
movq 0x1a6aa(%rip), %rcx     # 0x1f6b8
shlq %rcx
subq %rcx, %rax
cmpq $0x2, %rax
ja 0x5031
movl 0x80(%rsp), %eax
movzbl 0x87(%rsp), %ecx
cmpl %ecx, %eax
jbe 0x531a
movq 0x1a680(%rip), %rax     # 0x1f6b8
addq 0x1a671(%rip), %rax     # 0x1f6b0
movzbl 0x87(%rsp), %ecx
cmpq %rcx, %rax
jbe 0x51ac
cmpb $0x0, 0x8a(%rsp)
jne 0x509a
movl 0x80(%rsp), %eax
cvtsi2ss %rax, %xmm0
divss 0xe162(%rip), %xmm0     # 0x131d0
movss 0xaace(%rip), %xmm1     # 0xfb44
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0xe17a(%rip), %xmm0     # 0x13200
movsd %xmm0, 0xe172(%rip)     # 0x13200
movb $0x1, 0x1a703(%rip)     # 0x1f798
jmp 0x5425
movzbl 0x8a(%rsp), %eax
cmpl $0x7, %eax
jne 0x5140
movl 0x80(%rsp), %eax
movq 0x1a5f7(%rip), %rcx     # 0x1f6b0
addq %rcx, %rcx
subq %rcx, %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x34(%rsp)
testq %rax, %rax
movss %xmm0, 0x38(%rsp)
js 0x50f8
movss 0x34(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
movss 0x38(%rsp), %xmm0
divss 0xe0ca(%rip), %xmm0     # 0x131d0
movss 0xaa36(%rip), %xmm1     # 0xfb44
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0xe0e2(%rip), %xmm0     # 0x13200
movsd %xmm0, 0xe0da(%rip)     # 0x13200
movq 0x1a583(%rip), %rax     # 0x1f6b0
shlq %rax
movl %eax, 0x80(%rsp)
movb $0x1, 0x1a65a(%rip)     # 0x1f798
jmp 0x51a7
movzbl 0xe04d(%rip), %eax      # 0x13194
cmpl $0x1, %eax
jle 0x519b
movzbl 0xe041(%rip), %eax      # 0x13194
cmpl $0x5, %eax
jge 0x519b
movl 0xe0aa(%rip), %eax      # 0x13208
movl 0xe0a8(%rip), %ecx      # 0x1320c
addl $0x1, %ecx
cmpl %ecx, %eax
jbe 0x519b
callq 0x1a10
movzbl 0xe0e9(%rip), %edi      # 0x13260
movq 0xe04a(%rip), %rsi      # 0x131c8
xorl %edx, %edx
callq 0x10b0
movl $0x0, 0xe1d1(%rip)      # 0x13360
movb $0x1, 0x1a602(%rip)     # 0x1f798
jmp 0x5425
movb $0x1, 0x1a5f6(%rip)     # 0x1f798
jmp 0x5425
jmp 0x5318
cmpb $0x0, 0xdfe5(%rip)      # 0x13198
je 0x51d1
movq 0x162d4(%rip), %rdi     # 0x1b490
movl 0x80(%rsp), %edx
leaq 0xb051(%rip), %rsi      # 0x1021b
movb $0x0, %al
callq 0x10f0
movq 0x1a4e0(%rip), %rcx     # 0x1f6b8
movq 0x1a4d1(%rip), %rax     # 0x1f6b0
movq %rcx, %rdx
addq %rax, %rdx
shrq %rdx
movl 0x80(%rsp), %esi
addq %rsi, %rdx
movq %rdx, %xmm0
movaps 0xa972(%rip), %xmm1     # 0xfb70
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xa976(%rip), %xmm1     # 0xfb80
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x70(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
subq %rcx, %rax
movsd 0xa7bc(%rip), %xmm0     # 0xf9f0
xorps %xmm1, %xmm1
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x28(%rsp)
jb 0x5251
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
addsd %xmm1, %xmm0
addsd %xmm0, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, 0x80(%rsp)
cmpb $0x0, 0xdf20(%rip)      # 0x13198
je 0x52ef
movq 0x1620f(%rip), %rdi     # 0x1b490
movl 0x80(%rsp), %eax
movl %eax, %edx
cvtsi2sd %rax, %xmm0
ucomisd 0x70(%rsp), %xmm0
seta %al
andb $0x1, %al
movzbl %al, %ecx
leaq 0xaf9d(%rip), %rsi      # 0x10241
movb $0x0, %al
callq 0x10f0
movq 0x161de(%rip), %rdi     # 0x1b490
movl 0xdf50(%rip), %eax      # 0x13208
movl %eax, %edx
movq 0x78(%rsp), %rcx
movzbl 0x8a(%rsp), %eax
movl $0x7, %r8d
subq %rax, %r8
movq 0xded9(%rip), %r9       # 0x131b0
movl 0x80(%rsp), %eax
subq %rax, %r9
leaq 0xaf6e(%rip), %rsi      # 0x10256
movb $0x0, %al
callq 0x10f0
movzbl 0x8a(%rsp), %ecx
movl $0x7, %eax
subl %ecx, %eax
movslq %eax, %rcx
leaq 0xdf38(%rip), %rax      # 0x13240
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0xdf2b(%rip), %rax      # 0x13240
movl %edx, (%rax,%rcx,4)
jmp 0x531a
cmpb $0x0, 0x1a380(%rip)     # 0x1f6a1
jne 0x536c
cmpb $0x0, 0x8a(%rsp)
jne 0x536c
movzbl 0xde5d(%rip), %eax      # 0x13191
cmpl $0x0, %eax
je 0x5342
cmpl $0x2, 0xdec8(%rip)      # 0x13208
ja 0x5353
cmpb $0x0, 0x1a87f(%rip)     # 0x1fbc8
jne 0x535a
cmpq $0x0, 0x78(%rsp)
je 0x535a
movb $0x1, 0x1a86f(%rip)     # 0x1fbc9
movq 0x78(%rsp), %rax
movq %rax, 0xa0(%rsp)
jmp 0x5cb8
movl 0x80(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x98(%rsp), %xmm1
movzbl 0x88(%rsp), %eax
cvtsi2sd %eax, %xmm2
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x53c2
movl 0x80(%rsp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x70(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x53c2
movzbl 0x8b(%rsp), %eax
shll %eax
movb %al, 0x8b(%rsp)
jmp 0x540e
movl 0x80(%rsp), %eax
cvtsi2sd %rax, %xmm0
ucomisd 0x70(%rsp), %xmm0
jbe 0x540c
movl 0x80(%rsp), %eax
movzbl 0x87(%rsp), %ecx
cmpl %ecx, %eax
ja 0x540c
movzbl 0x8b(%rsp), %eax
shll %eax
movb %al, 0x8b(%rsp)
movzbl 0x8b(%rsp), %eax
orl $0x1, %eax
movb %al, 0x8b(%rsp)
jmp 0x540e
jmp 0x5410
movb 0x8a(%rsp), %al
addb $0x1, %al
movb %al, 0x8a(%rsp)
jmp 0x4f5e
movzbl 0x8a(%rsp), %eax
cmpl $0x8, %eax
jne 0x54c0
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
cmpq $0x1, 0x78(%rsp)
jne 0x5459
movb 0x8b(%rsp), %al
movb %al, 0x1a771(%rip)      # 0x1fbca
movb 0x8b(%rsp), %al
movb %al, 0x89(%rsp)
movb %al, 0x1a75e(%rip)      # 0x1fbcb
movb 0x8b(%rsp), %al
movb %al, 0x89(%rsp)
movzbl 0x8b(%rsp), %ecx
movzbl 0x1a73e(%rip), %eax     # 0x1fbc8
xorl %ecx, %eax
movb %al, 0x1a736(%rip)      # 0x1fbc8
cmpb $0x0, 0x1a72f(%rip)     # 0x1fbc8
jne 0x54a7
movq 0x78(%rsp), %rax
movq %rax, 0xdd51(%rip)      # 0x131f8
leaq 0x15fea(%rip), %rdi     # 0x1b498
movl $0x1, %edx
movzbl 0x8b(%rsp), %esi
callq 0x2440
callq 0x1b30
cmpb $0x0, 0x1a2cc(%rip)     # 0x1f798
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x4f49
cmpb $0x0, 0x1a6e8(%rip)     # 0x1fbc8
jne 0x54ea
cmpq $0x0, 0x78(%rsp)
jne 0x555a
movzbl 0xdca0(%rip), %eax      # 0x13191
cmpl $0x0, %eax
jne 0x555a
movl 0xdd0c(%rip), %eax      # 0x13208
cmpl 0xdd0a(%rip), %eax      # 0x1320c
jbe 0x5516
cmpl $0x0, 0xdd01(%rip)      # 0x1320c
je 0x5516
cmpb $0x0, 0xdc82(%rip)      # 0x13196
je 0x555a
movzbl 0xdc77(%rip), %eax      # 0x13194
cmpl $0x1, %eax
jle 0x5785
movzbl 0xdc67(%rip), %eax      # 0x13194
cmpl $0x5, %eax
jge 0x5785
movl 0xdccc(%rip), %eax      # 0x13208
movl 0xdcca(%rip), %ecx      # 0x1320c
addl $0x1, %ecx
cmpl %ecx, %eax
jbe 0x5785
cmpl $0x0, 0xdcb8(%rip)      # 0x1320c
je 0x5785
movb $0x0, 0x6e(%rsp)
movb $0x1, 0x1a663(%rip)     # 0x1fbc9
cmpb $0x0, 0xdc2b(%rip)      # 0x13198
je 0x560e
movq 0x15f16(%rip), %rdi     # 0x1b490
movl 0xdc88(%rip), %edx      # 0x13208
leaq 0xad07(%rip), %rsi      # 0x1028e
movb $0x0, %al
callq 0x10f0
cmpl $0x0, 0xdc93(%rip)      # 0x13228
je 0x55b2
movq 0x15ef2(%rip), %rdi     # 0x1b490
movl 0xdc84(%rip), %edx      # 0x13228
leaq 0xacef(%rip), %rsi      # 0x1029a
movb $0x0, %al
callq 0x10f0
cmpb $0x0, 0xdbd8(%rip)      # 0x13191
je 0x55f7
movl 0xdc47(%rip), %eax      # 0x13208
cmpl 0xdc45(%rip), %eax      # 0x1320c
jae 0x55e0
movq 0x15ec0(%rip), %rdi     # 0x1b490
leaq 0xacd4(%rip), %rsi      # 0x102ab
movb $0x0, %al
callq 0x10f0
jmp 0x55f5
movq 0x15ea9(%rip), %rdi     # 0x1b490
leaq 0xacc9(%rip), %rsi      # 0x102b7
movb $0x0, %al
callq 0x10f0
jmp 0x560c
movq 0x15e92(%rip), %rdi     # 0x1b490
leaq 0xaca6(%rip), %rsi      # 0x102ab
movb $0x0, %al
callq 0x10f0
jmp 0x560e
movb $0x0, 0x6f(%rsp)
movzbl 0x6f(%rsp), %eax
cmpl $0x8, %eax
jge 0x5649
movzbl 0x6f(%rsp), %eax
movl %eax, %ecx
leaq 0xdc15(%rip), %rax      # 0x13240
cmpl $0x1, (%rax,%rcx,4)
jbe 0x563b
movb 0x6e(%rsp), %al
addb $0x1, %al
movb %al, 0x6e(%rsp)
jmp 0x563d
movb 0x6f(%rsp), %al
addb $0x1, %al
movb %al, 0x6f(%rsp)
jmp 0x5613
cmpb $0x0, 0x6e(%rsp)
je 0x5780
cmpb $0x0, 0xdb3d(%rip)      # 0x13198
je 0x56a6
movq 0x15e2c(%rip), %rdi     # 0x1b490
leaq 0xac70(%rip), %rsi      # 0x102db
movb $0x0, %al
callq 0x10f0
movzbl 0x6e(%rsp), %eax
cmpl $0x1, %eax
jle 0x5691
movq 0x15e0d(%rip), %rdi     # 0x1b490
leaq 0xb8e7(%rip), %rsi      # 0x10f71
movb $0x0, %al
callq 0x10f0
movq 0x15df8(%rip), %rdi     # 0x1b490
leaq 0xaf79(%rip), %rsi      # 0x10618
movb $0x0, %al
callq 0x10f0
movb $0x0, 0x6f(%rsp)
movzbl 0x6f(%rsp), %eax
cmpl $0x8, %eax
jge 0x574b
movzbl 0x6f(%rsp), %eax
movl %eax, %ecx
leaq 0xdb79(%rip), %rax      # 0x13240
cmpl $0x1, (%rax,%rcx,4)
jbe 0x573a
cmpb $0x0, 0xdac4(%rip)      # 0x13198
je 0x56f0
movq 0x15db3(%rip), %rdi     # 0x1b490
movzbl 0x6f(%rsp), %edx
leaq 0xabae(%rip), %rsi      # 0x10297
movb $0x0, %al
callq 0x10f0
movb 0x6e(%rsp), %al
addb $-0x1, %al
movb %al, 0x6e(%rsp)
cmpb $0x0, 0xda97(%rip)      # 0x13198
je 0x5738
cmpb $0x0, 0x6e(%rsp)
je 0x5721
movq 0x15d7f(%rip), %rdi     # 0x1b490
leaq 0xab27(%rip), %rsi      # 0x1023f
movb $0x0, %al
callq 0x10f0
jmp 0x5736
movq 0x15d68(%rip), %rdi     # 0x1b490
leaq 0xb00c(%rip), %rsi      # 0x1073b
movb $0x0, %al
callq 0x10f0
jmp 0x5738
jmp 0x573a
jmp 0x573c
movb 0x6f(%rsp), %al
addb $0x1, %al
movb %al, 0x6f(%rsp)
jmp 0x56ab
cmpb $0x0, 0xda46(%rip)      # 0x13198
je 0x577e
movq 0x15d35(%rip), %rdi     # 0x1b490
leaq 0xabb8(%rip), %rsi      # 0x1031a
movb $0x0, %al
callq 0x10f0
movq 0x15d20(%rip), %rdi     # 0x1b490
leaq 0xabf3(%rip), %rsi      # 0x1036a
movb $0x0, %al
callq 0x10f0
jmp 0x5780
jmp 0x5960
cmpq $0x0, 0xda6b(%rip)      # 0x131f8
je 0x57c0
movq 0x78(%rsp), %rax
subq 0xda5d(%rip), %rax      # 0x131f8
cmpq $0x2, %rax
ja 0x57c0
movq 0xda50(%rip), %rax      # 0x131f8
movq %rax, 0x78(%rsp)
movb $0x0, 0x1a414(%rip)     # 0x1fbc8
movb $0x1, 0x1a40e(%rip)     # 0x1fbc9
jmp 0x595e
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x10c0
movb $0x0, 0x3e(%rsp)
movb 0x1a3ec(%rip), %al      # 0x1fbc8
movb %al, 0x3d(%rsp)
movb $0x0, 0x1a3e2(%rip)     # 0x1fbc9
cmpb $0x0, 0xd9aa(%rip)      # 0x13198
je 0x583f
movq 0x15c99(%rip), %rdi     # 0x1b490
movl 0xda0b(%rip), %edx      # 0x13208
movzbl 0x3d(%rsp), %ecx
movzbl 0x89(%rsp), %eax
xorl %eax, %ecx
movzbl 0x3d(%rsp), %r8d
movzbl 0x89(%rsp), %eax
xorl %eax, %r8d
movzbl 0x89(%rsp), %r9d
movzbl 0x89(%rsp), %eax
leaq 0xab68(%rip), %rsi      # 0x1039d
movl %eax, (%rsp)
movb $0x0, %al
callq 0x10f0
movb $0x7, 0x6d(%rsp)
movsbl 0x6d(%rsp), %eax
cmpl $0x0, %eax
jl 0x58e9
movsbq 0x6d(%rsp), %rcx
leaq 0xd9e1(%rip), %rax      # 0x13240
cmpl $0x0, (%rax,%rcx,4)
je 0x58cf
movsbl 0x6d(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
movb %al, 0x3f(%rsp)
movzbl 0x3d(%rsp), %eax
movzbl 0x3f(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jle 0x58cd
movsbq 0x6d(%rsp), %rax
movl 0x40(%rsp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rsp,%rax,4)
movb 0x3e(%rsp), %al
addb $0x1, %al
movb %al, 0x3e(%rsp)
movzbl 0x3f(%rsp), %ecx
movsbq 0x6d(%rsp), %rdx
leaq 0xd98d(%rip), %rax      # 0x13240
cmpl $0x1, (%rax,%rdx,4)
sete %al
andb $0x1, %al
movzbl %al, %eax
imull %eax, %ecx
movzbl 0x3d(%rsp), %eax
xorl %ecx, %eax
movb %al, 0x3d(%rsp)
jmp 0x58cf
cmpb $0x0, 0x3d(%rsp)
jne 0x58d8
jmp 0x58e9
jmp 0x58da
movb 0x6d(%rsp), %al
addb $-0x1, %al
movb %al, 0x6d(%rsp)
jmp 0x5844
cmpb $0x0, 0xd8a8(%rip)      # 0x13198
je 0x595c
cmpb $0x0, 0x3e(%rsp)
jne 0x5910
movq 0x15b90(%rip), %rdi     # 0x1b490
leaq 0xaadc(%rip), %rsi      # 0x103e3
movb $0x0, %al
callq 0x10f0
jmp 0x595a
movq 0x15b79(%rip), %rdi     # 0x1b490
leaq 0xab14(%rip), %rsi      # 0x10432
movb $0x0, %al
callq 0x10f0
cmpb $0x0, 0x3d(%rsp)
jne 0x5943
movq 0x15b5d(%rip), %rdi     # 0x1b490
leaq 0xab25(%rip), %rsi      # 0x1045f
movb $0x0, %al
callq 0x10f0
jmp 0x5958
movq 0x15b46(%rip), %rdi     # 0x1b490
leaq 0xab3d(%rip), %rsi      # 0x1048e
movb $0x0, %al
callq 0x10f0
jmp 0x595a
jmp 0x595c
jmp 0x595e
jmp 0x5960
movsd 0xd898(%rip), %xmm0     # 0x13200
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x59a8
jp 0x59a8
cmpl $0x0, 0xd8ae(%rip)      # 0x13228
jne 0x59a8
movl 0x80(%rsp), %eax
cvtsi2ss %rax, %xmm0
divss 0xd840(%rip), %xmm0     # 0x131d0
movss 0xa1ac(%rip), %xmm1     # 0xfb44
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xd858(%rip)     # 0x13200
cmpb $0x0, 0xd7e9(%rip)      # 0x13198
je 0x59c6
movq 0x15ad8(%rip), %rdi     # 0x1b490
leaq 0xab0f(%rip), %rsi      # 0x104ce
movb $0x0, %al
callq 0x10f0
jmp 0x5cab
xorps %xmm0, %xmm0
movsd %xmm0, 0xd82a(%rip)     # 0x13200
movq $0x0, 0x78(%rsp)
movq 0x78(%rsp), %rax
movl 0x8c(%rsp), %ecx
cmpq %rcx, %rax
jae 0x5c56
movb $0x0, 0x8b(%rsp)
movb $0x0, 0x8a(%rsp)
movzbl 0x8a(%rsp), %eax
cmpl $0x8, %eax
jge 0x5b83
movl $0x0, 0x80(%rsp)
callq 0x3150
movl %eax, 0x80(%rsp)
movl 0x80(%rsp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x98(%rsp), %xmm0
movzbl 0x88(%rsp), %eax
cvtsi2sd %eax, %xmm2
subsd %xmm2, %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, 0x17(%rsp)
jbe 0x5a6e
movzbl 0x19c3d(%rip), %eax     # 0x1f6a1
cmpl $0x0, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x5a20
cmpb $0x0, 0x19c24(%rip)     # 0x1f6a1
jne 0x5aab
cmpb $0x0, 0x8a(%rsp)
jne 0x5aab
cmpb $0x0, 0x1a138(%rip)     # 0x1fbc8
jne 0x5a99
movb $0x1, 0x1a130(%rip)     # 0x1fbc9
movq 0x78(%rsp), %rax
movq %rax, 0xa0(%rsp)
jmp 0x5cb8
movl 0x80(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x98(%rsp), %xmm1
movzbl 0x88(%rsp), %eax
cvtsi2sd %eax, %xmm2
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x5b01
movl 0x80(%rsp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x70(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x5b01
movzbl 0x8b(%rsp), %eax
shll %eax
movb %al, 0x8b(%rsp)
jmp 0x5b6c
movl 0x80(%rsp), %eax
cvtsi2sd %rax, %xmm0
ucomisd 0x70(%rsp), %xmm0
jbe 0x5b4d
movl 0x80(%rsp), %eax
movzbl 0x87(%rsp), %ecx
cmpl %ecx, %eax
ja 0x5b4d
movzbl 0x8b(%rsp), %eax
shll %eax
movb %al, 0x8b(%rsp)
movzbl 0x8b(%rsp), %eax
orl $0x1, %eax
movb %al, 0x8b(%rsp)
jmp 0x5b6a
leaq 0x19b6c(%rip), %rdi     # 0x1f6c0
leaq 0xa9c6(%rip), %rsi      # 0x10521
callq 0x1050
movl $0x8, %edi
callq 0x15c0
jmp 0x5b6c
jmp 0x5b6e
movb 0x8a(%rsp), %al
addb $0x1, %al
movb %al, 0x8a(%rsp)
jmp 0x5a04
movzbl 0xd608(%rip), %eax      # 0x13192
cmpl $0x0, %eax
je 0x5bbe
movl 0xd673(%rip), %eax      # 0x13208
cmpl 0xd671(%rip), %eax      # 0x1320c
jbe 0x5bbe
movzbl 0x8b(%rsp), %edi
callq 0x5cd0
movzbl %al, %ecx
movzbl 0x1a014(%rip), %eax     # 0x1fbc8
xorl %ecx, %eax
movb %al, 0x1a00c(%rip)      # 0x1fbc8
jmp 0x5bd5
movzbl 0x8b(%rsp), %ecx
movzbl 0x19ffb(%rip), %eax     # 0x1fbc8
xorl %ecx, %eax
movb %al, 0x19ff3(%rip)      # 0x1fbc8
cmpq $0x1, 0x78(%rsp)
jne 0x5bea
movb 0x8b(%rsp), %al
movb %al, 0x19fe0(%rip)      # 0x1fbca
movq 0x78(%rsp), %rax
movl 0x8c(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0x5c0d
movb 0x8b(%rsp), %al
movb %al, 0x19fbe(%rip)      # 0x1fbcb
cmpq $0x11d2, 0x78(%rsp)     # imm = 0x11D2
jne 0x5c2a
movq 0x78(%rsp), %rax
addq $0x1, %rax
subq $0x1, %rax
movq %rax, 0x78(%rsp)
leaq 0x15867(%rip), %rdi     # 0x1b498
movl $0x1, %edx
movzbl 0x8b(%rsp), %esi
callq 0x2440
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x59df
cmpb $0x0, 0x19f6b(%rip)     # 0x1fbc8
je 0x5c9a
movzbl 0xd52e(%rip), %eax      # 0x13194
cmpl $0x0, %eax
jne 0x5c77
movzbl 0xd523(%rip), %eax      # 0x13195
cmpl $0x0, %eax
je 0x5c8e
movl 0xd58b(%rip), %eax      # 0x13208
cmpl 0xd589(%rip), %eax      # 0x1320c
jbe 0x5c8e
cmpb $0x0, 0x19f40(%rip)     # 0x1fbcc
je 0x5c9a
movzbl 0xd4fd(%rip), %eax      # 0x13192
cmpl $0x0, %eax
je 0x5ca1
movb $0x1, 0x19f28(%rip)     # 0x1fbc9
movl $0x0, 0xd549(%rip)      # 0x131f4
movq 0x78(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
addq $0xa8, %rsp
retq
nopl (%rax,%rax)