// File: /workspace/github_c_makefile_star2_O1/mincebert[P]maketzx/maketzx.c
// Function: DecodeSpeedlockTable
void DecodeSpeedlockTable(word limit,byte offset)
{
  word count;
  dword savepos=filepos;
  if (zeta) { xorbyte=0x5a; addbyte=0; }
  ResetTempFile();
  if (limit>sizeof(slockdata)) Error(10);
  for (count=0; count<limit; count++)
      {
	slockdata[count+offset+tableoffset]=(byte)((GetData(&tempfile) ^ xorbyte)+addbyte);
	if (zeta)
	   {
	     slockdata[count+offset+tableoffset]^=0xff;
	     xorbyte+=0x35;
	   }
      }
  if (blocks==blockskip+2 && !subblocks)
     {
       for (count=0; count<limit; count++)
	   {
	     if (slocktype)
		{
		  if (slockdata[count]==0xdd && slockdata[count+1]==0x21 && count<0x11 && !tableoffset) { nxtloadpos=slockdata[count+2]+(256*slockdata[count+3]); }
		  if (slockdata[count]==0x11 && count<0x11 && !tableoffset) { expectedlength=1+slockdata[count+1]+(256*slockdata[count+2]); }
		  if ((slockdata[count]==0) && (slockdata[count+1]==0x80) && (slockdata[count+2]==0xff) && (slockdata[count+3]==0x02) && (slockdata[count+4]==0x10))
		     { tablepointer=tableoffset=count; break; }
		}
	     if (zeta)
		{
		  if ((slockdata[count]==0x10) && (slockdata[count+1]==0xff) && (slockdata[count+2]==0x02) && (slockdata[count+3]==0) && (slockdata[count+4]==0x80))
		     { tablepointer=tableoffset=count; break; }
		}
	   }
       if (!tableoffset)
	  {
	    byte rpage1=slockdata[0x27],rpage2=slockdata[0x65];
	    if (rpage1>=0x10 && rpage1<=0x17) tablepointer=tableoffset=0x23;
	    else if (rpage2>=0x10 && rpage2<=0x17) tablepointer=tableoffset=0x61;
	  }
     }
  loadertableadd=slockloadaddress+tablepointer;
  filepos=savepos;
  lseek(inpfile.handle,filepos,SEEK_SET);
  inpfile.bufpoint=0;
  ResetTempFile();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movl %edi, %ebp
cmpb $0x0, 0x83fb(%rip)      # 0xf1b5
je 0x6dca
movb $0x5a, 0x833d(%rip)     # 0xf100
movb $0x0, 0x8337(%rip)      # 0xf101
movq 0x8417(%rip), %rbx      # 0xf1e8
callq 0x161f
cmpl $0x300, %ebp            # imm = 0x300
ja 0x6ffc
testl %ebp, %ebp
je 0x6e3e
movzbl %r14b, %r15d
leaq 0x106c7(%rip), %r14     # 0x174b8
leaq 0x15148(%rip), %r12     # 0x1bf40
movl %ebp, %r13d
movq %r14, %rdi
callq 0x1db5
movb 0x82f7(%rip), %cl       # 0xf100
xorb %cl, %al
addb 0x82f0(%rip), %al       # 0xf101
movl 0x8429(%rip), %edx      # 0xf240
addl %r15d, %edx
movb %al, (%rdx,%r12)
cmpb $0x0, 0x8390(%rip)      # 0xf1b5
je 0x6e36
notb %al
movb %al, (%rdx,%r12)
addb $0x35, %cl
movb %cl, 0x82ca(%rip)       # 0xf100
incl %r15d
decl %r13d
jne 0x6dfb
movl 0x83e8(%rip), %eax      # 0xf22c
addl $0x2, %eax
cmpl %eax, 0x83db(%rip)      # 0xf228
jne 0x6fa4
cmpl $0x0, 0x83ee(%rip)      # 0xf248
jne 0x6fa4
testl %ebp, %ebp
je 0x6f69
movb 0x8346(%rip), %al       # 0xf1b4
movl 0x83cc(%rip), %ecx      # 0xf240
movb 0x833b(%rip), %dl       # 0xf1b5
movl %ebp, %esi
xorl %r8d, %r8d
leaq 0x150ba(%rip), %r9      # 0x1bf40
xorl %edi, %edi
testb %al, %al
je 0x6f26
movb (%rdi,%r9), %r10b
cmpb $-0x23, %r10b
jne 0x6ec7
testl %ecx, %ecx
setne %r11b
cmpb $0x21, 0x1(%rdi,%r9)
setne %bpl
cmpq $0x11, %rdi
setae %r14b
orb %r11b, %r14b
orb %bpl, %r14b
jne 0x6ec7
movzwl 0x2(%rdi,%r9), %r11d
movl %r11d, 0x8349(%rip)     # 0xf210
testl %ecx, %ecx
setne %r11b
cmpb $0x11, %r10b
setne %bpl
cmpq $0x11, %rdi
setae %r14b
orb %r11b, %r14b
orb %bpl, %r14b
jne 0x6ef5
movzwl 0x1(%rdi,%r9), %r11d
incl %r11d
movl %r11d, 0x831f(%rip)     # 0xf214
testb %r10b, %r10b
jne 0x6f26
cmpb 0x1(%rdi,%r9), %r8b
jno 0x6f26
leal 0x2(%rdi), %r10d
cmpb $-0x1, (%r10,%r9)
jne 0x6f26
leal 0x3(%rdi), %r10d
cmpb $0x2, (%r10,%r9)
jne 0x6f26
leal 0x4(%rdi), %r10d
cmpb $0x10, (%r10,%r9)
je 0x6feb
testb %dl, %dl
je 0x6f5d
cmpb $0x10, (%rdi,%r9)
jne 0x6f5d
cmpb $-0x1, 0x1(%rdi,%r9)
jne 0x6f5d
leal 0x2(%rdi), %r10d
cmpb $0x2, (%r10,%r9)
jne 0x6f5d
leal 0x3(%rdi), %r10d
cmpb $0x0, (%r10,%r9)
jne 0x6f5d
leal 0x4(%rdi), %r10d
cmpb (%r10,%r9), %r8b
jo 0x6feb
incq %rdi
cmpq %rdi, %rsi
jne 0x6e88
cmpl $0x0, 0x82d0(%rip)      # 0xf240
jne 0x6fa4
movb 0x14fef(%rip), %cl      # 0x1bf67
andb $-0x8, %cl
movl $0x23, %eax
cmpb $0x10, %cl
je 0x6f98
movb 0x1501a(%rip), %cl      # 0x1bfa5
andb $-0x8, %cl
movl $0x61, %eax
cmpb $0x10, %cl
jne 0x6fa4
movl %eax, 0x82a2(%rip)      # 0xf240
movl %eax, 0x82a0(%rip)      # 0xf244
movl 0x829a(%rip), %eax      # 0xf244
addl 0x8288(%rip), %eax      # 0xf238
movl %eax, 0x8286(%rip)      # 0xf23c
movq %rbx, 0x822b(%rip)      # 0xf1e8
movzbl 0x82bc(%rip), %edi      # 0xf280
movq %rbx, %rsi
xorl %edx, %edx
callq 0x10d0
movl $0x0, 0x83a8(%rip)      # 0xf380
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x161f
movl %edi, 0x824f(%rip)      # 0xf240
movl %edi, 0x824d(%rip)      # 0xf244
jmp 0x6f69
movl $0xa, %edi
callq 0x140c