// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: ceilspritescan
static void ceilspritescan(int x1, int x2)
{
	int x, y1, y2, twall, bwall;

	y1 = uwall[x1]; y2 = y1;
	for(x=x1;x<=x2;x++)
	{
		twall = uwall[x]-1; bwall = dwall[x];
		if (twall < bwall-1)
		{
			if (twall >= y2)
			{
				while (y1 < y2-1) ceilspritehline(x-1,++y1);
				y1 = twall;
			}
			else
			{
				while (y1 < twall) ceilspritehline(x-1,++y1);
				while (y1 > twall) lastx[y1--] = x;
			}
			while (y2 > bwall) ceilspritehline(x-1,--y2);
			while (y2 < bwall) lastx[y2++] = x;
		}
		else
		{
			while (y1 < y2-1) ceilspritehline(x-1,++y1);
			if (x == x2) break;
			y1 = uwall[x+1]; y2 = y1;
		}
	}
	while (y1 < y2-1) ceilspritehline(x2,++y1);
	faketimerhandler();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq %edi, %r12
leaq 0x564769(%rip), %rax    # 0x5a4520
movswl (%rax,%r12,2), %ebp
cmpl %esi, %r12d
movq %rsi, 0x8(%rsp)
jle 0x3fdce
movl %ebp, %r14d
jmp 0x3fff9
movslq %esi, %rcx
movq %rcx, 0x10(%rsp)
leal 0x1(%rsi), %ecx
movl %ecx, 0x4(%rsp)
movl %ebp, %r14d
movswl (%rax,%r12,2), %ebx
leaq 0x469124(%rip), %rcx    # 0x4a8f10
movswl (%rcx,%r12,2), %r13d
cmpw %r13w, %bx
jge 0x3fe2c
leal -0x1(%rbx), %esi
cmpl %ebx, %r14d
jge 0x3fe6e
leal -0x1(%r14), %eax
cmpl %eax, %ebp
jge 0x3feb8
movl %esi, %ebx
leal -0x1(%r12), %r15d
incl %ebp
movl %r15d, %edi
movl %ebp, %esi
callq 0x40d37
incl %ebp
cmpl %ebp, %r14d
jne 0x3fe14
movl %ebx, %ebp
jmp 0x3feba
leal -0x1(%r14), %ebx
cmpl %ebx, %ebp
jge 0x3fe55
leal -0x1(%r12), %r15d
incl %ebp
movl %r15d, %edi
movl %ebp, %esi
callq 0x40d37
incl %ebp
cmpl %ebp, %r14d
jne 0x3fe3b
movl %ebx, %ebp
leaq 0x5646cb(%rip), %rax    # 0x5a4520
cmpq 0x10(%rsp), %r12
je 0x3fff9
movswl 0x2(%rax,%r12,2), %r14d
movl %r14d, %ebp
jmp 0x3ffeb
cmpl %esi, %ebp
jge 0x3fe91
movl %esi, (%rsp)
leal -0x1(%r12), %r15d
incl %ebp
movl %r15d, %edi
movl %ebp, %esi
callq 0x40d37
incl %ebp
cmpl %ebp, %ebx
jne 0x3fe7c
movl (%rsp), %ebp
jmp 0x3feba
cmpl %ebx, %ebp
jl 0x3feba
movslq %ebp, %rax
movslq %ebx, %rcx
leaq 0x413e8e(%rip), %rdx    # 0x453d30
leaq (%rdx,%rax,4), %rdx
incq %rax
movl %r12d, (%rdx)
decq %rax
addq $-0x4, %rdx
cmpq %rcx, %rax
jg 0x3fea9
movl %esi, %ebp
cmpl %r13d, %r14d
jle 0x3fed7
leal -0x1(%r12), %r15d
decl %r14d
movl %r15d, %edi
movl %r14d, %esi
callq 0x40d37
cmpl %r13d, %r14d
jg 0x3fec4
cmpl %r13d, %r14d
jge 0x3ffe4
movslq %r14d, %rcx
movslq %r13d, %rdx
subq %rcx, %rdx
leaq 0x3(%rdx), %rax
andq $-0x4, %rax
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x413e2b(%rip), %rdx    # 0x453d30
leaq (%rdx,%rcx,4), %rcx
addq $0xc, %rcx
movdqa 0x341db(%rip), %xmm7    # 0x740f0
pxor %xmm7, %xmm0
xorl %edx, %edx
movdqa 0x341ad(%rip), %xmm5    # 0x740d0
movdqa 0x341b5(%rip), %xmm6    # 0x740e0
pcmpeqd %xmm8, %xmm8
movq %rdx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa %xmm1, %xmm2
por %xmm6, %xmm2
pxor %xmm7, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm0, %xmm3
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
movd %xmm2, %esi
notl %esi
testb $0x1, %sil
je 0x3ff75
movl %r12d, -0xc(%rcx,%rdx,4)
pxor %xmm8, %xmm2
pextrw $0x4, %xmm2, %esi
testb $0x1, %sil
je 0x3ff8a
movl %r12d, -0x8(%rcx,%rdx,4)
por %xmm5, %xmm1
pxor %xmm7, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm3, %xmm1
pxor %xmm8, %xmm1
pextrw $0x0, %xmm1, %esi
testb $0x1, %sil
je 0x3ffc5
movl %r12d, -0x4(%rcx,%rdx,4)
pextrw $0x4, %xmm1, %esi
testb $0x1, %sil
je 0x3ffd4
movl %r12d, (%rcx,%rdx,4)
addq $0x4, %rdx
cmpq %rdx, %rax
jne 0x3ff30
movl %r13d, %r14d
leaq 0x564535(%rip), %rax    # 0x5a4520
incq %r12
cmpl %r12d, 0x4(%rsp)
jne 0x3fde0
leal -0x1(%r14), %eax
cmpl %eax, %ebp
movq 0x8(%rsp), %rbx
jge 0x40018
incl %ebp
movl %ebx, %edi
movl %ebp, %esi
callq 0x40d37
incl %ebp
cmpl %ebp, %r14d
jne 0x40008
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xacd7