// File: /workspace/github_c_makefile_star2_O2/mincebert[P]maketzx/maketzx.c
// Function: ReadBleeploadBlock
word ReadBleeploadBlock(void)
{
  word loaded=0;
  pilot.freq=808;
  syncx.freq=2450;
  bit0.freq=2044;
  bit1.freq=1022;
  SetTimings();
  pilotlength=0;
  DataLoadOK=0;
//  PushFilePointers();
  do
     do {
//        RemoveFilePointers();
	  pilotlength=0;
	  PilotSearch(50);
	  if (!blocktype) return 0; if (!PilotLinkingOK) { pilotlength=0; break;};
	  mspause=0;
	  SyncSearch();
	  if (!blocktype) return 0;
	  if (!SyncLoadOK)
	     {
	       if (searching) break;
	       if (pilotlength/samprate>0.5) WriteTZXTone(pilot.tstates,(pilotlength/pilot.samples)*2);
	       mspause+=(FindPause()/samprate)*1000;
	       if (mspause && pilotlength/samprate>0.5) WriteTZXPause(mspause);
	       break;
	     }
	  loaded=DataRead(bit0.samples,bit1.samples,expectedlength);
	  if (blocktype && !searching) mspause+=(FindPause()/samprate)*1000;
	}
     while (!DataLoadOK);
  while (!DataLoadOK);
//  PushFilePointers();
  ResetTempFile();
  return loaded;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movabsq $0x4089400000000000, %rax # imm = 0x4089400000000000
movq %rax, 0x1700f(%rip)     # 0x1b728
movabsq $0x40a3240000000000, %rax # imm = 0x40A3240000000000
movq %rax, 0x1701e(%rip)     # 0x1b748
movabsq $0x409ff00000000000, %rax # imm = 0x409FF00000000000
movq %rax, 0x1702d(%rip)     # 0x1b768
movabsq $0x408ff00000000000, %rax # imm = 0x408FF00000000000
movq %rax, 0x1703c(%rip)     # 0x1b788
callq 0x2397
movb $0x0, 0x17481(%rip)     # 0x1bbd9
xorl %r14d, %r14d
pushq $0x32
popq %rbx
xorl %ebp, %ebp
andq $0x0, 0x17468(%rip)     # 0x1bbd0
movl %ebx, %edi
callq 0x2a7c
cmpb $0x0, 0x16f3b(%rip)     # 0x1b6b1
je 0x4978
cmpb $0x0, 0x17445(%rip)     # 0x1bbc8
je 0x47c8
andq $0x0, 0xaa83(%rip)      # 0xf210
callq 0x2dad
cmpb $0x0, 0x16f18(%rip)     # 0x1b6b1
je 0x4978
cmpb $0x0, 0x17004(%rip)     # 0x1b7aa
jne 0x48e9
cmpb $0x0, 0xaa6f(%rip)      # 0xf222
jne 0x47d0
movq 0x17414(%rip), %rax     # 0x1bbd0
testq %rax, %rax
js 0x47de
cvtsi2ss %rax, %xmm0
jmp 0x47f5
andq $0x0, 0x17400(%rip)     # 0x1bbd0
cmpb $0x0, 0x17402(%rip)     # 0x1bbd9
je 0x4760
jmp 0x4970
movq %rax, %rcx
shrq %rcx
movl %eax, %edx
andl $0x1, %edx
orq %rcx, %rdx
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
divss 0xa9e3(%rip), %xmm0     # 0xf1e0
ucomiss 0x5be4(%rip), %xmm0     # 0xa3e8
jbe 0x4843
movq %rax, %xmm0
punpckldq 0x5bfd(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5c05(%rip), %xmm0     # 0xa420
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x16f09(%rip), %xmm1    # 0x1b738
movl 0x16f0b(%rip), %edi     # 0x1b740
addsd %xmm1, %xmm1
cvttsd2si %xmm1, %rsi
callq 0x3141
callq 0x4167
testq %rax, %rax
js 0x4854
cvtsi2ss %rax, %xmm1
jmp 0x4869
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
movss 0xa96f(%rip), %xmm0     # 0xf1e0
divss %xmm0, %xmm1
mulss 0x5b67(%rip), %xmm1     # 0xa3e4
cvtss2sd %xmm1, %xmm1
addsd 0xa987(%rip), %xmm1     # 0xf210
movsd %xmm1, 0xa97f(%rip)     # 0xf210
ucomisd 0x5a8f(%rip), %xmm1     # 0xa328
jne 0x48a1
jnp 0x47d0
movq 0x17328(%rip), %rax     # 0x1bbd0
testq %rax, %rax
js 0x48b4
cvtsi2ss %rax, %xmm2
jmp 0x48c9
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
divss %xmm0, %xmm2
ucomiss 0x5b14(%rip), %xmm2     # 0xa3e8
jbe 0x47d0
cvttsd2si %xmm1, %rdi
callq 0x5486
jmp 0x47d0
movsd 0x16e87(%rip), %xmm0    # 0x1b778
movsd 0x16e9f(%rip), %xmm1    # 0x1b798
movl 0xa905(%rip), %edi      # 0xf204
callq 0x374a
movq %rax, %r14
cmpb $0x0, 0x16da3(%rip)     # 0x1b6b1
je 0x47d0
cmpb $0x0, 0xa907(%rip)      # 0xf222
jne 0x47d0
callq 0x4167
testq %rax, %rax
js 0x4932
cvtsi2ss %rax, %xmm0
jmp 0x4947
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0xa891(%rip), %xmm0     # 0xf1e0
mulss 0x5a8d(%rip), %xmm0     # 0xa3e4
cvtss2sd %xmm0, %xmm0
addsd 0xa8ad(%rip), %xmm0     # 0xf210
movsd %xmm0, 0xa8a5(%rip)     # 0xf210
jmp 0x47d0
callq 0x15e9
movl %r14d, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq