// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: setview
void setview(int x1, int y1, int x2, int y2)
{
	int i, xfov = 65536;

	if (widescreen) xfov = divscale16(xdim*3, ydim*4);

	windowx1 = x1; wx1 = (x1<<12);
	windowy1 = y1; wy1 = (y1<<12);
	windowx2 = x2; wx2 = ((x2+1)<<12);
	windowy2 = y2; wy2 = ((y2+1)<<12);

	xdimen = (x2-x1)+1; halfxdimen = (xdimen>>1);
	xdimenrecip = divscale32(1L,xdimen);
	ydimen = (y2-y1)+1;

	setaspect(mulscale16(65536,xfov), pixelaspect);

	for(i=0;i<windowx1;i++) { startumost[i] = 1, startdmost[i] = 0; }
	for(i=windowx1;i<=windowx2;i++)
		{ startumost[i] = windowy1, startdmost[i] = windowy2+1; }
	for(i=windowx2+1;i<xdim;i++) { startumost[i] = 1, startdmost[i] = 0; }

#if USE_POLYMOST && USE_OPENGL
	polymost_setview();
#endif
}

// Assembly:
movl %edx, %r8d
movl %edi, %r9d
cmpl $0x0, 0x3e2ac5(%rip)    # 0x416c70
je 0x341d1
movslq 0x3d3e38(%rip), %rax    # 0x407fec
movslq 0x3d3e35(%rip), %rdi    # 0x407ff0
shlq $0x2, %rdi
shlq $0x10, %rax
leaq (%rax,%rax,2), %rax
cqto
idivq %rdi
movq %rax, %rdi
jmp 0x341d6
movl $0x10000, %edi          # imm = 0x10000
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r9d, 0x39db8c(%rip)    # 0x3d1d70
movl %r9d, %eax
shll $0xc, %eax
movl %eax, 0x40239c(%rip)    # 0x43658c
movl %esi, 0x39f98a(%rip)    # 0x3d3b80
movl %esi, %eax
shll $0xc, %eax
movl %eax, 0x40238f(%rip)    # 0x436590
movl %r8d, 0x3d3dd8(%rip)    # 0x407fe0
movl %r8d, %eax
shll $0xc, %eax
movl $0x1000, %edx           # imm = 0x1000
addl %edx, %eax
movl %eax, 0x402379(%rip)    # 0x436594
movl %ecx, 0x3d3dc3(%rip)    # 0x407fe4
movl %ecx, %eax
shll $0xc, %eax
addl %edx, %eax
movl %eax, 0x40236a(%rip)    # 0x436598
subl %r9d, %r8d
incl %r8d
movl %r8d, 0x705f5(%rip)     # 0xa4830
movslq %r8d, %r9
sarl %r8d
movl %r8d, 0x3e4c1c(%rip)    # 0x418e64
movabsq $0x100000000, %rax      # imm = 0x100000000
xorl %edx, %edx
idivq %r9
movl %eax, 0x40233f(%rip)    # 0x43659c
subl %esi, %ecx
incl %ecx
movl %ecx, 0x24782d(%rip)    # 0x27ba94
movl 0x3e2a0b(%rip), %esi    # 0x416c78
callq 0x3bb56
movslq 0x39daf7(%rip), %rbx    # 0x3d1d70
testq %rbx, %rbx
jle 0x34555
leaq (%rbx,%rbx), %rdx
leaq 0x39daf3(%rip), %rdi    # 0x3d1d80
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x62f0
leal 0x7(%rbx), %eax
leaq -0x1(%rbx), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x3, %eax
shlq $0x4, %rax
movdqa 0x3fdf9(%rip), %xmm1    # 0x740b0
movdqa 0x3fe01(%rip), %xmm2    # 0x740c0
movdqa 0x3fe09(%rip), %xmm3    # 0x740d0
movdqa 0x3fe11(%rip), %xmm4    # 0x740e0
movdqa 0x3fe19(%rip), %xmm5    # 0x740f0
pxor %xmm5, %xmm0
pcmpeqd %xmm6, %xmm6
leaq 0x39bc8a(%rip), %rcx    # 0x3cff70
movdqa 0x3fe12(%rip), %xmm7    # 0x74100
movdqa %xmm4, %xmm8
pxor %xmm5, %xmm8
movdqa %xmm8, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm9    # xmm9 = xmm10[0,0,2,2]
pshuflw $0xe8, %xmm9, %xmm11    # xmm11 = xmm9[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm8
pshufd $0xf5, %xmm8, %xmm8     # xmm8 = xmm8[1,1,3,3]
pshuflw $0xe8, %xmm8, %xmm12    # xmm12 = xmm8[0,2,2,3,4,5,6,7]
pand %xmm11, %xmm12
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
pshuflw $0xe8, %xmm10, %xmm11   # xmm11 = xmm10[0,2,2,3,4,5,6,7]
por %xmm12, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
movd %xmm11, %edx
testb $0x1, %dl
je 0x34350
movw $0x1, (%r14,%rcx)
pand %xmm9, %xmm8
por %xmm10, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
movd %xmm8, %edx
shrl $0x10, %edx
testb $0x1, %dl
je 0x3437e
movw $0x1, 0x2(%r14,%rcx)
movdqa %xmm3, %xmm9
pxor %xmm5, %xmm9
movdqa %xmm9, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm8    # xmm8 = xmm10[0,0,2,2]
pcmpeqd %xmm0, %xmm9
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
movdqa %xmm9, %xmm11
pand %xmm8, %xmm11
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
por %xmm10, %xmm11
packssdw %xmm11, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
pextrw $0x2, %xmm11, %edx
testb $0x1, %dl
je 0x343da
movw $0x1, 0x4(%r14,%rcx)
pshufhw $0x84, %xmm8, %xmm8     # xmm8 = xmm8[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm9, %xmm9     # xmm9 = xmm9[0,1,2,3,4,5,4,6]
pand %xmm8, %xmm9
pshufhw $0x84, %xmm10, %xmm8    # xmm8 = xmm10[0,1,2,3,4,5,4,6]
por %xmm9, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x3, %xmm8, %edx
testb $0x1, %dl
je 0x34413
movw $0x1, 0x6(%r14,%rcx)
movdqa %xmm2, %xmm8
pxor %xmm5, %xmm8
movdqa %xmm8, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm9    # xmm9 = xmm10[0,0,2,2]
pshuflw $0xe8, %xmm9, %xmm11    # xmm11 = xmm9[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm8
pshufd $0xf5, %xmm8, %xmm8     # xmm8 = xmm8[1,1,3,3]
pshuflw $0xe8, %xmm8, %xmm12    # xmm12 = xmm8[0,2,2,3,4,5,6,7]
pand %xmm11, %xmm12
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
pshuflw $0xe8, %xmm10, %xmm11   # xmm11 = xmm10[0,2,2,3,4,5,6,7]
por %xmm12, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
pextrw $0x4, %xmm11, %edx
testb $0x1, %dl
je 0x34477
movw $0x1, 0x8(%r14,%rcx)
pand %xmm9, %xmm8
por %xmm10, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x5, %xmm8, %edx
testb $0x1, %dl
je 0x344a3
movw $0x1, 0xa(%r14,%rcx)
movdqa %xmm1, %xmm9
pxor %xmm5, %xmm9
movdqa %xmm9, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm8    # xmm8 = xmm10[0,0,2,2]
pcmpeqd %xmm0, %xmm9
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
movdqa %xmm9, %xmm11
pand %xmm8, %xmm11
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
por %xmm10, %xmm11
packssdw %xmm11, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
pextrw $0x6, %xmm11, %edx
testb $0x1, %dl
je 0x344ff
movw $0x1, 0xc(%r14,%rcx)
pshufhw $0x84, %xmm8, %xmm8     # xmm8 = xmm8[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm9, %xmm9     # xmm9 = xmm9[0,1,2,3,4,5,4,6]
pand %xmm8, %xmm9
pshufhw $0x84, %xmm10, %xmm8    # xmm8 = xmm10[0,1,2,3,4,5,4,6]
por %xmm9, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x7, %xmm8, %edx
testb $0x1, %dl
je 0x34538
movw $0x1, 0xe(%r14,%rcx)
paddq %xmm7, %xmm4
paddq %xmm7, %xmm3
paddq %xmm7, %xmm2
paddq %xmm7, %xmm1
addq $0x10, %r14
cmpq %r14, %rax
jne 0x342ee
movl 0x3d3a85(%rip), %eax    # 0x407fe0
cmpl %eax, %ebx
jle 0x34565
leal 0x1(%rax), %r14d
jmp 0x345a7
movl %ebx, %edi
movzwl 0x39f612(%rip), %ecx    # 0x3d3b80
movl 0x3d3a70(%rip), %edx    # 0x407fe4
incl %edx
leal 0x1(%rax), %r14d
addq %rbx, %rbx
movl %r14d, %esi
subl %edi, %esi
xorl %edi, %edi
leaq 0x39b9e5(%rip), %r8     # 0x3cff70
leaq 0x39d7ee(%rip), %r9     # 0x3d1d80
leaq (%rbx,%rdi,2), %r10
movw %cx, (%r8,%r10)
movw %dx, (%r9,%r10)
incq %rdi
cmpl %edi, %esi
jne 0x34592
movl 0x3d3a3f(%rip), %ebp    # 0x407fec
cmpl %ebp, %r14d
jge 0x34895
movslq %r14d, %r15
leaq 0x39d7c0(%rip), %rcx    # 0x3d1d80
leaq (%rcx,%r15,2), %rdi
movl %ebp, %ecx
subl %eax, %ecx
addl $-0x2, %ecx
leaq 0x2(,%rcx,2), %rdx
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x62f0
notl %r14d
addl %ebp, %r14d
leaq 0x8(%r14), %rax
andq $-0x8, %rax
movq %r14, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x39b975(%rip), %rcx    # 0x3cff70
leaq (%rcx,%r15,2), %rcx
addq $0xe, %rcx
movdqa 0x3faa5(%rip), %xmm1    # 0x740b0
movdqa 0x3faad(%rip), %xmm2    # 0x740c0
movdqa 0x3fab5(%rip), %xmm3    # 0x740d0
movdqa 0x3fabd(%rip), %xmm4    # 0x740e0
movdqa 0x3fac5(%rip), %xmm5    # 0x740f0
pxor %xmm5, %xmm0
pcmpeqd %xmm6, %xmm6
movq %rbx, %xmm7
pshufd $0x44, %xmm7, %xmm7     # xmm7 = xmm7[0,1,0,1]
movdqa %xmm7, %xmm8
por %xmm4, %xmm8
pxor %xmm5, %xmm8
movdqa %xmm8, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm9    # xmm9 = xmm10[0,0,2,2]
pshuflw $0xe8, %xmm9, %xmm11    # xmm11 = xmm9[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm8
pshufd $0xf5, %xmm8, %xmm8     # xmm8 = xmm8[1,1,3,3]
pshuflw $0xe8, %xmm8, %xmm12    # xmm12 = xmm8[0,2,2,3,4,5,6,7]
pand %xmm11, %xmm12
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
pshuflw $0xe8, %xmm10, %xmm11   # xmm11 = xmm10[0,2,2,3,4,5,6,7]
por %xmm12, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
movd %xmm11, %edx
testb $0x1, %dl
je 0x346a4
movw $0x1, -0xe(%rcx,%rbx,2)
pand %xmm9, %xmm8
por %xmm10, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
movd %xmm8, %edx
shrl $0x10, %edx
testb $0x1, %dl
je 0x346d1
movw $0x1, -0xc(%rcx,%rbx,2)
movdqa %xmm7, %xmm9
por %xmm3, %xmm9
pxor %xmm5, %xmm9
movdqa %xmm9, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm8    # xmm8 = xmm10[0,0,2,2]
pcmpeqd %xmm0, %xmm9
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
movdqa %xmm9, %xmm11
pand %xmm8, %xmm11
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
por %xmm10, %xmm11
packssdw %xmm11, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
pextrw $0x2, %xmm11, %edx
testb $0x1, %dl
je 0x34731
movw $0x1, -0xa(%rcx,%rbx,2)
pshufhw $0x84, %xmm8, %xmm8     # xmm8 = xmm8[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm9, %xmm9     # xmm9 = xmm9[0,1,2,3,4,5,4,6]
pand %xmm8, %xmm9
pshufhw $0x84, %xmm10, %xmm8    # xmm8 = xmm10[0,1,2,3,4,5,4,6]
por %xmm9, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x3, %xmm8, %edx
testb $0x1, %dl
je 0x34769
movw $0x1, -0x8(%rcx,%rbx,2)
movdqa %xmm7, %xmm8
por %xmm2, %xmm8
pxor %xmm5, %xmm8
movdqa %xmm8, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm9    # xmm9 = xmm10[0,0,2,2]
pshuflw $0xe8, %xmm9, %xmm11    # xmm11 = xmm9[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm8
pshufd $0xf5, %xmm8, %xmm8     # xmm8 = xmm8[1,1,3,3]
pshuflw $0xe8, %xmm8, %xmm12    # xmm12 = xmm8[0,2,2,3,4,5,6,7]
pand %xmm11, %xmm12
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
pshuflw $0xe8, %xmm10, %xmm11   # xmm11 = xmm10[0,2,2,3,4,5,6,7]
por %xmm12, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
pextrw $0x4, %xmm11, %edx
testb $0x1, %dl
je 0x347d1
movw $0x1, -0x6(%rcx,%rbx,2)
pand %xmm9, %xmm8
por %xmm10, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x5, %xmm8, %edx
testb $0x1, %dl
je 0x347fc
movw $0x1, -0x4(%rcx,%rbx,2)
por %xmm1, %xmm7
pxor %xmm5, %xmm7
movdqa %xmm7, %xmm9
pcmpgtd %xmm0, %xmm9
pshufd $0xa0, %xmm9, %xmm8     # xmm8 = xmm9[0,0,2,2]
pcmpeqd %xmm0, %xmm7
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
movdqa %xmm7, %xmm10
pand %xmm8, %xmm10
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
por %xmm9, %xmm10
packssdw %xmm10, %xmm10
pxor %xmm6, %xmm10
packssdw %xmm10, %xmm10
pextrw $0x6, %xmm10, %edx
testb $0x1, %dl
je 0x34853
movw $0x1, -0x2(%rcx,%rbx,2)
pshufhw $0x84, %xmm8, %xmm8     # xmm8 = xmm8[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm7, %xmm7     # xmm7 = xmm7[0,1,2,3,4,5,4,6]
pand %xmm8, %xmm7
pshufhw $0x84, %xmm9, %xmm8     # xmm8 = xmm9[0,1,2,3,4,5,4,6]
por %xmm7, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm7
pextrw $0x7, %xmm7, %edx
testb $0x1, %dl
je 0x34888
movw $0x1, (%rcx,%rbx,2)
addq $0x8, %rbx
cmpq %rbx, %rax
jne 0x34633
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x50c17