// File: /workspace/github_c_makefile_star2_O0/mincebert[P]maketzx/maketzx.c
// Function: CheckVOCHeader
void CheckVOCHeader(void)
{
  byte vochdr[26]="Creative Voice File\x1a\x1a\x0\x0a\x01\x29\x11",
       count;
  dword totalsamp=0;
  for (count=0; count<sizeof(vochdr); count++)
      {
	if (GetData(&inpfile)!=vochdr[count])
	   Error(5);
      }
  printf("Checking input file integrity...");
  while (!blocktype || !eof(inpfile.handle))
	{
	  ReadVOCBlock();
	  printf("\x0d");
	  printf("Checking input file integrity...");
	  if (!blocktype) break;
	  else {
		 byte ratio=0;
		 totalsamp+=blocklength;
		 if (blocktype!=8 && blocktype!=3) filepos+=blocklength;
		 lseek(inpfile.handle,filepos,SEEK_SET);
		 if (filepos>inpfile.length)
		    {
		      blocktype=0;
		      totalsamp-=(filepos-inpfile.length);
		      filepos=inpfile.length;
		    }
		 inpfile.bufpoint=0;
		 ratio=(totalsamp*100)/inpfile.length;
		 if (!blocktype || eof(inpfile.handle)) break;
/*                  {
		      printf("done\n");
		      printf("Total file length: %lu bytes (%lu
		      samples)\n\n",filepos,totalsamp);
		      if (blocktype && eof(inpfile.handle))
		      printf("***WARNING*** - Unexpected end of file!\n\n");
		    } */
		 else printf("%d%%",ratio);
	       }
	}
/*  if (eof(inpfile.length) && blocktype)
     {
       Error(9);
     } */
  printf("done\n");
  printf("Total file length: %lu bytes (%lu samples)\n\n",filepos,totalsamp);
  if (blocktype && eof(inpfile.handle)) printf("***WARNING*** - Unexpected end of file!\n\n");
  lseek(inpfile.handle,26,SEEK_SET);
  filepos=26;
  blocklength=processed=inpfile.bufpoint=0;
}

// Assembly:
subq $0x48, %rsp
movq 0xd3a5(%rip), %rax      # 0xf950
movq %rax, 0x20(%rsp)
movq 0xd3a1(%rip), %rax      # 0xf958
movq %rax, 0x28(%rsp)
movq 0xd39d(%rip), %rax      # 0xf960
movq %rax, 0x30(%rsp)
movw 0xd399(%rip), %ax       # 0xf968
movw %ax, 0x38(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x1f(%rsp)
movzbl 0x1f(%rsp), %eax
cmpq $0x1a, %rax
jae 0x2622
leaq 0x10c6c(%rip), %rdi     # 0x13260
callq 0x2370
movzbl %al, %eax
movzbl 0x1f(%rsp), %ecx
movzbl 0x20(%rsp,%rcx), %ecx
cmpl %ecx, %eax
je 0x2614
movl $0x5, %edi
callq 0x15c0
jmp 0x2616
movb 0x1f(%rsp), %al
addb $0x1, %al
movb %al, 0x1f(%rsp)
jmp 0x25e2
leaq 0xda67(%rip), %rdi      # 0x10090
movb $0x0, %al
callq 0x1090
movb $0x1, %al
cmpb $0x0, 0x1d068(%rip)     # 0x1f6a1
movb %al, 0xe(%rsp)
je 0x2657
movzbl 0x10c1a(%rip), %edi     # 0x13260
callq 0x1520
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x2664
jmp 0x2780
callq 0x2820
leaq 0xdeec(%rip), %rdi      # 0x1055c
movb $0x0, %al
callq 0x1090
leaq 0xda12(%rip), %rdi      # 0x10090
movb $0x0, %al
callq 0x1090
cmpb $0x0, 0x1d015(%rip)     # 0x1f6a1
jne 0x2693
jmp 0x2780
movb $0x0, 0xf(%rsp)
movq 0x10b01(%rip), %rax     # 0x131a0
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movzbl 0x1cff1(%rip), %eax     # 0x1f6a1
cmpl $0x8, %eax
je 0x26d6
movzbl 0x1cfe5(%rip), %eax     # 0x1f6a1
cmpl $0x3, %eax
je 0x26d6
movq 0x10ad8(%rip), %rax     # 0x131a0
addq 0x10af9(%rip), %rax     # 0x131c8
movq %rax, 0x10af2(%rip)     # 0x131c8
movzbl 0x10b83(%rip), %edi     # 0x13260
movq 0x10ae4(%rip), %rsi     # 0x131c8
xorl %edx, %edx
callq 0x10b0
movq 0x10ad6(%rip), %rax     # 0x131c8
cmpq 0x10c6f(%rip), %rax     # 0x13368
jbe 0x272b
movb $0x0, 0x1cf9f(%rip)     # 0x1f6a1
movq 0x10abf(%rip), %rcx     # 0x131c8
subq 0x10c58(%rip), %rcx     # 0x13368
movq 0x10(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10c44(%rip), %rax     # 0x13368
movq %rax, 0x10a9d(%rip)     # 0x131c8
movl $0x0, 0x10c2b(%rip)     # 0x13360
imulq $0x64, 0x10(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x10c22(%rip)           # 0x13368
movb %al, 0xf(%rsp)
cmpb $0x0, 0x1cf50(%rip)     # 0x1f6a1
je 0x2764
movzbl 0x10b06(%rip), %edi     # 0x13260
callq 0x1520
cmpl $0x0, %eax
je 0x2766
jmp 0x2780
movzbl 0xf(%rsp), %esi
leaq 0xd93f(%rip), %rdi      # 0x100b1
movb $0x0, %al
callq 0x1090
jmp 0x277b
jmp 0x2630
leaq 0xd92f(%rip), %rdi      # 0x100b6
movb $0x0, %al
callq 0x1090
movq 0x10a33(%rip), %rsi     # 0x131c8
movq 0x10(%rsp), %rdx
leaq 0xd91b(%rip), %rdi      # 0x100bc
movb $0x0, %al
callq 0x1090
movzbl 0x1cef2(%rip), %eax     # 0x1f6a1
cmpl $0x0, %eax
je 0x27d3
movzbl 0x10aa5(%rip), %edi     # 0x13260
callq 0x1520
cmpl $0x0, %eax
je 0x27d3
leaq 0xd91d(%rip), %rdi      # 0x100e9
movb $0x0, %al
callq 0x1090
movzbl 0x10a86(%rip), %edi     # 0x13260
movl $0x1a, %esi
xorl %edx, %edx
callq 0x10b0
movq $0x1a, 0x109d7(%rip) # 0x131c8
movl $0x0, 0x10b65(%rip)     # 0x13360
movq $0x0, 0x109a2(%rip) # 0x131a8
movq $0x0, 0x1098f(%rip) # 0x131a0
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)