// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setviewtotile
void setviewtotile(short tilenume, int xsiz, int ysiz)
{
	int i, j;

		//DRAWROOMS TO TILE BACKUP&SET CODE
	tilesizx[tilenume] = xsiz; tilesizy[tilenume] = ysiz;
	bakxsiz[setviewcnt] = xsiz; bakysiz[setviewcnt] = ysiz;
	bakframeplace[setviewcnt] = frameplace; frameplace = waloff[tilenume];
	bakwindowx1[setviewcnt] = windowx1; bakwindowy1[setviewcnt] = windowy1;
	bakwindowx2[setviewcnt] = windowx2; bakwindowy2[setviewcnt] = windowy2;
#if USE_POLYMOST
	if (setviewcnt == 0) {
		bakrendmode = rendmode;
		baktile = tilenume;
	}
	rendmode = 0;//2;
#endif
	copybufbyte(&startumost[windowx1],&bakumost[windowx1],(windowx2-windowx1+1)*sizeof(bakumost[0]));
	copybufbyte(&startdmost[windowx1],&bakdmost[windowx1],(windowx2-windowx1+1)*sizeof(bakdmost[0]));
	setviewcnt++;

	offscreenrendering = 1;
	setview(0,0,ysiz-1,xsiz-1);
	setaspect(65536,65536);
	j = 0; for(i=0;i<=xsiz;i++) { ylookup[i] = j, j += ysiz; }
	setvlinebpl(ysiz);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl -0x8(%rbp), %eax
movw %ax, %dx
movswq -0x2(%rbp), %rcx
leaq 0x3f2b99(%rip), %rax    # 0x44ad80
movw %dx, (%rax,%rcx,2)
movl -0xc(%rbp), %eax
movw %ax, %dx
movswq -0x2(%rbp), %rcx
leaq 0x3e4343(%rip), %rax    # 0x43c540
movw %dx, (%rax,%rcx,2)
movl -0x8(%rbp), %edx
movslq 0x41a815(%rip), %rcx    # 0x472a20
leaq 0x41a7fe(%rip), %rax    # 0x472a10
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %edx
movslq 0x41a801(%rip), %rcx    # 0x472a20
leaq 0x41a80a(%rip), %rax    # 0x472a30
movl %edx, (%rax,%rcx,4)
leaq 0x1629e0(%rip), %rax    # 0x1bac10
movq (%rax), %rdx
movslq 0x41a7e6(%rip), %rcx    # 0x472a20
leaq 0x41a7ff(%rip), %rax    # 0x472a40
movq %rdx, (%rax,%rcx,8)
movswq -0x2(%rbp), %rcx
leaq 0x37dbef(%rip), %rax    # 0x3d5e40
movq (%rax,%rcx,8), %rcx
leaq 0x1629b4(%rip), %rax    # 0x1bac10
movq %rcx, (%rax)
movl 0x3b5eeb(%rip), %edx    # 0x40e150
movslq 0x41a7b4(%rip), %rcx    # 0x472a20
leaq 0x41a7ed(%rip), %rax    # 0x472a60
movl %edx, (%rax,%rcx,4)
movl 0x3b7564(%rip), %edx    # 0x40f7e0
movslq 0x41a79d(%rip), %rcx    # 0x472a20
leaq 0x41a7e6(%rip), %rax    # 0x472a70
movl %edx, (%rax,%rcx,4)
movl 0x3eaaad(%rip), %edx    # 0x442d40
movslq 0x41a786(%rip), %rcx    # 0x472a20
leaq 0x41a7df(%rip), %rax    # 0x472a80
movl %edx, (%rax,%rcx,4)
movl 0x3eaa9a(%rip), %edx    # 0x442d44
movslq 0x41a76f(%rip), %rcx    # 0x472a20
leaq 0x41a7d8(%rip), %rax    # 0x472a90
movl %edx, (%rax,%rcx,4)
cmpl $0x0, 0x41a75e(%rip)    # 0x472a20
jne 0x582dd
leaq 0x595655(%rip), %rax    # 0x5ed920
movl (%rax), %eax
movl %eax, 0x41a7cd(%rip)    # 0x472aa0
movswl -0x2(%rbp), %eax
movl %eax, 0x41a7c7(%rip)    # 0x472aa4
leaq 0x59563c(%rip), %rax    # 0x5ed920
movl $0x0, (%rax)
movslq 0x3b5e5f(%rip), %rax    # 0x40e150
leaq 0x3b47d8(%rip), %rdi    # 0x40cad0
shlq %rax
addq %rax, %rdi
movslq 0x3b5e4b(%rip), %rax    # 0x40e150
leaq 0x41a7a4(%rip), %rsi    # 0x472ab0
shlq %rax
addq %rax, %rsi
movl 0x3eaa28(%rip), %eax    # 0x442d40
subl 0x3b5e32(%rip), %eax    # 0x40e150
addl $0x1, %eax
cltq
shlq %rax
movl %eax, %edx
callq 0x6ef00
movslq 0x3b5e1c(%rip), %rax    # 0x40e150
leaq 0x3b5e25(%rip), %rdi    # 0x40e160
shlq %rax
addq %rax, %rdi
movslq 0x3b5e08(%rip), %rax    # 0x40e150
leaq 0x41bde1(%rip), %rsi    # 0x474130
shlq %rax
addq %rax, %rsi
movl 0x3ea9e5(%rip), %eax    # 0x442d40
subl 0x3b5def(%rip), %eax    # 0x40e150
addl $0x1, %eax
cltq
shlq %rax
movl %eax, %edx
callq 0x6ef00
movl 0x41a6aa(%rip), %eax    # 0x472a20
addl $0x1, %eax
movl %eax, 0x41a6a1(%rip)    # 0x472a20
leaq 0x162892(%rip), %rax    # 0x1bac18
movb $0x1, (%rax)
movl -0xc(%rbp), %edx
subl $0x1, %edx
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
xorl %esi, %esi
movl %esi, %edi
callq 0x4c7e0
movl $0x10000, %esi          # imm = 0x10000
movl %esi, %edi
callq 0x56e20
movl $0x0, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x8(%rbp), %eax
jg 0x583e5
movl -0x14(%rbp), %edx
movslq -0x10(%rbp), %rcx
leaq 0x3f96b2(%rip), %rax    # 0x451a80
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x583b8
movl -0xc(%rbp), %edi
callq 0xa7550
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)