// File: nandakishoremmn2[P]multigrid/multigrid.cpp
// Function: MultiGrid::interp()
void MultiGrid::interp()
{
	// Interpolate values from *grid2.temp to temp
	real **temp2 = grid2->temp;
	int n2 = grid2->getSize();

	for (int i = 0; i < n2-1; ++i)
	{
		for (int j = 0; j < n2-1; ++j)
		{
			// Between 4 points
			temp[2*i+1][2*j+1] = ( temp2[i][j] + temp2[i][j+1] + temp2[i+1][j] + temp2[i+1][j+1] ) / 4.0;
		}
	}

	for (int i = 0; i < n2-1; ++i)
	{
		for (int j = 1; j < n2-1; ++j)
		{
			// Between 2 points
			temp[2*i+1][2*j] = ( temp2[i][j] + temp2[i+1][j] ) / 2.0;
			temp[2*j][2*i+1] = ( temp2[j][i] + temp2[j][i+1] ) / 2.0;
		}
	}

	for (int i = 1; i < n2-1; ++i)
	{
		for (int j = 1; j < n2-1; ++j)
		{
			temp[2*i][2*j] = temp2[i][j];
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq (%rax), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, -0x10(%rbp)
movq (%rax), %rdi
callq 0x2230
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x2363
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x2353
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x1c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
addsd (%rcx,%rdx,8), %xmm0
movq -0x10(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x1c(%rbp), %rdx
addsd (%rcx,%rdx,8), %xmm0
movq -0x10(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
addsd (%rcx,%rdx,8), %xmm0
movsd 0x2dea(%rip), %xmm1     # 0x5108
divsd %xmm1, %xmm0
movq 0x8(%rax), %rax
movl -0x18(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2299
jmp 0x2355
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2281
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x246b
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x245b
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq -0x10(%rbp), %rcx
movl -0x20(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x24(%rbp), %rdx
addsd (%rcx,%rdx,8), %xmm0
movsd 0x2d2a(%rip), %xmm1     # 0x50f8
divsd %xmm1, %xmm0
movq 0x8(%rax), %rcx
movl -0x20(%rbp), %edx
shll %edx
addl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl -0x24(%rbp), %edx
shll %edx
movslq %edx, %rdx
movsd %xmm0, (%rcx,%rdx,8)
movq -0x10(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq -0x10(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl -0x20(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
addsd (%rcx,%rdx,8), %xmm0
movsd 0x2ccf(%rip), %xmm1     # 0x50f8
divsd %xmm1, %xmm0
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x20(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2382
jmp 0x245d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x236a
movl $0x1, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x24e1
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x24d4
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0x28(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x2c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x8(%rax), %rax
movl -0x28(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl -0x2c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2486
jmp 0x24d6
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2472
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)