// File: suhasjains[P]AMR-Solver/src/poisson.cpp
// Function: amrsolver::gauss_seidel_red(myOctree::Octree*, myOctree::Field*, double)
double gauss_seidel_red(Octree* node, Field* f, double global_res) {

	double res, err;
	double dx, dy, dz;
	double ue, uw, un, us, ut, ub, up;
	double prev_val, curr_val;
	double force = 100.0;
	double relax = 1.4;
	res = 0.0;
	
	Field temp(nx_block+2*pad,ny_block+2*pad,nz_block+2*pad, "temp");
	//temp.set_field(0.0);	
	
	dx = node->get_block_data()->dx;
	dy = node->get_block_data()->dy;
	dz = node->get_block_data()->dz;
	
	
	//jocobi work - add here
	for(int i=pad; i<nx_block+pad; i++) {
		for(int j=pad; j<ny_block+pad; j++) {
			for(int k=pad; k<nz_block+pad; k++) {
			

				if((i+j+k)%2==0) {

					ue = f->val[i+1][j][k];		
					uw = f->val[i-1][j][k];		
					un = f->val[i][j+1][k];		
					us = f->val[i][j-1][k];		
					ut = f->val[i][j][k+1];		
					ub = f->val[i][j][k-1];		
					up = f->val[i][j][k];		
					
	
					if(i==pad)		temp.val[i][j][k] += (2.0*uw - up)/pow(dx,2); 	
					else			temp.val[i][j][k] += uw/pow(dx,2);	
					if(i==nx_block+pad-1)	temp.val[i][j][k] += (2.0*ue - up)/pow(dx,2); 	
					else			temp.val[i][j][k] += ue/pow(dx,2);	
					if(j==pad)		temp.val[i][j][k] += (2.0*us - up)/pow(dy,2); 	
					else			temp.val[i][j][k] += us/pow(dy,2);	
					if(j==ny_block+pad-1)	temp.val[i][j][k] += (2.0*un - up)/pow(dy,2); 	
					else			temp.val[i][j][k] += un/pow(dy,2);	
					if(k==pad)		temp.val[i][j][k] += (2.0*ub - up)/pow(dz,2); 	
					else			temp.val[i][j][k] += ub/pow(dz,2);	
					if(k==nz_block+pad-1)	temp.val[i][j][k] += (2.0*ut - up)/pow(dz,2); 	
					else			temp.val[i][j][k] += ut/pow(dz,2);	
	
					temp.val[i][j][k] -= force;
					temp.val[i][j][k] /= 2.0;
					temp.val[i][j][k] /= (1.0/pow(dx,2) + 1.0/pow(dy,2) + 1.0/pow(dz,2));
	
					prev_val = f->val[i][j][k];

					f->val[i][j][k] = (1.0 - relax) * f->val[i][j][k] + relax * temp.val[i][j][k];
					
					curr_val = f->val[i][j][k];
	
					/*magnitude to be considered*/
					err = std::abs(curr_val - prev_val);
					if(err>res) 	res = err;	
				
				}	
			}
		}
	}	
	
	
	if(res>global_res)	global_res = res;

	return global_res;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movabsq $0x4059000000000000, %rax # imm = 0x4059000000000000
movq %rax, -0x90(%rbp)
movabsq $0x3ff6666666666666, %rax # imm = 0x3FF6666666666666
movq %rax, -0x98(%rbp)
movq $0x0, -0x20(%rbp)
leaq 0xdb23(%rip), %rax      # 0x2626c
movl (%rax), %edx
leaq 0xdb16(%rip), %rax      # 0x26268
movl (%rax), %eax
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x13c(%rbp)
leaq 0xdb08(%rip), %rax      # 0x26270
movl (%rax), %edx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x138(%rbp)
leaq 0xdaf8(%rip), %rax      # 0x26274
movl (%rax), %edx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
movl %eax, -0x134(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x3430
movq -0x130(%rbp), %rdx
leaq 0x8de9(%rip), %rsi      # 0x21593
leaq -0x108(%rbp), %rdi
callq 0x4570
jmp 0x187b8
movl -0x134(%rbp), %ecx
movl -0x138(%rbp), %edx
movl -0x13c(%rbp), %esi
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %r8
callq 0xc0a0
jmp 0x187df
leaq -0x108(%rbp), %rdi
callq 0x3180
leaq -0x109(%rbp), %rdi
callq 0x3290
movq -0x8(%rbp), %rdi
callq 0x6de0
movq %rax, -0x148(%rbp)
jmp 0x18809
movq -0x148(%rbp), %rax
movsd 0x70(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x6de0
movq %rax, -0x150(%rbp)
jmp 0x1882c
movq -0x150(%rbp), %rax
movsd 0x78(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x6de0
movq %rax, -0x158(%rbp)
jmp 0x1884f
movq -0x158(%rbp), %rax
movsd 0x80(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
leaq 0xd9fe(%rip), %rax      # 0x26268
movl (%rax), %eax
movl %eax, -0x120(%rbp)
movl -0x120(%rbp), %eax
leaq 0xd9ed(%rip), %rcx      # 0x2626c
movl (%rcx), %ecx
leaq 0xd9e0(%rip), %rdx      # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x19346
leaq 0xd9cf(%rip), %rax      # 0x26268
movl (%rax), %eax
movl %eax, -0x124(%rbp)
movl -0x124(%rbp), %eax
leaq 0xd9c2(%rip), %rcx      # 0x26270
movl (%rcx), %ecx
leaq 0xd9b1(%rip), %rdx      # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x19330
leaq 0xd9a0(%rip), %rax      # 0x26268
movl (%rax), %eax
movl %eax, -0x128(%rbp)
movl -0x128(%rbp), %eax
leaq 0xd997(%rip), %rcx      # 0x26274
movl (%rcx), %ecx
leaq 0xd982(%rip), %rdx      # 0x26268
addl (%rdx), %ecx
cmpl %ecx, %eax
jge 0x1931a
movl -0x120(%rbp), %eax
addl -0x124(%rbp), %eax
addl -0x128(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x19304
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x120(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x120(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x124(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x124(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x128(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x128(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x78(%rbp)
movl -0x120(%rbp), %eax
leaq 0xd7e1(%rip), %rcx      # 0x26268
cmpl (%rcx), %eax
jne 0x18b7a
movsd -0x50(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x160(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x869b(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x160(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x18bd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x18b46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3180
leaq -0x109(%rbp), %rdi
callq 0x3290
jmp 0x19386
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xc640
jmp 0x19386
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x168(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x85d4(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x168(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x120(%rbp), %eax
leaq 0xd689(%rip), %rcx      # 0x2626c
movl (%rcx), %ecx
leaq 0xd67c(%rip), %rdx      # 0x26268
addl (%rdx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x18c7b
movsd -0x48(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x170(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x8531(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x170(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x18cd7
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x178(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x84d3(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x178(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x124(%rbp), %eax
leaq 0xd584(%rip), %rcx      # 0x26268
cmpl (%rcx), %eax
jne 0x18d6e
movsd -0x60(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x180(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x843e(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x180(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x18dca
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x188(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x83e0(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x188(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x124(%rbp), %eax
leaq 0xd499(%rip), %rcx      # 0x26270
movl (%rcx), %ecx
leaq 0xd488(%rip), %rdx      # 0x26268
addl (%rdx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x18e6f
movsd -0x58(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x190(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x833d(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x190(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x18ecb
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x82df(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x198(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x128(%rbp), %eax
leaq 0xd390(%rip), %rcx      # 0x26268
cmpl (%rcx), %eax
jne 0x18f62
movsd -0x70(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x1a0(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0x824a(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x1a0(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x18fbe
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x1a8(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0x81ec(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x1a8(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x128(%rbp), %eax
leaq 0xd2a9(%rip), %rcx      # 0x26274
movl (%rcx), %ecx
leaq 0xd294(%rip), %rdx      # 0x26268
addl (%rdx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x19063
movsd -0x68(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x1b0(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0x8149(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x1b0(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x190bf
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x1b8(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0x80eb(%rip), %xmm1     # 0x21168
callq 0x3410
movaps %xmm0, %xmm1
movsd -0x1b8(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd -0x90(%rbp), %xmm1
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x8056(%rip), %xmm1     # 0x21180
mulsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movsd -0x30(%rbp), %xmm0
movsd 0x8028(%rip), %xmm1     # 0x21168
movsd %xmm1, -0x1e0(%rbp)
callq 0x3410
movsd -0x1e0(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd 0x7eb0(%rip), %xmm0     # 0x21010
movsd %xmm0, -0x1c8(%rbp)
divsd %xmm2, %xmm0
movsd %xmm0, -0x1d8(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x3410
movsd -0x1e0(%rbp), %xmm1
movsd -0x1c8(%rbp), %xmm2
movaps %xmm0, %xmm3
movsd -0x1d8(%rbp), %xmm0
divsd %xmm3, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, -0x1d0(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x3410
movsd -0x1d0(%rbp), %xmm2
movaps %xmm0, %xmm3
movsd -0x1c8(%rbp), %xmm0
movaps %xmm0, %xmm1
divsd %xmm3, %xmm1
addsd %xmm1, %xmm2
movq -0xd8(%rbp), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd %xmm1, -0x80(%rbp)
movsd -0x98(%rbp), %xmm1
subsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x120(%rbp), %rdi
movq (%rax,%rdi,8), %rax
movslq -0x124(%rbp), %rsi
movq (%rax,%rsi,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0xd8(%rbp), %rdx
movq (%rdx,%rdi,8), %rdx
movq (%rdx,%rsi,8), %rdx
movsd (%rdx,%rcx,8), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x120(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x124(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x128(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x88(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
subsd %xmm1, %xmm0
callq 0x6d50
movsd %xmm0, -0x1c0(%rbp)
jmp 0x192df
movsd -0x1c0(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
ucomisd -0x20(%rbp), %xmm0
jbe 0x19302
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x19304
jmp 0x19306
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x188d0
jmp 0x1931c
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x188a1
jmp 0x19332
movl -0x120(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x120(%rbp)
jmp 0x18872
movsd -0x20(%rbp), %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0x1935c
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x1e8(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xc640
movsd -0x1e8(%rbp), %xmm0
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x118(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)