// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: clearview
void clearview(int dacol)
{
	int y, dx;
	intptr_t p;

	if (qsetmode != 200) return;

#if USE_POLYMOST && USE_OPENGL
	if (rendmode == 3) {
		palette_t p;
		if (usegammabrightness) p = curpalette[dacol];
		else {
			p.r = britable[curbrightness][ curpalette[dacol].r ];
			p.g = britable[curbrightness][ curpalette[dacol].g ];
			p.b = britable[curbrightness][ curpalette[dacol].b ];
		}
		glfunc.glClearColor(((float)p.r)/255.0,
					  ((float)p.g)/255.0,
					  ((float)p.b)/255.0,
					  0);
		glfunc.glScissor(windowx1,yres-(windowy2+1),windowx2-windowx1+1,windowy2-windowy1+1);
		glfunc.glEnable(GL_SCISSOR_TEST);
		glfunc.glClear(GL_COLOR_BUFFER_BIT);
		glfunc.glDisable(GL_SCISSOR_TEST);
		return;
	}
#endif

	dx = windowx2-windowx1+1;
	dacol += (dacol<<8); dacol += (dacol<<16);
	p = frameplace+ylookup[windowy1]+windowx1;
	for(y=windowy1;y<=windowy2;y++) {
		clearbufbyte((void*)p,dx,dacol);
		p += ylookup[1];
	}

	faketimerhandler();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0xc8, 0x17c518(%rip)   # 0x1b8a28
jne 0x3c54d
leaq 0x5be437(%rip), %rax    # 0x5fa950
cmpl $0x3, (%rax)
jne 0x3c558
cmpl $0x0, 0x68267(%rip)     # 0xa478c
je 0x3c5cb
movslq %edi, %rcx
leaq 0x3fa47b(%rip), %rsi    # 0x4369b0
leaq (%rsi,%rcx,4), %rax
leaq (%rsi,%rcx,4), %rdx
incq %rdx
leaq (%rsi,%rcx,4), %rcx
addq $0x2, %rcx
jmp 0x3c601
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movslq 0x397621(%rip), %rax    # 0x3d3b80
cmpl 0x3cba7f(%rip), %eax    # 0x407fe4
jg 0x3c5bc
movl 0x3cba73(%rip), %ebx    # 0x407fe0
movslq 0x3957fc(%rip), %rcx    # 0x3d1d70
subl %ecx, %ebx
incl %ebx
imull $0x1010101, %edi, %ebp  # imm = 0x1010101
leaq 0x141b2b(%rip), %rdx    # 0x17e0b0
addq (%rdx), %rcx
leaq 0x3da711(%rip), %rdx    # 0x416ca0
movslq (%rdx,%rax,4), %r14
addq %rcx, %r14
leal -0x1(%rax), %r15d
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x4d3fe
movslq 0x3da6f7(%rip), %rax    # 0x416ca4
addq %rax, %r14
incl %r15d
cmpl 0x3cba2a(%rip), %r15d   # 0x407fe4
jl 0x3c59a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xacd7
movslq 0x17c432(%rip), %rcx    # 0x1b8a04
movslq %edi, %rsi
leaq 0x3fa3d4(%rip), %rdi    # 0x4369b0
movzbl (%rdi,%rsi,4), %eax
shlq $0x8, %rcx
leaq 0x3fabc5(%rip), %r8     # 0x4371b0
addq %rcx, %r8
addq %r8, %rax
movzbl 0x1(%rdi,%rsi,4), %edx
addq %r8, %rdx
movzbl 0x2(%rdi,%rsi,4), %ecx
addq %r8, %rcx
movzbl (%rax), %eax
movzbl (%rdx), %edx
cvtsi2sd %eax, %xmm0
movsd 0x3aadd(%rip), %xmm2    # 0x770f0
divsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
movzbl (%rcx), %eax
cvtsi2sd %edx, %xmm1
divsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
cvtsi2sd %eax, %xmm3
leaq 0x5be10b(%rip), %rbx    # 0x5fa740
divsd %xmm2, %xmm3
xorps %xmm2, %xmm2
cvtsd2ss %xmm3, %xmm2
xorps %xmm3, %xmm3
callq *(%rbx)
movl 0x395725(%rip), %edi    # 0x3d1d70
leaq 0x679e2(%rip), %rax     # 0xa4034
movl 0x3cb98c(%rip), %ecx    # 0x407fe4
movl %ecx, %esi
notl %esi
addl (%rax), %esi
movl 0x3cb97c(%rip), %edx    # 0x407fe0
subl %edi, %edx
incl %edx
subl 0x397512(%rip), %ecx    # 0x3d3b80
incl %ecx
callq *0x88(%rbx)
movl $0xc11, %edi            # imm = 0xC11
callq *0x40(%rbx)
movl $0x4000, %edi           # imm = 0x4000
callq *0x8(%rbx)
movl $0xc11, %edi            # imm = 0xC11
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x48(%rax)