// File: jamesliu516[P]amrdg2d/wall4amrdg2013.cpp
// Function: chazhi4smtrictPshbl(std::vector<bodygridclass*, std::allocator<bodygridclass*>>&, pointxy const&, privariables&)
void chazhi4smtrictPshbl(vector< OctCell * > &grid, const PXYZ &smtrict, JBBL &jbu )
{
    double distance;
    vector<double> expMinusR;
    double sumR = 0.0; 
    int nmc1=grid.size();  

    SHBL shu;
    for(int i=0; i < nmc1; ++i) {
        distance=sqrt( (smtrict.x-grid[i]->xc1) * (smtrict.x-grid[i]->xc1) 
            + (smtrict.y-grid[i]->yc1) * (smtrict.y-grid[i]->yc1));
        // expMinusR.push_back(exp(-distance));
        expMinusR.push_back(1.0/(1.0e-18+distance));
        sumR += expMinusR[i];

    }

    for(int i = 0; i < nmc1; ++i)
    {
        shu.q += expMinusR[i] * grid[i]->dof[0][0]/sumR;
        shu.qu += expMinusR[i] * grid[i]->dof[1][0]/sumR;
        shu.qv += expMinusR[i] * grid[i]->dof[2][0]/sumR;
        shu.te += expMinusR[i] * grid[i]->dof[3][0]/sumR;
    }

    shblToJbbl(&shu,&jbu);   
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq %rdx, 0xd0(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x17d10
movq $0x0, 0xa8(%rsp)
movq 0xe0(%rsp), %rdi
callq 0x1bd50
movl %eax, 0xa4(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x21aa0
jmp 0x2ba4b
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
cmpl 0xa4(%rsp), %eax
jge 0x2bc1b
movq 0xd8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x70(%rsp), %rsi
callq 0x1e180
movsd 0x28(%rsp), %xmm0
movq (%rax), %rax
movsd 0x278(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0xd8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x70(%rsp), %rsi
callq 0x1e180
movsd 0x30(%rsp), %xmm0
movq (%rax), %rax
movsd 0x278(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0xd8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x70(%rsp), %rsi
callq 0x1e180
movsd 0x38(%rsp), %xmm0
movq (%rax), %rax
movsd 0x280(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0xd8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x70(%rsp), %rsi
callq 0x1e180
movsd 0x40(%rsp), %xmm3
movsd 0x48(%rsp), %xmm1
movsd 0x50(%rsp), %xmm0
movsd 0x58(%rsp), %xmm2
movq (%rax), %rax
movsd 0x280(%rax), %xmm4
subsd %xmm4, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x31c0
movsd %xmm0, 0xc8(%rsp)
movsd 0xc8(%rsp), %xmm1
movsd 0x13c67(%rip), %xmm0    # 0x3f800
addsd %xmm0, %xmm1
movsd 0x134b3(%rip), %xmm0    # 0x3f058
divsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2e100
jmp 0x2bbc3
movslq 0x70(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x182c0
movsd (%rax), %xmm0
addsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x2ba53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x17de0
jmp 0x2bdd2
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0xa4(%rsp), %eax
jge 0x2bda6
movslq 0x64(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x182c0
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x1e180
movsd 0x8(%rsp), %xmm0
movq (%rax), %rax
mulsd 0x30(%rax), %xmm0
divsd 0xa8(%rsp), %xmm0
addsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movslq 0x64(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x182c0
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x1e180
movsd 0x10(%rsp), %xmm0
movq (%rax), %rax
mulsd 0x60(%rax), %xmm0
divsd 0xa8(%rsp), %xmm0
addsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movslq 0x64(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x182c0
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x1e180
movsd 0x18(%rsp), %xmm0
movq (%rax), %rax
mulsd 0x90(%rax), %xmm0
divsd 0xa8(%rsp), %xmm0
addsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movslq 0x64(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x182c0
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x1e180
movsd 0x20(%rsp), %xmm0
movq (%rax), %rax
mulsd 0xc0(%rax), %xmm0
divsd 0xa8(%rsp), %xmm0
addsd 0x98(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x2bc23
movq 0xd0(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x21ad0
jmp 0x2bdbd
leaq 0xb0(%rsp), %rdi
callq 0x17de0
addq $0xe8, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0x3440
nopl (%rax)