// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
movabsq $0x4089400000000000, %rax # imm = 0x4089400000000000
movq %rax, 0x16d61(%rip)     # 0x1b738
movabsq $0x40a3240000000000, %rax # imm = 0x40A3240000000000
movq %rax, 0x16d70(%rip)     # 0x1b758
movabsq $0x409ff00000000000, %rax # imm = 0x409FF00000000000
movq %rax, 0x16d7f(%rip)     # 0x1b778
movabsq $0x408ff00000000000, %rax # imm = 0x408FF00000000000
movq %rax, 0x16d8e(%rip)     # 0x1b798
callq 0x240d
movb $0x0, 0x171d3(%rip)     # 0x1bbe9
xorl %ebx, %ebx
leaq 0xa766(%rip), %r15      # 0xf185
leaq 0xe972(%rip), %r14      # 0x13398
xorl %ebp, %ebp
movq $0x0, 0x171ad(%rip) # 0x1bbe0
movl $0x32, %edi
callq 0x2ba3
cmpb $0x0, 0x16c7d(%rip)     # 0x1b6c1
je 0x4c87
cmpb $0x0, 0x17187(%rip)     # 0x1bbd8
je 0x4a9c
movq $0x0, 0xa7c2(%rip) # 0xf220
callq 0x2edd
cmpb $0x0, 0x16c57(%rip)     # 0x1b6c1
je 0x4c87
cmpb $0x0, 0x16d43(%rip)     # 0x1b7ba
jne 0x4bf3
cmpb $0x0, 0xa7ae(%rip)      # 0xf232
jne 0x4aa7
movq 0x17153(%rip), %rax     # 0x1bbe0
testq %rax, %rax
js 0x4ab9
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x4ad3
movq $0x0, 0x17139(%rip) # 0x1bbe0
cmpb $0x0, 0x1713b(%rip)     # 0x1bbe9
je 0x4a28
jmp 0x4c80
movq %rax, %rcx
shrq %rcx
movl %eax, %edx
andl $0x1, %edx
orq %rcx, %rdx
xorps %xmm0, %xmm0
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
divss 0xa715(%rip), %xmm0     # 0xf1f0
ucomiss 0x6906(%rip), %xmm0     # 0xb3e8
jbe 0x4b21
movq %rax, %xmm0
punpckldq 0x691f(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6927(%rip), %xmm0     # 0xb420
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x16c3b(%rip), %xmm1    # 0x1b748
movl 0x16c3d(%rip), %edi     # 0x1b750
addsd %xmm1, %xmm1
cvttsd2si %xmm1, %rsi
callq 0x329a
callq 0x43aa
testq %rax, %rax
js 0x4b35
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
jmp 0x4b4d
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
movss 0xa69b(%rip), %xmm0     # 0xf1f0
divss %xmm0, %xmm1
mulss 0x6883(%rip), %xmm1     # 0xb3e4
cvtss2sd %xmm1, %xmm1
addsd 0xa6b3(%rip), %xmm1     # 0xf220
movsd %xmm1, 0xa6ab(%rip)     # 0xf220
ucomisd 0x67ab(%rip), %xmm1     # 0xb328
jne 0x4b85
jnp 0x4aa7
movq 0x17054(%rip), %rax     # 0x1bbe0
testq %rax, %rax
js 0x4b9b
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
jmp 0x4bb3
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
divss %xmm0, %xmm2
ucomiss 0x682a(%rip), %xmm2     # 0xb3e8
jbe 0x4aa7
cvttsd2si %xmm1, %rax
movw %ax, 0xa5b6(%rip)       # 0xf186
xorl %r12d, %r12d
movzbl (%r12,%r15), %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1e01
incq %r12
cmpq $0x3, %r12
jne 0x4bd3
jmp 0x4aa7
movsd 0x16b8d(%rip), %xmm0    # 0x1b788
movsd 0x16ba5(%rip), %xmm1    # 0x1b7a8
movl 0xa60b(%rip), %edi      # 0xf214
callq 0x38de
movq %rax, %rbx
cmpb $0x0, 0x16aa9(%rip)     # 0x1b6c1
je 0x4aa7
cmpb $0x0, 0xa60d(%rip)      # 0xf232
jne 0x4aa7
callq 0x43aa
testq %rax, %rax
js 0x4c3f
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x4c57
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0xa591(%rip), %xmm0     # 0xf1f0
mulss 0x677d(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0xa5ad(%rip), %xmm0     # 0xf220
movsd %xmm0, 0xa5a5(%rip)     # 0xf220
jmp 0x4aa7
callq 0x161e
movl %ebx, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq