// File: /workspace/github_c_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
incl 0xa9f5(%rip)            # 0xf248
movb $0x9, 0x17396(%rip)     # 0x1bbf0
movl $0x10b, 0xa9b0(%rip)    # imm = 0x10B
callq 0x4aaf
cmpb $0x0, 0x17379(%rip)     # 0x1bbe9
je 0x4a6e
movl %eax, %r14d
movl %r14d, %edi
callq 0x4d93
movzbl 0x17489(%rip), %eax     # 0x1bd11
movl 0xa9ba(%rip), %ecx      # 0xf248
decl %ecx
cmpl %eax, %ecx
jne 0x4aa5
addq %r14, %rbx
movl 0xa96f(%rip), %edi      # 0xf210
leal -0x2(%r14), %esi
callq 0x4e25
movq 0x1732f(%rip), %rdi     # 0x1bbe0
movl $0x8, %esi
movq %r14, %rdx
callq 0x5778
movzbl 0x1744e(%rip), %eax     # 0x1bd13
incl %eax
movzbl 0x17447(%rip), %ecx     # 0x1bd15
cmpl %ecx, %eax
jne 0x484d
movq $0x0, 0x172ff(%rip) # 0x1bbe0
movl $0x32, %edi
callq 0x2bfc
cmpb $0x0, 0x16dcf(%rip)     # 0x1b6c1
je 0x4a5f
cmpb $0x0, 0x172d9(%rip)     # 0x1bbd8
jne 0x490c
movq $0x0, 0x172d4(%rip) # 0x1bbe0
movq $0x0, 0xa909(%rip) # 0xf220
callq 0x2f5c
cmpb $0x0, 0x16e97(%rip)     # 0x1b7ba
jne 0x4a39
movq 0x172b0(%rip), %rax     # 0x1bbe0
testq %rax, %rax
js 0x493c
cvtsi2ss %rax, %xmm0
jmp 0x4953
movq %rax, %rcx
shrq %rcx
movl %eax, %edx
andl $0x1, %edx
orq %rcx, %rdx
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
divss 0xa895(%rip), %xmm0     # 0xf1f0
ucomiss 0x6a86(%rip), %xmm0     # 0xb3e8
jbe 0x4a39
movq %rax, %xmm0
punpckldq 0x6a9b(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6aa3(%rip), %xmm0     # 0xb420
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x16db7(%rip), %xmm1    # 0x1b748
movl 0x16db9(%rip), %edi     # 0x1b750
addsd %xmm1, %xmm1
cvttsd2si %xmm1, %rsi
callq 0x3321
callq 0x4488
testq %rax, %rax
js 0x49b9
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x49d1
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0xa817(%rip), %xmm0     # 0xf1f0
mulss 0x6a03(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0xa833(%rip), %xmm0     # 0xf220
movsd %xmm0, 0xa82b(%rip)     # 0xf220
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4a01
jnp 0x4a39
cvttsd2si %xmm0, %rax
movw %ax, 0xa779(%rip)       # 0xf186
xorl %r15d, %r15d
leaq 0xa76e(%rip), %r12      # 0xf185
leaq 0xe97a(%rip), %r14      # 0x13398
movzbl (%r15,%r12), %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1e21
incq %r15
cmpq $0x3, %r15
jne 0x4a1e
movq $0x0, 0x1719c(%rip) # 0x1bbe0
movb $-0x61, 0x171a5(%rip)   # 0x1bbf0
movl $0x0, 0xa7f3(%rip)      # 0xf248
xorl %edi, %edi
movq %rbx, %rsi
callq 0x4e25
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movups 0x6f9c(%rip), %xmm0     # 0xba11
movaps %xmm0, 0x16c74(%rip)    # 0x1b6f0
movups 0x6f7e(%rip), %xmm0     # 0xba01
movaps %xmm0, 0x16c56(%rip)    # 0x1b6e0
movabsq $0x726f7272652061, %rax # imm = 0x726F7272652061
movq %rax, 0x16c62(%rip)     # 0x1b6fd
movl $0x8, %edi
callq 0x140c
movl $0xc, %edi
callq 0x140c