// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: crtinit
static void
crtinit(void)
{
	int i, j, ofs;
	Color col1, col2;
	float c;
	int psm;

	intensityRange = pixelIntensityMax - pixelIntensityMin;
	intensityOffset = pixelIntensityMin+(1.0-pixelSustainRangeOffset)*intensityRange;
	sustainTransferCf = intensityOffset * pixelSustainSensitivity;
	pixelSustainFactor = pixelSustainFactorMin +
		pixelSustainPercent*(pixelSustainFactorMax-pixelSustainFactorMin);
	sustainFactor = pixelSustainFactor;


	/* Intensities */
	for(i = 0; i < 8; i++)
		pxintensity[i] = pixelIntensityMin + i/7.0 * intensityRange;

	/* Phosphor 1 ramp */
	ofs = pxintensity[4]/4;
	for(i = 0; i < ofs; i++){
		phos1ramp[i] = phos1blur;
		phos1ramp[i].a = i < pixelHaloMinIntensity ?
			pixelHaloMinIntensity : i;
	}
	for(j = 0; i < 256; i++, j++){
		c = (float)j/(255-ofs);
		c *= c;
		phos1ramp[i].r = phos1blur.r*(1.0-c) + phos1.r*c;
		phos1ramp[i].g = phos1blur.g*(1.0-c) + phos1.g*c;
		phos1ramp[i].b = phos1blur.b*(1.0-c) + phos1.b*c;
		phos1ramp[i].a = i < pixelHaloMinIntensity ?
			pixelHaloMinIntensity : i;
	}

	/* Phosphor 2 ramp */
	col1 = phos2;
	col2 = phos2aged;

	c = (255-phos2AlphaCorr)/255.0;
	col1.r *= c; col1.g *= c; col1.b *= c;
	c = (255-phos2AlphaCorr*0.25)/255.0;
	col2.r *= c; col2.g *= c; col2.b *= c;
	psm = pixelSustainMax + phos2AlphaCorr;

	phos2MinVal = 0;
	for(i = 0; i < 256; i++){
		c = i/255.0;
		phos2ramp[i].r = col1.r*c + col2.r*(1.0-c);
		phos2ramp[i].g = col1.g*c + col2.g*(1.0-c);
		phos2ramp[i].b = col1.b*c + col2.b*(1.0-c);
		phos2ramp[i].a = psm*(c + -0.5*(cos(M_PI*c) - 1))/2.0;
		if(phos2ramp[i].a < 3)
			phos2MinVal = i;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x4bd2(%rip), %eax      # 0x8270
subl 0x4bd0(%rip), %eax      # 0x8274
movl %eax, 0x1d04cf6(%rip)   # 0x1d083a0
cvtsi2sdl 0x4bc2(%rip), %xmm1 # 0x8274
movss 0x4bbe(%rip), %xmm0     # 0x8278
cvtss2sd %xmm0, %xmm2
movsd 0x294a(%rip), %xmm0     # 0x6010
subsd %xmm2, %xmm0
cvtsi2sdl 0x1d04cce(%rip), %xmm2 # 0x1d083a0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x1d04cc0(%rip)   # 0x1d083a4
cvtsi2ssl 0x1d04cb8(%rip), %xmm0 # 0x1d083a4
mulss 0x4b88(%rip), %xmm0     # 0x827c
cvttss2si %xmm0, %eax
movl %eax, 0x1d04caa(%rip)   # 0x1d083a8
movss 0x4b7a(%rip), %xmm1     # 0x8280
movss 0x4b76(%rip), %xmm0     # 0x8284
movss 0x4b72(%rip), %xmm2     # 0x8288
subss 0x4b62(%rip), %xmm2     # 0x8280
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1d04c7e(%rip)  # 0x1d083ac
movss 0x1d04c76(%rip), %xmm0  # 0x1d083ac
movss %xmm0, 0x1d04c72(%rip)  # 0x1d083b0
movl $0x0, -0x4(%rbp)
cmpl $0x8, -0x4(%rbp)
jge 0x3793
cvtsi2sdl 0x4b21(%rip), %xmm1 # 0x8274
cvtsi2sdl -0x4(%rbp), %xmm0
movsd 0x28e0(%rip), %xmm2     # 0x6040
divsd %xmm2, %xmm0
cvtsi2sdl 0x1d04c34(%rip), %xmm2 # 0x1d083a0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x1d04bd7(%rip), %rax   # 0x1d0835c
movb %dl, (%rax,%rcx)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3745
movzbl 0x1d04bc6(%rip), %eax   # 0x1d08360
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, -0xc(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x3803
movslq -0x4(%rbp), %rcx
leaq 0x1d04c01(%rip), %rax   # 0x1d083c0
movl 0x4ac7(%rip), %edx      # 0x828c
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
cmpl 0x4abf(%rip), %eax      # 0x8290
jge 0x37de
movl 0x4ab7(%rip), %eax      # 0x8290
movl %eax, -0x20(%rbp)
jmp 0x37e4
movl -0x4(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x1d04bcc(%rip), %rax   # 0x1d083c0
movb %dl, 0x3(%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x37ac
movl $0x0, -0x8(%rbp)
cmpl $0x100, -0x4(%rbp)      # imm = 0x100
jge 0x3966
cvtsi2ssl -0x8(%rbp), %xmm0
movl -0xc(%rbp), %ecx
movl $0xff, %eax
subl %ecx, %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x18(%rbp)
movss -0x18(%rbp), %xmm0
mulss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
movzbl 0x4a44(%rip), %eax      # 0x828c
cvtsi2sd %eax, %xmm0
movss -0x18(%rbp), %xmm4
cvtss2sd %xmm4, %xmm1
movsd 0x27b3(%rip), %xmm2     # 0x6010
movaps %xmm2, %xmm3
subsd %xmm1, %xmm3
movzbl 0x4a29(%rip), %eax      # 0x8294
cvtsi2ss %eax, %xmm1
mulss %xmm4, %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x1d04b30(%rip), %rax   # 0x1d083c0
movb %dl, (%rax,%rcx,4)
movzbl 0x49f3(%rip), %ecx      # 0x828d
cvtsi2sd %ecx, %xmm0
movss -0x18(%rbp), %xmm4
cvtss2sd %xmm4, %xmm1
movaps %xmm2, %xmm3
subsd %xmm1, %xmm3
movzbl 0x49e0(%rip), %ecx      # 0x8295
cvtsi2ss %ecx, %xmm1
mulss %xmm4, %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movb %cl, %dl
movslq -0x4(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx,4)
movzbl 0x49b0(%rip), %eax      # 0x828e
cvtsi2sd %eax, %xmm0
movss -0x18(%rbp), %xmm3
cvtss2sd %xmm3, %xmm1
subsd %xmm1, %xmm2
movzbl 0x49a0(%rip), %eax      # 0x8296
cvtsi2ss %eax, %xmm1
mulss %xmm3, %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x1d04aa5(%rip), %rax   # 0x1d083c0
movb %dl, 0x2(%rax,%rcx,4)
movl -0x4(%rbp), %eax
cmpl 0x4968(%rip), %eax      # 0x8290
jge 0x3935
movl 0x4960(%rip), %eax      # 0x8290
movl %eax, -0x24(%rbp)
jmp 0x393b
movl -0x4(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x1d04a75(%rip), %rax   # 0x1d083c0
movb %dl, 0x3(%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x380a
movl 0x492c(%rip), %eax      # 0x8298
movl %eax, -0x10(%rbp)
movl 0x4927(%rip), %eax      # 0x829c
movl %eax, -0x14(%rbp)
movl 0x4922(%rip), %ecx      # 0x82a0
movl $0xff, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0x2687(%rip), %xmm1     # 0x6018
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
movss -0x18(%rbp), %xmm2
movzbl -0x10(%rbp), %eax
cvtsi2ss %eax, %xmm0
mulss %xmm2, %xmm0
cvttss2si %xmm0, %eax
movb %al, -0x10(%rbp)
movss -0x18(%rbp), %xmm2
movzbl -0xf(%rbp), %eax
cvtsi2ss %eax, %xmm0
mulss %xmm2, %xmm0
cvttss2si %xmm0, %eax
movb %al, -0xf(%rbp)
movss -0x18(%rbp), %xmm2
movzbl -0xe(%rbp), %eax
cvtsi2ss %eax, %xmm0
mulss %xmm2, %xmm0
cvttss2si %xmm0, %eax
movb %al, -0xe(%rbp)
cvtsi2sdl 0x48b2(%rip), %xmm0 # 0x82a0
movsd 0x262a(%rip), %xmm2     # 0x6020
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
movss -0x18(%rbp), %xmm1
movzbl -0x14(%rbp), %eax
cvtsi2ss %eax, %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movb %al, -0x14(%rbp)
movss -0x18(%rbp), %xmm1
movzbl -0x13(%rbp), %eax
cvtsi2ss %eax, %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movb %al, -0x13(%rbp)
movss -0x18(%rbp), %xmm1
movzbl -0x12(%rbp), %eax
cvtsi2ss %eax, %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movb %al, -0x12(%rbp)
movl 0x484b(%rip), %eax      # 0x82a4
addl 0x4841(%rip), %eax      # 0x82a0
movl %eax, -0x1c(%rbp)
movl $0x0, 0x1d04d54(%rip)   # 0x1d087c0
movl $0x0, -0x4(%rbp)
cmpl $0x100, -0x4(%rbp)      # imm = 0x100
jge 0x3c06
cvtsi2sdl -0x4(%rbp), %xmm0
movsd 0x258b(%rip), %xmm1     # 0x6018
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
movzbl -0x10(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss -0x18(%rbp), %xmm2
mulss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm1
movzbl -0x14(%rbp), %eax
cvtsi2sd %eax, %xmm0
cvtss2sd %xmm2, %xmm4
movsd 0x254d(%rip), %xmm2     # 0x6010
movsd %xmm2, -0x40(%rbp)
movaps %xmm2, %xmm3
subsd %xmm4, %xmm3
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x1d04ce8(%rip), %rax   # 0x1d087d0
movb %dl, (%rax,%rcx,4)
movzbl -0xf(%rbp), %ecx
cvtsi2ss %ecx, %xmm0
movss -0x18(%rbp), %xmm3
mulss %xmm3, %xmm0
cvtss2sd %xmm0, %xmm1
movzbl -0x13(%rbp), %ecx
cvtsi2sd %ecx, %xmm0
cvtss2sd %xmm3, %xmm4
movaps %xmm2, %xmm3
subsd %xmm4, %xmm3
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movb %cl, %dl
movslq -0x4(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx,4)
movzbl -0xe(%rbp), %ecx
cvtsi2ss %ecx, %xmm0
movss -0x18(%rbp), %xmm3
mulss %xmm3, %xmm0
cvtss2sd %xmm0, %xmm1
movzbl -0x12(%rbp), %ecx
cvtsi2sd %ecx, %xmm0
cvtss2sd %xmm3, %xmm3
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movb %cl, %dl
movslq -0x4(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx,4)
cvtsi2sdl -0x1c(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movss -0x18(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x24a4(%rip), %xmm1     # 0x6028
mulsd %xmm1, %xmm0
callq 0x2470
movsd -0x40(%rbp), %xmm3
movsd -0x38(%rbp), %xmm2
movaps %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
subsd %xmm3, %xmm1
movsd 0x2485(%rip), %xmm3     # 0x6030
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0x2479(%rip), %xmm1     # 0x6038
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x1d04bfc(%rip), %rax   # 0x1d087d0
movb %dl, 0x3(%rax,%rcx,4)
movslq -0x4(%rbp), %rcx
leaq 0x1d04bed(%rip), %rax   # 0x1d087d0
movzbl 0x3(%rax,%rcx,4), %eax
cmpl $0x3, %eax
jge 0x3bf6
movl -0x4(%rbp), %eax
movl %eax, 0x1d04bca(%rip)   # 0x1d087c0
jmp 0x3bf8
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3a73
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)