// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsp, -0xa0(%rbp)
movl 0x8(%rdi), %r8d
movl 0xc(%rdi), %eax
movl 0x10(%rdi), %edx
movq %rdx, -0x68(%rbp)
movq %r8, -0x58(%rbp)
imulq %r8, %rdx
movq %rdx, -0x50(%rbp)
imulq %rdx, %rax
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x48(%rbp)
movq %rcx, %rsp
movq %rdi, -0x80(%rbp)
movslq 0xc(%rdi), %rax
movq %rax, -0x60(%rbp)
testq %rax, %rax
jle 0xcb1f
movq -0x80(%rbp), %rax
movl 0x8(%rax), %ecx
movl 0x10(%rax), %r8d
movq 0x18(%rax), %r9
movl %ecx, %eax
imull %r8d, %eax
movl %eax, -0x40(%rbp)
movq -0x50(%rbp), %rax
leaq (,%rax,4), %rax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rax
leaq (,%rax,4), %rbx
xorl %edi, %edi
movsd 0x49f3(%rip), %xmm0     # 0x114b0
movq -0x48(%rbp), %r15
xorl %r12d, %r12d
testl %ecx, %ecx
jle 0xcb0f
movq %r15, %r13
movl %edi, %eax
xorl %edx, %edx
testl %r8d, %r8d
jle 0xcb01
movslq %eax, %r11
addq %r9, %r11
xorl %r10d, %r10d
movzbl (%r11,%r10), %r14d
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
divsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
movss %xmm1, (%r13,%r10,4)
incq %r10
cmpq %r10, %r8
jne 0xcadd
incq %rdx
addl %r8d, %eax
addq %rbx, %r13
cmpq %rcx, %rdx
jne 0xcacf
incq %r12
addl -0x40(%rbp), %edi
addq -0x78(%rbp), %r15
cmpq -0x60(%rbp), %r12
jne 0xcac4
cmpl $0x2, 0xc(%rsi)
jl 0xd241
movq -0x50(%rbp), %rax
leaq (,%rax,4), %rcx
movq %rcx, -0xa8(%rbp)
movq -0x48(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rax
leaq (,%rax,4), %rdx
movq %rdx, -0x60(%rbp)
negq %rdx
movq %rdx, -0x78(%rbp)
movq -0x58(%rbp), %rdi
leaq -0x4(,%rdi,4), %rdx
imulq %rax, %rdx
addq %rcx, %rdx
movq %rdx, -0x98(%rbp)
leaq 0x4(,%rdi,4), %rdx
imulq %rax, %rdx
addq %rcx, %rdx
movq %rdx, -0x58(%rbp)
leaq (%rcx,%rax,4), %rax
movq %rax, -0x90(%rbp)
xorl %r13d, %r13d
movss 0x4b12(%rip), %xmm0     # 0x116b4
movsd 0x46d6(%rip), %xmm1     # 0x11280
movsd 0x4926(%rip), %xmm2     # 0x114d8
movsd 0x4926(%rip), %xmm3     # 0x114e0
movsd 0x4926(%rip), %xmm4     # 0x114e8
movsd 0x46c6(%rip), %xmm5     # 0x11290
movapd 0x4a6e(%rip), %xmm6     # 0x11640
movq %rcx, -0x88(%rbp)
movl 0x8(%rsi), %edx
testb $0x1, %r13b
jne 0xceeb
testl %edx, %edx
jle 0xd20a
movq -0x50(%rbp), %rax
imulq %r13, %rax
movq -0x48(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, -0x40(%rbp)
movq -0x90(%rbp), %r8
movq -0x58(%rbp), %r11
movq -0x70(%rbp), %r14
movq -0x98(%rbp), %r15
xorl %r10d, %r10d
movq -0x80(%rbp), %rdi
movq 0x18(%rdi), %rcx
movl 0x8(%rdi), %eax
imull %r13d, %eax
addl %r10d, %eax
imull 0x10(%rdi), %eax
movslq %eax, %rdi
movzbl (%rcx,%rdi), %eax
movzbl 0x1(%rcx,%rdi), %ebx
movzbl 0x2(%rcx,%rdi), %r9d
addl %ebx, %eax
addl %r9d, %ebx
movl $0x100, %edi            # imm = 0x100
cmpl %edi, %ebx
setae %cl
cmpl %edi, %eax
jb 0xcc72
cmpl $0x100, %ebx            # imm = 0x100
jb 0xcc7c
addl %r9d, %eax
cmpl $0x1ff, %eax            # imm = 0x1FF
setae %bl
setb %r9b
xorl %r12d, %r12d
jmp 0xcc84
xorl %ebx, %ebx
xorl %r9d, %r9d
xorl %r12d, %r12d
jmp 0xcc86
movb $0x1, %r12b
xorl %ebx, %ebx
xorl %r9d, %r9d
xorl %ecx, %ecx
movq %r10, %rax
imulq -0x68(%rbp), %rax
movq -0x40(%rbp), %rdi
movsd (%rdi,%rax,4), %xmm7
cvttps2dq %xmm7, %xmm9
cvttss2si 0x8(%rdi,%rax,4), %eax
cvtdq2ps %xmm9, %xmm10
xorps %xmm7, %xmm7
cvtsi2ss %eax, %xmm7
pshufd $0x55, %xmm9, %xmm8     # xmm8 = xmm9[1,1,1,1]
cvtdq2ps %xmm8, %xmm8
addss %xmm0, %xmm10
cvtss2sd %xmm10, %xmm10
mulsd %xmm10, %xmm10
cvtdq2pd %xmm9, %xmm9
movapd %xmm9, %xmm11
mulpd %xmm9, %xmm11
movaps %xmm8, %xmm12
addss %xmm0, %xmm12
cvtss2sd %xmm12, %xmm12
mulsd %xmm12, %xmm12
addsd %xmm11, %xmm12
unpckhpd %xmm11, %xmm11          # xmm11 = xmm11[1,1]
addsd %xmm10, %xmm11
movaps %xmm7, %xmm10
addss %xmm0, %xmm10
cvtss2sd %xmm10, %xmm13
mulsd %xmm13, %xmm13
addsd %xmm13, %xmm11
xorps %xmm10, %xmm10
cvtsd2ss %xmm11, %xmm10
addsd %xmm13, %xmm12
xorps %xmm11, %xmm11
cvtsd2ss %xmm12, %xmm11
testb %bl, %bl
je 0xcd54
ucomiss %xmm10, %xmm11
ja 0xcd5d
addpd %xmm6, %xmm9
cvtpd2ps %xmm9, %xmm7
movlpd %xmm7, -0x38(%rbp)
xorps %xmm7, %xmm7
cvtsi2sd %eax, %xmm7
addsd %xmm1, %xmm7
cvtsd2ss %xmm7, %xmm7
movb $-0x1, %cl
movb $-0x1, %al
jmp 0xcd88
testb %r9b, %r9b
je 0xceb4
addsd %xmm1, %xmm9
xorps %xmm7, %xmm7
cvtsd2ss %xmm9, %xmm7
movss %xmm7, -0x38(%rbp)
movss %xmm8, -0x34(%rbp)
xorps %xmm7, %xmm7
cvtsi2sd %eax, %xmm7
addsd %xmm1, %xmm7
cvtsd2ss %xmm7, %xmm7
movb $-0x1, %al
xorl %ecx, %ecx
movss %xmm7, -0x30(%rbp)
movq 0x18(%rsi), %rdi
imull %r13d, %edx
addl %r10d, %edx
imull 0x10(%rsi), %edx
movslq %edx, %rdx
movb $-0x1, (%rdi,%rdx)
movq 0x18(%rsi), %rdx
movl 0x8(%rsi), %edi
imull %r13d, %edi
addl %r10d, %edi
imull 0x10(%rsi), %edi
movslq %edi, %rdi
movb %cl, 0x1(%rdx,%rdi)
movq 0x18(%rsi), %rcx
movl 0x8(%rsi), %edx
imull %r13d, %edx
addl %r10d, %edx
imull 0x10(%rsi), %edx
movslq %edx, %rdx
movb %al, 0x2(%rcx,%rdx)
incq %r10
xorl %eax, %eax
xorps %xmm7, %xmm7
cvtss2sd (%r8,%rax), %xmm7
xorps %xmm8, %xmm8
cvtss2sd -0x38(%rbp,%rax), %xmm8
movaps %xmm8, %xmm9
mulsd %xmm2, %xmm9
mulsd %xmm3, %xmm9
addsd %xmm7, %xmm9
xorps %xmm7, %xmm7
cvtsd2ss %xmm9, %xmm7
movss %xmm7, (%r8,%rax)
xorps %xmm7, %xmm7
cvtss2sd (%r11,%rax), %xmm7
movaps %xmm8, %xmm9
mulsd %xmm3, %xmm9
addsd %xmm7, %xmm9
xorps %xmm7, %xmm7
cvtsd2ss %xmm9, %xmm7
movss %xmm7, (%r11,%rax)
xorps %xmm7, %xmm7
cvtss2sd (%r14,%rax), %xmm7
movaps %xmm8, %xmm9
mulsd %xmm4, %xmm9
mulsd %xmm3, %xmm9
addsd %xmm7, %xmm9
xorps %xmm7, %xmm7
cvtsd2ss %xmm9, %xmm7
movss %xmm7, (%r14,%rax)
xorps %xmm7, %xmm7
cvtss2sd (%r15,%rax), %xmm7
mulsd %xmm5, %xmm8
mulsd %xmm3, %xmm8
addsd %xmm7, %xmm8
xorps %xmm7, %xmm7
cvtsd2ss %xmm8, %xmm7
movss %xmm7, (%r15,%rax)
addq $0x4, %rax
cmpq $0xc, %rax
jne 0xcdda
movslq 0x8(%rsi), %rdx
movq -0x60(%rbp), %rax
addq %rax, %r15
addq %rax, %r14
addq %rax, %r11
addq %rax, %r8
cmpq %rdx, %r10
jl 0xcc1b
jmp 0xd20a
testb %r12b, %r12b
je 0xced2
addpd %xmm6, %xmm9
cvtpd2ps %xmm9, %xmm8
movlpd %xmm8, -0x38(%rbp)
movb $-0x1, %cl
xorl %eax, %eax
jmp 0xcd88
ucomiss %xmm10, %xmm11
seta %dil
andb %dil, %cl
cmpb $0x1, %cl
jne 0xcd30
jmp 0xcd5d
testl %edx, %edx
jle 0xd20a
movq -0x50(%rbp), %rax
imulq %r13, %rax
movq -0x48(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
movq %rax, -0x40(%rbp)
movq -0x60(%rbp), %rcx
movq %rcx, %r11
imulq %rdx, %r11
movq -0x70(%rbp), %rax
addq %rax, %r11
leaq -0x1(%rdx), %r14
imulq %rcx, %r14
addq %rax, %r14
leaq -0x2(%rdx), %r15
imulq %rcx, %r15
leaq (%rax,%r15), %r8
addq -0x88(%rbp), %r15
leaq -0x1(%rdx), %r10
movq -0x80(%rbp), %rdi
movq 0x18(%rdi), %rcx
movl 0x8(%rdi), %eax
imull %r13d, %eax
addl %r10d, %eax
imull 0x10(%rdi), %eax
movslq %eax, %rdi
movzbl (%rcx,%rdi), %eax
movzbl 0x1(%rcx,%rdi), %ebx
movzbl 0x2(%rcx,%rdi), %r9d
addl %ebx, %eax
addl %r9d, %ebx
movl $0x100, %edi            # imm = 0x100
cmpl %edi, %ebx
setae %cl
cmpl %edi, %eax
jb 0xcf92
cmpl $0x100, %ebx            # imm = 0x100
jb 0xcf9c
addl %r9d, %eax
cmpl $0x1ff, %eax            # imm = 0x1FF
setae %bl
setb %r9b
xorl %r12d, %r12d
jmp 0xcfa4
xorl %ebx, %ebx
xorl %r9d, %r9d
xorl %r12d, %r12d
jmp 0xcfa6
movb $0x1, %r12b
xorl %ebx, %ebx
xorl %r9d, %r9d
xorl %ecx, %ecx
movq %r10, %rax
imulq -0x68(%rbp), %rax
movq -0x40(%rbp), %rdi
movsd (%rdi,%rax,4), %xmm7
cvttps2dq %xmm7, %xmm9
cvttss2si 0x8(%rdi,%rax,4), %eax
cvtdq2ps %xmm9, %xmm10
xorps %xmm7, %xmm7
cvtsi2ss %eax, %xmm7
pshufd $0x55, %xmm9, %xmm8     # xmm8 = xmm9[1,1,1,1]
cvtdq2ps %xmm8, %xmm8
addss %xmm0, %xmm10
cvtss2sd %xmm10, %xmm10
mulsd %xmm10, %xmm10
cvtdq2pd %xmm9, %xmm9
movapd %xmm9, %xmm11
mulpd %xmm9, %xmm11
movaps %xmm8, %xmm12
addss %xmm0, %xmm12
cvtss2sd %xmm12, %xmm12
mulsd %xmm12, %xmm12
addsd %xmm11, %xmm12
unpckhpd %xmm11, %xmm11          # xmm11 = xmm11[1,1]
addsd %xmm10, %xmm11
movaps %xmm7, %xmm10
addss %xmm0, %xmm10
cvtss2sd %xmm10, %xmm13
mulsd %xmm13, %xmm13
addsd %xmm13, %xmm11
xorps %xmm10, %xmm10
cvtsd2ss %xmm11, %xmm10
addsd %xmm13, %xmm12
xorps %xmm11, %xmm11
cvtsd2ss %xmm12, %xmm11
testb %bl, %bl
je 0xd074
ucomiss %xmm10, %xmm11
ja 0xd07d
addpd %xmm6, %xmm9
cvtpd2ps %xmm9, %xmm7
movlpd %xmm7, -0x38(%rbp)
xorps %xmm7, %xmm7
cvtsi2sd %eax, %xmm7
addsd %xmm1, %xmm7
cvtsd2ss %xmm7, %xmm7
movb $-0x1, %cl
movb $-0x1, %al
jmp 0xd0a8
testb %r9b, %r9b
je 0xd1d3
addsd %xmm1, %xmm9
xorps %xmm7, %xmm7
cvtsd2ss %xmm9, %xmm7
movss %xmm7, -0x38(%rbp)
movss %xmm8, -0x34(%rbp)
xorps %xmm7, %xmm7
cvtsi2sd %eax, %xmm7
addsd %xmm1, %xmm7
cvtsd2ss %xmm7, %xmm7
movb $-0x1, %al
xorl %ecx, %ecx
movss %xmm7, -0x30(%rbp)
movl 0x8(%rsi), %edi
imull %r13d, %edi
addl %r10d, %edi
imull 0x10(%rsi), %edi
movq 0x18(%rsi), %r9
movslq %edi, %rdi
movb $-0x1, (%r9,%rdi)
movl 0x8(%rsi), %edi
imull %r13d, %edi
addl %r10d, %edi
imull 0x10(%rsi), %edi
movq 0x18(%rsi), %r9
movslq %edi, %rdi
movb %cl, 0x1(%r9,%rdi)
movl 0x8(%rsi), %ecx
imull %r13d, %ecx
addl %r10d, %ecx
imull 0x10(%rsi), %ecx
movq 0x18(%rsi), %rdi
movslq %ecx, %rcx
movb %al, 0x2(%rdi,%rcx)
xorl %eax, %eax
xorps %xmm7, %xmm7
cvtss2sd (%r15,%rax), %xmm7
xorps %xmm8, %xmm8
cvtss2sd -0x38(%rbp,%rax), %xmm8
movaps %xmm8, %xmm9
mulsd %xmm2, %xmm9
mulsd %xmm3, %xmm9
addsd %xmm7, %xmm9
xorps %xmm7, %xmm7
cvtsd2ss %xmm9, %xmm7
movss %xmm7, (%r15,%rax)
xorps %xmm7, %xmm7
cvtss2sd (%r8,%rax), %xmm7
movaps %xmm8, %xmm9
mulsd %xmm3, %xmm9
addsd %xmm7, %xmm9
xorps %xmm7, %xmm7
cvtsd2ss %xmm9, %xmm7
movss %xmm7, (%r8,%rax)
xorps %xmm7, %xmm7
cvtss2sd (%r14,%rax), %xmm7
movaps %xmm8, %xmm9
mulsd %xmm4, %xmm9
mulsd %xmm3, %xmm9
addsd %xmm7, %xmm9
xorps %xmm7, %xmm7
cvtsd2ss %xmm9, %xmm7
movss %xmm7, (%r14,%rax)
xorps %xmm7, %xmm7
cvtss2sd (%r11,%rax), %xmm7
mulsd %xmm5, %xmm8
mulsd %xmm3, %xmm8
addsd %xmm7, %xmm8
xorps %xmm7, %xmm7
cvtsd2ss %xmm8, %xmm7
movss %xmm7, (%r11,%rax)
addq $0x4, %rax
cmpq $0xc, %rax
jne 0xd0fc
movq -0x78(%rbp), %rax
addq %rax, %r11
addq %rax, %r14
addq %rax, %r8
addq %rax, %r15
cmpq $0x2, %rdx
movq %r10, %rdx
jge 0xcf37
jmp 0xd20a
testb %r12b, %r12b
je 0xd1f1
addpd %xmm6, %xmm9
cvtpd2ps %xmm9, %xmm8
movlpd %xmm8, -0x38(%rbp)
movb $-0x1, %cl
xorl %eax, %eax
jmp 0xd0a8
ucomiss %xmm10, %xmm11
seta %dil
andb %dil, %cl
cmpb $0x1, %cl
jne 0xd050
jmp 0xd07d
incq %r13
movslq 0xc(%rsi), %rax
decq %rax
movq -0xa8(%rbp), %rcx
addq %rcx, -0x70(%rbp)
addq %rcx, -0x88(%rbp)
addq %rcx, -0x98(%rbp)
addq %rcx, -0x58(%rbp)
addq %rcx, -0x90(%rbp)
cmpq %rax, %r13
jl 0xcbd9
movq -0xa0(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop