// File: FR13ndSDP[P]NHT/Solver.cpp
// Function: jacobi(std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, double)
Vec jacobi(Vec aW, Vec aP, Vec aE, Vec Su, double p)
{
    int n = aW.size();
    Vec phi(n,1);
    Vec phi0(n,0);
    Vec errList(n,1);
    // whith origin value as 0
    while (maxabs(errList) > p)
    {
        phi[0] = (aE[0]*phi0[1]+Su[0])/aP[0];
        for (int i =1; i<n-1; i++)
        {
            phi[i] = (aW[i]*phi0[i-1]+aE[i]*phi0[i+1]+Su[i])/aP[i];
        }
        phi[n-1] = (aW[n-1]*phi0[n-2]+Su[n-1])/aP[n-1];
        for (int i=0; i<n; i++)
        {
            errList[i] = phi0[i] - phi[i];
            phi0[i] = phi[i];
        }
    }
    return phi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %r8, -0x108(%rbp)
movq %rcx, -0x100(%rbp)
movq %rdx, -0xf8(%rbp)
movq %rsi, -0xf0(%rbp)
movq %rdi, %rax
movq -0xf0(%rbp), %rdi
movq %rax, -0xe0(%rbp)
movq %rax, %rsi
movq %rsi, -0xe8(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movsd %xmm0, -0x30(%rbp)
callq 0x3e40
movl %eax, -0x34(%rbp)
movb $0x0, -0x35(%rbp)
movslq -0x34(%rbp), %rax
movq %rax, -0xd8(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x40(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x34b0
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rcx
leaq -0x40(%rbp), %rdx
callq 0x34d0
jmp 0x61d0
leaq -0x41(%rbp), %rdi
callq 0x3550
movslq -0x34(%rbp), %rax
movq %rax, -0x118(%rbp)
movq $0x0, -0x78(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x34b0
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rcx
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x34d0
jmp 0x6219
leaq -0x79(%rbp), %rdi
callq 0x3550
movslq -0x34(%rbp), %rax
movq %rax, -0x128(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0xa0(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x34b0
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rcx
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0x34d0
jmp 0x6274
leaq -0xa1(%rbp), %rdi
callq 0x3550
leaq -0xc0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3570
jmp 0x6295
leaq -0xc0(%rbp), %rdi
callq 0x5a40
movsd %xmm0, -0x130(%rbp)
jmp 0x62ab
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3690
movsd -0x138(%rbp), %xmm1
movsd -0x130(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x66d7
movq -0x100(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x158(%rbp)
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x3490
movq -0x108(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x150(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x158(%rbp), %xmm0
movsd -0x150(%rbp), %xmm2
movq -0xf8(%rbp), %rdi
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x148(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x148(%rbp), %xmm0
movq -0xe0(%rbp), %rdi
divsd (%rax), %xmm0
movsd %xmm0, -0x140(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x140(%rbp), %xmm0
movsd %xmm0, (%rax)
movl $0x1, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x6546
movq -0xf0(%rbp), %rdi
movslq -0xc4(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x180(%rbp)
movl -0xc4(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x3490
movq -0x100(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x178(%rbp)
movslq -0xc4(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x188(%rbp)
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x3490
movsd -0x188(%rbp), %xmm1
movsd -0x180(%rbp), %xmm0
movsd -0x178(%rbp), %xmm2
movq -0x108(%rbp), %rdi
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x170(%rbp)
movslq -0xc4(%rbp), %rsi
callq 0x3490
movsd -0x170(%rbp), %xmm0
movq -0xf8(%rbp), %rdi
addsd (%rax), %xmm0
movsd %xmm0, -0x168(%rbp)
movslq -0xc4(%rbp), %rsi
callq 0x3490
movsd -0x168(%rbp), %xmm0
movq -0xe0(%rbp), %rdi
divsd (%rax), %xmm0
movsd %xmm0, -0x160(%rbp)
movslq -0xc4(%rbp), %rsi
callq 0x3490
movsd -0x160(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x6392
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x3550
jmp 0x6737
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x3550
jmp 0x672b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa1(%rbp), %rdi
callq 0x3550
jmp 0x6704
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x66f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3690
jmp 0x66f8
movq -0xf0(%rbp), %rdi
movl -0x34(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x1a8(%rbp)
movl -0x34(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x3490
movq -0x108(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x1a0(%rbp)
movl -0x34(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd -0x1a8(%rbp), %xmm0
movsd -0x1a0(%rbp), %xmm2
movq -0xf8(%rbp), %rdi
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x198(%rbp)
movl -0x34(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd -0x198(%rbp), %xmm0
movq -0xe0(%rbp), %rdi
divsd (%rax), %xmm0
movsd %xmm0, -0x190(%rbp)
movl -0x34(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd -0x190(%rbp), %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x66d2
movslq -0xc8(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x3490
movq -0xe0(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x1c0(%rbp)
movslq -0xc8(%rbp), %rsi
callq 0x3490
movsd -0x1c0(%rbp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, -0x1b8(%rbp)
movslq -0xc8(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x3490
movsd -0x1b8(%rbp), %xmm0
movq -0xe0(%rbp), %rdi
movsd %xmm0, (%rax)
movslq -0xc8(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x1b0(%rbp)
movslq -0xc8(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x3490
movsd -0x1b0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x6612
jmp 0x6280
movb $0x1, -0x35(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3690
leaq -0x70(%rbp), %rdi
callq 0x3690
testb $0x1, -0x35(%rbp)
jne 0x671b
jmp 0x670f
leaq -0x98(%rbp), %rdi
callq 0x3690
leaq -0x70(%rbp), %rdi
callq 0x3690
jmp 0x672b
movq -0xe0(%rbp), %rdi
callq 0x3690
movq -0xe8(%rbp), %rax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq -0xe0(%rbp), %rdi
callq 0x3690
movq -0x50(%rbp), %rdi
callq 0x2350