LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: CloseFiles
void CloseFiles(void)
{
  close(inpfile.handle);
  if (outfile.bufpoint) Flush(&outfile);
  close(outfile.handle);
  fclose(logfile);
}

// Assembly:
pushq %rax
movzbl 0xdcb4(%rip), %edi      # 0xf280
callq 0x10f0
movl 0x11ec1(%rip), %edx     # 0x13498
testq %rdx, %rdx
je 0x15ef
movzbl 0x11db5(%rip), %edi     # 0x13398
leaq 0x11ec6(%rip), %rsi     # 0x134b0
callq 0x1080
movzbl 0x11da2(%rip), %edi     # 0x13398
callq 0x10f0
movq 0x15eae(%rip), %rdi     # 0x174b0
popq %rax
jmp 0x1090
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: PushFilePointers
void PushFilePointers(void)
{
  stackitem *pointer;
  byte item=stack1.busy+stack2.busy+stack3.busy+stack4.busy+stack5.busy+1;
  if (item>5) item=5;
  switch (item)
	 {
	   case 1 : pointer=&stack1; break;
	   case 2 : pointer=&stack2; break;
	   case 3 : pointer=&stack3; break;
	   case 4 : pointer=&stack4; break;
	   case 5 : pointer=&stack5; break;
	 }
  (*pointer).busy=1;
  (*pointer).savedir=direction;
  (*pointer).saverev=revsamples;
  (*pointer).savelast=lastsample;
  (*pointer).savebtype=blocktype;
  (*pointer).savepos=filepos;
  (*pointer).savetotal=totalread;
  (*pointer).saveprocess=processed;
  (*pointer).saveblocklen=blocklength;
}

// Assembly:
movb 0x19f70(%rip), %al      # 0x1b5d0
addb 0x19f9a(%rip), %al      # 0x1b600
addb 0x19fc4(%rip), %al      # 0x1b630
addb 0x19fee(%rip), %al      # 0x1b660
addb 0x1a018(%rip), %al      # 0x1b690
incb %al
movzbl %al, %ecx
cmpb $0x5, %cl
movl $0x5, %eax
cmovbl %ecx, %eax
addb $-0x2, %al
cmpb $0x3, %al
ja 0x169e
movzbl %al, %eax
leaq 0xd740(%rip), %rcx      # 0xedd8
movq (%rcx,%rax,8), %rax
jmp 0x16a5
leaq 0x19f2b(%rip), %rax     # 0x1b5d0
movb $0x1, (%rax)
movb 0xda43(%rip), %cl       # 0xf0f1
movb %cl, 0x1(%rax)
movq 0xdb50(%rip), %rcx      # 0xf208
movq %rcx, 0x8(%rax)
movb 0x19ffe(%rip), %cl      # 0x1b6c0
movb %cl, 0x3(%rax)
movb 0x19ff6(%rip), %cl      # 0x1b6c1
movb %cl, 0x2(%rax)
movq 0xdb13(%rip), %rcx      # 0xf1e8
movq %rcx, 0x10(%rax)
movq 0xdaf0(%rip), %rcx      # 0xf1d0
movq %rcx, 0x18(%rax)
movq 0xdadd(%rip), %rcx      # 0xf1c8
movq %rcx, 0x20(%rax)
movq 0xdaca(%rip), %rcx      # 0xf1c0
movq %rcx, 0x28(%rax)
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: PopFilePointers
void PopFilePointers(void)
{
  stackitem *pointer;
  byte item=stack1.busy+stack2.busy+stack3.busy+stack4.busy+stack5.busy;
  switch (item)
	 {
	   case 0 :
	   case 1 : pointer=&stack1; break;
	   case 2 : pointer=&stack2; break;
	   case 3 : pointer=&stack3; break;
	   case 4 : pointer=&stack4; break;
	   case 5 : pointer=&stack5; break;
	 }
  (*pointer).busy=0;
  direction=(*pointer).savedir;
  revsamples=(*pointer).saverev;
  lastsample=(*pointer).savelast;
  blocktype=(*pointer).savebtype;
  filepos=(*pointer).savepos;
  totalread=(*pointer).savetotal;
  processed=(*pointer).saveprocess;
  blocklength=(*pointer).saveblocklen;
}

// Assembly:
movb 0x19eff(%rip), %al      # 0x1b600
addb 0x19ec9(%rip), %al      # 0x1b5d0
addb 0x19f23(%rip), %al      # 0x1b630
addb 0x19f4d(%rip), %al      # 0x1b660
addb 0x19f77(%rip), %al      # 0x1b690
addb $-0x2, %al
cmpb $0x3, %al
ja 0x172f
movzbl %al, %eax
leaq 0xd6af(%rip), %rcx      # 0xedd8
movq (%rcx,%rax,8), %rax
jmp 0x1736
leaq 0x19e9a(%rip), %rax     # 0x1b5d0
movb $0x0, (%rax)
movb 0x1(%rax), %cl
movb %cl, 0xd9af(%rip)       # 0xf0f1
movq 0x8(%rax), %rcx
movq %rcx, 0xdabb(%rip)      # 0xf208
movb 0x3(%rax), %cl
movb %cl, 0x19f6a(%rip)      # 0x1b6c0
movb 0x2(%rax), %cl
movb %cl, 0x19f62(%rip)      # 0x1b6c1
movq 0x10(%rax), %rcx
movq %rcx, 0xda7e(%rip)      # 0xf1e8
movq 0x18(%rax), %rcx
movq %rcx, 0xda5b(%rip)      # 0xf1d0
movq 0x20(%rax), %rcx
movq %rcx, 0xda48(%rip)      # 0xf1c8
movq 0x28(%rax), %rax
movq %rax, 0xda35(%rip)      # 0xf1c0
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: Instructions
void Instructions(void)
{
  printf("Translates VOC files in TZX format for ZX Spectrum emulators\n\n");
  printf("Syntax: MAKETZX <inputfile> [outputfile] [switches]\n\n");
  printf("Switches:\n\n");
  printf("   -n: operate in normal mode         -s n: use Speedlock type n algorithm\n");
  printf("   -a: use Alkatraz algorithm         -k n: skip n blocks before considering\n");
  printf("   -f: use Softlock algorithm               specific loaders\n");
  printf("   -b: use Bleepload algorithm        -x: display file informations in hex\n");
  printf("   -z: use ZetaLoad algorithm         -q: disable hi-fi reproduction tones\n");
  printf("   -l: enable logfile generation      -r: use TZX revision 1.01\n\n");
/*printf("          -digital : use Digital Integrations algorithm and timings\n");*/
  exit(0);
}

// Assembly:
pushq %rax
leaq 0xa743(%rip), %rdi      # 0xc42d
callq 0x1070
leaq 0xa775(%rip), %rdi      # 0xc46b
callq 0x1070
leaq 0xa79e(%rip), %rdi      # 0xc4a0
callq 0x1070
leaq 0xa79d(%rip), %rdi      # 0xc4ab
callq 0x1070
leaq 0xa7dc(%rip), %rdi      # 0xc4f6
callq 0x1070
leaq 0xa81d(%rip), %rdi      # 0xc543
callq 0x1070
leaq 0xa84e(%rip), %rdi      # 0xc580
callq 0x1070
leaq 0xa88d(%rip), %rdi      # 0xc5cb
callq 0x1070
leaq 0xa8cc(%rip), %rdi      # 0xc616
callq 0x1070
xorl %edi, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: End
void End(void)
{
  if (tempfile.bufpoint) Flush(&tempfile);
  CloseFiles();
  remove(tempfile.name);
  printf("\nDone!\n\n");
  exit(0);
}

// Assembly:
pushq %rax
movl 0x1583f(%rip), %edx     # 0x175b8
testq %rdx, %rdx
je 0x1d91
movzbl 0x15733(%rip), %edi     # 0x174b8
leaq 0x15844(%rip), %rsi     # 0x175d0
callq 0x1080
callq 0x15c4
leaq 0x1571c(%rip), %rdi     # 0x174b9
callq 0x1050
leaq 0xa8ae(%rip), %rdi      # 0xc657
callq 0x1070
xorl %edi, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: GetData
byte GetData(fdata* record)
{
  byte value;                       /* WHAT A MESS!!!!! */
  (*record).bufpoint&=0x3fff;
  if (!((*record).bufpoint)) (*record).xferred+=read((*record).handle,(*record).buffer,sizeof((*record).buffer));
  value=(*record).buffer[(*record).bufpoint];
  (*record).bufpoint++;
  filepos++;
  if (filepos>inpfile.length && blocktype) blocktype=0;
  return value;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andl $0x3fff, 0x100(%rdi)    # imm = 0x3FFF
jne 0x1de0
movzbl (%rbx), %edi
leaq 0x118(%rbx), %rsi
movl $0x4000, %edx           # imm = 0x4000
callq 0x1110
addq %rax, 0x110(%rbx)
movl 0x100(%rbx), %ecx
movb 0x118(%rbx,%rcx), %al
incl %ecx
movl %ecx, 0x100(%rbx)
movq 0xd3ec(%rip), %rcx      # 0xf1e8
incq %rcx
movq %rcx, 0xd3e2(%rip)      # 0xf1e8
cmpq 0xd57b(%rip), %rcx      # 0xf388
jbe 0x1e1f
cmpb $0x0, 0x198ab(%rip)     # 0x1b6c1
je 0x1e1f
movb $0x0, 0x198a2(%rip)     # 0x1b6c1
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: PutData
void PutData(fdata* record,byte value,word dimension)
{
  word count;                                  /* WHAT A MESS!!!!! */
  for (count=0; count<dimension; count++)
      {
	(*record).buffer[((*record).bufpoint)]=value;
	(*record).bufpoint++;
	(*record).bufpoint&=0x3fff;
	if (!(*record).bufpoint)
	   (*record).xferred+=write((*record).handle,(*record).buffer,sizeof(*record).buffer);
      }
}

// Assembly:
testl %edx, %edx
je 0x1e7f
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x118(%rdi), %r15
movl 0x100(%r14), %eax
movb %bpl, 0x118(%r14,%rax)
incl %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl %eax, 0x100(%r14)
jne 0x1e71
movzbl (%r14), %edi
movl $0x4000, %edx           # imm = 0x4000
movq %r15, %rsi
callq 0x1080
addq %rax, 0x110(%r14)
decl %ebx
jne 0x1e3a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ReadVOCBlock
void ReadVOCBlock(void)
{
  blocktype=GetData(&inpfile);
  if (!blocktype) return;
  if (blocktype>8)
     Error(5);
  switch (blocktype)
	 {
	 case 1  : ProcessVOCData(); break;
	 case 2  : ProcessContinue(); break;
	 case 3  : ProcessSilence(); break;
	 case 4  : ProcessMarker(); break;
	 case 5  : ProcessASCII(); break;
	 case 8  : ProcessExtended(); break;
	 default : printf("\nSorry, block type %d of VOC files is not yet supported\n\n",blocktype);
		   CloseFiles();
		   exit(1);
	 }
}

// Assembly:
pushq %rax
leaq 0xd223(%rip), %rdi      # 0xf280
callq 0x1db5
movb %al, 0x19659(%rip)      # 0x1b6c1
testb %al, %al
je 0x2095
cmpb $0x9, %al
jae 0x20b5
movzbl 0x1964a(%rip), %esi     # 0x1b6c1
leal -0x1(%rsi), %eax
cmpl $0x7, %eax
ja 0x20bf
leaq 0x902a(%rip), %rcx      # 0xb0b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
popq %rax
jmp 0x2159
popq %rax
retq
popq %rax
jmp 0x2343
popq %rax
jmp 0x220f
popq %rax
jmp 0x2389
popq %rax
jmp 0x2255
popq %rax
jmp 0x22fd
movl $0x5, %edi
callq 0x140c
leaq 0x9538(%rip), %rdi      # 0xb5fe
xorl %eax, %eax
callq 0x10b0
callq 0x15c4
movl $0x1, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ReadVOCData
byte ReadVOCData(void)
{
  if (!(blocklength-processed))
  do {
       processed=0;
       ReadVOCBlock();
       if (!blocktype) return 0;
     }
  while (blocktype==8 || blocktype==3);
  processed++;
  if (blocktype==8 || blocktype==3) processed+=3;
  totalread++;
  return(GetData(&inpfile));
}

// Assembly:
movq 0xd0dd(%rip), %rax      # 0xf1c0
cmpq 0xd0de(%rip), %rax      # 0xf1c8
jne 0x2118
pushq %rax
movq $0x0, 0xd0d0(%rip) # 0xf1c8
callq 0x2055
movzbl 0x195bd(%rip), %eax     # 0x1b6c1
cmpl $0x3, %eax
je 0x20ed
cmpl $0x8, %eax
je 0x20ed
testl %eax, %eax
leaq 0x8(%rsp), %rsp
jne 0x2118
retq
movq 0xd0a9(%rip), %rax      # 0xf1c8
leaq 0x1(%rax), %rcx
movq %rcx, 0xd09e(%rip)      # 0xf1c8
movzbl 0x19590(%rip), %ecx     # 0x1b6c1
cmpl $0x8, %ecx
je 0x213b
cmpl $0x3, %ecx
jne 0x2146
addq $0x4, %rax
movq %rax, 0xd082(%rip)      # 0xf1c8
incq 0xd083(%rip)            # 0xf1d0
leaq 0xd12c(%rip), %rdi      # 0xf280
jmp 0x1db5
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ProcessVOCData
void ProcessVOCData(void)
{
  byte brate;
  word timeconst;
  dword data;
  blocklength=(byte)GetData(&inpfile);
  blocklength+=(word)(256*GetData(&inpfile));
  blocklength+=(dword)(65536*GetData(&inpfile));
  blocklength-=2;
  brate=GetData(&inpfile);
  compression=GetData(&inpfile);
  if (compression) { printf("\nSorry, compressed blocks are not yet supported\n\n"); }
  timeconst=65536-(word)(brate*256);
  if (brate>0xd3) timeconst-=0x54;
  samprate=(double)(256000000/timeconst);
  SetTimings();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0xd11d(%rip), %rbx      # 0xf280
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
movq %rax, 0xd04b(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x8, %eax
addq %rax, 0xd036(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x10, %eax
movq 0xd021(%rip), %rcx      # 0xf1c0
addq %rcx, %rax
addq $-0x2, %rax
movq %rax, 0xd013(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1db5
movb %al, 0xd013(%rip)       # 0xf1d8
testb %al, %al
je 0x21d5
leaq 0xa4bd(%rip), %rdi      # 0xc68d
callq 0x1070
cmpb $-0x2c, %bpl
movl $0xffac, %eax           # imm = 0xFFAC
movl $0x10000, %ecx          # imm = 0x10000
cmovael %eax, %ecx
movzbl %bpl, %eax
shll $0x8, %eax
subl %eax, %ecx
movl $0xf424000, %eax        # imm = 0xF424000
xorl %edx, %edx
divl %ecx
cvtsi2ss %eax, %xmm0
movss %xmm0, 0xcfec(%rip)     # 0xf1f0
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2424
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ProcessSilence
void ProcessSilence(void)
{
  byte silrate;
  word sillength,timeconst;
  blocklength=(byte)GetData(&inpfile);
  blocklength+=(word)(256*GetData(&inpfile));
  blocklength+=(dword)(65536*GetData(&inpfile));
  sillength=(byte)GetData(&inpfile);
  sillength+=(word)(256*GetData(&inpfile));
  silrate=GetData(&inpfile);
  timeconst=65536-(word)(silrate*256);
  silence=sillength/((double)256000000/timeconst)*1000;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0xd020(%rip), %rbx      # 0xf280
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
movq %rax, 0xcf4e(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x8, %eax
addq %rax, 0xcf39(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x10, %eax
addq %rax, 0xcf24(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %ebp
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %r14d
shll $0x8, %r14d
orl %ebp, %r14d
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x8, %eax
movl $0x10000, %ecx          # imm = 0x10000
subl %eax, %ecx
cvtsi2sd %r14d, %xmm0
cvtsi2sd %ecx, %xmm1
movsd 0x8f90(%rip), %xmm2     # 0xb270
divsd %xmm1, %xmm2
divsd %xmm2, %xmm0
mulsd 0x8f88(%rip), %xmm0     # 0xb278
movsd %xmm0, 0xcee8(%rip)     # 0xf1e0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ProcessExtended
void ProcessExtended(void)
{
  word timeconst;
  blocklength=(byte)GetData(&inpfile);
  blocklength+=(word)(256*GetData(&inpfile));
  blocklength+=(dword)(65536*GetData(&inpfile));
  timeconst=GetData(&inpfile);
  timeconst+=256*(GetData(&inpfile));
  if (GetData(&inpfile)) Error(6);
  if (GetData(&inpfile))
     {
       printf("\nSorry, stereo VOC files are not yet supported\n\n");
       CloseFiles();
       exit(1);
     }
  SetTimings();
}

// Assembly:
pushq %rbx
leaq 0xceef(%rip), %rbx      # 0xf280
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
movq %rax, 0xce1d(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x8, %eax
addq %rax, 0xce08(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x10, %eax
addq %rax, 0xcdf3(%rip)      # 0xf1c0
movq %rbx, %rdi
callq 0x1db5
movq %rbx, %rdi
callq 0x1db5
movq %rbx, %rdi
callq 0x1db5
testb %al, %al
jne 0x23ff
leaq 0xce90(%rip), %rdi      # 0xf280
callq 0x1db5
testb %al, %al
jne 0x2409
popq %rbx
jmp 0x2424
movl $0x6, %edi
callq 0x140c
leaq 0xa2ae(%rip), %rdi      # 0xc6be
callq 0x1070
callq 0x15c4
movl $0x1, %edi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: SetTimings
void SetTimings(void)
{
  TuneRates(&pilot);
  TuneRates(&syncx);
  TuneRates(&bit0);
  TuneRates(&bit1);
}

// Assembly:
pushq %rax
leaq 0x1930c(%rip), %rdi     # 0x1b738
callq 0x2456
leaq 0x19320(%rip), %rdi     # 0x1b758
callq 0x2456
leaq 0x19334(%rip), %rdi     # 0x1b778
callq 0x2456
leaq 0x19348(%rip), %rdi     # 0x1b798
popq %rax
jmp 0x2456
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: TuneRates
void TuneRates(wdata* record)
{
 if (samprate && (*record).freq)
    {
      (*record).tstates=(word)(3500000/(2*(*record).freq));
      (*record).samples=(double)(samprate/(*record).freq); //-((*record).freq/100*correction)));
      (*record).rfreq=(float)(samprate/(*record).samples);
    }
}

// Assembly:
movss 0xcd92(%rip), %xmm0     # 0xf1f0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2468
jnp 0x24b5
movsd (%rdi), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x2478
jnp 0x24b5
movapd %xmm1, %xmm2
addsd %xmm1, %xmm2
movsd 0x8df8(%rip), %xmm3     # 0xb280
divsd %xmm2, %xmm3
cvttsd2si %xmm3, %rax
movl %eax, 0x18(%rdi)
cvtss2sd %xmm0, %xmm0
movaps %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x10(%rdi)
divsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: WriteTZXPulseSequence
void WriteTZXPulseSequence(byte pulsenum)
{
  byte count;
  pulses[1]=pulsenum;
  for (count=0; count<sizeof(pulses); count++) PutData(&outfile,pulses[count],1);
  for (count=0; count<pulsenum; count++)
      {
	PutData(&outfile,Lo(pulseseq[count]),1);
	PutData(&outfile,Hi(pulseseq[count]),1);
      }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movb %bl, 0xbdf5(%rip)       # 0xf179
xorl %r15d, %r15d
leaq 0xbdea(%rip), %r12      # 0xf178
leaq 0x10003(%rip), %r14     # 0x13398
movzbl (%r15,%r12), %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1e21
incq %r15
cmpq $0x1, %r15
je 0x3395
testb %bl, %bl
je 0x33fb
movzbl %bl, %r14d
shll $0x2, %r14d
xorl %r15d, %r15d
leaq 0x183fa(%rip), %r12     # 0x1b7c0
leaq 0xffcb(%rip), %rbx      # 0x13398
movzbl (%r15,%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x1e21
movzbl 0x1(%r15,%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x1e21
addq $0x4, %r15
cmpq %r15, %r14
jne 0x33cd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: FindPause
dword FindPause(void)
{
  dword hpulse;
  double detfreq;
  PushFilePointers();
  FindingPause=1;
  printf("Finding pause...     \x0d");
//  do detfreq=BeepSearch(50);
//  while (abs(detfreq-808)>150 && blocktype);
//  if (!blocktype) return 0;
  hpulse=PilotSearch(50)/ecf;
  FindingPause=0;
  if (blocktype)
     {
       PopFilePointers();
       lseek(inpfile.handle,filepos,SEEK_SET);
       inpfile.bufpoint=0;
     }
  printf("                     \x0d");
  if (silence) { mspause+=silence; silence=0; }

  return hpulse;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
callq 0x165a
movb $0x1, 0xad21(%rip)      # 0xf1ba
leaq 0x7518(%rip), %rdi      # 0xb9b8
xorl %eax, %eax
callq 0x10b0
movl $0x32, %edi
callq 0x2bfc
movq %rax, %rbx
movsd 0xac3c(%rip), %xmm0     # 0xf0f8
movsd %xmm0, 0x8(%rsp)
movb $0x0, 0xacf1(%rip)      # 0xf1ba
cmpb $0x0, 0x171f1(%rip)     # 0x1b6c1
je 0x44f6
callq 0x16fb
movzbl 0xada2(%rip), %edi      # 0xf280
movq 0xad03(%rip), %rsi      # 0xf1e8
xorl %edx, %edx
callq 0x10d0
movl $0x0, 0xae8a(%rip)      # 0xf380
leaq 0x74d2(%rip), %rdi      # 0xb9cf
xorl %eax, %eax
callq 0x10b0
movsd 0xacd4(%rip), %xmm0     # 0xf1e0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4518
jnp 0x4533
addsd 0xad00(%rip), %xmm0     # 0xf220
movsd %xmm0, 0xacf8(%rip)     # 0xf220
movq $0x0, 0xacad(%rip) # 0xf1e0
movq %rbx, %xmm0
punpckldq 0x6ed0(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6ed8(%rip), %xmm0     # 0xb420
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
subsd 0x6d9e(%rip), %xmm1     # 0xb308
cvttsd2si %xmm1, %rax
sarq $0x3f, %rdx
andq %rdx, %rax
orq %rcx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: GetBleeploadInfo
void GetBleeploadInfo(word length)
{
  word count;
  PushFilePointers();
  ResetTempFile();
  GetData(&tempfile);
  for (count=0; count<length; count++) { bleepblock[count]=GetData(&tempfile); }
  nxtloadpos=bleepblock[0x102]+256*bleepblock[0x103];
  expectedlength=0x109+(bleepblock[0x104+bleepblock[0x104]+4]&7)+3;
  ResetTempFile();
  PopFilePointers();
//  RecoverFilePointers();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x165a
callq 0x161f
leaq 0x1270a(%rip), %rdi     # 0x174b8
callq 0x1db5
testl %ebx, %ebx
je 0x4ddf
movl %ebx, %r14d
xorl %r15d, %r15d
leaq 0x126f4(%rip), %rbx     # 0x174b8
leaq 0x16e45(%rip), %r12     # 0x1bc10
movq %rbx, %rdi
callq 0x1db5
movb %al, (%r15,%r12)
incq %r15
cmpq %r15, %r14
jne 0x4dcb
leaq 0x16e2a(%rip), %rax     # 0x1bc10
movzwl 0x16f25(%rip), %ecx     # 0x1bd12
movl %ecx, 0xa41d(%rip)      # 0xf210
movzbl 0x16f1a(%rip), %ecx     # 0x1bd14
movzbl 0x108(%rcx,%rax), %eax
andl $0x7, %eax
addl $0x10c, %eax            # imm = 0x10C
movl %eax, 0xa404(%rip)      # 0xf214
callq 0x161f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x16fb
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: SearchBleeploadGroup3
byte SearchBleeploadGroup3(void)
{
  PushFilePointers();
  expectedlength=0x10b;
  searching=1;
  ReadBleeploadBlock();
  searching=0;
  if (!blocktype) return blocktype;
  PopFilePointers();
  lseek(inpfile.handle,filepos,SEEK_SET);
  inpfile.bufpoint=0;
  return DataLoadOK;
}

// Assembly:
pushq %rax
callq 0x165a
movl $0x10b, 0x98c8(%rip)    # imm = 0x10B
movb $0x1, 0x98df(%rip)      # 0xf232
callq 0x4aaf
movb $0x0, 0x98d3(%rip)      # 0xf232
cmpb $0x0, 0x15d5b(%rip)     # 0x1b6c1
je 0x5994
callq 0x16fb
movzbl 0x990c(%rip), %edi      # 0xf280
movq 0x986d(%rip), %rsi      # 0xf1e8
xorl %edx, %edx
callq 0x10d0
movl $0x0, 0x99f4(%rip)      # 0xf380
movb 0x16257(%rip), %al      # 0x1bbe9
jmp 0x5996
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: StoreBleeploadCode
void StoreBleeploadCode(word length)
{
  word count;
  PushFilePointers();
  if (length>512) Error(14);
  ResetTempFile();
  GetData(&tempfile);
  for (count=0; count<length; count++)
      { bleeploader[count]=GetData(&tempfile); }
  for (count=1; count<length-3; count++)
      {
	if (bleeploader[count]==0x32 && bleeploader[count+1]==0x15 && bleeploader[count+2]==0xff)
	   { expectedlength=0x109+2+bleeploader[count-1]; break;}
      }
  ResetTempFile();
  PopFilePointers();
//  RecoverFilePointers();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edi, %ebx
callq 0x165a
cmpl $0x201, %ebx            # imm = 0x201
jae 0x5a4c
callq 0x161f
leaq 0x11af8(%rip), %rdi     # 0x174b8
callq 0x1db5
testl %ebx, %ebx
je 0x59f1
movl %ebx, %r15d
xorl %r12d, %r12d
leaq 0x11ae2(%rip), %r14     # 0x174b8
leaq 0x16353(%rip), %r13     # 0x1bd30
movq %r14, %rdi
callq 0x1db5
movb %al, (%r12,%r13)
incq %r12
cmpq %r12, %r15
jne 0x59dd
addl $-0x3, %ebx
cmpl $0x2, %ebx
jb 0x5a39
movl %ebx, %eax
decq %rax
xorl %edx, %edx
leaq 0x16329(%rip), %rcx     # 0x1bd30
cmpb $0x32, 0x1(%rdx,%rcx)
jne 0x5a1e
cmpb $0x15, 0x2(%rdx,%rcx)
jne 0x5a1e
leal 0x3(%rdx), %esi
cmpb $-0x1, (%rsi,%rcx)
je 0x5a28
incq %rdx
cmpq %rdx, %rax
jne 0x5a07
jmp 0x5a39
movl %edx, %eax
movzbl (%rax,%rcx), %eax
addl $0x10b, %eax            # imm = 0x10B
movl %eax, 0x97db(%rip)      # 0xf214
callq 0x161f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x16fb
movl $0xe, %edi
callq 0x140c
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ReadSoftlockFirstBlock
word ReadSoftlockFirstBlock(void)
{
  dword loaded;
  pilot.freq=808;
  syncx.freq=2450;
  bit0.freq=2600;
  bit1.freq=1300;
  SetTimings();
  pilotlength=0;
  DataLoadOK=0;
  while (!DataLoadOK)
	{
	  PilotSearch(256);
	  if (!blocktype) return 0; if (!PilotLinkingOK) { pilotlength=0; return 0;}
	  mspause=0;
	  SyncSearch();
	  if (!blocktype) return 0; if (!SyncLoadOK) return 0;
	  loaded=DataRead(bit0.samples,bit1.samples,expectedlength);
	}
  return loaded;
}

// Assembly:
pushq %rbx
movabsq $0x4089400000000000, %rax # imm = 0x4089400000000000
movq %rax, 0x15cd0(%rip)     # 0x1b738
movabsq $0x40a3240000000000, %rax # imm = 0x40A3240000000000
movq %rax, 0x15cdf(%rip)     # 0x1b758
movabsq $0x40a4500000000000, %rax # imm = 0x40A4500000000000
movq %rax, 0x15cee(%rip)     # 0x1b778
movabsq $0x4094500000000000, %rax # imm = 0x4094500000000000
movq %rax, 0x15cfd(%rip)     # 0x1b798
callq 0x2424
movq $0x0, 0x16135(%rip) # 0x1bbe0
movb $0x0, 0x16137(%rip)     # 0x1bbe9
movl $0x100, %edi            # imm = 0x100
callq 0x2bfc
xorl %ebx, %ebx
cmpb $0x0, 0x15bfc(%rip)     # 0x1b6c1
je 0x5b26
cmpb $0x0, 0x1610a(%rip)     # 0x1bbd8
je 0x5b1b
movq $0x0, 0x9745(%rip) # 0xf220
callq 0x2f5c
cmpb $0x0, 0x15bda(%rip)     # 0x1b6c1
je 0x5b26
cmpb $0x0, 0x15cca(%rip)     # 0x1b7ba
je 0x5b26
movsd 0x15c8e(%rip), %xmm0    # 0x1b788
movsd 0x15ca6(%rip), %xmm1    # 0x1b7a8
movl 0x970c(%rip), %edi      # 0xf214
callq 0x39c9
cmpb $0x0, 0x160d5(%rip)     # 0x1bbe9
je 0x5ab2
movq %rax, %rbx
jmp 0x5b26
movq $0x0, 0x160ba(%rip) # 0x1bbe0
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: FindAlkatrazLoader1
word FindAlkatrazLoader1(word limit)
{
  byte lastval;
  word count,position,offset;
  PushFilePointers();
  ResetTempFile();
  for (count=0; count<limit; count++)
      {
	if ((lastval=GetData(&tempfile))==0xea && count>127) break;
      }
  do { lastval=GetData(&tempfile); }
  while (lastval!=0x11);
  position=GetData(&tempfile);
  position+=256*GetData(&tempfile)+1;
  if (position<61440) offset=0x190;
  else offset=0x200;
  position-=offset;
  ResetTempFile();
  PopFilePointers();
  lseek(inpfile.handle,filepos,SEEK_SET);
  inpfile.bufpoint=0;
  return position;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
callq 0x165a
callq 0x161f
testl %ebx, %ebx
je 0x5b6f
decl %ebx
xorl %r15d, %r15d
leaq 0x1196d(%rip), %r14     # 0x174b8
movq %r14, %rdi
callq 0x1db5
cmpb $-0x16, %al
sete %al
cmpl $0x7f, %r15d
seta %cl
testb %al, %cl
jne 0x5b6f
leal 0x1(%r15), %eax
cmpl %r15d, %ebx
movl %eax, %r15d
jne 0x5b4b
leaq 0x11942(%rip), %rbx     # 0x174b8
movq %rbx, %rdi
callq 0x1db5
cmpb $0x11, %al
jne 0x5b76
leaq 0x1192f(%rip), %rbx     # 0x174b8
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %r14d
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x8, %eax
leal (%r14,%rax), %ecx
incl %ecx
cmpl $0xf000, %ecx           # imm = 0xF000
leal -0x18f(%r14,%rax), %ecx
leal -0x1ff(%r14,%rax), %ebx
cmovbl %ecx, %ebx
callq 0x161f
callq 0x16fb
movzbl 0x96ad(%rip), %edi      # 0xf280
movq 0x960e(%rip), %rsi      # 0xf1e8
xorl %edx, %edx
callq 0x10d0
movl $0x0, 0x9795(%rip)      # 0xf380
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ReadAlkatrazBlock
dword ReadAlkatrazBlock(void)
{
  dword loaded;
  pilot.freq=808;
  syncx.freq=2450;
  bit0.freq=3100;
  bit1.freq=1550;
  SetTimings();
  pilotlength=0;
  DataLoadOK=0;
  while (!DataLoadOK)
	{
	  PilotSearch(50);
	  if (!blocktype) return 0; if (!PilotLinkingOK) { pilotlength=0; return 0;}
	  mspause=0;
	  SyncSearch();
	  if (!blocktype) return 0; if (!SyncLoadOK) return 0;
	  loaded=DataRead(bit0.samples,bit1.samples,expectedlength);
	  if (blocktype) mspause+=(FindPause()/samprate)*1000;
	}
  return loaded;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movabsq $0x4089400000000000, %rax # imm = 0x4089400000000000
movq %rax, 0x15b30(%rip)     # 0x1b738
movabsq $0x40a3240000000000, %rax # imm = 0x40A3240000000000
movq %rax, 0x15b3f(%rip)     # 0x1b758
movabsq $0x40a8380000000000, %rax # imm = 0x40A8380000000000
movq %rax, 0x15b4e(%rip)     # 0x1b778
movabsq $0x4098380000000000, %rax # imm = 0x4098380000000000
movq %rax, 0x15b5d(%rip)     # 0x1b798
callq 0x2424
movq $0x0, 0x15f95(%rip) # 0x1bbe0
movb $0x0, 0x15f97(%rip)     # 0x1bbe9
xorl %ebx, %ebx
movl $0x32, %edi
callq 0x2bfc
cmpb $0x0, 0x15a5c(%rip)     # 0x1b6c1
je 0x5d38
cmpb $0x0, 0x15f66(%rip)     # 0x1bbd8
je 0x5d2b
movq $0x0, 0x959d(%rip) # 0xf220
callq 0x2f5c
cmpb $0x0, 0x15a32(%rip)     # 0x1b6c1
je 0x5d38
cmpb $0x0, 0x15b1e(%rip)     # 0x1b7ba
je 0x5d38
movsd 0x15ade(%rip), %xmm0    # 0x1b788
movsd 0x15af6(%rip), %xmm1    # 0x1b7a8
movl 0x955c(%rip), %edi      # 0xf214
callq 0x39c9
movq %rax, %r14
cmpb $0x0, 0x159fa(%rip)     # 0x1b6c1
je 0x5d19
callq 0x4488
testq %rax, %rax
js 0x5cdd
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x5cf5
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x94f3(%rip), %xmm0     # 0xf1f0
mulss 0x56df(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0x950f(%rip), %xmm0     # 0xf220
movsd %xmm0, 0x9507(%rip)     # 0xf220
cmpb $0x0, 0x15ec9(%rip)     # 0x1bbe9
je 0x5c54
movq %r14, %rbx
jmp 0x5d38
movq $0x0, 0x15eaa(%rip) # 0x1bbe0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ReadSpeedlock13FirstBlock
word ReadSpeedlock13FirstBlock(void)
{
  word loaded;
  pilotlength=0;
  DataLoadOK=0;
  while (!DataLoadOK)
	{
	  PushFilePointers();
	  pilotlength=ClickingPilotSearch();
	  if (!blocktype || !ClickingPilotOK) return 0;
	  mspause=0;
	  ReadSpeedlockFlag(bit0.samples,bit1.samples);
	  if (!blocktype) return 0;
	  loaded=DataRead(bit0.samples,bit1.samples,expectedlength);
	  if (blocktype && blocks<=blockskip+1 || slocktype==1) mspause+=(FindPause()/samprate)*1000;
	}

  return loaded;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq $0x0, 0x15e8f(%rip) # 0x1bbe0
movb $0x0, 0x15e91(%rip)     # 0x1bbe9
movl $0xff, %ebp
callq 0x165a
callq 0x2918
movq %rax, 0x15e72(%rip)     # 0x1bbe0
xorl %ebx, %ebx
cmpb $0x0, 0x1594a(%rip)     # 0x1b6c1
je 0x5e58
cmpb $0x0, 0x15a35(%rip)     # 0x1b7b9
je 0x5e58
cvttsd2si 0x159f6(%rip), %edi # 0x1b788
cvttsd2si 0x15a0e(%rip), %esi # 0x1b7a8
movq $0x0, 0x947b(%rip) # 0xf220
andl %ebp, %edi
andl %ebp, %esi
callq 0x5e61
cmpb $0x0, 0x1590c(%rip)     # 0x1b6c1
je 0x5e58
movsd 0x159c5(%rip), %xmm0    # 0x1b788
movsd 0x159dd(%rip), %xmm1    # 0x1b7a8
movl 0x9443(%rip), %edi      # 0xf214
callq 0x39c9
movq %rax, %rbx
cmpb $0x0, 0x158e1(%rip)     # 0x1b6c1
je 0x5df2
movl 0x9444(%rip), %eax      # 0xf22c
incl %eax
cmpl %eax, 0x9438(%rip)      # 0xf228
jbe 0x5dfb
cmpb $0x1, 0x93bb(%rip)      # 0xf1b4
jne 0x5e4b
callq 0x4488
testq %rax, %rax
js 0x5e0f
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x5e27
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x93c1(%rip), %xmm0     # 0xf1f0
mulss 0x55ad(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0x93dd(%rip), %xmm0     # 0xf220
movsd %xmm0, 0x93d5(%rip)     # 0xf220
cmpb $0x0, 0x15d97(%rip)     # 0x1bbe9
je 0x5d5d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ReadSpeedlockFlag
void ReadSpeedlockFlag(byte bit0,byte bit1)
{
  byte count,value=0,tolerance,maxpulse;/*=bit1+bit0-tolerance;*/
  word pulse;
/*  if (maxpulse>pilot.samples) */
  if (spdchk) { bit0*=ecf; bit1*=ecf; }
  tolerance=(bit1-bit0)/2;
  maxpulse=bit1+(pilot.samples-bit1)/2;
  for (count=0; count<slockflagbits+1; count++)
      {
	pulse=FindEdge2();
	if ((pulse<=bit0+tolerance) && (pulse>=bit0-tolerance)) value<<=1;
	else if ((pulse<=maxpulse) && (pulse>=bit1-tolerance)) { value<<=1; value|=0x01; }
	     else if (pulse>maxpulse) { strcpy(errstring,"Pulse too long"); Error(8);}
      }
  value<<=7-slockflagbits;
  slockflag=value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
shll $0x8, %esi
orl %edi, %esi
cmpb $0x0, 0x9341(%rip)      # 0xf1b9
movd %esi, %xmm0
je 0x5eaa
pxor %xmm1, %xmm1
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
cvtdq2pd %xmm0, %xmm0
movsd 0x9262(%rip), %xmm1     # 0xf0f8
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm0, %xmm1
cvttpd2dq %xmm1, %xmm0
packuswb %xmm0, %xmm0
packuswb %xmm0, %xmm0
movd %xmm0, %ebx
movl %ebx, %ebp
shrl $0x8, %ebp
movl $0xff, %eax
andl %eax, %ebp
andl %eax, %ebx
movl %ebp, %ecx
subl %ebx, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd 0x15874(%rip), %xmm1    # 0x1b748
subsd %xmm0, %xmm1
mulsd 0x53f0(%rip), %xmm1     # 0xb2d0
addl %ecx, %edx
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %r14d
shrl %edx
andl %eax, %edx
leal (%rdx,%rbx), %r15d
subl %edx, %ebx
andl %eax, %r14d
subl %edx, %ebp
xorl %r12d, %r12d
xorl %r13d, %r13d
callq 0x2648
cmpl %eax, %r15d
jb 0x5f13
cmpl %eax, %ebx
ja 0x5f13
addb %r13b, %r13b
jmp 0x5f29
cmpl %r14d, %eax
ja 0x5f24
cmpl %eax, %ebp
ja 0x5f24
addb %r13b, %r13b
incb %r13b
jmp 0x5f29
cmpl %r14d, %eax
ja 0x5f57
incb %r12b
movzbl 0x91f9(%rip), %eax      # 0xf12c
cmpb %r12b, %al
jae 0x5f00
movzbl %r13b, %edx
movb $0x7, %cl
subb %al, %cl
shll %cl, %edx
movb %dl, 0x9304(%rip)       # 0xf24c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $0x676e6f6c206f6f, %rax # imm = 0x676E6F6C206F6F
movq %rax, 0x1577f(%rip)     # 0x1b6e7
movabsq $0x6f742065736c7550, %rax # imm = 0x6F742065736C7550
movq %rax, 0x15767(%rip)     # 0x1b6e0
movl $0x8, %edi
callq 0x140c
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ReadSpeedlock47FirstBlock
word ReadSpeedlock47FirstBlock(void)
{
  word loaded;
  pilotlength=0;
  DataLoadOK=0;
  while (!DataLoadOK)
	{

	  do {
	       PilotSearch(32);
	       if (!blocktype) return 0;
	       if (!PilotLinkingOK) { pilotlength=0; }
	     }
	  while (!PilotLinkingOK);
	  mspause=0;
	  do
	     {
	       SyncSearch();
	       if (!blocktype) return 0;
	     }
	  while (!SyncLoadOK);

/*        PilotSearch(32);
	  if (!blocktype) return 0; if (!PilotLinkingOK) { pilotlength=0; return 0; }
	  mspause=0;
	  SyncSearch();
	  if (!blocktype) return 0; if (!SyncLoadOK) return 0; */
	  CompositeSyncSearch();
	  if (!blocktype) return 0;
	  ReadSpeedlockFlag(bit0.samples,bit1.samples);
	  if (!blocktype) return 0;
	  loaded=DataRead(bit0.samples,bit1.samples,expectedlength);
	  if (blocktype && blocks<=blockskip+1) mspause+=(FindPause()/samprate)*1000;
	}

  return loaded;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq $0x0, 0x15c4f(%rip) # 0x1bbe0
movb $0x0, 0x15c51(%rip)     # 0x1bbe9
movl $0xff, %ebp
movl $0x20, %edi
callq 0x2bfc
xorl %ebx, %ebx
cmpb $0x0, 0x15711(%rip)     # 0x1b6c1
je 0x60c8
cmpb $0x0, 0x15c1b(%rip)     # 0x1bbd8
jne 0x5fd6
movq $0x0, 0x15c16(%rip) # 0x1bbe0
movl $0x20, %edi
callq 0x2bfc
jmp 0x5fa9
movq $0x0, 0x923f(%rip) # 0xf220
callq 0x2f5c
cmpb $0x0, 0x156d4(%rip)     # 0x1b6c1
je 0x60c8
cmpb $0x0, 0x157c0(%rip)     # 0x1b7ba
je 0x5fe1
callq 0x60d1
cmpb $0x0, 0x156b9(%rip)     # 0x1b6c1
je 0x60c8
cvttsd2si 0x15772(%rip), %edi # 0x1b788
cvttsd2si 0x1578a(%rip), %esi # 0x1b7a8
andl %ebp, %edi
andl %ebp, %esi
callq 0x5e61
cmpb $0x0, 0x15693(%rip)     # 0x1b6c1
je 0x60c8
movsd 0x1574c(%rip), %xmm0    # 0x1b788
movsd 0x15764(%rip), %xmm1    # 0x1b7a8
movl 0x91ca(%rip), %edi      # 0xf214
callq 0x39c9
movq %rax, %rbx
cmpb $0x0, 0x15668(%rip)     # 0x1b6c1
je 0x60bb
movl 0x91cb(%rip), %eax      # 0xf22c
incl %eax
cmpl %eax, 0x91bf(%rip)      # 0xf228
ja 0x60bb
callq 0x4488
testq %rax, %rax
js 0x607f
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x6097
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x9151(%rip), %xmm0     # 0xf1f0
mulss 0x533d(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0x916d(%rip), %xmm0     # 0xf220
movsd %xmm0, 0x9165(%rip)     # 0xf220
cmpb $0x0, 0x15b27(%rip)     # 0x1bbe9
je 0x5f9d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: CompositeSyncSearch
void CompositeSyncSearch(void)
{
  byte count,tolerance;
  dword pulse;
  for (count=0; count<7; count++)
      {
	syncx.freq=compositesync[count];
	SetTimings();
	tolerance=syncx.samples/3;
	pulse=FindEdge2();
	if (!blocktype) return;
	if (pulse<(int)syncx.samples-tolerance || pulse>(int)syncx.samples+tolerance)
	   { strcpy(errstring,"Bad sync detection or corrupted composite-sync"); Error(8); }
      }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x9032(%rip), %r14      # 0xf110
movl (%rbx,%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x15666(%rip)    # 0x1b758
callq 0x2424
movsd 0x15669(%rip), %xmm0    # 0x1b768
movsd %xmm0, (%rsp)
callq 0x2648
cmpb $0x0, 0x155b1(%rip)     # 0x1b6c1
je 0x614e
movsd (%rsp), %xmm0
divsd 0x5169(%rip), %xmm0     # 0xb288
cvttsd2si %xmm0, %edx
cvttsd2si 0x1563d(%rip), %ecx # 0x1b768
movzbl %dl, %edx
movl %ecx, %esi
subl %edx, %esi
movslq %esi, %rsi
cmpq %rsi, %rax
jb 0x6156
addl %edx, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
ja 0x6156
addq $0x4, %rbx
cmpq $0x1c, %rbx
jne 0x60de
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movups 0x58e8(%rip), %xmm0     # 0xba45
movups %xmm0, 0x1559b(%rip)    # 0x1b6ff
movups 0x58cb(%rip), %xmm0     # 0xba36
movaps %xmm0, 0x1557e(%rip)    # 0x1b6f0
movups 0x58ad(%rip), %xmm0     # 0xba26
movaps %xmm0, 0x15560(%rip)    # 0x1b6e0
movl $0x8, %edi
callq 0x140c
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: WriteTZXPureData
void WriteTZXPureData(byte lastbyte,dword datalen)
{
  dword count;
  puredata[1]=Lo(bit0.tstates); puredata[2]=Hi(bit0.tstates);
  puredata[3]=Lo(bit1.tstates); puredata[4]=Hi(bit1.tstates);
  puredata[5]=lastbyte;
  if (!saveslockflag) { puredata[6]=Lo(mspause); puredata[7]=Hi(mspause); }
  else puredata[6]=puredata[7]=0;
  puredata[8]=Lo(datalen); puredata[9]=Hi(datalen); puredata[10]=Ehi(datalen);
  for (count=0; count<sizeof(puredata); count++) PutData(&outfile,puredata[count],1);
  if (saveslockflag) PutData(&outfile,slockflag,1);
  else if (savemidsync)
	  { for (count=0; count<datalen; count++) PutData(&outfile,midsync[count],1); }
       else {
	      PushFilePointers();
	      ResetTempFile();
	      for (count=0; count<datalen; count++)
		  { PutData(&outfile,GetData(&tempfile),1); }
	      PopFilePointers();
	      lseek(inpfile.handle,filepos,SEEK_SET);
	      inpfile.bufpoint=0;
	    }
  ResetTempFile();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movzwl 0x1533c(%rip), %eax     # 0x1b790
movw %ax, 0x8d20(%rip)       # 0xf17b
movl 0x1534f(%rip), %eax     # 0x1b7b0
movb %al, 0x8d16(%rip)       # 0xf17d
movb %ah, 0x8d11(%rip)       # 0xf17e
movb %dil, 0x8d0b(%rip)      # 0xf17f
cmpb $0x0, 0x8dd2(%rip)      # 0xf24d
je 0x6488
movw $0x0, 0x8cfa(%rip)      # 0xf180
jmp 0x64b4
movsd 0x8d90(%rip), %xmm0     # 0xf220
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x4e68(%rip), %xmm0     # 0xb308
cvttsd2si %xmm0, %rdx
sarq $0x3f, %rcx
andl %ecx, %edx
orl %edx, %eax
movw %ax, 0x8ccc(%rip)       # 0xf180
movb %bl, 0x8cc8(%rip)       # 0xf182
movb %bh, 0x8cc3(%rip)       # 0xf183
movq %rbx, %r12
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x8cb6(%rip)       # 0xf184
xorl %r14d, %r14d
leaq 0x8ca2(%rip), %r15      # 0xf17a
leaq 0xceb9(%rip), %rbx      # 0x13398
movzbl (%r14,%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x1e21
incq %r14
cmpq $0xb, %r14
jne 0x64df
cmpb $0x0, 0x8d4c(%rip)      # 0xf24d
je 0x652b
movzbl 0x8d42(%rip), %esi      # 0xf24c
leaq 0xce87(%rip), %rdi      # 0x13398
movl $0x1, %edx
callq 0x1e21
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x161f
cmpb $0x0, 0x8d1c(%rip)      # 0xf24e
je 0x6566
testq %r12, %r12
je 0x651b
xorl %r14d, %r14d
leaq 0x8bea(%rip), %r15      # 0xf12d
leaq 0xce4e(%rip), %rbx      # 0x13398
movzbl (%r14,%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x1e21
incq %r14
cmpq %r14, %r12
jne 0x654a
jmp 0x651b
callq 0x165a
callq 0x161f
testq %r12, %r12
je 0x65a0
leaq 0x10f3c(%rip), %rbx     # 0x174b8
leaq 0xce15(%rip), %r14      # 0x13398
movq %rbx, %rdi
callq 0x1db5
movzbl %al, %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1e21
decq %r12
jne 0x6583
callq 0x16fb
movzbl 0x8cd4(%rip), %edi      # 0xf280
movq 0x8c35(%rip), %rsi      # 0xf1e8
xorl %edx, %edx
callq 0x10d0
movl $0x0, 0x8dbc(%rip)      # 0xf380
jmp 0x651b
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: DecryptToneSearch
void DecryptToneSearch(void)
{
  tonesearch=1;
  pilotlength=BeepSearch(128);
  tonesearch=0;
  mspause+=(FindPause()/samprate)*1000;
}

// Assembly:
pushq %rax
movb $0x1, 0x8c2f(%rip)      # 0xf200
movl $0x80, %edi
callq 0x345d
movl %eax, %eax
movq %rax, 0x155fc(%rip)     # 0x1bbe0
movb $0x0, 0x8c15(%rip)      # 0xf200
callq 0x4488
testq %rax, %rax
js 0x65fc
cvtsi2ss %rax, %xmm0
jmp 0x6611
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x8bd7(%rip), %xmm0     # 0xf1f0
mulss 0x4dc3(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0x8bf3(%rip), %xmm0     # 0xf220
movsd %xmm0, 0x8beb(%rip)     # 0xf220
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: WaveSearch
word WaveSearch(void)
{
  byte maxsmp=(samprate/500)/2;
  word length=0;
  dword pulse,last,read;
  read=pulse=FindEdge1();
  if (!blocktype) return read;
  do {
       last=pulse;
       pulse=FindEdge1();
       if (!blocktype) return read;
       length=(((read+=pulse)/samprate)*1000);
     }
  while ((last-pulse)<maxsmp/4 || length<20);
  return length;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movss 0x8ba8(%rip), %xmm0     # 0xf1f0
movss %xmm0, 0xc(%rsp)
callq 0x24b6
movq %rax, %rbx
cmpb $0x0, 0x15064(%rip)     # 0x1b6c1
je 0x66e9
movss 0xc(%rsp), %xmm0
divss 0x4d6f(%rip), %xmm0     # 0xb3e0
mulss 0x4d6f(%rip), %xmm0     # 0xb3e8
cvttss2si %xmm0, %eax
shrb $0x2, %al
movzbl %al, %r14d
movq %rbx, %r15
callq 0x24b6
cmpb $0x0, 0x1502e(%rip)     # 0x1b6c1
je 0x66ed
addq %rax, %r15
js 0x66a4
xorps %xmm0, %xmm0
cvtsi2ss %r15, %xmm0
jmp 0x66bf
movq %r15, %rcx
shrq %rcx
movl %r15d, %edx
andl $0x1, %edx
orq %rcx, %rdx
xorps %xmm0, %xmm0
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
divss 0x8b29(%rip), %xmm0     # 0xf1f0
mulss 0x4d15(%rip), %xmm0     # 0xb3e4
subq %rax, %rbx
cmpq %r14, %rbx
movq %rax, %rbx
jb 0x6687
cvttss2si %xmm0, %rcx
movq %rax, %rbx
cmpl $0x14, %ecx
jb 0x6687
jmp 0x66f0
movl %ebx, %ecx
jmp 0x66f0
movl %r15d, %ecx
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: FindLoadAddress
void FindLoadAddress(word limit)
{
  byte push=0,found=0,opcode=0;
  word count;
  dword savepos=filepos;
  slockloadaddress=0;
  ResetTempFile();
  do
     {
       for (count=0; ((count<limit) && !found); count++)
	   {
	     if (!found) if ((GetData(&tempfile))==0x19) { found=1;break; }
	   }
       if (!found) Error(11);
       opcode=GetData(&tempfile);
       if (opcode==1)
	  {
	    slockloadaddress+=GetData(&tempfile);
	    slockloadaddress+=256*(GetData(&tempfile));
	  }
       if (opcode==0x11)
	  {
	    slockloadaddress+=GetData(&tempfile);
	    slockloadaddress+=256*(GetData(&tempfile));
	  }
       if (opcode==0xd5) push=1;
     }
  while (!push);
  filepos=savepos;
  lseek(inpfile.handle,filepos,SEEK_SET);
  inpfile.bufpoint=0;
  ResetTempFile();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebp
movq 0x852c(%rip), %rbx      # 0xf1e8
movl $0x0, 0x8572(%rip)      # 0xf238
callq 0x161f
xorl %r15d, %r15d
leaq 0x107e3(%rip), %r14     # 0x174b8
xorl %r12d, %r12d
testl %ebp, %ebp
sete %al
testb %r15b, %r15b
setne %cl
orb %al, %cl
jne 0x6d0f
movl $0x1, %r13d
movq %r14, %rdi
callq 0x1db5
cmpb $0x19, %al
je 0x6d0c
testb %r15b, %r15b
jne 0x6d0f
leal 0x1(%r13), %eax
cmpl %ebp, %r13d
movl %eax, %r13d
jb 0x6ced
jmp 0x6d0f
movb $0x1, %r15b
testb %r15b, %r15b
je 0x6d99
movq %r14, %rdi
callq 0x1db5
cmpb $-0x2b, %al
je 0x6d58
movzbl %al, %eax
cmpl $0x11, %eax
je 0x6d31
cmpl $0x1, %eax
jne 0x6d5b
movq %r14, %rdi
callq 0x1db5
movzbl %al, %eax
addl %eax, 0x84f6(%rip)      # 0xf238
movq %r14, %rdi
callq 0x1db5
movzbl %al, %eax
shll $0x8, %eax
addl %eax, 0x84e2(%rip)      # 0xf238
jmp 0x6d5b
movb $0x1, %r12b
testb %r12b, %r12b
je 0x6cd8
movq %rbx, 0x847d(%rip)      # 0xf1e8
movzbl 0x850e(%rip), %edi      # 0xf280
movq %rbx, %rsi
xorl %edx, %edx
callq 0x10d0
movl $0x0, 0x85fa(%rip)      # 0xf380
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x161f
movl $0xb, %edi
callq 0x140c
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: ReadZetaLoadFirstBlock
word ReadZetaLoadFirstBlock(void)
{
  word loaded;
  pilotlength=0;
  DataLoadOK=0;
  while (!DataLoadOK)
	{
	  PilotSearch(32);
	  if (!blocktype) return 0; if (!PilotLinkingOK) { pilotlength=0; return 0; }
	  mspause=0;
	  SyncSearch();
	  if (!blocktype) return 0; if (!SyncLoadOK) return 0;
	  bit0.freq=2044; bit1.freq=1022; SetTimings();
	  slockflagbits=4;
	  ReadSpeedlockFlag(bit0.samples,bit1.samples);
	  if (!blocktype) return 0;
	  bit0.freq=3100; bit1.freq=1550; SetTimings();
	  loaded=DataRead(bit0.samples,bit1.samples,expectedlength);
	  if (blocktype && blocks<=blockskip+1) mspause+=(FindPause()/samprate)*1000;
	}
  return loaded;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq $0x0, 0x14796(%rip) # 0x1bbe0
movb $0x0, 0x14798(%rip)     # 0x1bbe9
movabsq $0x409ff00000000000, %r14 # imm = 0x409FF00000000000
movabsq $0x408ff00000000000, %r15 # imm = 0x408FF00000000000
movl $0xff, %ebp
movabsq $0x40a8380000000000, %r12 # imm = 0x40A8380000000000
movabsq $0x4098380000000000, %r13 # imm = 0x4098380000000000
movl $0x20, %edi
callq 0x2bfc
xorl %ebx, %ebx
cmpb $0x0, 0x14230(%rip)     # 0x1b6c1
je 0x75c2
cmpb $0x0, 0x1473a(%rip)     # 0x1bbd8
je 0x75b7
movq $0x0, 0x7d71(%rip) # 0xf220
callq 0x2f5c
cmpb $0x0, 0x14206(%rip)     # 0x1b6c1
je 0x75c2
cmpb $0x0, 0x142f2(%rip)     # 0x1b7ba
je 0x75c2
movq %r14, 0x142a3(%rip)     # 0x1b778
movq %r15, 0x142bc(%rip)     # 0x1b798
callq 0x2424
cvttsd2si 0x1429f(%rip), %edi # 0x1b788
cvttsd2si 0x142b7(%rip), %esi # 0x1b7a8
movb $0x4, 0x7c34(%rip)      # 0xf12c
andl %ebp, %edi
andl %ebp, %esi
callq 0x5e61
cmpb $0x0, 0x141b9(%rip)     # 0x1b6c1
je 0x75c2
movq %r12, 0x14263(%rip)     # 0x1b778
movq %r13, 0x1427c(%rip)     # 0x1b798
callq 0x2424
movsd 0x1425f(%rip), %xmm0    # 0x1b788
movsd 0x14277(%rip), %xmm1    # 0x1b7a8
movl 0x7cdd(%rip), %edi      # 0xf214
callq 0x39c9
movq %rax, %rbx
cmpb $0x0, 0x1417b(%rip)     # 0x1b6c1
je 0x75a8
movl 0x7cde(%rip), %eax      # 0xf22c
incl %eax
cmpl %eax, 0x7cd2(%rip)      # 0xf228
ja 0x75a8
callq 0x4488
testq %rax, %rax
js 0x756c
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x7584
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0x7c64(%rip), %xmm0     # 0xf1f0
mulss 0x3e50(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0x7c80(%rip), %xmm0     # 0xf220
movsd %xmm0, 0x7c78(%rip)     # 0xf220
cmpb $0x0, 0x1463a(%rip)     # 0x1bbe9
je 0x747e
jmp 0x75c2
movq $0x0, 0x1461e(%rip) # 0x1bbe0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: WriteTZXNormalBlock
void WriteTZXNormalBlock(word datalen)
{
  word count;
  PushFilePointers();
  stdspeed[1]=Lo(mspause); stdspeed[2]=Hi(mspause);
  stdspeed[3]=Lo(datalen); stdspeed[4]=Hi(datalen);
  for (count=0; count<sizeof(stdspeed); count++) PutData(&outfile,stdspeed[count],1);
  ResetTempFile();
  for (count=0; count<datalen; count++) PutData(&outfile,GetData(&tempfile),1);
  PopFilePointers();
  lseek(inpfile.handle,filepos,SEEK_SET);
  inpfile.bufpoint=0;
  ResetTempFile();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x165a
movsd 0x72b2(%rip), %xmm0     # 0xf220
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
subsd 0x338a(%rip), %xmm0     # 0xb308
sarq $0x3f, %rdx
cvttsd2si %xmm0, %rax
andq %rdx, %rax
orq %rcx, %rax
movb %al, 0x71c6(%rip)       # 0xf159
movb %ah, 0x71c1(%rip)       # 0xf15a
movb %bl, 0x71bc(%rip)       # 0xf15b
movb %bh, 0x71b7(%rip)       # 0xf15c
xorl %r15d, %r15d
leaq 0x71a9(%rip), %r12      # 0xf158
leaq 0xb3e2(%rip), %r14      # 0x13398
movzbl (%r15,%r12), %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1e21
incq %r15
cmpq $0x5, %r15
jne 0x7fb6
callq 0x161f
testl %ebx, %ebx
je 0x8004
leaq 0xf4d7(%rip), %r15      # 0x174b8
leaq 0xb3b0(%rip), %r14      # 0x13398
movq %r15, %rdi
callq 0x1db5
movzbl %al, %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1e21
decl %ebx
jne 0x7fe8
callq 0x16fb
movzbl 0x7270(%rip), %edi      # 0xf280
movq 0x71d1(%rip), %rsi      # 0xf1e8
xorl %edx, %edx
callq 0x10d0
movl $0x0, 0x7358(%rip)      # 0xf380
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x161f