// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/build.c
// Function: gettile
int gettile(int tilenum)
{
	char snotbuf[80];
	int i, j, otilenum, topleft, gap, temp, templong, ch;
	int xtiles, ytiles, tottiles;

	if (tilenum < 0) tilenum = 0;

	xtiles = (xdim>>6); ytiles = (ydim>>6); tottiles = xtiles*ytiles;
	otilenum = tilenum;

	keystatus[0x2f] = 0;
	for(i=0;i<MAXTILES;i++)
	{
		localartfreq[i] = 0;
		localartlookup[i] = i;
	}
	if ((searchstat == 1) || (searchstat == 2))
		for(i=0;i<numsectors;i++)
		{
			localartfreq[sector[i].ceilingpicnum]++;
			localartfreq[sector[i].floorpicnum]++;
		}
	if (searchstat == 0)
		for(i=0;i<numwalls;i++)
			localartfreq[wall[i].picnum]++;
	if (searchstat == 4)
		for(i=0;i<numwalls;i++)
			localartfreq[wall[i].overpicnum]++;
	if (searchstat == 3)
		for(i=0;i<MAXSPRITES;i++)
			if (sprite[i].statnum < MAXSTATUS)
				localartfreq[sprite[i].picnum]++;
	gap = (MAXTILES>>1);
	do
	{
		for(i=0;i<MAXTILES-gap;i++)
		{
			temp = i;
			while ((localartfreq[temp] < localartfreq[temp+gap]) && (temp >= 0))
			{
				templong = localartfreq[temp];
				localartfreq[temp] = localartfreq[temp+gap];
				localartfreq[temp+gap] = templong;
				templong = localartlookup[temp];
				localartlookup[temp] = localartlookup[temp+gap];
				localartlookup[temp+gap] = templong;

				if (tilenum == temp)
					tilenum = temp+gap;
				else if (tilenum == temp+gap)
					tilenum = temp;

				temp -= gap;
			}
		}
		gap >>= 1;
	}
	while (gap > 0);
	localartlookupnum = 0;
	while (localartfreq[localartlookupnum] > 0)
		localartlookupnum++;

	if (localartfreq[0] == 0)
	{
		tilenum = otilenum;
		localartlookupnum = MAXTILES;
		for(i=0;i<MAXTILES;i++)
			localartlookup[i] = i;
	}

	topleft = ((tilenum/(xtiles<<gettilezoom))*(xtiles<<gettilezoom))-(xtiles<<gettilezoom);
	if (topleft < 0) topleft = 0;
	if (topleft > MAXTILES-(tottiles<<(gettilezoom<<1))) topleft = MAXTILES-(tottiles<<(gettilezoom<<1));
	while ((keystatus[0x1c]|keystatus[1]) == 0)
	{
		drawtilescreen(topleft,tilenum);
		OSD_Draw();
		showframe();

		if (handleevents()) {
			if (quitevent) quitevent = 0;
		}

		synctics = totalclock-lockclock;
		lockclock += synctics;

		if ((keystatus[0x37] > 0) && (gettilezoom < 2))
		{
			gettilezoom++;
			topleft = ((tilenum/(xtiles<<gettilezoom))*(xtiles<<gettilezoom))-(xtiles<<gettilezoom);
			if (topleft < 0) topleft = 0;
			if (topleft > MAXTILES-(tottiles<<(gettilezoom<<1))) topleft = MAXTILES-(tottiles<<(gettilezoom<<1));
			keystatus[0x37] = 0;
		}
		if ((keystatus[0xb5] > 0) && (gettilezoom > 0))
		{
			gettilezoom--;
			topleft = ((tilenum/(xtiles<<gettilezoom))*(xtiles<<gettilezoom))-(xtiles<<gettilezoom);
			if (topleft < 0) topleft = 0;
			if (topleft > MAXTILES-(tottiles<<(gettilezoom<<1))) topleft = MAXTILES-(tottiles<<(gettilezoom<<1));
			keystatus[0xb5] = 0;
		}
		if ((keystatus[0xcb] > 0) && (tilenum > 0))
			tilenum--, keystatus[0xcb] = 0;
		if ((keystatus[0xcd] > 0) && (tilenum < MAXTILES-1))
			tilenum++, keystatus[0xcd] = 0;
		if ((keystatus[0xc8] > 0) && (tilenum >= (xtiles<<gettilezoom)))
			tilenum-=(xtiles<<gettilezoom), keystatus[0xc8] = 0;
		if ((keystatus[0xd0] > 0) && (tilenum < MAXTILES-(xtiles<<gettilezoom)))
			tilenum+=(xtiles<<gettilezoom), keystatus[0xd0] = 0;
		if ((keystatus[0xc9] > 0) && (tilenum >= (xtiles<<gettilezoom)))
		{
			tilenum-=(tottiles<<(gettilezoom<<1));
			if (tilenum < 0) tilenum = 0;
			keystatus[0xc9] = 0;
		}
		if ((keystatus[0xd1] > 0) && (tilenum < MAXTILES-(xtiles<<gettilezoom)))
		{
			tilenum+=(tottiles<<(gettilezoom<<1));
			if (tilenum >= MAXTILES) tilenum = MAXTILES-1;
			keystatus[0xd1] = 0;
		}
		if (keystatus[0x2f] > 0)   //V
		{
			keystatus[0x2f] = 0;
			if (tilenum < localartlookupnum)
				tilenum = localartlookup[tilenum];
			else
				tilenum = 0;
			localartlookupnum = MAXTILES;
			for(i=0;i<MAXTILES;i++)
				localartlookup[i] = i;
		}
		if (keystatus[0x22] > 0)       //G (goto)
		{
			if (tilenum < localartlookupnum)         //Automatically press 'V'
				tilenum = localartlookup[tilenum];
			else
				tilenum = 0;
			localartlookupnum = MAXTILES;
			for(i=0;i<MAXTILES;i++)
				localartlookup[i] = i;

			keystatus[0x22] = 0;
			bflushchars();

			j = tilenum;
			while (keystatus[1] == 0)
			{
				if (handleevents()) {
					if (quitevent) quitevent = 0;
				}

				ch = bgetchar();

				//drawtilescreen(topleft,tilenum);
				Bsprintf(snotbuf,"Goto tile: %d_ ",j);
				printext256(0,0,whitecol,blackcol,snotbuf,0);
				showframe();

				if (ch >= '0' && ch <= '9') {
					i = (j*10)+(ch-'0');
					if (i < MAXTILES) j = i;
				} else if (ch == 8) {
					j /= 10;
				} else if (ch == 13) {
					tilenum = j;
					break;
				}
			}
			clearkeys();
		}
		while (tilenum < topleft) topleft -= (xtiles<<gettilezoom);
		while (tilenum >= topleft+(tottiles<<(gettilezoom<<1))) topleft += (xtiles<<gettilezoom);
		if (topleft < 0) topleft = 0;
		if (topleft > MAXTILES-(tottiles<<(gettilezoom<<1))) topleft = MAXTILES-(tottiles<<(gettilezoom<<1));
	}

	if (keystatus[0x1c] == 0)
	{
		tilenum = otilenum;
	}
	else
	{
		if (tilenum < localartlookupnum)
		{
			tilenum = localartlookup[tilenum];
			if ((tilesizx[tilenum] == 0) || (tilesizy[tilenum] == 0))
				tilenum = otilenum;
		}
		else
			tilenum = otilenum;
	}
	keystatus[0x1] = 0;
	keystatus[0x1c] = 0;
	return(tilenum);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edi, %ebp
leaq 0x3f035a(%rip), %rax    # 0x407fec
movl (%rax), %eax
movl %eax, 0x14(%rsp)
leaq 0x3f0351(%rip), %rax    # 0x407ff0
movl (%rax), %eax
sarl $0x6, %eax
movl %eax, 0x10(%rsp)
leaq 0x1665e1(%rip), %rax    # 0x17e290
movb $0x0, 0x2f(%rax)
leaq 0x1210e6(%rip), %r15    # 0x138da0
xorl %ebx, %ebx
movl $0x4800, %edx           # imm = 0x4800
movq %r15, %rdi
xorl %esi, %esi
callq 0x62f0
movdqa 0x5c3bd(%rip), %xmm0    # 0x74090
leaq 0x1258d6(%rip), %r12    # 0x13d5b0
movdqa 0x5c3be(%rip), %xmm1    # 0x740a0
movdqa %xmm0, (%rbx,%r12)
paddw %xmm1, %xmm0
addq $0x10, %rbx
cmpq $0x4800, %rbx           # imm = 0x4800
jne 0x17ce2
xorl %r8d, %r8d
testl %ebp, %ebp
cmovgl %ebp, %r8d
leaq 0x380dc9(%rip), %rax    # 0x398ad2
movzwl (%rax), %eax
leal -0x1(%rax), %ecx
cmpw $0x1, %cx
ja 0x17d55
leaq 0x3b8244(%rip), %rcx    # 0x3cff60
movswq (%rcx), %rcx
testq %rcx, %rcx
jle 0x17d55
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rcx
xorl %edx, %edx
leaq 0x22bd2a(%rip), %rsi    # 0x243a60
movswq 0x10(%rsi,%rdx), %rdi
incw (%r15,%rdi,2)
movswq 0x18(%rsi,%rdx), %rdi
incw (%r15,%rdi,2)
addq $0x28, %rdx
cmpq %rdx, %rcx
jne 0x17d36
sarl $0x6, 0x14(%rsp)
testl %eax, %eax
je 0x17dc8
cmpl $0x4, %eax
je 0x17d99
cmpl $0x3, %eax
jne 0x17df9
movl $0x1a, %eax
leaq 0x264f38(%rip), %rcx    # 0x27ccb0
cmpw $0x3ff, (%rcx,%rax)     # imm = 0x3FF
jg 0x17d8b
movswq -0xc(%rcx,%rax), %rdx
incw (%r15,%rdx,2)
addq $0x2c, %rax
cmpq $0xb001a, %rax          # imm = 0xB001A
jne 0x17d78
jmp 0x17df9
leaq 0x3feec8(%rip), %rax    # 0x416c68
movswq (%rax), %rax
testq %rax, %rax
jle 0x17df9
leaq 0x1a0ca0(%rip), %rcx    # 0x1b8a50
addq $0x12, %rcx
movswq (%rcx), %rdx
incw (%r15,%rdx,2)
addq $0x20, %rcx
decq %rax
jne 0x17db4
jmp 0x17df9
leaq 0x3fee99(%rip), %rax    # 0x416c68
movswq (%rax), %rax
testq %rax, %rax
jle 0x17df9
shlq $0x5, %rax
xorl %ecx, %ecx
leaq 0x1a0c6b(%rip), %rdx    # 0x1b8a50
movswq 0x10(%rdx,%rcx), %rsi
incw (%r15,%rsi,2)
addq $0x20, %rcx
cmpq %rcx, %rax
jne 0x17de5
movl 0x10(%rsp), %eax
imull 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
movl $0x1200, %eax           # imm = 0x1200
movl %r8d, 0xc(%rsp)
movl %r8d, %r14d
movl $0x2400, %ecx           # imm = 0x2400
subl %eax, %ecx
movq %rcx, 0x18(%rsp)
movl %eax, %ecx
leaq (%r12,%rcx,2), %rsi
negl %eax
movslq %eax, %rdi
addq %rdi, %rdi
xorl %r8d, %r8d
movzwl (%r15,%r8,2), %r11d
leaq (%r8,%rcx), %r9
movzwl (%r15,%r9,2), %ebp
cmpw %bp, %r11w
jge 0x17eaa
leaq (%r15,%r9,2), %rbx
movq %rsi, %r9
movq %r8, %r13
movl %r8d, %r10d
leal (%rcx,%r10), %edx
movw %bp, (%r15,%r13,2)
movw %r11w, (%rbx)
movzwl (%r12,%r13,2), %r11d
movzwl (%r9), %ebx
movw %bx, (%r12,%r13,2)
movw %r11w, (%r9)
cmpl %r14d, %edx
movl %r14d, %r11d
cmovel %r10d, %r11d
cmpl %r14d, %r10d
movl %r11d, %r14d
cmovel %edx, %r14d
movl %eax, %r11d
addl %r10d, %r11d
js 0x17eaa
movslq %r11d, %r13
movzwl (%r15,%r13,2), %r11d
movslq %r10d, %rdx
subl %ecx, %r10d
leaq (%r15,%rdx,2), %rbx
movzwl (%rbx), %ebp
addq %rdi, %r9
cmpw %bp, %r11w
jl 0x17e51
incq %r8
addq $0x2, %rsi
cmpq 0x18(%rsp), %r8
jne 0x17e30
movl %ecx, %eax
shrl %eax
cmpl $0x1, %ecx
ja 0x17e13
movw $0xffff, %ax            # imm = 0xFFFF
incl %eax
movswq %ax, %rcx
cmpw $0x0, (%r15,%rcx,2)
jg 0x17ecd
movw %ax, 0x129ece(%rip)     # 0x141db0
cmpw $0x0, 0x120eb6(%rip)    # 0x138da0
leaq 0x16639f(%rip), %rbx    # 0x17e290
movl 0x14(%rsp), %ebp
movl 0x10(%rsp), %r15d
jne 0x17f30
movw $0x2400, 0x129eab(%rip) # imm = 0x2400
movdqa 0x5c183(%rip), %xmm0    # 0x74090
xorl %eax, %eax
movdqa %xmm0, (%rax,%r12)
paddw %xmm1, %xmm0
addq $0x10, %rax
cmpq $0x4800, %rax           # imm = 0x4800
jne 0x17f0f
movw $0x2400, %ax            # imm = 0x2400
movl 0xc(%rsp), %ecx
movl %ecx, %r14d
movb 0x1c(%rbx), %cl
movb 0x1(%rbx), %dl
orb %cl, %dl
jne 0x18378
movl 0x8c0c4(%rip), %ecx     # 0xa4008
movl %ebp, %esi
shll %cl, %esi
movl %r14d, %eax
cltd
idivl %esi
addl %esi, %edx
movl %r14d, %eax
subl %edx, %eax
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
addl %ecx, %ecx
movl %r15d, %edx
shll %cl, %edx
movl $0x2400, %r13d          # imm = 0x2400
subl %edx, %r13d
cmpl %r13d, %eax
cmovll %eax, %r13d
movl %r13d, %edi
movl %r14d, %esi
callq 0x18782
callq 0x4c991
callq 0x6efcd
callq 0x6f32a
testl %eax, %eax
je 0x17fa7
leaq 0x166108(%rip), %rax    # 0x17e0a0
cmpb $0x0, (%rax)
je 0x17fa7
leaq 0x1660fc(%rip), %rax    # 0x17e0a0
movb $0x0, (%rax)
leaq 0x39453a(%rip), %rax    # 0x3ac4e8
movl (%rax), %eax
movl %eax, %ecx
subl 0x115da8(%rip), %ecx    # 0x12dd60
movl %ecx, 0x115da6(%rip)    # 0x12dd64
movl %eax, 0x115d9c(%rip)    # 0x12dd60
cmpb $0x0, 0x37(%rbx)
setg %cl
movl 0x8c037(%rip), %eax     # 0xa4008
cmpl $0x2, %eax
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1802c
leal 0x2(,%rax,2), %esi
leal 0x1(%rax), %edi
movl %ebp, %r8d
movl %edi, %ecx
shll %cl, %r8d
movl %edi, 0x8c012(%rip)     # 0xa4008
movl %r14d, %eax
cltd
idivl %r8d
addl %r8d, %edx
movl %r14d, %eax
subl %edx, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movl %r15d, %edx
movl %esi, %ecx
shll %cl, %edx
movl $0x2400, %r13d          # imm = 0x2400
subl %edx, %r13d
cmpl %r13d, %eax
cmovll %eax, %r13d
movb $0x0, 0x37(%rbx)
movl %edi, %eax
cmpb $0x0, 0xb5(%rbx)
setg %cl
testl %eax, %eax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
movdqa 0x5c058(%rip), %xmm1    # 0x740a0
jne 0x1809b
leal -0x2(,%rax,2), %esi
leal -0x1(%rax), %edi
movl %ebp, %r8d
movl %edi, %ecx
shll %cl, %r8d
movl %edi, 0x8bfa6(%rip)     # 0xa4008
movl %r14d, %eax
cltd
idivl %r8d
addl %r8d, %edx
movl %r14d, %eax
subl %edx, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movl %r15d, %edx
movl %esi, %ecx
shll %cl, %edx
movl $0x2400, %r13d          # imm = 0x2400
subl %edx, %r13d
cmpl %r13d, %eax
cmovll %eax, %r13d
movb $0x0, 0xb5(%rbx)
movl %edi, %eax
testl %r14d, %r14d
jle 0x180b3
cmpb $0x0, 0xcb(%rbx)
jle 0x180b3
decl %r14d
movb $0x0, 0xcb(%rbx)
cmpb $0x0, 0xcd(%rbx)
jle 0x180cf
cmpl $0x23fe, %r14d          # imm = 0x23FE
jg 0x180cf
incl %r14d
movb $0x0, 0xcd(%rbx)
cmpb $0x0, 0xc8(%rbx)
jle 0x180ef
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
movl %r14d, %ecx
subl %edx, %ecx
jl 0x180ef
movb $0x0, 0xc8(%rbx)
movl %ecx, %r14d
cmpb $0x0, 0xd0(%rbx)
jle 0x18117
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
movl $0x2400, %ecx           # imm = 0x2400
subl %edx, %ecx
cmpl %ecx, %r14d
jge 0x18117
addl %r14d, %edx
movb $0x0, 0xd0(%rbx)
movl %edx, %r14d
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
cmpb $0x0, 0xc9(%rbx)
jle 0x18149
cmpl %edx, %r14d
jl 0x18149
leal (%rax,%rax), %ecx
movl %r15d, %edx
shll %cl, %edx
subl %edx, %r14d
testl %r14d, %r14d
movl $0x0, %ecx
cmovlel %ecx, %r14d
movb $0x0, 0xc9(%rbx)
cmpb $0x0, 0xd1(%rbx)
jle 0x18183
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
movl $0x2400, %ecx           # imm = 0x2400
subl %edx, %ecx
cmpl %ecx, %r14d
jge 0x18183
leal (%rax,%rax), %ecx
movl %r15d, %edx
shll %cl, %edx
addl %r14d, %edx
movl $0x23ff, %ecx           # imm = 0x23FF
cmpl %ecx, %edx
cmovgel %ecx, %edx
movb $0x0, 0xd1(%rbx)
movl %edx, %r14d
cmpb $0x0, 0x2f(%rbx)
jle 0x181d0
movb $0x0, 0x2f(%rbx)
movswl 0x129c1c(%rip), %edx    # 0x141db0
xorl %ecx, %ecx
cmpl %edx, %r14d
jge 0x181a3
movslq %r14d, %rcx
movswl (%r12,%rcx,2), %ecx
movw $0x2400, 0x129c04(%rip) # imm = 0x2400
xorl %edx, %edx
movdqa 0x5beda(%rip), %xmm0    # 0x74090
movdqa %xmm0, (%rdx,%r12)
paddw %xmm1, %xmm0
addq $0x10, %rdx
cmpq $0x4800, %rdx           # imm = 0x4800
jne 0x181b6
movl %ecx, %r14d
cmpb $0x0, 0x22(%rbx)
jle 0x1830c
movswl 0x129bcf(%rip), %eax    # 0x141db0
xorl %ebp, %ebp
cmpl %eax, %r14d
jge 0x181f0
movslq %r14d, %rax
movswl (%r12,%rax,2), %ebp
movw $0x2400, 0x129bb7(%rip) # imm = 0x2400
xorl %eax, %eax
movdqa 0x5be8d(%rip), %xmm0    # 0x74090
movdqa %xmm0, (%rax,%r12)
paddw %xmm1, %xmm0
addq $0x10, %rax
cmpq $0x4800, %rax           # imm = 0x4800
jne 0x18203
movb $0x0, 0x22(%rbx)
callq 0x1f0c4
cmpb $0x0, 0x1(%rbx)
je 0x18230
movl %ebp, %r14d
jmp 0x182f2
movl %ebp, 0x18(%rsp)
movl %ebp, %r14d
callq 0x6f32a
testl %eax, %eax
je 0x18256
leaq 0x165e59(%rip), %rax    # 0x17e0a0
cmpb $0x0, (%rax)
je 0x18256
leaq 0x165e4d(%rip), %rax    # 0x17e0a0
movb $0x0, (%rax)
callq 0x1f08a
movl %eax, %ebp
leaq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0x5c38b(%rip), %rsi     # 0x745f7
movl %r14d, %edx
xorl %eax, %eax
callq 0x6b00
movswl 0x115acb(%rip), %edx    # 0x12dd48
movswl 0x115ac8(%rip), %ecx    # 0x12dd4c
xorl %edi, %edi
xorl %esi, %esi
movq %r15, %r8
xorl %r9d, %r9d
callq 0x3d8b3
callq 0x6efcd
leal -0x30(%rbp), %eax
cmpb $0x9, %al
ja 0x182b8
movzbl %bpl, %eax
leal (%r14,%r14,4), %ecx
leal (%rax,%rcx,2), %eax
addl $-0x30, %eax
cmpl $0x2400, %eax           # imm = 0x2400
cmovll %eax, %r14d
jmp 0x182e1
cmpb $0x8, %bpl
je 0x182c9
movzbl %bpl, %eax
cmpl $0xd, %eax
jne 0x182e1
jmp 0x182f2
movslq %r14d, %rax
imulq $0x66666667, %rax, %r14 # imm = 0x66666667
movq %r14, %rax
shrq $0x3f, %rax
sarq $0x22, %r14
addl %eax, %r14d
cmpb $0x0, 0x1(%rbx)
je 0x18237
movl 0x18(%rsp), %eax
movl %eax, %r14d
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x62f0
movl 0x8bd01(%rip), %eax     # 0xa4008
movl 0x10(%rsp), %r15d
cmpl %r13d, %r14d
movl 0x14(%rsp), %ebp
jge 0x18323
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
subl %edx, %r13d
cmpl %r13d, %r14d
jl 0x1831b
leal (%rax,%rax), %ecx
movl %r15d, %edx
shll %cl, %edx
leal (%rdx,%r13), %ecx
cmpl %ecx, %r14d
jl 0x18346
movl %ebp, %esi
movl %eax, %ecx
shll %cl, %esi
addl %esi, %r13d
leal (%rdx,%r13), %eax
cmpl %eax, %r14d
jge 0x1833a
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
movl $0x2400, %eax           # imm = 0x2400
subl %edx, %eax
cmpl %eax, %r13d
cmovll %r13d, %eax
movb 0x1c(%rbx), %cl
movb 0x1(%rbx), %dl
orb %cl, %dl
movl %eax, %r13d
je 0x17f73
movzwl 0x129a38(%rip), %eax    # 0x141db0
testb %cl, %cl
je 0x183a6
cwtl
cmpl %eax, %r14d
jge 0x183a6
movslq %r14d, %rax
movswq (%r12,%rax,2), %rax
leaq 0x3f7c8f(%rip), %rcx    # 0x410020
cmpw $0x0, (%rcx,%rax,2)
je 0x183a6
leaq 0x3e9441(%rip), %rcx    # 0x4017e0
cmpw $0x0, (%rcx,%rax,2)
jne 0x183aa
movl 0xc(%rsp), %eax
xorl %ecx, %ecx
movb %cl, 0x1(%rbx)
movb %cl, 0x1c(%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq