// File: /workspace/github_c_makefile_star2_O3/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 0xaae6(%rip)            # 0xf248
movb $0x9, 0x17487(%rip)     # 0x1bbf0
movl $0x10b, 0xaaa1(%rip)    # imm = 0x10B
callq 0x49be
cmpb $0x0, 0x1746a(%rip)     # 0x1bbe9
je 0x497d
movl %eax, %r14d
movl %r14d, %edi
callq 0x4c92
movzbl 0x1757a(%rip), %eax     # 0x1bd11
movl 0xaaab(%rip), %ecx      # 0xf248
decl %ecx
cmpl %eax, %ecx
jne 0x49b4
addq %r14, %rbx
movl 0xaa60(%rip), %edi      # 0xf210
leal -0x2(%r14), %esi
callq 0x4d24
movq 0x17420(%rip), %rdi     # 0x1bbe0
movl $0x8, %esi
movq %r14, %rdx
callq 0x56ac
movzbl 0x1753f(%rip), %eax     # 0x1bd13
incl %eax
movzbl 0x17538(%rip), %ecx     # 0x1bd15
cmpl %ecx, %eax
jne 0x475c
movq $0x0, 0x173f0(%rip) # 0x1bbe0
movl $0x32, %edi
callq 0x2ba3
cmpb $0x0, 0x16ec0(%rip)     # 0x1b6c1
je 0x496e
cmpb $0x0, 0x173ca(%rip)     # 0x1bbd8
jne 0x481b
movq $0x0, 0x173c5(%rip) # 0x1bbe0
movq $0x0, 0xa9fa(%rip) # 0xf220
callq 0x2edd
cmpb $0x0, 0x16f88(%rip)     # 0x1b7ba
jne 0x4948
movq 0x173a1(%rip), %rax     # 0x1bbe0
testq %rax, %rax
js 0x484b
cvtsi2ss %rax, %xmm0
jmp 0x4862
movq %rax, %rcx
shrq %rcx
movl %eax, %edx
andl $0x1, %edx
orq %rcx, %rdx
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
divss 0xa986(%rip), %xmm0     # 0xf1f0
ucomiss 0x6b77(%rip), %xmm0     # 0xb3e8
jbe 0x4948
movq %rax, %xmm0
punpckldq 0x6b8c(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x6b94(%rip), %xmm0     # 0xb420
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x16ea8(%rip), %xmm1    # 0x1b748
movl 0x16eaa(%rip), %edi     # 0x1b750
addsd %xmm1, %xmm1
cvttsd2si %xmm1, %rsi
callq 0x329a
callq 0x43aa
testq %rax, %rax
js 0x48c8
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x48e0
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
divss 0xa908(%rip), %xmm0     # 0xf1f0
mulss 0x6af4(%rip), %xmm0     # 0xb3e4
cvtss2sd %xmm0, %xmm0
addsd 0xa924(%rip), %xmm0     # 0xf220
movsd %xmm0, 0xa91c(%rip)     # 0xf220
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4910
jnp 0x4948
cvttsd2si %xmm0, %rax
movw %ax, 0xa86a(%rip)       # 0xf186
xorl %r15d, %r15d
leaq 0xa85f(%rip), %r12      # 0xf185
leaq 0xea6b(%rip), %r14      # 0x13398
movzbl (%r15,%r12), %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1e01
incq %r15
cmpq $0x3, %r15
jne 0x492d
movq $0x0, 0x1728d(%rip) # 0x1bbe0
movb $-0x61, 0x17296(%rip)   # 0x1bbf0
movl $0x0, 0xa8e4(%rip)      # 0xf248
xorl %edi, %edi
movq %rbx, %rsi
callq 0x4d24
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movups 0x708d(%rip), %xmm0     # 0xba11
movaps %xmm0, 0x16d65(%rip)    # 0x1b6f0
movups 0x706f(%rip), %xmm0     # 0xba01
movaps %xmm0, 0x16d47(%rip)    # 0x1b6e0
movabsq $0x726f7272652061, %rax # imm = 0x726F7272652061
movq %rax, 0x16d53(%rip)     # 0x1b6fd
movl $0x8, %edi
callq 0x140c
movl $0xc, %edi
callq 0x140c