// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edi, %r14d
cmpb $0x0, 0xb8c3(%rip)      # 0xf1b9
je 0x3908
movsd 0xb7f8(%rip), %xmm2     # 0xf0f8
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm1
movapd %xmm1, %xmm4
addsd %xmm0, %xmm4
movsd 0x79b8(%rip), %xmm3     # 0xb2d0
movsd 0x17e28(%rip), %xmm2    # 0x1b748
subsd %xmm1, %xmm2
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
addsd 0x7984(%rip), %xmm2     # 0xb2b8
cvttsd2si %xmm2, %eax
cvttsd2si %xmm1, %ecx
subsd %xmm0, %xmm1
mulsd %xmm3, %xmm1
cvttsd2si %xmm1, %edx
movl $0xff, %esi
movl %eax, %edi
andl %esi, %edi
andl %esi, %ecx
movsd %xmm0, 0x18(%rsp)
cvttsd2si %xmm0, %r8d
andl %esi, %r8d
addl %ecx, %r8d
andl %esi, %edx
cmpl %edi, %r8d
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movapd %xmm4, %xmm1
movsd %xmm0, 0x20(%rsp)
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %ebx
cmovael %eax, %ebx
cmpl $0x0, 0xb8bc(%rip)      # 0xf248
sete %al
cmpb $0x0, 0xb81e(%rip)      # 0xf1b4
sete %cl
testb %cl, %al
jne 0x39a6
cmpb $0x0, 0xb812(%rip)      # 0xf1b6
je 0x39ad
movb $0x0, 0x1823b(%rip)     # 0x1bbe8
mulsd %xmm3, %xmm4
movsd %xmm4, 0x10(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb8ad(%rip)     # 0xf270
movapd %xmm0, 0xb895(%rip)     # 0xf260
movq $0x0, 0xb842(%rip) # 0xf218
xorl %eax, %eax
movb %al, 0x17dda(%rip)      # 0x1b7b8
movb %al, 0x18205(%rip)      # 0x1bbe9
leaq 0x7c9b(%rip), %rdi      # 0xb686
xorl %eax, %eax
callq 0x10b0
movsd 0x10(%rsp), %xmm1
movzbl %bl, %ebp
movsd 0x18(%rsp), %xmm0
subsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
testl %r14d, %r14d
movq %rbp, 0x20(%rsp)
je 0x3b81
movq $0x0, 0xb7fa(%rip) # 0xf220
movl %r14d, %r13d
decl %r14d
xorl %ebx, %ebx
leaq 0x13a83(%rip), %r12     # 0x174b8
movq %r13, %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
callq 0x260f
movsd 0x18(%rsp), %xmm1
movl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
ucomisd %xmm0, %xmm1
movb 0x17c65(%rip), %cl      # 0x1b6c1
jbe 0x3a62
testb %cl, %cl
jne 0x3a3d
orb %r13b, %cl
je 0x3b69
ucomisd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
jb 0x3a82
ucomisd %xmm0, %xmm1
jb 0x3a82
addb %bpl, %bpl
jmp 0x3a9c
ucomisd %xmm1, %xmm0
jbe 0x4368
cmpl 0x20(%rsp), %eax
ja 0x4368
addb %bpl, %bpl
incb %bpl
incb %r13b
cmpb $0x8, %r13b
jne 0x3a3d
cmpb $0x0, 0xb706(%rip)      # 0xf1b2
movl %ebp, %eax
je 0x3ad7
movl 0xb772(%rip), %ecx      # 0xf228
movl %ebp, %eax
cmpl 0xb76e(%rip), %ecx      # 0xf22c
jbe 0x3ad7
movb $0x8, %cl
xorl %eax, %eax
movl %ebp, %edx
shrb %al
movl %edx, %esi
andb $-0x80, %sil
orb %sil, %al
addb %dl, %dl
decb %cl
jne 0x3ac6
xorb %al, 0x1810b(%rip)      # 0x1bbe8
cmpq $0x1, %rbx
movq %r15, %r13
jne 0x3aed
movb %bpl, 0x180fd(%rip)     # 0x1bbea
cmpq %r14, %rbx
jne 0x3af9
movb %bpl, 0x180f2(%rip)     # 0x1bbeb
movzbl %bpl, %esi
movq %r12, %rdi
movl $0x1, %edx
callq 0x1e01
incq %rbx
cmpq %r13, %rbx
jne 0x3a35
cmpb $0x0, 0x180cb(%rip)     # 0x1bbe8
je 0x3b53
movb 0xb690(%rip), %al       # 0xf1b5
orb 0xb689(%rip), %al       # 0xf1b4
je 0x3b4a
movl 0xb6f5(%rip), %eax      # 0xf228
cmpl 0xb6f3(%rip), %eax      # 0xf22c
seta %al
cmpb $0x0, 0x180a9(%rip)     # 0x1bbec
sete %cl
testb %cl, %al
jne 0x3b53
cmpb $0x0, 0xb661(%rip)      # 0xf1b2
je 0x3b5a
movb $0x1, 0x1808f(%rip)     # 0x1bbe9
movl $0x0, 0xb6b0(%rip)      # 0xf214
jmp 0x3f39
cmpb $0x0, 0x18078(%rip)     # 0x1bbe8
jne 0x3b79
movb $0x1, 0x18070(%rip)     # 0x1bbe9
movq %rbx, %r13
jmp 0x3f39
movsd 0x7747(%rip), %xmm0     # 0xb2d0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x2c(%rsp)
leaq 0xb6c4(%rip), %r12      # 0xf260
xorl %r13d, %r13d
callq 0x1659
xorl %r15d, %r15d
xorl %ebx, %ebx
cmpb $0x0, 0x17c08(%rip)     # 0x1b7b8
jne 0x3e5c
callq 0x260f
movsd 0x18(%rsp), %xmm1
movq %rax, %r14
movl %r14d, %edx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
ucomisd %xmm0, %xmm1
movb 0x17ae8(%rip), %al      # 0x1b6c1
jbe 0x3bdf
testb %al, %al
jne 0x3bb6
movl %r14d, %ecx
subl 0x2c(%rsp), %ecx
cmpl $0x1, %ecx
ja 0x3c12
movl %r14d, %ecx
movq 0x17ae3(%rip), %rsi     # 0x1b6d8
subq %rsi, %rcx
subq %rsi, %rcx
cmpq $0x2, %rcx
movsd 0x10(%rsp), %xmm3
ja 0x3c28
cmpl %ebp, %r14d
jbe 0x3dd1
jmp 0x3c28
cmpl %ebp, %r14d
movsd 0x10(%rsp), %xmm3
jbe 0x3dd1
movq 0x17ab0(%rip), %rsi     # 0x1b6d8
movq 0x17aa1(%rip), %rcx     # 0x1b6d0
leaq (%rcx,%rsi), %rdi
cmpq %rbp, %rdi
jbe 0x3c58
cmpb $0x7, %r15b
jne 0x3e76
movl %r14d, %edx
leaq (%rcx,%rcx), %rsi
subq %rsi, %rdx
js 0x3ca1
xorps %xmm0, %xmm0
cvtsi2ss %rdx, %xmm0
jmp 0x3cb9
cmpb $0x0, 0xb559(%rip)      # 0xf1b8
je 0x3cee
movq 0x13844(%rip), %rdi     # 0x174b0
leaq 0x7a30(%rip), %rsi      # 0xb6a3
movl %r14d, %edx
xorl %eax, %eax
callq 0x1120
movsd 0x10(%rsp), %xmm3
movq 0x17a4e(%rip), %rsi     # 0x1b6d8
movq 0x17a3f(%rip), %rcx     # 0x1b6d0
leaq (%rcx,%rsi), %rdi
cmpb $0x0, 0xb51c(%rip)      # 0xf1b8
sete %al
jmp 0x3cf0
movq %rdx, %rsi
shrq %rsi
andl $0x1, %edx
orq %rsi, %rdx
xorps %xmm0, %xmm0
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
divss 0xb52f(%rip), %xmm0     # 0xf1f0
mulss 0x771b(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0xb54b(%rip), %xmm0     # 0xf220
movsd %xmm0, 0xb543(%rip)     # 0xf220
addl %ecx, %ecx
movb $0x1, 0x17ad2(%rip)     # 0x1b7b8
movl %ecx, %r14d
jmp 0x3dd1
movb $0x1, %al
shrq %rdi
movl %r14d, %edx
addq %rdi, %rdx
movq %rdx, %xmm0
punpckldq 0x770a(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x7712(%rip), %xmm0     # 0xb420
movsd 0x75a2(%rip), %xmm1     # 0xb2b8
cmpq %rsi, %rcx
jb 0x3d1f
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
subsd %xmm3, %xmm2
addsd %xmm1, %xmm2
addsd %xmm2, %xmm2
cvttsd2si %xmm2, %r14
testb %al, %al
je 0x3d4a
movl $0x7, %ebp
subq %r15, %rbp
jmp 0x3dbc
movq 0x1375f(%rip), %rdi     # 0x174b0
movq %r13, %r12
movl %r14d, %r13d
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
xorl %ecx, %ecx
ucomisd %xmm3, %xmm0
seta %cl
leaq 0x795a(%rip), %rsi      # 0xb6c9
movl %r14d, %edx
xorl %eax, %eax
callq 0x1120
movq 0x13730(%rip), %rdi     # 0x174b0
movl 0xb4a2(%rip), %edx      # 0xf228
movl $0x7, %ebp
subq %r15, %rbp
movq 0xb43b(%rip), %r9       # 0xf1d0
subq %r13, %r9
movq %r12, %r13
leaq 0xb4be(%rip), %r12      # 0xf260
leaq 0x7935(%rip), %rsi      # 0xb6de
movq %r13, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x1120
movsd 0x10(%rsp), %xmm3
movsd 0x18(%rsp), %xmm1
incl (%r12,%rbp,4)
movb 0x178f5(%rip), %al      # 0x1b6c1
movq 0x20(%rsp), %rbp
movl %r15d, %ecx
orb %al, %cl
je 0x3f09
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
ucomisd %xmm1, %xmm0
jb 0x3df7
ucomisd %xmm0, %xmm3
jb 0x3df7
addb %bl, %bl
jmp 0x3e06
ucomisd %xmm3, %xmm0
jbe 0x3e06
cmpl %ebp, %r14d
ja 0x3e06
addb %bl, %bl
incb %bl
incq %r15
cmpq $0x8, %r15
jne 0x3ba9
testq %r13, %r13
jne 0x3e1e
movb %bl, 0x17dcc(%rip)      # 0x1bbea
incq %r13
movb %bl, 0x17dc4(%rip)      # 0x1bbeb
movb 0x17dbb(%rip), %al      # 0x1bbe8
movl %eax, %ecx
xorb %bl, %cl
movb %cl, 0x17db1(%rip)      # 0x1bbe8
cmpb %bl, %al
jne 0x3e42
movq %r13, 0xb3d6(%rip)      # 0xf218
movzbl %bl, %esi
leaq 0x1366c(%rip), %rdi     # 0x174b8
movl $0x1, %edx
callq 0x1e01
movb %bl, 0xf(%rsp)
jmp 0x3e5f
xorl %r14d, %r14d
callq 0x178b
cmpb $0x0, 0x1794d(%rip)     # 0x1b7b8
je 0x3b9f
jmp 0x3f4b
movzbl %r15b, %eax
testl %eax, %eax
jne 0x3eb3
xorps %xmm0, %xmm0
cvtsi2ss %rdx, %xmm0
divss 0xb362(%rip), %xmm0     # 0xf1f0
mulss 0x754e(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0xb37e(%rip), %xmm0     # 0xf220
movsd %xmm0, 0xb376(%rip)     # 0xf220
movb $0x1, 0x17907(%rip)     # 0x1b7b8
jmp 0x3e5f
movb 0xb2fb(%rip), %al       # 0xf1b4
addb $-0x2, %al
cmpb $0x2, %al
ja 0x3ef3
movl 0xb367(%rip), %eax      # 0xf22c
incl %eax
cmpl %eax, 0xb35b(%rip)      # 0xf228
jbe 0x3ef3
callq 0x16fa
movzbl 0xb3a5(%rip), %edi      # 0xf280
movq 0xb306(%rip), %rsi      # 0xf1e8
xorl %edx, %edx
callq 0x10d0
movl $0x0, 0xb48d(%rip)      # 0xf380
movb $0x1, 0x178be(%rip)     # 0x1b7b8
cmpq $0x8, %r15
je 0x3e13
jmp 0x3e5f
cmpb $0x0, 0xb2a1(%rip)      # 0xf1b1
je 0x3f1b
cmpl $0x2, 0xb30f(%rip)      # 0xf228
ja 0x3f32
cmpb $0x0, 0x17cc6(%rip)     # 0x1bbe8
sete %al
testq %r13, %r13
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3f39
movb $0x1, 0x17cb0(%rip)     # 0x1bbe9
movq %r13, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb 0x17c97(%rip), %bl      # 0x1bbe8
testb %bl, %bl
sete %al
testq %r13, %r13
setne %cl
testb %cl, %al
jne 0x3f8e
cmpb $0x0, 0xb24a(%rip)      # 0xf1b1
jne 0x3f8e
movl 0xb2b9(%rip), %edx      # 0xf228
movl 0xb2b7(%rip), %eax      # 0xf22c
cmpl %eax, %edx
jbe 0x400c
testl %eax, %eax
je 0x400c
cmpb $0x0, 0xb22a(%rip)      # 0xf1b6
jne 0x400c
movb $0x1, 0x17c54(%rip)     # 0x1bbe9
cmpb $0x0, 0xb21c(%rip)      # 0xf1b8
je 0x4089
movq 0x13507(%rip), %rdi     # 0x174b0
movl 0xb279(%rip), %edx      # 0xf228
leaq 0x7760(%rip), %rsi      # 0xb716
xorl %eax, %eax
callq 0x1120
movl 0xb285(%rip), %edx      # 0xf248
testl %edx, %edx
je 0x3fdc
movq 0x134e2(%rip), %rdi     # 0x174b0
leaq 0x774d(%rip), %rsi      # 0xb722
xorl %eax, %eax
callq 0x1120
cmpb $0x0, 0xb1ce(%rip)      # 0xf1b1
je 0x406c
movl 0xb239(%rip), %eax      # 0xf228
movq 0x134ba(%rip), %rcx     # 0x174b0
cmpl 0xb230(%rip), %eax      # 0xf22c
jb 0x4073
leaq 0x773a(%rip), %rdi      # 0xb73f
movl $0x23, %esi
jmp 0x407f
movb 0xb1a2(%rip), %cl       # 0xf1b4
addb $-0x2, %cl
cmpb $0x2, %cl
ja 0x402e
testl %eax, %eax
sete %cl
incl %eax
cmpl %eax, %edx
setbe %al
orb %cl, %al
je 0x3f8e
movq 0xb1e3(%rip), %rax      # 0xf218
testq %rax, %rax
setne %cl
movq %r13, %rsi
subq %rax, %rsi
cmpq $0x3, %rsi
setb %sil
andb %cl, %sil
cmpb $0x1, %sil
jne 0x4267
movb $0x0, 0x17b8b(%rip)     # 0x1bbe8
movb $0x1, 0x17b85(%rip)     # 0x1bbe9
movq %rax, %r13
jmp 0x41f4
movq 0x1343d(%rip), %rcx     # 0x174b0
leaq 0x76b9(%rip), %rdi      # 0xb733
movl $0xb, %esi
movl $0x1, %edx
callq 0x1180
xorpd %xmm0, %xmm0
xorl %eax, %eax
movdqa 0x7399(%rip), %xmm1     # 0xb430
movdqa 0x73a1(%rip), %xmm2     # 0xb440
movdqa (%rax,%r12), %xmm3
pxor %xmm1, %xmm3
pcmpgtd %xmm2, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
psubb %xmm3, %xmm0
addq $0x10, %rax
cmpq $0x20, %rax
jne 0x409f
pxor %xmm1, %xmm1
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
psadbw %xmm1, %xmm0
movd %xmm0, %ebx
testb %bl, %bl
je 0x41f4
cmpb $0x0, 0xb0d6(%rip)      # 0xf1b8
je 0x4128
movq 0x133c5(%rip), %rcx     # 0x174b0
leaq 0x7671(%rip), %rdi      # 0xb763
movl $0x3e, %esi
movl $0x1, %edx
callq 0x1180
cmpb $0x1, %bl
je 0x4117
movq 0x133a3(%rip), %rsi     # 0x174b0
movl $0x73, %edi
callq 0x1100
movq 0x13392(%rip), %rsi     # 0x174b0
movl $0x20, %edi
callq 0x1100
movq %r13, %r15
leaq 0x75ed(%rip), %rbp      # 0xb71f
movq %r12, %rax
xorl %r13d, %r13d
movq %rax, %r12
cmpl $0x2, (%rax)
jb 0x419e
cmpb $0x0, 0xb071(%rip)      # 0xf1b8
je 0x4182
movq 0x13360(%rip), %rdi     # 0x174b0
movq %rbp, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x1120
decb %bl
cmpb $0x0, 0xb052(%rip)      # 0xf1b8
je 0x419e
movq 0x13341(%rip), %rcx     # 0x174b0
testb %bl, %bl
je 0x4186
movl $0x2c, %edi
movq %rcx, %rsi
callq 0x1100
jmp 0x419e
decb %bl
jmp 0x419e
movl $0x2, %esi
movl $0x1, %edx
leaq 0x7a2c(%rip), %rdi      # 0xbbc3
callq 0x1180
xorl %ebx, %ebx
incq %r13
movq %r12, %rax
addq $0x4, %rax
cmpq $0x8, %r13
jne 0x4138
cmpb $0x0, 0xb003(%rip)      # 0xf1b8
je 0x41f1
movq 0x132f2(%rip), %rcx     # 0x174b0
leaq 0x75dd(%rip), %rdi      # 0xb7a2
movl $0x4f, %esi
movl $0x1, %edx
callq 0x1180
movq 0x132d5(%rip), %rcx     # 0x174b0
leaq 0x7610(%rip), %rdi      # 0xb7f2
movl $0x32, %esi
movl $0x1, %edx
callq 0x1180
movq %r15, %r13
movsd 0xb024(%rip), %xmm0     # 0xf220
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4238
jp 0x4238
cmpl $0x0, 0xb039(%rip)      # 0xf248
jne 0x4238
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
divss 0xafcc(%rip), %xmm0     # 0xf1f0
mulss 0x71b8(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xafe8(%rip)     # 0xf220
cmpb $0x0, 0xaf79(%rip)      # 0xf1b8
je 0x3f39
movq 0x13264(%rip), %rcx     # 0x174b0
leaq 0x7703(%rip), %rdi      # 0xb956
movl $0x52, %esi
movl $0x1, %edx
callq 0x1180
jmp 0x3f39
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movb $0x0, 0x1796b(%rip)     # 0x1bbe9
cmpb $0x0, 0xaf33(%rip)      # 0xf1b8
je 0x42b1
movq 0x13222(%rip), %rdi     # 0x174b0
movzbl 0xf(%rsp), %r9d
movl %ebx, %eax
xorb %r9b, %al
movzbl %al, %ecx
movl %r9d, (%rsp)
leaq 0x757e(%rip), %rsi      # 0xb825
movl %ecx, %r8d
xorl %eax, %eax
callq 0x1120
movl $0x7, %ecx
xorl %edx, %edx
xorl %eax, %eax
movl (%r12,%rcx,4), %edi
testl %edi, %edi
je 0x42e7
movl $0x1, %esi
shll %cl, %esi
movzbl %bl, %r8d
movzbl %sil, %r9d
cmpl %r8d, %r9d
ja 0x42e7
incl 0x30(%rsp,%rcx,4)
incb %al
cmpl $0x1, %edi
cmovnel %edx, %esi
xorb %bl, %sil
movl %esi, %ebx
subq $0x1, %rcx
setb %sil
testb %bl, %bl
je 0x42f8
testb %sil, %sil
je 0x42ba
cmpb $0x0, 0xaeb9(%rip)      # 0xf1b8
je 0x41f4
movq 0x131a4(%rip), %rcx     # 0x174b0
testb %al, %al
je 0x433f
leaq 0x75a3(%rip), %rdi      # 0xb8ba
movl $0x2c, %esi
movl $0x1, %edx
callq 0x1180
movq 0x13183(%rip), %rcx     # 0x174b0
testb %bl, %bl
je 0x434d
leaq 0x75de(%rip), %rdi      # 0xb916
movl $0x3f, %esi
jmp 0x4359
leaq 0x7525(%rip), %rdi      # 0xb86b
movl $0x4e, %esi
jmp 0x4359
leaq 0x7593(%rip), %rdi      # 0xb8e7
movl $0x2e, %esi
movl $0x1, %edx
callq 0x1180
jmp 0x41f4
movabsq $0x676e6f6c206f6f, %rax # imm = 0x676E6F6C206F6F
movq %rax, 0x1736e(%rip)     # 0x1b6e7
movabsq $0x6f742065736c7550, %rax # imm = 0x6F742065736C7550
movq %rax, 0x17356(%rip)     # 0x1b6e0
movl $0x8, %edi
callq 0x140c