// File: FR13ndSDP[P]NHT/Parameters.cpp
// Function: Parameters::Coeff(std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&)
void Parameters::Coeff(Vec &aW, Vec &aP, Vec &aE)
{
    double dx = L/N;
    for (int i=0; i<N; i++)
    {
        aW[i] = K/dx;
        aE[i] = aW[i];
        aP[i] = aW[i]+aE[i]+ uS*RHOC*dx/dt;
    }
    aE[N-1] = 0;
    aW[0] = 0;
    // left boundary
    if (B_L == 1)
        aP[0] += K/dx;
    else if (B_L == 2)
        aP[0] += -K/dx;
    else
        aP[0] += (-K/dx + 1/(1/A1+dx/(2*K)));
    // right boundary
    if (B_R == 1)
        aP[N-1] += K/dx;
    else if (B_R == 2)
        aP[N-1] += -K/dx;
    else
        aP[N-1] += (-K/dx + 1/(1/A2+dx/(2*K)));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movsd 0x18(%rax), %xmm0
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x5074
movq -0x38(%rbp), %rax
movsd 0x38(%rax), %xmm0
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x3490
movsd -0x58(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x3490
movsd -0x50(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x3490
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x3490
movsd -0x48(%rbp), %xmm0
movq %rax, %rcx
movq -0x38(%rbp), %rax
addsd (%rcx), %xmm0
cvtsi2sdl 0x4(%rax), %xmm1
mulsd 0x30(%rax), %xmm1
mulsd -0x28(%rbp), %xmm1
divsd 0x10(%rax), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x3490
movsd -0x40(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4f9c
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movq %rax, %rcx
movq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rcx)
cmpl $0x1, 0x8(%rax)
jne 0x50e3
movq -0x38(%rbp), %rax
movsd 0x38(%rax), %xmm0
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x60(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x51b0
movq -0x38(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x5133
movq -0x38(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x68(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x51ae
movq -0x38(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
divsd -0x28(%rbp), %xmm0
movsd 0x2ea8(%rip), %xmm2     # 0x8008
divsd 0x20(%rax), %xmm2
movsd -0x28(%rbp), %xmm1
movsd 0x2ea6(%rip), %xmm3     # 0x8018
mulsd 0x38(%rax), %xmm3
divsd %xmm3, %xmm1
addsd %xmm1, %xmm2
movsd 0x2e81(%rip), %xmm1     # 0x8008
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3490
movsd -0x70(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x51b0
movq -0x38(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jne 0x51f0
movq -0x38(%rbp), %rax
movsd 0x38(%rax), %xmm0
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x18(%rbp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd -0x78(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x52ce
movq -0x38(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jne 0x5247
movq -0x38(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x18(%rbp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd -0x80(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x52cc
movq -0x38(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
divsd -0x28(%rbp), %xmm0
movsd 0x2d94(%rip), %xmm2     # 0x8008
divsd 0x28(%rax), %xmm2
movsd -0x28(%rbp), %xmm1
movsd 0x2d92(%rip), %xmm3     # 0x8018
mulsd 0x38(%rax), %xmm3
divsd %xmm3, %xmm1
addsd %xmm1, %xmm2
movsd 0x2d6d(%rip), %xmm1     # 0x8008
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x18(%rbp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x3490
movsd -0x88(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x52ce
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)