// File: /workspace/github_c_makefile_star2_O1/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, 0x17c7de(%rip)   # 0x1b7a28
jne 0x3b287
leaq 0x5be6fd(%rip), %rax    # 0x5f9950
cmpl $0x3, (%rax)
jne 0x3b292
cmpl $0x0, 0x6852d(%rip)     # 0xa378c
je 0x3b305
movslq %edi, %rcx
leaq 0x3fa741(%rip), %rsi    # 0x4359b0
leaq (%rsi,%rcx,4), %rax
leaq (%rsi,%rcx,4), %rdx
incq %rdx
leaq (%rsi,%rcx,4), %rcx
addq $0x2, %rcx
jmp 0x3b33b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movslq 0x3978e7(%rip), %rax    # 0x3d2b80
cmpl 0x3cbd45(%rip), %eax    # 0x406fe4
jg 0x3b2f6
movl 0x3cbd39(%rip), %ebx    # 0x406fe0
movslq 0x395ac2(%rip), %rcx    # 0x3d0d70
subl %ecx, %ebx
incl %ebx
imull $0x1010101, %edi, %ebp  # imm = 0x1010101
leaq 0x141df1(%rip), %rdx    # 0x17d0b0
addq (%rdx), %rcx
leaq 0x3da9d7(%rip), %rdx    # 0x415ca0
movslq (%rdx,%rax,4), %r14
addq %rcx, %r14
leal -0x1(%rax), %r15d
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x4ac19
movslq 0x3da9bd(%rip), %rax    # 0x415ca4
addq %rax, %r14
incl %r15d
cmpl 0x3cbcf0(%rip), %r15d   # 0x406fe4
jl 0x3b2d4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xab51
movslq 0x17c6f8(%rip), %rcx    # 0x1b7a04
movslq %edi, %rsi
leaq 0x3fa69a(%rip), %rdi    # 0x4359b0
movzbl (%rdi,%rsi,4), %eax
shlq $0x8, %rcx
leaq 0x3fae8b(%rip), %r8     # 0x4361b0
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 0x3ac0b(%rip), %xmm2    # 0x75f58
divsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
movzbl (%rcx), %eax
cvtsi2sd %edx, %xmm1
divsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
cvtsi2sd %eax, %xmm3
leaq 0x5be3d1(%rip), %rbx    # 0x5f9740
divsd %xmm2, %xmm3
xorps %xmm2, %xmm2
cvtsd2ss %xmm3, %xmm2
xorps %xmm3, %xmm3
callq *(%rbx)
movl 0x3959eb(%rip), %edi    # 0x3d0d70
leaq 0x67ca8(%rip), %rax     # 0xa3034
movl 0x3cbc52(%rip), %ecx    # 0x406fe4
movl %ecx, %esi
notl %esi
addl (%rax), %esi
movl 0x3cbc42(%rip), %edx    # 0x406fe0
subl %edi, %edx
incl %edx
subl 0x3977d8(%rip), %ecx    # 0x3d2b80
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)