// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: prepwall
static void prepwall(int z, walltype *wal)
{
	int i, l=0, ol=0, splc, sinc, x, topinc, top, botinc, bot, walxrepeat;

	walxrepeat = (wal->xrepeat<<3);

		//lwall calculation
	i = xb1[z]-halfxdimen;
	topinc = -(ry1[z]>>2);
	botinc = ((ry2[z]-ry1[z])>>8);
	top = mulscale5(rx1[z],xdimen)+mulscale2(topinc,i);
	bot = mulscale11(rx1[z]-rx2[z],xdimen)+mulscale2(botinc,i);

	splc = mulscale19(ry1[z],xdimscale);
	sinc = mulscale16(ry2[z]-ry1[z],xdimscale);

	x = xb1[z];
	if (bot != 0)
	{
		l = divscale12(top,bot);
		swall[x] = mulscale21(l,sinc)+splc;
		l *= walxrepeat;
		lwall[x] = (l>>18);
	}
	while (x+4 <= xb2[z])
	{
		top += topinc; bot += botinc;
		if (bot != 0)
		{
			ol = l; l = divscale12(top,bot);
			swall[x+4] = mulscale21(l,sinc)+splc;
			l *= walxrepeat;
			lwall[x+4] = (l>>18);
		}
		i = ((ol+l)>>1);
		lwall[x+2] = (i>>18);
		lwall[x+1] = ((ol+i)>>19);
		lwall[x+3] = ((l+i)>>19);
		swall[x+2] = ((swall[x]+swall[x+4])>>1);
		swall[x+1] = ((swall[x]+swall[x+2])>>1);
		swall[x+3] = ((swall[x+4]+swall[x+2])>>1);
		x += 4;
	}
	if (x+2 <= xb2[z])
	{
		top += (topinc>>1); bot += (botinc>>1);
		if (bot != 0)
		{
			ol = l; l = divscale12(top,bot);
			swall[x+2] = mulscale21(l,sinc)+splc;
			l *= walxrepeat;
			lwall[x+2] = (l>>18);
		}
		lwall[x+1] = ((l+ol)>>19);
		swall[x+1] = ((swall[x]+swall[x+2])>>1);
		x += 2;
	}
	if (x+1 <= xb2[z])
	{
		bot += (botinc>>2);
		if (bot != 0)
		{
			l = divscale12(top+(topinc>>2),bot);
			swall[x+1] = mulscale21(l,sinc)+splc;
			lwall[x+1] = mulscale18(l,walxrepeat);
		}
	}

	if (lwall[xb1[z]] < 0) lwall[xb1[z]] = 0;
	if ((lwall[xb2[z]] >= walxrepeat) && (walxrepeat)) lwall[xb2[z]] = walxrepeat-1;
	if (wal->cstat&8)
	{
		walxrepeat--;
		for(x=xb1[z];x<=xb2[z];x++) lwall[x] = walxrepeat-lwall[x];
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x16(%rax), %eax
shll $0x3, %eax
movl %eax, -0x3c(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x24a41a(%rip), %rax    # 0x2a85d0
movl (%rax,%rcx,4), %eax
subl 0x3f54e5(%rip), %eax    # 0x4536a4
movl %eax, -0x14(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x3e8b93(%rip), %rax    # 0x446d60
movl (%rax,%rcx,4), %ecx
sarl $0x2, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x475e6b(%rip), %rax    # 0x4d4050
movl (%rax,%rcx,4), %eax
movslq -0x4(%rbp), %rdx
leaq 0x3e8b6d(%rip), %rcx    # 0x446d60
subl (%rcx,%rdx,4), %eax
sarl $0x8, %eax
movl %eax, -0x34(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x3e4b59(%rip), %rax    # 0x442d60
movl (%rax,%rcx,4), %edi
movl 0x82b10(%rip), %esi     # 0xe0d20
callq 0x5ae80
movl %eax, -0x44(%rbp)
movl -0x2c(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0x5efb0
movl %eax, %ecx
movl -0x44(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x30(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x3e4b28(%rip), %rax    # 0x442d60
movl (%rax,%rcx,4), %edi
movslq -0x4(%rbp), %rcx
leaq 0x471e0a(%rip), %rax    # 0x4d0050
subl (%rax,%rcx,4), %edi
movl 0x82ad1(%rip), %esi     # 0xe0d20
callq 0x5efd0
movl %eax, -0x40(%rbp)
movl -0x34(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0x5efb0
movl %eax, %ecx
movl -0x40(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x38(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x3e8ae9(%rip), %rax    # 0x446d60
movl (%rax,%rcx,4), %edi
movl 0x3ad614(%rip), %esi    # 0x40b894
callq 0x5eb30
movl %eax, -0x20(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x475dbd(%rip), %rax    # 0x4d4050
movl (%rax,%rcx,4), %edi
movslq -0x4(%rbp), %rcx
leaq 0x3e8abf(%rip), %rax    # 0x446d60
subl (%rax,%rcx,4), %edi
movl 0x3ad5ea(%rip), %esi    # 0x40b894
callq 0x39010
movl %eax, -0x24(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x24a313(%rip), %rax    # 0x2a85d0
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x5e313
movl -0x30(%rbp), %edi
movl -0x38(%rbp), %esi
callq 0x59a10
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x5eb10
movl %eax, %edx
addl -0x20(%rbp), %edx
movslq -0x28(%rbp), %rcx
leaq 0x4803de(%rip), %rax    # 0x4de6d0
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edx
sarl $0x12, %edx
movslq -0x28(%rbp), %rcx
leaq 0x4830c0(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
jmp 0x5e315
movl -0x28(%rbp), %eax
addl $0x4, %eax
movslq -0x4(%rbp), %rdx
leaq 0x24e2ba(%rip), %rcx    # 0x2ac5e0
cmpl (%rcx,%rdx,4), %eax
jg 0x5e4b2
movl -0x2c(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x5e3a1
movl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x30(%rbp), %edi
movl -0x38(%rbp), %esi
callq 0x59a10
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x5eb10
movl %eax, %edx
addl -0x20(%rbp), %edx
movl -0x28(%rbp), %eax
addl $0x4, %eax
movslq %eax, %rcx
leaq 0x480355(%rip), %rax    # 0x4de6d0
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edx
sarl $0x12, %edx
movl -0x28(%rbp), %eax
addl $0x4, %eax
movslq %eax, %rcx
leaq 0x483032(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl -0x18(%rbp), %eax
sarl %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %edx
sarl $0x12, %edx
movl -0x28(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x48300e(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %edx
addl -0x14(%rbp), %edx
sarl $0x13, %edx
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x482ff2(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %edx
addl -0x14(%rbp), %edx
sarl $0x13, %edx
movl -0x28(%rbp), %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x482fd6(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
movslq -0x28(%rbp), %rcx
leaq 0x4802c8(%rip), %rax    # 0x4de6d0
movl (%rax,%rcx,4), %edx
movl -0x28(%rbp), %eax
addl $0x4, %eax
movslq %eax, %rcx
leaq 0x4802b5(%rip), %rax    # 0x4de6d0
addl (%rax,%rcx,4), %edx
sarl %edx
movl -0x28(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x4802a0(%rip), %rax    # 0x4de6d0
movl %edx, (%rax,%rcx,4)
movslq -0x28(%rbp), %rcx
leaq 0x480292(%rip), %rax    # 0x4de6d0
movl (%rax,%rcx,4), %edx
movl -0x28(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x48027f(%rip), %rax    # 0x4de6d0
addl (%rax,%rcx,4), %edx
sarl %edx
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x48026a(%rip), %rax    # 0x4de6d0
movl %edx, (%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x4, %eax
movslq %eax, %rcx
leaq 0x480257(%rip), %rax    # 0x4de6d0
movl (%rax,%rcx,4), %edx
movl -0x28(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x480244(%rip), %rax    # 0x4de6d0
addl (%rax,%rcx,4), %edx
sarl %edx
movl -0x28(%rbp), %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x48022f(%rip), %rax    # 0x4de6d0
movl %edx, (%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x28(%rbp)
jmp 0x5e315
movl -0x28(%rbp), %eax
addl $0x2, %eax
movslq -0x4(%rbp), %rdx
leaq 0x24e11d(%rip), %rcx    # 0x2ac5e0
cmpl (%rcx,%rdx,4), %eax
jg 0x5e59d
movl -0x2c(%rbp), %eax
sarl %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x34(%rbp), %eax
sarl %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x5e542
movl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x30(%rbp), %edi
movl -0x38(%rbp), %esi
callq 0x59a10
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x5eb10
movl %eax, %edx
addl -0x20(%rbp), %edx
movl -0x28(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x4801b4(%rip), %rax    # 0x4de6d0
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edx
sarl $0x12, %edx
movl -0x28(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x482e91(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %edx
addl -0x1c(%rbp), %edx
sarl $0x13, %edx
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x482e75(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
movslq -0x28(%rbp), %rcx
leaq 0x480167(%rip), %rax    # 0x4de6d0
movl (%rax,%rcx,4), %edx
movl -0x28(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x480154(%rip), %rax    # 0x4de6d0
addl (%rax,%rcx,4), %edx
sarl %edx
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x48013f(%rip), %rax    # 0x4de6d0
movl %edx, (%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq -0x4(%rbp), %rdx
leaq 0x24e032(%rip), %rcx    # 0x2ac5e0
cmpl (%rcx,%rdx,4), %eax
jg 0x5e620
movl -0x34(%rbp), %eax
sarl $0x2, %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x5e61e
movl -0x30(%rbp), %edi
movl -0x2c(%rbp), %eax
sarl $0x2, %eax
addl %eax, %edi
movl -0x38(%rbp), %esi
callq 0x59a10
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x5eb10
movl %eax, %edx
addl -0x20(%rbp), %edx
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x4800d5(%rip), %rax    # 0x4de6d0
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %edi
movl -0x3c(%rbp), %esi
callq 0x5eff0
movl %eax, %edx
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x482db5(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
jmp 0x5e620
movslq -0x4(%rbp), %rcx
leaq 0x249fa5(%rip), %rax    # 0x2a85d0
movslq (%rax,%rcx,4), %rcx
leaq 0x482d9a(%rip), %rax    # 0x4e13d0
cmpl $0x0, (%rax,%rcx,4)
jge 0x5e659
movslq -0x4(%rbp), %rcx
leaq 0x249f89(%rip), %rax    # 0x2a85d0
movslq (%rax,%rcx,4), %rcx
leaq 0x482d7e(%rip), %rax    # 0x4e13d0
movl $0x0, (%rax,%rcx,4)
movslq -0x4(%rbp), %rcx
leaq 0x24df7c(%rip), %rax    # 0x2ac5e0
movslq (%rax,%rcx,4), %rcx
leaq 0x482d61(%rip), %rax    # 0x4e13d0
movl (%rax,%rcx,4), %eax
cmpl -0x3c(%rbp), %eax
jl 0x5e69c
cmpl $0x0, -0x3c(%rbp)
je 0x5e69c
movl -0x3c(%rbp), %edx
subl $0x1, %edx
movslq -0x4(%rbp), %rcx
leaq 0x24df52(%rip), %rax    # 0x2ac5e0
movslq (%rax,%rcx,4), %rcx
leaq 0x482d37(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movswl 0xe(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x5e705
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x249f10(%rip), %rax    # 0x2a85d0
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movslq -0x4(%rbp), %rdx
leaq 0x24df0c(%rip), %rcx    # 0x2ac5e0
cmpl (%rcx,%rdx,4), %eax
jg 0x5e703
movl -0x3c(%rbp), %edx
movslq -0x28(%rbp), %rcx
leaq 0x482ce9(%rip), %rax    # 0x4e13d0
subl (%rax,%rcx,4), %edx
movslq -0x28(%rbp), %rcx
leaq 0x482cdb(%rip), %rax    # 0x4e13d0
movl %edx, (%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x5e6c6
jmp 0x5e705
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)