// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: dosetaspect
static void dosetaspect(void)
{
	int i, j, k, x, xinc;

	if (xyaspect != oxyaspect)
	{
		oxyaspect = xyaspect;
		j = xyaspect*320;
		horizlookup2[horizycent-1] = divscale26(131072,j);
		for(i=ydim*4-1;i>=0;i--)
			if (i != (horizycent-1))
			{
				horizlookup[i] = divscale28(1,i-(horizycent-1));
				horizlookup2[i] = divscale14(klabs(horizlookup[i]),j);
			}
	}
	if ((xdimen != oxdimen) || (viewingrange != oviewingrange))
	{
		oxdimen = xdimen;
		oviewingrange = viewingrange;
		xinc = mulscale32(viewingrange*320,xdimenrecip);
		x = (640<<16)-mulscale1(xinc,xdimen);
		for(i=0;i<xdimen;i++)
		{
			j = (x&65535); k = (x>>16); x += xinc;
			if (j != 0) j = mulscale16((int)radarang[k+1]-(int)radarang[k],j);
			radarang2[i] = (short)(((int)radarang[k]+j)>>6);
		}
		for(i=1;i<65536;i++) distrecip[i] = divscale20(xdimen,i);
		nytooclose = xdimen*2100;
		nytoofar = 65536*16384-1048576;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl 0x3613ba(%rip), %eax    # 0x39a418
cmpl 0xa80dc(%rip), %eax     # 0xe1140
je 0x39131
movl 0x3613a8(%rip), %eax    # 0x39a418
movl %eax, 0xa80ca(%rip)     # 0xe1140
imull $0x140, 0x361398(%rip), %eax # imm = 0x140
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %esi
movl $0x20000, %edi          # imm = 0x20000
callq 0x5ae00
movl %eax, %edx
movq 0x4189cf(%rip), %rax    # 0x451a68
movl 0x4189d1(%rip), %ecx    # 0x451a70
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x409ca2(%rip), %eax    # 0x442d50
shll $0x2, %eax
subl $0x1, %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x3912f
movl -0x4(%rbp), %eax
movl 0x4189aa(%rip), %ecx    # 0x451a70
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x39122
movl -0x4(%rbp), %esi
movl 0x41899a(%rip), %eax    # 0x451a70
subl $0x1, %eax
subl %eax, %esi
movl $0x1, %edi
callq 0x37640
movl %eax, %edx
movq 0x418972(%rip), %rax    # 0x451a60
movslq -0x4(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x418964(%rip), %rax    # 0x451a60
movslq -0x4(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x37610
movl %eax, %edi
movl -0x8(%rbp), %esi
callq 0x5ae20
movl %eax, %edx
movq 0x41894d(%rip), %rax    # 0x451a68
movslq -0x4(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x39124
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x390b7
jmp 0x39131
movl 0xa7be9(%rip), %eax     # 0xe0d20
cmpl 0xa8007(%rip), %eax     # 0xe1144
jne 0x39151
movl 0x3d376b(%rip), %eax    # 0x40c8b0
cmpl 0xa7ffd(%rip), %eax     # 0xe1148
je 0x3928c
movl 0xa7bc9(%rip), %eax     # 0xe0d20
movl %eax, 0xa7fe7(%rip)     # 0xe1144
movl 0x3d374d(%rip), %eax    # 0x40c8b0
movl %eax, 0xa7fdf(%rip)     # 0xe1148
imull $0x140, 0x3d373d(%rip), %edi # imm = 0x140
movl 0x437c73(%rip), %esi    # 0x470dec
callq 0x5ae40
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %edi
movl 0xa7b96(%rip), %esi     # 0xe0d20
callq 0x5ae60
movl %eax, %ecx
movl $0x2800000, %eax        # imm = 0x2800000
subl %ecx, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0xa7b75(%rip), %eax     # 0xe0d20
jge 0x39239
movl -0x10(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x8(%rbp)
movl -0x10(%rbp), %eax
sarl $0x10, %eax
movl %eax, -0xc(%rbp)
movl -0x14(%rbp), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x39204
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x43219c(%rip), %rax    # 0x46b380
movswl (%rax,%rcx,2), %edi
movslq -0xc(%rbp), %rcx
leaq 0x43218d(%rip), %rax    # 0x46b380
movswl (%rax,%rcx,2), %eax
subl %eax, %edi
movl -0x8(%rbp), %esi
callq 0x39010
movl %eax, -0x8(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x432171(%rip), %rax    # 0x46b380
movswl (%rax,%rcx,2), %eax
addl -0x8(%rbp), %eax
sarl $0x6, %eax
movw %ax, %dx
movslq -0x4(%rbp), %rcx
leaq 0x455799(%rip), %rax    # 0x48e9c0
movw %dx, (%rax,%rcx,2)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x391a2
movl $0x1, -0x4(%rbp)
cmpl $0x10000, -0x4(%rbp)    # imm = 0x10000
jge 0x39272
movl 0xa7ad1(%rip), %edi     # 0xe0d20
movl -0x4(%rbp), %esi
callq 0x555d0
movl %eax, %edx
movslq -0x4(%rbp), %rcx
leaq 0x456ddc(%rip), %rax    # 0x490040
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x39240
imull $0x834, 0xa7aa4(%rip), %eax # imm = 0x834
movl %eax, 0x496dbe(%rip)    # 0x4d0040
movl $0x3ff00000, 0x496db8(%rip) # imm = 0x3FF00000
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)