// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/kplib.c
// Function: kzread
int kzread (void *buffer, int leng)
{
	int i, j, k, bfinal, btype, hlit, hdist;

	if ((!kzfs.fil) || (leng <= 0)) return(0);

	if (kzfs.comptyp == 0)
	{
		if (kzfs.pos != kzfs.i) //Seek only when position changes
			fseek(kzfs.fil,kzfs.seek0+kzfs.pos,SEEK_SET);
		i = min(kzfs.leng-kzfs.pos,leng);
		i = (int)fread(buffer,1,i,kzfs.fil);
		kzfs.i += i; //kzfs.i is a local copy of ftell(kzfs.fil);
	}
	else if (kzfs.comptyp == 8)
	{
		zipfilmode = 1;

			//Initialize for putbuf4zip
		gzbufptr = (char *)buffer; gzbufptr = &gzbufptr[-kzfs.pos];
		kzfs.endpos = min(kzfs.pos+leng,kzfs.leng);
		if (kzfs.endpos == kzfs.pos) return(0); //Guard against reading 0 length

		if (kzfs.pos < gslidew-32768) // Must go back to start :(
		{
			if (kzfs.comptell) fseek(kzfs.fil,kzfs.seek0,SEEK_SET);

			gslidew = 0; gslider = 16384;
			kzfs.jmpplc = 0;

				//Initialize for suckbits/peekbits/getbits
			kzfs.comptell = min(kzfs.compleng,(int)sizeof(olinbuf));
			kzfs.comptell = (int)fread(&olinbuf[0],1,kzfs.comptell,kzfs.fil);
				//Make it re-load when there are < 32 bits left in FIFO
			bitpos = -(((int)sizeof(olinbuf)-4)<<3);
				//Identity: filptr + (bitpos>>3) = &olinbuf[0]
			filptr = &olinbuf[-(bitpos>>3)];
		}
		else
		{
			i = max(gslidew-32768,0); j = gslider-16384;

				//HACK: Don't unzip anything until you have to...
				//   (keeps file pointer as low as possible)
			if (kzfs.endpos <= gslidew) j = kzfs.endpos;

				//write uncompoffs on slidebuf from: i to j
			if (!((i^j)&32768))
				putbuf4zip(&slidebuf[i&32767],i,j);
			else
			{
				putbuf4zip(&slidebuf[i&32767],i,j&~32767);
				putbuf4zip(slidebuf,j&~32767,j);
			}

				//HACK: Don't unzip anything until you have to...
				//   (keeps file pointer as low as possible)
			if (kzfs.endpos <= gslidew) goto retkzread;
		}

		switch (kzfs.jmpplc)
		{
			case 0: goto kzreadplc0;
			case 1: goto kzreadplc1;
			case 2: goto kzreadplc2;
			case 3: goto kzreadplc3;
		}
kzreadplc0:;
		do
		{
			bfinal = getbits(1); btype = getbits(2);

#if 0
				//Display Huffman block offsets&lengths of input file - for debugging only!
			{
			static int ouncomppos = 0, ocomppos = 0;
			if (kzfs.comptell == sizeof(olinbuf)) i = 0;
			else if (kzfs.comptell < kzfs.compleng) i = kzfs.comptell-(sizeof(olinbuf)-4);
			else i = kzfs.comptell-(kzfs.comptell%(sizeof(olinbuf)-4));
			i += ((char *)&filptr[bitpos>>3])-((char *)(&olinbuf[0]));
			i = (i<<3)+(bitpos&7)-3;
			if (gslidew) printf(" ULng:0x%08x CLng:0x%08x.%x",gslidew-ouncomppos,(i-ocomppos)>>3,((i-ocomppos)&7)<<1);
			printf("\ntype:%d, Uoff:0x%08x Coff:0x%08x.%x",btype,gslidew,i>>3,(i&7)<<1);
			if (bfinal)
			{
				printf(" ULng:0x%08x CLng:0x%08x.%x",kzfs.leng-gslidew,((kzfs.compleng<<3)-i)>>3,(((kzfs.compleng<<3)-i)&7)<<1);
				printf("\n        Uoff:0x%08x Coff:0x%08x.0",kzfs.leng,kzfs.compleng);
				ouncomppos = ocomppos = 0;
			}
			else { ouncomppos = gslidew; ocomppos = i; }
			}
#endif

			if (btype == 0)
			{
				  //Raw (uncompressed)
				suckbits((-bitpos)&7);  //Synchronize to start of next byte
				i = getbits(16); if ((getbits(16)^i) != 0xffff) return(-1);
				for(;i;i--)
				{
					if (gslidew >= gslider)
					{
						putbuf4zip(&slidebuf[(gslider-16384)&32767],gslider-16384,gslider); gslider += 16384;
						if (gslider-16384 >= kzfs.endpos)
						{
							kzfs.jmpplc = 1; kzfs.i = i; kzfs.bfinal = bfinal;
							goto retkzread;
kzreadplc1:;         i = kzfs.i; bfinal = kzfs.bfinal;
						}
					}
					slidebuf[(gslidew++)&32767] = (char)getbits(8);
				}
				continue;
			}
			if (btype == 3) continue;

			if (btype == 1) //Fixed Huffman
			{
				hlit = 288; hdist = 32; i = 0;
				for(;i<144;i++) clen[i] = 8; //Fixed bit sizes (literals)
				for(;i<256;i++) clen[i] = 9; //Fixed bit sizes (literals)
				for(;i<280;i++) clen[i] = 7; //Fixed bit sizes (EOI,lengths)
				for(;i<288;i++) clen[i] = 8; //Fixed bit sizes (lengths)
				for(;i<320;i++) clen[i] = 5; //Fixed bit sizes (distances)
			}
			else  //Dynamic Huffman
			{
				hlit = getbits(5)+257; hdist = getbits(5)+1; j = getbits(4)+4;
				for(i=0;i<j;i++) cclen[ccind[i]] = getbits(3);
				for(;i<19;i++) cclen[ccind[i]] = 0;
				hufgencode(cclen,19,ibuf0,nbuf0);

				j = 0; k = hlit+hdist;
				while (j < k)
				{
					i = hufgetsym(ibuf0,nbuf0);
					if (i < 16) { clen[j++] = i; continue; }
					if (i == 16)
						{ for(i=getbits(2)+3;i;i--) { clen[j] = clen[j-1]; j++; } }
					else
					{
						if (i == 17) i = getbits(3)+3; else i = getbits(7)+11;
						for(;i;i--) clen[j++] = 0;
					}
				}
			}

			hufgencode(clen,hlit,ibuf0,nbuf0);
			qhufgencode(ibuf0,nbuf0,qhufval0,qhufbit0,LOGQHUFSIZ0);

			hufgencode(&clen[hlit],hdist,ibuf1,nbuf1);
			qhufgencode(ibuf1,nbuf1,qhufval1,qhufbit1,LOGQHUFSIZ1);

			while (1)
			{
				if (gslidew >= gslider)
				{
					putbuf4zip(&slidebuf[(gslider-16384)&32767],gslider-16384,gslider); gslider += 16384;
					if (gslider-16384 >= kzfs.endpos)
					{
						kzfs.jmpplc = 2; kzfs.bfinal = bfinal; goto retkzread;
kzreadplc2:;      bfinal = kzfs.bfinal;
					}
				}

				k = peekbits(LOGQHUFSIZ0);
				if (qhufbit0[k]) { i = qhufval0[k]; suckbits((int)qhufbit0[k]); }
				else i = hufgetsym(ibuf0,nbuf0);

				if (i < 256) { slidebuf[(gslidew++)&32767] = (char)i; continue; }
				if (i == 256) break;
				i = getbits(hxbit[i+30-257][0]) + hxbit[i+30-257][1];

				k = peekbits(LOGQHUFSIZ1);
				if (qhufbit1[k]) { j = qhufval1[k]; suckbits((int)qhufbit1[k]); }
				else j = hufgetsym(ibuf1,nbuf1);

				j = getbits(hxbit[j][0]) + hxbit[j][1];
				for(;i;i--,gslidew++) slidebuf[gslidew&32767] = slidebuf[(gslidew-j)&32767];
			}
		} while (!bfinal);

		gslider -= 16384;
		if (!((gslider^gslidew)&32768))
			putbuf4zip(&slidebuf[gslider&32767],gslider,gslidew);
		else
		{
			putbuf4zip(&slidebuf[gslider&32767],gslider,gslidew&~32767);
			putbuf4zip(slidebuf,gslidew&~32767,gslidew);
		}
kzreadplc3:; kzfs.jmpplc = 3;
	}

retkzread:;
	i = kzfs.pos;
	kzfs.pos += leng; if (kzfs.pos > kzfs.leng) kzfs.pos = kzfs.leng;
	return(kzfs.pos-i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq 0x56f360(%rip), %rcx    # 0x5affc8
testq %rcx, %rcx
sete %dl
testl %esi, %esi
setle %sil
xorl %eax, %eax
orb %dl, %sil
jne 0x40cf6
movq %rdi, %r14
movl 0x56f34c(%rip), %edx    # 0x5affd0
cmpl $0x8, %edx
je 0x40d05
testl %edx, %edx
jne 0x40cd9
movl 0x56f365(%rip), %esi    # 0x5afff8
cmpl 0x56f377(%rip), %esi    # 0x5b0010
je 0x40cb8
addl 0x56f337(%rip), %esi    # 0x5affd8
movq %rcx, %rdi
xorl %edx, %edx
callq 0x6c70
movl 0x56f347(%rip), %esi    # 0x5afff8
movq 0x56f310(%rip), %rcx    # 0x5affc8
movl 0x56f332(%rip), %eax    # 0x5afff0
subl %esi, %eax
cmpl %ebx, %eax
cmovgel %ebx, %eax
movslq %eax, %rdx
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x6550
addl %eax, 0x56f337(%rip)    # 0x5b0010
movl 0x56f319(%rip), %eax    # 0x5afff8
addl %eax, %ebx
movl 0x56f309(%rip), %ecx    # 0x5afff0
cmpl %ecx, %ebx
cmovgel %ecx, %ebx
movl %ebx, 0x56f306(%rip)    # 0x5afff8
subl %eax, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x56f434(%rip)    # 0x5b0140
movslq 0x56f2e5(%rip), %rsi    # 0x5afff8
subq %rsi, %r14
movq %r14, 0x56f42b(%rip)    # 0x5b0148
leal (%rsi,%rbx), %edi
movl 0x56f2ca(%rip), %edx    # 0x5afff0
cmpl %edx, %edi
cmovll %edi, %edx
movl %edx, 0x56f2cf(%rip)    # 0x5b0000
cmpl %esi, %edx
je 0x40cf6
movl 0x56f2e5(%rip), %eax    # 0x5b0020
leal -0x8000(%rax), %edi
cmpl %edi, %esi
jge 0x40dc9
cmpl $0x0, 0x56f298(%rip)    # 0x5affe8
je 0x40d69
movl 0x56f280(%rip), %esi    # 0x5affd8
movq %rcx, %rdi
xorl %edx, %edx
callq 0x6c70
movq 0x56f25f(%rip), %rcx    # 0x5affc8
andl $0x0, 0x56f2b0(%rip)    # 0x5b0020
andl $0x0, 0x56f291(%rip)    # 0x5b0008
movl $0x4000, 0x56f3cf(%rip) # imm = 0x4000
movl 0x56f259(%rip), %eax    # 0x5affe0
movl $0x10000, %edx          # imm = 0x10000
cmpl %edx, %eax
cmovll %eax, %edx
movl %edx, 0x56f251(%rip)    # 0x5affe8
movslq %edx, %rdx
leaq 0x56f3bf(%rip), %rdi    # 0x5b0160
pushq $0x1
popq %rsi
callq 0x6550
movl %eax, 0x56f239(%rip)    # 0x5affe8
movl $0xfff80020, 0x57f3a7(%rip) # imm = 0xFFF80020
leaq 0x57f39c(%rip), %rax    # 0x5c015c
movq %rax, 0x57f3a1(%rip)    # 0x5c0168
jmp 0x40e2d
xorl %esi, %esi
testl %edi, %edi
cmovgl %edi, %esi
movl $0xffffc000, %ebp       # imm = 0xFFFFC000
addl 0x56f375(%rip), %ebp    # 0x5b0150
cmpl %eax, %edx
cmovlel %edx, %ebp
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
leaq 0x57f382(%rip), %rdi    # 0x5c0170
addq %rax, %rdi
movl %ebp, %eax
xorw %si, %ax
jns 0x40e14
movl %ebp, %r14d
andl $0xffff8000, %r14d      # imm = 0xFFFF8000
movl %r14d, %edx
callq 0x413f9
leaq 0x57f35f(%rip), %rdi    # 0x5c0170
movl %r14d, %esi
movl %ebp, %edx
callq 0x413f9
movl 0x56f1df(%rip), %eax    # 0x5b0000
cmpl 0x56f1f9(%rip), %eax    # 0x5b0020
jle 0x40cd9
movl 0x56f1d5(%rip), %eax    # 0x5b0008
cmpl $0x1, %eax
movq %rbx, 0x20(%rsp)
je 0x40e59
cmpl $0x2, %eax
je 0x40e4d
cmpl $0x3, %eax
je 0x413d5
jmp 0x40e6b
movl 0x56f1c4(%rip), %r15d   # 0x5b0018
jmp 0x411c4
movl 0x56f1b1(%rip), %ebp    # 0x5b0010
movl 0x56f1b2(%rip), %r15d   # 0x5b0018
jmp 0x41350
pushq $0x1
popq %rdi
callq 0x41434
movl %eax, %r15d
pushq $0x2
popq %rdi
callq 0x41434
testl %eax, %eax
je 0x40eb8
cmpl $0x3, %eax
je 0x4137b
leaq 0x5872de(%rip), %r14    # 0x5c8170
cmpl $0x1, %eax
movl %r15d, 0x1c(%rsp)
jne 0x40ef3
xorl %eax, %eax
cmpq $0x240, %rax            # imm = 0x240
je 0x40f57
movl $0x8, (%rax,%r14)
addq $0x4, %rax
jmp 0x40e9e
xorl %edi, %edi
subl 0x57f2a0(%rip), %edi    # 0x5c0160
andl $0x7, %edi
callq 0x41450
pushq $0x10
popq %r14
movl %r14d, %edi
callq 0x41434
movl %eax, %ebp
movl %r14d, %edi
callq 0x41434
xorl %ebp, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x41304
pushq $-0x1
popq %rax
jmp 0x40cf6
pushq $0x5
popq %rbp
movl %ebp, %edi
callq 0x41434
movq %rax, 0x8(%rsp)
movl %ebp, %edi
callq 0x41434
movq %rax, 0x10(%rsp)
pushq $0x4
popq %rdi
callq 0x41434
cmpl $-0x3, %eax
pushq $-0x4
popq %rbx
cmovgel %eax, %ebx
addl $0x4, %ebx
leaq (,%rbx,4), %r12
xorl %r13d, %r13d
leaq 0x2b82c(%rip), %rbp     # 0x6c760
leaq 0x587735(%rip), %r15    # 0x5c8670
cmpq %r13, %r12
je 0x40f70
pushq $0x3
popq %rdi
callq 0x41434
movslq (%r13,%rbp), %rcx
movl %eax, (%r15,%rcx,4)
addq $0x4, %r13
jmp 0x40f3b
xorl %eax, %eax
cmpq $0x70, %rax
je 0x40fa1
movl $0x9, 0x240(%r14,%rax,4)
incq %rax
jmp 0x40f59
movq 0x8(%rsp), %rax
addl $0x101, %eax            # imm = 0x101
movq %rax, 0x8(%rsp)
leaq (,%rbx,4), %rax
addq %rbp, %rax
cmpq $0x12, %rbx
ja 0x40fbe
movslq (%rax), %rcx
andl $0x0, (%r15,%rcx,4)
incq %rbx
addq $0x4, %rax
jmp 0x40f8a
xorl %eax, %eax
cmpq $0x18, %rax
je 0x410ad
movl $0x7, 0x400(%r14,%rax,4)
incq %rax
jmp 0x40fa3
movq 0x10(%rsp), %rbx
leal 0x1(%rbx), %eax
movl %eax, 0x4(%rsp)
leaq 0x58769f(%rip), %rdi    # 0x5c8670
leaq 0x5876e8(%rip), %r13    # 0x5c86c0
leaq 0x587b61(%rip), %r12    # 0x5c8b40
pushq $0x13
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x4153c
movq 0x8(%rsp), %rax
addl %eax, %ebx
incl %ebx
xorl %r15d, %r15d
movl %ebx, 0x10(%rsp)
cmpl %ebx, %r15d
jge 0x410c6
movq %r13, %rdi
movq %r12, %rsi
callq 0x415ba
movslq %r15d, %rbp
cmpl $0xf, %eax
jg 0x41022
incl %r15d
movl %eax, (%r14,%rbp,4)
jmp 0x40ffd
movq %r12, %rbx
movq %r13, %r12
pushq $0x3
popq %r13
movl %r13d, %edi
cmpl $0x11, %eax
je 0x41070
cmpl $0x10, %eax
jne 0x41069
pushq $0x2
popq %rdi
callq 0x41434
addl $0x3, %eax
leaq (%r14,%rbp,4), %rcx
xorl %edx, %edx
movq %r12, %r13
movq %rbx, %r12
movl 0x10(%rsp), %ebx
cmpl %edx, %eax
je 0x41064
movl -0x4(%rcx,%rdx,4), %esi
movl %esi, (%rcx,%rdx,4)
incq %rdx
jmp 0x41054
addl %edx, %r15d
jmp 0x40ffd
pushq $0x7
popq %rdi
pushq $0xb
popq %r13
callq 0x41434
shlq $0x2, %rbp
addl %r13d, %eax
negl %eax
xorl %ecx, %ecx
movq %r12, %r13
movq %rbx, %r12
movl 0x10(%rsp), %ebx
movl %eax, %edx
addl %ecx, %edx
je 0x410a5
leaq (,%rcx,4), %rdx
addq %rbp, %rdx
andl $0x0, (%r14,%rdx)
incq %rcx
jmp 0x4108a
addl %ecx, %r15d
jmp 0x40ffd
xorl %eax, %eax
cmpq $0x8, %rax
je 0x410d2
movl $0x8, 0x460(%r14,%rax,4)
incq %rax
jmp 0x410af
movq 0x20(%rsp), %rbx
movq 0x8(%rsp), %r15
jmp 0x410f8
xorl %eax, %eax
pushq $0x20
popq %rcx
movl %ecx, 0x4(%rsp)
cmpq $0x20, %rax
je 0x410f2
movl $0x5, 0x480(%r14,%rax,4)
incq %rax
jmp 0x410db
movl $0x120, %r15d           # imm = 0x120
leaq 0x5875c1(%rip), %r12    # 0x5c86c0
leaq 0x587a3a(%rip), %r13    # 0x5c8b40
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0x4153c
leaq 0x587aa2(%rip), %rdx    # 0x5c8bc0
leaq 0x58829b(%rip), %rcx    # 0x5c93c0
pushq $0x9
popq %r8
movq %r12, %rdi
movq %r13, %rsi
callq 0x41602
movslq %r15d, %rax
leaq (%r14,%rax,4), %rdi
leaq 0x58847e(%rip), %r14    # 0x5c95c0
leaq 0x5884f7(%rip), %r15    # 0x5c9640
movl 0x4(%rsp), %esi
movq %r14, %rdx
movq %r15, %rcx
callq 0x4153c
leaq 0x588561(%rip), %rdx    # 0x5c96c0
leaq 0x58865a(%rip), %rcx    # 0x5c97c0
pushq $0x6
popq %r8
movq %r14, %rdi
movq %r15, %rsi
callq 0x41602
movl 0x56eea5(%rip), %ecx    # 0x5b0020
movl 0x1c(%rsp), %r15d
movl 0x56efca(%rip), %edx    # 0x5b0150
cmpl %edx, %ecx
jl 0x411c4
leal -0x4000(%rdx), %esi
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
leaq 0x57efd2(%rip), %rdi    # 0x5c0170
addq %rax, %rdi
callq 0x413f9
movl 0x56efa4(%rip), %eax    # 0x5b0150
leal 0x4000(%rax), %ecx
movl %ecx, 0x56ef98(%rip)    # 0x5b0150
cmpl 0x56ee42(%rip), %eax    # 0x5b0000
jge 0x412ee
pushq $0x9
popq %rdi
callq 0x416f1
cltq
leaq 0x5881eb(%rip), %rcx    # 0x5c93c0
movzbl (%rax,%rcx), %edi
testl %edi, %edi
je 0x411ef
leaq 0x5879dc(%rip), %rcx    # 0x5c8bc0
movl (%rcx,%rax,4), %r14d
callq 0x41450
jmp 0x41205
leaq 0x5874ca(%rip), %rdi    # 0x5c86c0
leaq 0x587943(%rip), %rsi    # 0x5c8b40
callq 0x415ba
movl %eax, %r14d
cmpl $0xff, %r14d
jg 0x41232
movl 0x56ee0c(%rip), %eax    # 0x5b0020
leal 0x1(%rax), %ecx
movl %ecx, 0x56ee03(%rip)    # 0x5b0020
andl $0x7fff, %eax           # imm = 0x7FFF
leaq 0x57ef47(%rip), %rdx    # 0x5c0170
movb %r14b, (%rax,%rdx)
jmp 0x41180
cmpl $0x100, %r14d           # imm = 0x100
je 0x4137b
addl $0xffffff1d, %r14d      # imm = 0xFFFFFF1D
leaq 0x5885b3(%rip), %rbx    # 0x5c9800
movl (%rbx,%r14,8), %edi
callq 0x41434
movl %eax, %ebp
addl 0x4(%rbx,%r14,8), %ebp
pushq $0x6
popq %rdi
callq 0x416f1
cltq
leaq 0x588552(%rip), %rcx    # 0x5c97c0
movzbl (%rax,%rcx), %edi
testl %edi, %edi
je 0x41288
leaq 0x588443(%rip), %rcx    # 0x5c96c0
movl (%rcx,%rax,4), %r14d
callq 0x41450
jmp 0x4129e
leaq 0x588331(%rip), %rdi    # 0x5c95c0
leaq 0x5883aa(%rip), %rsi    # 0x5c9640
callq 0x415ba
movl %eax, %r14d
movslq %r14d, %r14
movl (%rbx,%r14,8), %edi
callq 0x41434
addl 0x4(%rbx,%r14,8), %eax
movl 0x56ed6b(%rip), %ecx    # 0x5b0020
negl %eax
movl $0x7fff, %edx           # imm = 0x7FFF
leaq 0x57eead(%rip), %rsi    # 0x5c0170
movq 0x20(%rsp), %rbx
subl $0x1, %ebp
jb 0x41180
leal (%rax,%rcx), %edi
andl %edx, %edi
movb (%rdi,%rsi), %dil
movl %ecx, %r8d
andl %edx, %r8d
movb %dil, (%r8,%rsi)
incl %ecx
movl %ecx, 0x56ed34(%rip)    # 0x5b0020
jmp 0x412c8
movl $0x2, 0x56ed10(%rip)    # 0x5b0008
movl %r15d, 0x56ed19(%rip)   # 0x5b0018
jmp 0x40cd9
testl %ebp, %ebp
je 0x4137b
movl 0x56ee42(%rip), %edx    # 0x5b0150
cmpl %edx, 0x56ed0c(%rip)    # 0x5b0020
jl 0x41350
leal -0x4000(%rdx), %esi
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
leaq 0x57ee46(%rip), %rdi    # 0x5c0170
addq %rax, %rdi
callq 0x413f9
movl 0x56ee18(%rip), %eax    # 0x5b0150
leal 0x4000(%rax), %ecx
movl %ecx, 0x56ee0c(%rip)    # 0x5b0150
cmpl 0x56ecb6(%rip), %eax    # 0x5b0000
jge 0x413e4
pushq $0x8
popq %rdi
callq 0x41434
movl 0x56ecc2(%rip), %ecx    # 0x5b0020
leal 0x1(%rcx), %edx
movl %edx, 0x56ecb9(%rip)    # 0x5b0020
andl $0x7fff, %ecx           # imm = 0x7FFF
leaq 0x57edfc(%rip), %rdx    # 0x5c0170
movb %al, (%rcx,%rdx)
decl %ebp
jmp 0x41304
testl %r15d, %r15d
je 0x40e6b
movl $0xffffc000, %esi       # imm = 0xFFFFC000
addl 0x56edc1(%rip), %esi    # 0x5b0150
movl %esi, 0x56edbb(%rip)    # 0x5b0150
movl 0x56ec85(%rip), %edx    # 0x5b0020
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
leaq 0x57edc7(%rip), %rdi    # 0x5c0170
addq %rax, %rdi
movl %esi, %eax
xorw %dx, %ax
jns 0x413d0
movl $0xffff8000, %ebp       # imm = 0xFFFF8000
andl %ebp, %edx
callq 0x413f9
movl 0x56ec5b(%rip), %edx    # 0x5b0020
andl %edx, %ebp
leaq 0x57eda2(%rip), %rdi    # 0x5c0170
movl %ebp, %esi
callq 0x413f9
movl $0x3, 0x56ec29(%rip)    # 0x5b0008
jmp 0x40cd9
movl $0x1, 0x56ec1a(%rip)    # 0x5b0008
movl %ebp, 0x56ec1c(%rip)    # 0x5b0010
jmp 0x412f8