// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r12
movq %rcx, -0x48(%rbp)
movq %rdx, -0x50(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdi, %r14
movq 0x8(%r8), %r13
subq (%r8), %r13
shrq $0x3, %r13
movslq %r13d, %r15
xorl %eax, %eax
leaq -0x68(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x80(%rbp), %rdi
leaq -0x38(%rbp), %rbx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x32ea
xorl %eax, %eax
movq %rax, (%rbx)
leaq -0x68(%rbp), %rdi
leaq -0x38(%rbp), %rdx
leaq -0x29(%rbp), %rcx
movq %r15, %rsi
callq 0x32ea
leaq -0x38(%rbp), %rdx
movq $0x0, (%rdx)
leaq -0x29(%rbp), %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x32ea
movq -0x48(%rbp), %rax
movq (%rax), %rcx
movsd (%rcx), %xmm0
movq -0x50(%rbp), %rax
movq (%rax), %rdx
divsd (%rdx), %xmm0
movq -0x80(%rbp), %rax
movsd %xmm0, (%rax)
movq (%r12), %rsi
movsd (%rsi), %xmm0
divsd (%rdx), %xmm0
movq -0x68(%rbp), %rdi
movsd %xmm0, (%rdi)
cmpl $0x1, %r13d
jle 0x42f2
movq -0x40(%rbp), %r8
movq (%r8), %r8
movl %r13d, %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movl $0x1, %r10d
movsd (%rcx,%r10,8), %xmm0
movsd (%rdx,%r10,8), %xmm1
movsd -0x8(%rax,%r10,8), %xmm2
movsd (%r8,%r10,8), %xmm3
mulsd %xmm2, %xmm3
subsd %xmm3, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%r10,8)
movsd (%r8,%r10,8), %xmm0
movsd -0x8(%rdi,%r10,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%rsi,%r10,8), %xmm1
movsd (%rdx,%r10,8), %xmm3
mulsd %xmm2, %xmm0
subsd %xmm0, %xmm3
divsd %xmm3, %xmm1
movsd %xmm1, (%rdi,%r10,8)
incq %r10
cmpq %r10, %r9
jne 0x424e
movsd -0x8(%rdi,%r15,8), %xmm0
movq (%r14), %rcx
movsd %xmm0, -0x8(%rcx,%r15,8)
cmpl $0x2, %r13d
jl 0x4314
leal -0x1(%r13), %edx
movl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
incq %rdx
mulsd -0x10(%rax,%rdx,8), %xmm0
addsd -0x10(%rdi,%rdx,8), %xmm0
movsd %xmm0, -0x10(%rcx,%rdx,8)
decq %rdx
cmpq $0x1, %rdx
ja 0x42d5
jmp 0x4314
shlq $0x20, %r13
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r13, %rax
sarq $0x1d, %rax
movsd (%rdi,%rax), %xmm0
movq (%r14), %rcx
movsd %xmm0, (%rcx,%rax)
movq -0x58(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4335
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x4364
movq -0x58(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
jmp 0x4364
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4379
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2280