// File: /workspace/github_c_makefile_star2_O2/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, 0x178fc8(%rip)   # 0x1b1a28
jne 0x38a9d
leaq 0x5baee7(%rip), %rax    # 0x5f3950
cmpl $0x3, (%rax)
jne 0x38aa8
cmpl $0x0, 0x64d17(%rip)     # 0x9d78c
je 0x38b12
movslq %edi, %rcx
leaq 0x3f6f2b(%rip), %rsi    # 0x42f9b0
leaq (%rsi,%rcx,4), %rax
leaq (%rsi,%rcx,4), %rdx
incq %rdx
leaq (%rsi,%rcx,4), %rcx
addq $0x2, %rcx
jmp 0x38b48
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x3c8532(%rip), %ebx    # 0x400fe0
movslq 0x3922bb(%rip), %r14    # 0x3cad70
subl %r14d, %ebx
incl %ebx
imull $0x1010101, %edi, %ebp  # imm = 0x1010101
leaq 0x13e5e9(%rip), %rax    # 0x1770b0
movslq 0x3940b2(%rip), %r15    # 0x3ccb80
leaq 0x3d71cb(%rip), %rcx    # 0x40fca0
movslq (%rcx,%r15,4), %rcx
addq (%rax), %r14
addq %rcx, %r14
cmpl 0x3c84fe(%rip), %r15d   # 0x400fe4
jg 0x38b03
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x444f0
movslq 0x3d71a9(%rip), %rax    # 0x40fca4
addq %rax, %r14
incl %r15d
jmp 0x38adf
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9fd2
movslq 0x178eeb(%rip), %rcx    # 0x1b1a04
movslq %edi, %rsi
leaq 0x3f6e8d(%rip), %rdi    # 0x42f9b0
movzbl (%rdi,%rsi,4), %eax
shlq $0x8, %rcx
leaq 0x3f767e(%rip), %r8     # 0x4301b0
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 0x3343e(%rip), %xmm2    # 0x6bf98
divsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
movzbl (%rcx), %eax
cvtsi2sd %edx, %xmm1
divsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
cvtsi2sd %eax, %xmm3
leaq 0x5babc4(%rip), %rbx    # 0x5f3740
divsd %xmm2, %xmm3
cvtsd2ss %xmm3, %xmm2
xorps %xmm3, %xmm3
callq *(%rbx)
movl 0x3921e1(%rip), %edi    # 0x3cad70
leaq 0x6449e(%rip), %rax     # 0x9d034
movl 0x3c8448(%rip), %ecx    # 0x400fe4
movl %ecx, %esi
notl %esi
addl (%rax), %esi
movl 0x3c8438(%rip), %edx    # 0x400fe0
subl %edi, %edx
incl %edx
subl 0x393fce(%rip), %ecx    # 0x3ccb80
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)