// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/crt.c
// Function: renderpixel
static void
renderpixel(CRT *crt, int x, int y, int a, int level)
{
	int p, v, b;
	float f;

	p = y*1024 + x;
	v = crt->phos1vals[p];
	if(v >= 255) return;
	if(v == 0){
//		printf("adding phos1 %d\n", p);
		crt->phos1List[crt->numPhos1++] = p;
	}
	v += a;
	crt->phos1vals[p] = v > 255 ? 255 : v;

	if(--level){
		f = a/255.0;
		b = f*f*255*blurFactorSquare + a*blurFactorLinear;
		if(b > 0){
			if(x < 1023) renderpixel(crt, x+1, y, b, level);
			if(y < 1023) renderpixel(crt, x, y+1, b, level);
			if(x > 0) renderpixel(crt, x-1, y, b, level);
			if(y > 0) renderpixel(crt, x, y-1, b, level);
			b *= blurFactorDiagonal;
			if(b > 0){
				if(y > 0){
					if(x < 1023)
						renderpixel(crt, x+1, y-1, b, level);
					if(x > 0)
						renderpixel(crt, x-1, y-1, b, level);
				}
				if(y < 1023){
					if(x < 1023)
						renderpixel(crt, x+1, y+1, b, level);
					if(x > 0)
						renderpixel(crt, x-1, y+1, b, level);
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r13d
movl %esi, %ebx
movl %edx, %r15d
decl %r8d
movl %r8d, -0x2c(%rbp)
movq %rdi, -0x38(%rbp)
movl %r15d, %eax
shll $0xa, %eax
addl %ebx, %eax
movzbl 0x1700014(%rdi,%rax), %ecx
testl %ecx, %ecx
je 0x3716
cmpl $0xff, %ecx
jne 0x372d
jmp 0x38da
movslq 0xa00004(%rdi), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0xa00004(%rdi)
movl %eax, 0x600004(%rdi,%rdx,4)
addl %r13d, %ecx
movl $0xff, %edx
cmpl %edx, %ecx
cmovgel %edx, %ecx
movb %cl, 0x1700014(%rdi,%rax)
movl -0x2c(%rbp), %r14d
subl $0x1, %r14d
jb 0x38da
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
divsd 0x18e1(%rip), %xmm0     # 0x5040
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r13d, %xmm1
mulss %xmm0, %xmm0
mulss 0x1aad(%rip), %xmm0     # 0x5224
mulss 0x1aa9(%rip), %xmm1     # 0x5228
mulss 0x1aa5(%rip), %xmm0     # 0x522c
addss %xmm1, %xmm0
cvttss2si %xmm0, %r13d
testl %r13d, %r13d
jle 0x38da
cmpl $0x3ff, %ebx            # imm = 0x3FF
jge 0x37bb
leal 0x1(%rbx), %esi
movq -0x38(%rbp), %rdi
movl %r15d, %edx
movl %r13d, %ecx
movl -0x2c(%rbp), %r8d
callq 0x36d1
movq -0x38(%rbp), %rdi
cmpl $0x3fe, %r15d           # imm = 0x3FE
jg 0x37de
leal 0x1(%r15), %edx
movq -0x38(%rbp), %rdi
movl %ebx, %esi
movl %r13d, %ecx
movl -0x2c(%rbp), %r8d
callq 0x36d1
movq -0x38(%rbp), %rdi
testl %ebx, %ebx
jle 0x37fc
leal -0x1(%rbx), %esi
movq -0x38(%rbp), %rdi
movl %r15d, %edx
movl %r13d, %ecx
movl -0x2c(%rbp), %r8d
callq 0x36d1
movq -0x38(%rbp), %rdi
testl %r15d, %r15d
jle 0x3887
leal -0x1(%r15), %r12d
movq -0x38(%rbp), %rdi
movl %ebx, %esi
movl %r12d, %edx
movl %r13d, %ecx
movl -0x2c(%rbp), %r8d
callq 0x36d1
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
mulss 0x19fe(%rip), %xmm0     # 0x522c
cvttss2si %xmm0, %r13d
testl %r13d, %r13d
jle 0x38da
cmpl $0x3fe, %ebx            # imm = 0x3FE
jg 0x3862
leal 0x1(%rbx), %esi
movq -0x38(%rbp), %rdi
movl %r12d, %edx
movl %r13d, %ecx
movl -0x2c(%rbp), %r8d
callq 0x36d1
movq -0x38(%rbp), %rdi
testl %ebx, %ebx
jle 0x387c
leal -0x1(%rbx), %esi
movq -0x38(%rbp), %rdi
movl %r12d, %edx
movl %r13d, %ecx
movl -0x2c(%rbp), %r8d
callq 0x36d1
movq -0x38(%rbp), %rdi
cmpl $0x3fe, %r15d           # imm = 0x3FE
jle 0x38a1
jmp 0x38da
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
mulss 0x1995(%rip), %xmm0     # 0x522c
cvttss2si %xmm0, %r13d
testl %r13d, %r13d
jle 0x38da
cmpl $0x3ff, %ebx            # imm = 0x3FF
jge 0x38cc
leal 0x1(%rbx), %esi
incq %r15
movq -0x38(%rbp), %rdi
movl %r15d, %edx
movl %r13d, %ecx
movl -0x2c(%rbp), %r8d
callq 0x36d1
movq -0x38(%rbp), %rdi
testl %ebx, %ebx
jg 0x38cf
jmp 0x38da
incq %r15
decl %ebx
movl %r14d, -0x2c(%rbp)
jmp 0x36f5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)