// File: /workspace/github_c_makefile_star2_O0/mincebert[P]maketzx/maketzx.c
// Function: ReadBleeploadGroup
dword ReadBleeploadGroup(void)
{
  word bytes;
  dword grandtotal=0;
  do {
       subblocks++;
       header.type=9;
       expectedlength=0x10b;
       grandtotal+=(bytes=ReadBleeploadBlock());
       if (!DataLoadOK) { strcpy(errstring,"Bad mid-sync detection or data error"); Error(8); }
       GetBleeploadInfo(bytes);
       if (bleepblock[0x101]!=subblocks-1) Error(12);
       PrintBlockInfo(nxtloadpos,bytes-2);
       WriteTZXTurboBlock(pilotlength,8,bytes);
     }
  while (bleepblock[0x103]+1!=bleepblock[0x105]);
  pilotlength=0;
  PilotSearch(50);
  if (!blocktype) return grandtotal;
  if (!PilotLinkingOK) pilotlength=0;
  mspause=0;
  SyncSearch();
  if (!SyncLoadOK && (pilotlength/samprate>0.5))
     {
       WriteTZXTone(pilot.tstates,(pilotlength/pilot.samples)*2);
       mspause+=(FindPause()/samprate)*1000;
       if (mspause) WriteTZXPause(mspause);
     }
  pilotlength=0;
  header.type=0x9f;
  subblocks=0;
  PrintBlockInfo(0,grandtotal);
  return grandtotal;
}

// Assembly:
subq $0x28, %rsp
movq $0x0, 0x10(%rsp)
movl 0xd035(%rip), %eax      # 0x13228
addl $0x1, %eax
movl %eax, 0xd02c(%rip)      # 0x13228
movb $0x9, 0x199cd(%rip)     # 0x1fbd0
movl $0x10b, 0xcfe7(%rip)    # imm = 0x10B
callq 0x6490
movl %eax, 0x1c(%rsp)
movl %eax, %eax
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpb $0x0, 0x199a0(%rip)     # 0x1fbc9
jne 0x6248
leaq 0x1948e(%rip), %rdi     # 0x1f6c0
leaq 0xa340(%rip), %rsi      # 0x10579
callq 0x1050
movl $0x8, %edi
callq 0x15c0
movl 0x1c(%rsp), %edi
callq 0x6800
movzbl 0x19a99(%rip), %eax     # 0x1fcf1
movl 0xcfca(%rip), %ecx      # 0x13228
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x626f
movl $0xc, %edi
callq 0x15c0
movl 0xcf7b(%rip), %edi      # 0x131f0
movl 0x1c(%rsp), %eax
subl $0x2, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x68b0
movq 0x19934(%rip), %rdi     # 0x1fbc0
movl 0x1c(%rsp), %eax
movl %eax, %edx
movl $0x8, %esi
callq 0x7260
movzbl 0x19a50(%rip), %eax     # 0x1fcf3
addl $0x1, %eax
movzbl 0x19a48(%rip), %ecx     # 0x1fcf5
cmpl %ecx, %eax
jne 0x61ed
movq $0x0, 0x19900(%rip) # 0x1fbc0
movl $0x32, %edi
callq 0x39e0
cmpb $0x0, 0x193d0(%rip)     # 0x1f6a1
jne 0x62e2
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x6486
cmpb $0x0, 0x198cf(%rip)     # 0x1fbb8
jne 0x62f6
movq $0x0, 0x198ca(%rip) # 0x1fbc0
xorps %xmm0, %xmm0
movsd %xmm0, 0xceff(%rip)     # 0x13200
callq 0x3ec0
cmpb $0x0, 0x1948d(%rip)     # 0x1f79a
jne 0x6454
movq 0x198a6(%rip), %rax     # 0x1fbc0
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, 0x8(%rsp)
testq %rax, %rax
movss %xmm0, 0xc(%rsp)
js 0x6353
movss 0x8(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0xc(%rsp), %xmm0
divss 0xce6f(%rip), %xmm0     # 0x131d0
cvtss2sd %xmm0, %xmm0
movsd 0x96c3(%rip), %xmm1     # 0xfa30
ucomisd %xmm1, %xmm0
jbe 0x6454
movl 0x193b3(%rip), %edi     # 0x1f730
movaps 0x97ec(%rip), %xmm1     # 0xfb70
movq 0x19834(%rip), %xmm0    # 0x1fbc0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x97e8(%rip), %xmm1     # 0xfb80
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x19379(%rip), %xmm1    # 0x1f728
divsd %xmm1, %xmm0
addsd %xmm0, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %esi
callq 0x4480
callq 0x5d40
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, (%rsp)
testq %rax, %rax
movss %xmm0, 0x4(%rsp)
js 0x63ff
movss (%rsp), %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x4(%rsp), %xmm0
divss 0xcdc3(%rip), %xmm0     # 0x131d0
movss 0x972f(%rip), %xmm1     # 0xfb44
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0xcddb(%rip), %xmm0     # 0x13200
movsd %xmm0, 0xcdd3(%rip)     # 0x13200
movsd 0xcdcb(%rip), %xmm0     # 0x13200
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6442
jp 0x6442
jmp 0x6452
cvttsd2si 0xcdb5(%rip), %rax # 0x13200
movl %eax, %edi
callq 0x7510
jmp 0x6454
movq $0x0, 0x19761(%rip) # 0x1fbc0
movb $-0x61, 0x1976a(%rip)   # 0x1fbd0
movl $0x0, 0xcdb8(%rip)      # 0x13228
movq 0x10(%rsp), %rsi
xorl %edi, %edi
callq 0x68b0
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq