// File: JorisCaze[P]NASG-EOS_Calibration/src/calib_liq-vap.cpp
// Function: computeDHeatCapDiffL(std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&, double, double, double, double)
double computeDHeatCapDiffL(vector<double> const& psatExp, vector<double> const& Texp, vector<double> const& vLexp, double mvL, double mTp, double mTp2, double pinfL)
{
    // Purpose : compute pinfL derivative of fn computeHeatCapDiffL() for computePinfL Newton-Raphson process
    double m1(0.), m2(0.), m3(0.), m4(0.), bf1(0.), bf2(0.);
    for (unsigned int i = 0; i < Texp.size(); i++) {
        bf1 = Texp[i]/(psatExp[i]+pinfL);
        bf2 = bf1/(psatExp[i]+pinfL);
        m1 += -bf2*(vLexp[i]*mvL);
        m2 += bf1*(bf1 - (1./Texp.size())*mTp);
        m3 += bf1*(vLexp[i]-mvL);
        m4 += -bf2*(bf1-mTp)+bf1*(bf2+mTp2);
    }
    return (m1*m2-m3*m4)/(m2*m2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
movsd %xmm1, -0x28(%rbp)
movsd %xmm2, -0x30(%rbp)
movsd %xmm3, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jae 0x32ab
movq -0x10(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, %esi
callq 0x4110
movsd (%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, %esi
callq 0x4110
movsd -0xa8(%rbp), %xmm0
movsd (%rax), %xmm1
movsd -0x38(%rbp), %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, %esi
callq 0x4110
movsd -0xa0(%rbp), %xmm0
movsd (%rax), %xmm1
movsd -0x38(%rbp), %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x18(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, %esi
callq 0x4110
movsd -0x98(%rbp), %xmm1
movsd (%rax), %xmm2
movsd -0x20(%rbp), %xmm0
mulsd %xmm0, %xmm2
movsd -0x40(%rbp), %xmm0
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd %xmm0, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x40f0
movsd -0x90(%rbp), %xmm1
movsd -0x88(%rbp), %xmm0
movq %rax, %xmm3
movaps 0x4e53(%rip), %xmm2     # 0x8010
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
movapd 0x4e57(%rip), %xmm2     # 0x8020
subpd %xmm2, %xmm3
movaps %xmm3, %xmm2
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
addsd %xmm2, %xmm3
movsd 0x4e60(%rip), %xmm2     # 0x8040
divsd %xmm3, %xmm2
movsd -0x28(%rbp), %xmm3
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
movsd -0x48(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x18(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, %esi
callq 0x4110
movsd -0x80(%rbp), %xmm0
movsd (%rax), %xmm2
subsd -0x20(%rbp), %xmm2
movsd -0x50(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x68(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd -0x60(%rbp), %xmm2
subsd -0x28(%rbp), %xmm2
movsd -0x60(%rbp), %xmm1
movsd -0x68(%rbp), %xmm3
addsd -0x30(%rbp), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x30a2
movsd -0x40(%rbp), %xmm0
movsd -0x48(%rbp), %xmm2
movsd -0x50(%rbp), %xmm1
mulsd -0x58(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x48(%rbp), %xmm1
mulsd -0x48(%rbp), %xmm1
divsd %xmm1, %xmm0
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)