// File: FR13ndSDP[P]NHT/Solver.cpp
// Function: TDMA(std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>)
Vec TDMA(Vec aW, Vec aP, Vec aE, Vec Su)
{
    int size = Su.size();
    Vec P(size, 0), Q(size, 0), phi(size,0);
    P[0] = aE[0] / aP[0];
    Q[0] = Su[0] / aP[0];
    for (int i = 1; i < size; i++)
    {
        P[i] = aE[i]/(aP[i] - aW[i]*P[i-1]);
        Q[i] = (Su[i]+aW[i]*Q[i-1])/(aP[i] - aW[i]*P[i-1]);
    }
    phi[size-1] = Q[size-1];
    for (int i = size-1; i>0 ; i--)
    {
        phi[i-1] = P[i-1]*phi[i]+Q[i-1];
    }
    return phi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %r8, -0xd0(%rbp)
movq %rcx, -0xe8(%rbp)
movq %rdx, -0xe0(%rbp)
movq %rsi, -0xd8(%rbp)
movq %rdi, %rax
movq -0xd0(%rbp), %rdi
movq %rax, -0xc8(%rbp)
movq %rax, %r8
movq %r8, -0xc0(%rbp)
movq %rax, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %rdi, -0x28(%rbp)
callq 0x3e40
movl %eax, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq $0x0, -0x50(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x34b0
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rcx
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x34d0
jmp 0x5bbe
leaq -0x51(%rbp), %rdi
callq 0x3550
movslq -0x2c(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq $0x0, -0x88(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x34b0
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rcx
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x34d0
jmp 0x5c10
leaq -0x89(%rbp), %rdi
callq 0x3550
movb $0x0, -0x8a(%rbp)
movslq -0x2c(%rbp), %rax
movq %rax, -0x108(%rbp)
movq $0x0, -0x98(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x34b0
movq -0xc8(%rbp), %rdi
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rcx
leaq -0x98(%rbp), %rdx
callq 0x34d0
jmp 0x5c6f
leaq -0x99(%rbp), %rdi
callq 0x3550
movq -0xe8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movq -0xe0(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x128(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x128(%rbp), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, -0x120(%rbp)
leaq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x120(%rbp), %xmm0
movq -0xd0(%rbp), %rdi
movsd %xmm0, (%rax)
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movq -0xe0(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x118(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x118(%rbp), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, -0x110(%rbp)
leaq -0x80(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x110(%rbp), %xmm0
movsd %xmm0, (%rax)
movl $0x1, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x5fb9
movq -0xe8(%rbp), %rdi
movslq -0xa0(%rbp), %rsi
callq 0x3490
movq -0xe0(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x168(%rbp)
movslq -0xa0(%rbp), %rsi
callq 0x3490
movq -0xd8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x170(%rbp)
movslq -0xa0(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x178(%rbp)
movl -0xa0(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x3490
movsd -0x178(%rbp), %xmm1
movsd -0x170(%rbp), %xmm2
movsd -0x168(%rbp), %xmm0
movsd (%rax), %xmm3
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x160(%rbp)
movslq -0xa0(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3490
movsd -0x160(%rbp), %xmm0
movq -0xd0(%rbp), %rdi
movsd %xmm0, (%rax)
movslq -0xa0(%rbp), %rsi
callq 0x3490
movq -0xd8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x150(%rbp)
movslq -0xa0(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x158(%rbp)
movl -0xa0(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x3490
movsd -0x158(%rbp), %xmm0
movsd -0x150(%rbp), %xmm1
movq -0xe0(%rbp), %rdi
movsd (%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x138(%rbp)
movslq -0xa0(%rbp), %rsi
callq 0x3490
movq -0xd8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x140(%rbp)
movslq -0xa0(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x148(%rbp)
movl -0xa0(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x3490
movsd -0x148(%rbp), %xmm1
movsd -0x140(%rbp), %xmm2
movsd -0x138(%rbp), %xmm0
movsd (%rax), %xmm3
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x130(%rbp)
movslq -0xa0(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3490
movsd -0x130(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x5d37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x3550
jmp 0x6109
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x3550
jmp 0x6100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x3550
leaq -0x80(%rbp), %rdi
callq 0x3690
jmp 0x6100
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x3490
movq -0xc8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x180(%rbp)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd -0x180(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0xa4(%rbp)
jle 0x60c2
movl -0xa4(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x3490
movq -0xc8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x198(%rbp)
movslq -0xa4(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x190(%rbp)
movl -0xa4(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x3490
movsd -0x198(%rbp), %xmm0
movsd -0x190(%rbp), %xmm2
movq -0xc8(%rbp), %rdi
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x188(%rbp)
movl -0xa4(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd -0x188(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xa4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x6004
movb $0x1, -0x8a(%rbp)
testb $0x1, -0x8a(%rbp)
jne 0x60de
movq -0xc8(%rbp), %rdi
callq 0x3690
leaq -0x80(%rbp), %rdi
callq 0x3690
leaq -0x48(%rbp), %rdi
callq 0x3690
movq -0xc0(%rbp), %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x3690
movq -0x60(%rbp), %rdi
callq 0x2350
nopw %cs:(%rax,%rax)