// File: rishabh-battulwar[P]imageprocessing/./include/ImageProc.h
// Function: ImageProc::mbvq_error_diffusion(Image&, Image&)
void ImageProc::mbvq_error_diffusion(Image &img_orig, Image &img_modified)
{
	float diffusionError[3], distance[6];
	int direction, quad, vertex_number;
	float img_orig_float[img_orig.rows][img_orig.cols][img_orig.channels];

	for(int i = 0; i < img_orig.rows; i++)
		for(int j = 0; j < img_orig.cols; j++)
			for(int k = 0; k < img_orig.channels; k++)
			{
				img_orig_float[i][j][k] = float(img_orig.getvalue(i,j,k)/255.0);
			}


	for(int i = 0; i < img_modified.rows-1; i++)
	{
		if(i%2 == 0)
		{
			direction = LEFT2RIGHT;
			for(int j = 0; j < img_modified.cols; j++)
			{
				int R = img_orig.getvalue(i,j,0);
				int G = img_orig.getvalue(i,j,1);
				int B = img_orig.getvalue(i,j,2);
				int r = img_orig_float[i][j][0];
				int g = img_orig_float[i][j][1];
				int b = img_orig_float[i][j][2];
				if((R+G) > 255)
					if((G+B) > 255)
						if((R+G+B) > 510) 	quad = CMYW;
						else 				quad = MYGC;
					else quad = RGMY;
				else if(!((G+B) > 255))
					if(!((R+G+B) > 255)) 	quad = KRGB;
					else 					quad = RGBM;
				else quad = CMBG;

				distance[0] = distance_from_vertex(r,g,b,'C');
				distance[1] = distance_from_vertex(r,g,b,'M');
				distance[2] = distance_from_vertex(r,g,b,'Y');
				distance[3] = distance_from_vertex(r,g,b,'W');
				distance[4] = distance_from_vertex(r,g,b,'R');
				distance[5] = distance_from_vertex(r,g,b,'G');
				distance[6] = distance_from_vertex(r,g,b,'B');
				distance[7] = distance_from_vertex(r,g,b,'K');

				if(quad == CMYW)
					vertex_number = nearest_vertex(distance,0,1,2,3);
				else if(quad == MYGC)
					vertex_number = nearest_vertex(distance,1,2,5,0);
				else if(quad == RGMY)
					vertex_number = nearest_vertex(distance,4,5,1,2);
				else if(quad == CMBG)
					vertex_number = nearest_vertex(distance,0,1,6,5);
				else if(quad == RGBM)
					vertex_number = nearest_vertex(distance,4,5,6,1);
				else if(quad == KRGB)
					vertex_number = nearest_vertex(distance,7,4,5,6);

				switch(vertex_number)
				{
					case 0:
						diffusionError[0] = r - 1.0;
						diffusionError[1] = g - 0.0;
						diffusionError[2] = b - 1.0;
						img_modified.setvalue(i,j,0,255);
						img_modified.setvalue(i,j,1,0);
						img_modified.setvalue(i,j,2,255);
						break;
					case 1:
						diffusionError[0] = r - 0.0;
						diffusionError[1] = g - 1.0;
						diffusionError[2] = b - 1.0;
						img_modified.setvalue(i,j,0,0);
						img_modified.setvalue(i,j,1,255);
						img_modified.setvalue(i,j,2,255);
						break;
					case 2:
						diffusionError[0] = r - 1.0;
						diffusionError[1] = g - 1.0;
						diffusionError[2] = b - 0.0;
						img_modified.setvalue(i,j,0,255);
						img_modified.setvalue(i,j,1,255);
						img_modified.setvalue(i,j,2,0);
						break;
					case 3:
						diffusionError[0] = r - 1.0;
						diffusionError[1] = g - 1.0;
						diffusionError[2] = b - 1.0;
						img_modified.setvalue(i,j,0,255);
						img_modified.setvalue(i,j,1,255);
						img_modified.setvalue(i,j,2,255);
						break;
					case 4:
						diffusionError[0] = r - 0.0;
						diffusionError[1] = g - 1.0;
						diffusionError[2] = b - 0.0;
						img_modified.setvalue(i,j,0,0);
						img_modified.setvalue(i,j,1,255);
						img_modified.setvalue(i,j,2,0);
						break;
					case 5:
						diffusionError[0] = r - 1.0;
						diffusionError[1] = g - 0.0;
						diffusionError[2] = b - 0.0;
						img_modified.setvalue(i,j,0,255);
						img_modified.setvalue(i,j,1,0);
						img_modified.setvalue(i,j,2,0);
						break;
					case 6:
						diffusionError[0] = r - 0.0;
						diffusionError[1] = g - 0.0;
						diffusionError[2] = b - 1.0;
						img_modified.setvalue(i,j,0,0);
						img_modified.setvalue(i,j,1,0);
						img_modified.setvalue(i,j,2,255);
						break;
					case 7:
						diffusionError[0] = r - 0.0;
						diffusionError[1] = g - 0.0;
						diffusionError[2] = b - 0.0;
						img_modified.setvalue(i,j,0,0);
						img_modified.setvalue(i,j,1,0);
						img_modified.setvalue(i,j,2,0);
						break;
					default:
						break;
				}

				for(int k = 0; k < 3; k++)
				{
					img_orig_float[i][j+1][k] = img_orig_float[i][j+1][k]+(diffusionError[k]*7.0/16);
					img_orig_float[i+1][j+1][k] = img_orig_float[i+1][j+1][k]+(diffusionError[k]*1.0/16);
					img_orig_float[i+1][j][k] = img_orig_float[i+1][j][k]+(diffusionError[k]*5.0/16);
					img_orig_float[i+1][j-1][k] = img_orig_float[i+1][j-1][k]+(diffusionError[k]*3.0/16);
				}

			}
		}

		else
		{
			direction = RIGHT2LEFT;
			for(int j = img_modified.cols - 1; j >= 0; j--)
			{
				int R = img_orig.getvalue(i,j,0);
				int G = img_orig.getvalue(i,j,1);
				int B = img_orig.getvalue(i,j,2);
				int r = img_orig_float[i][j][0];
				int g = img_orig_float[i][j][1];
				int b = img_orig_float[i][j][2];
				if((R+G) > 255)
					if((G+B) > 255)
						if((R+G+B) > 510) 	quad = CMYW;
						else 				quad = MYGC;
					else quad = RGMY;
				else if(!((G+B) > 255))
					if(!((R+G+B) > 255)) 	quad = KRGB;
					else 					quad = RGBM;
				else quad = CMBG;

				distance[0] = distance_from_vertex(r,g,b,'C');
				distance[1] = distance_from_vertex(r,g,b,'M');
				distance[2] = distance_from_vertex(r,g,b,'Y');
				distance[3] = distance_from_vertex(r,g,b,'W');
				distance[4] = distance_from_vertex(r,g,b,'R');
				distance[5] = distance_from_vertex(r,g,b,'G');
				distance[6] = distance_from_vertex(r,g,b,'B');
				distance[7] = distance_from_vertex(r,g,b,'K');

				if(quad == CMYW)
					vertex_number = nearest_vertex(distance,0,1,2,3);
				else if(quad == MYGC)
					vertex_number = nearest_vertex(distance,1,2,5,0);
				else if(quad == RGMY)
					vertex_number = nearest_vertex(distance,4,5,1,2);
				else if(quad == CMBG)
					vertex_number = nearest_vertex(distance,0,1,6,5);
				else if(quad == RGBM)
					vertex_number = nearest_vertex(distance,4,5,6,1);
				else if(quad == KRGB)
					vertex_number = nearest_vertex(distance,7,4,5,6);

				switch(vertex_number)
				{
					case 0:
						diffusionError[0] = r - 1.0;
						diffusionError[1] = g - 0.0;
						diffusionError[2] = b - 1.0;
						img_modified.setvalue(i,j,0,255);
						img_modified.setvalue(i,j,1,0);
						img_modified.setvalue(i,j,2,255);
						break;
					case 1:
						diffusionError[0] = r - 0.0;
						diffusionError[1] = g - 1.0;
						diffusionError[2] = b - 1.0;
						img_modified.setvalue(i,j,0,0);
						img_modified.setvalue(i,j,1,255);
						img_modified.setvalue(i,j,2,255);
						break;
					case 2:
						diffusionError[0] = r - 1.0;
						diffusionError[1] = g - 1.0;
						diffusionError[2] = b - 0.0;
						img_modified.setvalue(i,j,0,255);
						img_modified.setvalue(i,j,1,255);
						img_modified.setvalue(i,j,2,0);
						break;
					case 3:
						diffusionError[0] = r - 1.0;
						diffusionError[1] = g - 1.0;
						diffusionError[2] = b - 1.0;
						img_modified.setvalue(i,j,0,255);
						img_modified.setvalue(i,j,1,255);
						img_modified.setvalue(i,j,2,255);
						break;
					case 4:
						diffusionError[0] = r - 0.0;
						diffusionError[1] = g - 1.0;
						diffusionError[2] = b - 0.0;
						img_modified.setvalue(i,j,0,0);
						img_modified.setvalue(i,j,1,255);
						img_modified.setvalue(i,j,2,0);
						break;
					case 5:
						diffusionError[0] = r - 1.0;
						diffusionError[1] = g - 0.0;
						diffusionError[2] = b - 0.0;
						img_modified.setvalue(i,j,0,255);
						img_modified.setvalue(i,j,1,0);
						img_modified.setvalue(i,j,2,0);
						break;
					case 6:
						diffusionError[0] = r - 0.0;
						diffusionError[1] = g - 0.0;
						diffusionError[2] = b - 1.0;
						img_modified.setvalue(i,j,0,0);
						img_modified.setvalue(i,j,1,0);
						img_modified.setvalue(i,j,2,255);
						break;
					case 7:
						diffusionError[0] = r - 0.0;
						diffusionError[1] = g - 0.0;
						diffusionError[2] = b - 0.0;
						img_modified.setvalue(i,j,0,0);
						img_modified.setvalue(i,j,1,0);
						img_modified.setvalue(i,j,2,0);
						break;
					default:
						break;
				}

				for(int k = 0; k < 3; k++)
				{
					img_orig_float[i][j-1][k] = img_orig_float[i][j-1][k]+(diffusionError[k]*7.0/16);
					img_orig_float[i+1][j-1][k] = img_orig_float[i+1][j-1][k]+(diffusionError[k]*1.0/16);
					img_orig_float[i+1][j][k] = img_orig_float[i+1][j][k]+(diffusionError[k]*5.0/16);
					img_orig_float[i+1][j+1][k] = img_orig_float[i+1][j+1][k]+(diffusionError[k]*3.0/16);
				}
			}

		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
movl 0xc(%rax), %edx
movq %rcx, -0xd8(%rbp)
movl 0x10(%rax), %eax
movq %rax, -0xd0(%rbp)
movq %rsp, %rsi
movq %rsi, -0x58(%rbp)
movq %rdx, %rsi
imulq %rcx, %rsi
imulq %rax, %rsi
leaq 0xf(,%rsi,4), %rdi
andq $-0x10, %rdi
movq %rsp, %rsi
subq %rdi, %rsi
movq %rsi, -0xc8(%rbp)
movq %rsi, %rsp
movq %rdx, -0x60(%rbp)
movq %rcx, -0x68(%rbp)
movq %rax, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x144bc
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x144ac
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x1449c
movq -0x8(%rbp), %rdi
movl -0x74(%rbp), %esi
movl -0x78(%rbp), %edx
movl -0x7c(%rbp), %ecx
callq 0x83b0
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
movl %eax, %ecx
movq -0xc8(%rbp), %rax
cvtsi2sd %ecx, %xmm0
movsd 0x806a(%rip), %xmm1     # 0x1c4c8
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x74(%rbp), %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x78(%rbp), %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x7c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1441d
jmp 0x1449e
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x14406
jmp 0x144ae
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x143ef
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x15da7
movl -0x80(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x15143
movl $0x1, -0x44(%rbp)
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x1513e
movq -0x8(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %ecx, %ecx
callq 0x83b0
movl %eax, -0x88(%rbp)
movq -0x8(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
callq 0x83b0
movl %eax, -0x8c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
callq 0x83b0
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
movl %eax, %ecx
movq -0xc8(%rbp), %rax
movl %ecx, -0x90(%rbp)
movslq -0x80(%rbp), %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movslq -0x84(%rbp), %rdi
imulq %rdx, %rdi
cvttss2si (%rcx,%rdi,4), %ecx
movl %ecx, -0x94(%rbp)
movslq -0x80(%rbp), %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movslq -0x84(%rbp), %rdi
imulq %rdx, %rdi
cvttss2si 0x4(%rcx,%rdi,4), %ecx
movl %ecx, -0x98(%rbp)
movslq -0x80(%rbp), %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0x84(%rbp), %rcx
imulq %rdx, %rcx
cvttss2si 0x8(%rax,%rcx,4), %eax
movl %eax, -0x9c(%rbp)
movl -0x88(%rbp), %eax
addl -0x8c(%rbp), %eax
cmpl $0xff, %eax
jle 0x1465e
movl -0x8c(%rbp), %eax
addl -0x90(%rbp), %eax
cmpl $0xff, %eax
jle 0x14655
movl -0x88(%rbp), %eax
addl -0x8c(%rbp), %eax
addl -0x90(%rbp), %eax
cmpl $0x1fe, %eax            # imm = 0x1FE
jle 0x1464c
movl $0x1, -0x48(%rbp)
jmp 0x14653
movl $0x2, -0x48(%rbp)
jmp 0x1465c
movl $0x3, -0x48(%rbp)
jmp 0x146a5
movl -0x8c(%rbp), %eax
addl -0x90(%rbp), %eax
cmpl $0xff, %eax
jg 0x1469c
movl -0x88(%rbp), %eax
addl -0x8c(%rbp), %eax
addl -0x90(%rbp), %eax
cmpl $0xff, %eax
jg 0x14693
movl $0x6, -0x48(%rbp)
jmp 0x1469a
movl $0x5, -0x48(%rbp)
jmp 0x146a3
movl $0x4, -0x48(%rbp)
jmp 0x146a5
cvtsi2ssl -0x94(%rbp), %xmm0
cvtsi2ssl -0x98(%rbp), %xmm1
cvtsi2ssl -0x9c(%rbp), %xmm2
movl $0x43, %edi
callq 0x15dc0
movss %xmm0, -0x40(%rbp)
cvtsi2ssl -0x94(%rbp), %xmm0
cvtsi2ssl -0x98(%rbp), %xmm1
cvtsi2ssl -0x9c(%rbp), %xmm2
movl $0x4d, %edi
callq 0x15dc0
movss %xmm0, -0x3c(%rbp)
cvtsi2ssl -0x94(%rbp), %xmm0
cvtsi2ssl -0x98(%rbp), %xmm1
cvtsi2ssl -0x9c(%rbp), %xmm2
movl $0x59, %edi
callq 0x15dc0
movss %xmm0, -0x38(%rbp)
cvtsi2ssl -0x94(%rbp), %xmm0
cvtsi2ssl -0x98(%rbp), %xmm1
cvtsi2ssl -0x9c(%rbp), %xmm2
movl $0x57, %edi
callq 0x15dc0
movss %xmm0, -0x34(%rbp)
cvtsi2ssl -0x94(%rbp), %xmm0
cvtsi2ssl -0x98(%rbp), %xmm1
cvtsi2ssl -0x9c(%rbp), %xmm2
movl $0x52, %edi
callq 0x15dc0
movss %xmm0, -0x30(%rbp)
cvtsi2ssl -0x94(%rbp), %xmm0
cvtsi2ssl -0x98(%rbp), %xmm1
cvtsi2ssl -0x9c(%rbp), %xmm2
movl $0x47, %edi
callq 0x15dc0
movss %xmm0, -0x2c(%rbp)
cvtsi2ssl -0x94(%rbp), %xmm0
cvtsi2ssl -0x98(%rbp), %xmm1
cvtsi2ssl -0x9c(%rbp), %xmm2
movl $0x42, %edi
callq 0x15dc0
movss %xmm0, -0x28(%rbp)
cvtsi2ssl -0x94(%rbp), %xmm0
cvtsi2ssl -0x98(%rbp), %xmm1
cvtsi2ssl -0x9c(%rbp), %xmm2
movl $0x4b, %edi
callq 0x15dc0
movss %xmm0, -0x24(%rbp)
cmpl $0x1, -0x48(%rbp)
jne 0x14806
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x148d8
cmpl $0x2, -0x48(%rbp)
jne 0x1482f
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
movl $0x5, %ecx
xorl %r8d, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x148d6
cmpl $0x3, -0x48(%rbp)
jne 0x14858
leaq -0x40(%rbp), %rdi
movl $0x4, %esi
movl $0x5, %edx
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x148d4
cmpl $0x4, -0x48(%rbp)
jne 0x1487e
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x6, %ecx
movl $0x5, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x148d2
cmpl $0x5, -0x48(%rbp)
jne 0x148a7
leaq -0x40(%rbp), %rdi
movl $0x4, %esi
movl $0x5, %edx
movl $0x6, %ecx
movl $0x1, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x148d0
cmpl $0x6, -0x48(%rbp)
jne 0x148ce
leaq -0x40(%rbp), %rdi
movl $0x7, %esi
movl $0x4, %edx
movl $0x5, %ecx
movl $0x6, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x148d0
jmp 0x148d2
jmp 0x148d4
jmp 0x148d6
jmp 0x148d8
movl -0x4c(%rbp), %eax
movq %rax, -0xe0(%rbp)
subq $0x7, %rax
ja 0x14e24
movq -0xe0(%rbp), %rax
leaq 0x7c96(%rip), %rcx      # 0x1c590
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cvtsi2sdl -0x94(%rbp), %xmm0
movsd 0x7955(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0x98(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0x9c(%rbp), %xmm0
movsd 0x7920(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x14e26
cvtsi2sdl -0x94(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0x98(%rbp), %xmm0
movsd 0x7895(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0x9c(%rbp), %xmm0
movsd 0x7878(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x14e26
cvtsi2sdl -0x94(%rbp), %xmm0
movsd 0x7804(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0x98(%rbp), %xmm0
movsd 0x77e7(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0x9c(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x14e26
cvtsi2sdl -0x94(%rbp), %xmm0
movsd 0x775c(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0x98(%rbp), %xmm0
movsd 0x773f(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0x9c(%rbp), %xmm0
movsd 0x7722(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x14e26
cvtsi2sdl -0x94(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0x98(%rbp), %xmm0
movsd 0x7694(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0x9c(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x14e26
cvtsi2sdl -0x94(%rbp), %xmm0
movsd 0x760b(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0x98(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0x9c(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x14e26
cvtsi2sdl -0x94(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0x98(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0x9c(%rbp), %xmm0
movsd 0x753b(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x14e26
cvtsi2sdl -0x94(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0x98(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0x9c(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x84(%rbp), %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x14e26
jmp 0x14e26
movl $0x0, -0xa0(%rbp)
cmpl $0x3, -0xa0(%rbp)
jge 0x15128
movq -0xd0(%rbp), %rdx
movq -0xc8(%rbp), %rax
movq -0xd8(%rbp), %rsi
movslq -0x80(%rbp), %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0x84(%rbp), %edi
addl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xa0(%rbp), %rdi
movss (%rcx,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xa0(%rbp), %rcx
movss -0x1c(%rbp,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x7645(%rip), %xmm2     # 0x1c4f0
mulsd %xmm2, %xmm1
movsd 0x71f9(%rip), %xmm2     # 0x1c0b0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x80(%rbp), %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0x84(%rbp), %edi
addl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xa0(%rbp), %rdi
movss %xmm0, (%rcx,%rdi,4)
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0x84(%rbp), %edi
addl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xa0(%rbp), %rdi
movss (%rcx,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xa0(%rbp), %rcx
movss -0x1c(%rbp,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x730b(%rip), %xmm2     # 0x1c268
mulsd %xmm2, %xmm1
movsd 0x7147(%rip), %xmm2     # 0x1c0b0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0x84(%rbp), %edi
addl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xa0(%rbp), %rdi
movss %xmm0, (%rcx,%rdi,4)
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movslq -0x84(%rbp), %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xa0(%rbp), %rdi
movss (%rcx,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xa0(%rbp), %rcx
movss -0x1c(%rbp,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x73f1(%rip), %xmm2     # 0x1c400
mulsd %xmm2, %xmm1
movsd 0x7095(%rip), %xmm2     # 0x1c0b0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movslq -0x84(%rbp), %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xa0(%rbp), %rdi
movss %xmm0, (%rcx,%rdi,4)
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0x84(%rbp), %edi
subl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xa0(%rbp), %rdi
movss (%rcx,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xa0(%rbp), %rcx
movss -0x1c(%rbp,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x71b7(%rip), %xmm2     # 0x1c278
mulsd %xmm2, %xmm1
movsd 0x6fe3(%rip), %xmm2     # 0x1c0b0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x84(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xa0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x14e30
jmp 0x1512a
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x144fd
jmp 0x15d97
movl $0x0, -0x44(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
subl $0x1, %eax
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
jl 0x15d95
movq -0x8(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %ecx, %ecx
callq 0x83b0
movl %eax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
callq 0x83b0
movl %eax, -0xac(%rbp)
movq -0x8(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
callq 0x83b0
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
movl %eax, %ecx
movq -0xc8(%rbp), %rax
movl %ecx, -0xb0(%rbp)
movslq -0x80(%rbp), %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movslq -0xa4(%rbp), %rdi
imulq %rdx, %rdi
cvttss2si (%rcx,%rdi,4), %ecx
movl %ecx, -0xb4(%rbp)
movslq -0x80(%rbp), %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movslq -0xa4(%rbp), %rdi
imulq %rdx, %rdi
cvttss2si 0x4(%rcx,%rdi,4), %ecx
movl %ecx, -0xb8(%rbp)
movslq -0x80(%rbp), %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xa4(%rbp), %rcx
imulq %rdx, %rcx
cvttss2si 0x8(%rax,%rcx,4), %eax
movl %eax, -0xbc(%rbp)
movl -0xa8(%rbp), %eax
addl -0xac(%rbp), %eax
cmpl $0xff, %eax
jle 0x152b5
movl -0xac(%rbp), %eax
addl -0xb0(%rbp), %eax
cmpl $0xff, %eax
jle 0x152ac
movl -0xa8(%rbp), %eax
addl -0xac(%rbp), %eax
addl -0xb0(%rbp), %eax
cmpl $0x1fe, %eax            # imm = 0x1FE
jle 0x152a3
movl $0x1, -0x48(%rbp)
jmp 0x152aa
movl $0x2, -0x48(%rbp)
jmp 0x152b3
movl $0x3, -0x48(%rbp)
jmp 0x152fc
movl -0xac(%rbp), %eax
addl -0xb0(%rbp), %eax
cmpl $0xff, %eax
jg 0x152f3
movl -0xa8(%rbp), %eax
addl -0xac(%rbp), %eax
addl -0xb0(%rbp), %eax
cmpl $0xff, %eax
jg 0x152ea
movl $0x6, -0x48(%rbp)
jmp 0x152f1
movl $0x5, -0x48(%rbp)
jmp 0x152fa
movl $0x4, -0x48(%rbp)
jmp 0x152fc
cvtsi2ssl -0xb4(%rbp), %xmm0
cvtsi2ssl -0xb8(%rbp), %xmm1
cvtsi2ssl -0xbc(%rbp), %xmm2
movl $0x43, %edi
callq 0x15dc0
movss %xmm0, -0x40(%rbp)
cvtsi2ssl -0xb4(%rbp), %xmm0
cvtsi2ssl -0xb8(%rbp), %xmm1
cvtsi2ssl -0xbc(%rbp), %xmm2
movl $0x4d, %edi
callq 0x15dc0
movss %xmm0, -0x3c(%rbp)
cvtsi2ssl -0xb4(%rbp), %xmm0
cvtsi2ssl -0xb8(%rbp), %xmm1
cvtsi2ssl -0xbc(%rbp), %xmm2
movl $0x59, %edi
callq 0x15dc0
movss %xmm0, -0x38(%rbp)
cvtsi2ssl -0xb4(%rbp), %xmm0
cvtsi2ssl -0xb8(%rbp), %xmm1
cvtsi2ssl -0xbc(%rbp), %xmm2
movl $0x57, %edi
callq 0x15dc0
movss %xmm0, -0x34(%rbp)
cvtsi2ssl -0xb4(%rbp), %xmm0
cvtsi2ssl -0xb8(%rbp), %xmm1
cvtsi2ssl -0xbc(%rbp), %xmm2
movl $0x52, %edi
callq 0x15dc0
movss %xmm0, -0x30(%rbp)
cvtsi2ssl -0xb4(%rbp), %xmm0
cvtsi2ssl -0xb8(%rbp), %xmm1
cvtsi2ssl -0xbc(%rbp), %xmm2
movl $0x47, %edi
callq 0x15dc0
movss %xmm0, -0x2c(%rbp)
cvtsi2ssl -0xb4(%rbp), %xmm0
cvtsi2ssl -0xb8(%rbp), %xmm1
cvtsi2ssl -0xbc(%rbp), %xmm2
movl $0x42, %edi
callq 0x15dc0
movss %xmm0, -0x28(%rbp)
cvtsi2ssl -0xb4(%rbp), %xmm0
cvtsi2ssl -0xb8(%rbp), %xmm1
cvtsi2ssl -0xbc(%rbp), %xmm2
movl $0x4b, %edi
callq 0x15dc0
movss %xmm0, -0x24(%rbp)
cmpl $0x1, -0x48(%rbp)
jne 0x1545d
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x1552f
cmpl $0x2, -0x48(%rbp)
jne 0x15486
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
movl $0x5, %ecx
xorl %r8d, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x1552d
cmpl $0x3, -0x48(%rbp)
jne 0x154af
leaq -0x40(%rbp), %rdi
movl $0x4, %esi
movl $0x5, %edx
movl $0x1, %ecx
movl $0x2, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x1552b
cmpl $0x4, -0x48(%rbp)
jne 0x154d5
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x6, %ecx
movl $0x5, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x15529
cmpl $0x5, -0x48(%rbp)
jne 0x154fe
leaq -0x40(%rbp), %rdi
movl $0x4, %esi
movl $0x5, %edx
movl $0x6, %ecx
movl $0x1, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x15527
cmpl $0x6, -0x48(%rbp)
jne 0x15525
leaq -0x40(%rbp), %rdi
movl $0x7, %esi
movl $0x4, %edx
movl $0x5, %ecx
movl $0x6, %r8d
callq 0x15fe0
movl %eax, -0x4c(%rbp)
jmp 0x15527
jmp 0x15529
jmp 0x1552b
jmp 0x1552d
jmp 0x1552f
movl -0x4c(%rbp), %eax
movq %rax, -0xe8(%rbp)
subq $0x7, %rax
ja 0x15a7b
movq -0xe8(%rbp), %rax
leaq 0x701f(%rip), %rcx      # 0x1c570
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cvtsi2sdl -0xb4(%rbp), %xmm0
movsd 0x6cfe(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0xb8(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0xbc(%rbp), %xmm0
movsd 0x6cc9(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x15a7d
cvtsi2sdl -0xb4(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0xb8(%rbp), %xmm0
movsd 0x6c3e(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0xbc(%rbp), %xmm0
movsd 0x6c21(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x15a7d
cvtsi2sdl -0xb4(%rbp), %xmm0
movsd 0x6bad(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0xb8(%rbp), %xmm0
movsd 0x6b90(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0xbc(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x15a7d
cvtsi2sdl -0xb4(%rbp), %xmm0
movsd 0x6b05(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0xb8(%rbp), %xmm0
movsd 0x6ae8(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0xbc(%rbp), %xmm0
movsd 0x6acb(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x15a7d
cvtsi2sdl -0xb4(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0xb8(%rbp), %xmm0
movsd 0x6a3d(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0xbc(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x15a7d
cvtsi2sdl -0xb4(%rbp), %xmm0
movsd 0x69b4(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0xb8(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0xbc(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %ecx, %ecx
movl $0xff, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x15a7d
cvtsi2sdl -0xb4(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0xb8(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0xbc(%rbp), %xmm0
movsd 0x68e4(%rip), %xmm1     # 0x1c268
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
movl $0xff, %r8d
callq 0x83f0
jmp 0x15a7d
cvtsi2sdl -0xb4(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2sdl -0xb8(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
cvtsi2sdl -0xbc(%rbp), %xmm0
xorps %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x83f0
movq -0x10(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0xa4(%rbp), %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x83f0
jmp 0x15a7d
jmp 0x15a7d
movl $0x0, -0xc0(%rbp)
cmpl $0x3, -0xc0(%rbp)
jge 0x15d7f
movq -0xd0(%rbp), %rdx
movq -0xc8(%rbp), %rax
movq -0xd8(%rbp), %rsi
movslq -0x80(%rbp), %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0xa4(%rbp), %edi
subl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xc0(%rbp), %rdi
movss (%rcx,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xc0(%rbp), %rcx
movss -0x1c(%rbp,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x69ee(%rip), %xmm2     # 0x1c4f0
mulsd %xmm2, %xmm1
movsd 0x65a2(%rip), %xmm2     # 0x1c0b0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x80(%rbp), %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0xa4(%rbp), %edi
subl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xc0(%rbp), %rdi
movss %xmm0, (%rcx,%rdi,4)
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0xa4(%rbp), %edi
subl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xc0(%rbp), %rdi
movss (%rcx,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xc0(%rbp), %rcx
movss -0x1c(%rbp,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x66b4(%rip), %xmm2     # 0x1c268
mulsd %xmm2, %xmm1
movsd 0x64f0(%rip), %xmm2     # 0x1c0b0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0xa4(%rbp), %edi
subl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xc0(%rbp), %rdi
movss %xmm0, (%rcx,%rdi,4)
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movslq -0xa4(%rbp), %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xc0(%rbp), %rdi
movss (%rcx,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xc0(%rbp), %rcx
movss -0x1c(%rbp,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x679a(%rip), %xmm2     # 0x1c400
mulsd %xmm2, %xmm1
movsd 0x643e(%rip), %xmm2     # 0x1c0b0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movslq -0xa4(%rbp), %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xc0(%rbp), %rdi
movss %xmm0, (%rcx,%rdi,4)
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdi
movq %rsi, %rcx
imulq %rdx, %rcx
imulq %rcx, %rdi
shlq $0x2, %rdi
movq %rax, %rcx
addq %rdi, %rcx
movl -0xa4(%rbp), %edi
addl $0x1, %edi
movslq %edi, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq %rdi, %rcx
movslq -0xc0(%rbp), %rdi
movss (%rcx,%rdi,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xc0(%rbp), %rcx
movss -0x1c(%rbp,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x6560(%rip), %xmm2     # 0x1c278
mulsd %xmm2, %xmm1
movsd 0x638c(%rip), %xmm2     # 0x1c0b0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movl -0x80(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq %rdx, %rsi
imulq %rsi, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0xa4(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq -0xc0(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc0(%rbp)
jmp 0x15a87
jmp 0x15d81
movl -0xa4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x1515a
jmp 0x15d97
jmp 0x15d99
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x144c3
movq -0x58(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)