// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, 0x38(%rsp)
movq %rdi, %r14
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x8(%rdi), %rbx
subq (%rdi), %rbx
shrq $0x3, %rbx
testl %ebx, %ebx
jle 0x13ea4
movq %rsi, %r15
movl %ebx, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r12d, %r12d
leaq 0x40(%rsp), %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq (%r14), %rax
movq (%rax,%r12,8), %rax
movsd (%r15), %xmm0
subsd 0x278(%rax), %xmm0
movsd 0x8(%r15), %xmm1
subsd 0x280(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0xa385(%rip), %xmm0     # 0x1e1b8
jb 0x13e3b
sqrtsd %xmm0, %xmm0
jmp 0x13e40
callq 0x31b0
addsd 0xaa30(%rip), %xmm0     # 0x1e878
movsd 0xa350(%rip), %xmm1     # 0x1e1a0
divsd %xmm0, %xmm1
movsd %xmm1, 0x40(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x13e75
movsd %xmm1, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x13e80
movq %rsp, %rdi
movq %r13, %rdx
callq 0x15364
movq (%rsp), %rax
movapd 0x20(%rsp), %xmm0
addsd (%rax,%r12,8), %xmm0
movapd %xmm0, 0x20(%rsp)
incq %r12
cmpq %r12, %rbp
jne 0x13dfd
jmp 0x13eae
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
xorpd %xmm0, %xmm0
testl %ebx, %ebx
xorpd %xmm4, %xmm4
movapd 0x20(%rsp), %xmm5
jle 0x13f1a
movq (%rsp), %rax
movq (%r14), %rcx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
unpcklpd %xmm5, %xmm5            # xmm5 = xmm5[0,0]
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movsd (%rax,%rdx,8), %xmm1
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
movsd 0x60(%rsi), %xmm2
movsd 0xc0(%rsi), %xmm3
movhpd 0x90(%rsi), %xmm2       # xmm2 = xmm2[0],mem[0]
mulpd %xmm1, %xmm2
divpd %xmm5, %xmm2
addpd %xmm2, %xmm4
movhpd 0x30(%rsi), %xmm3       # xmm3 = xmm3[0],mem[0]
mulpd %xmm1, %xmm3
divpd %xmm5, %xmm3
addpd %xmm3, %xmm0
incq %rdx
cmpq %rdx, %rbx
jne 0x13ed3
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
movq 0x38(%rsp), %rax
movhpd %xmm0, (%rax)
divpd %xmm1, %xmm4
movupd %xmm4, 0x8(%rax)
movapd %xmm4, %xmm2
mulpd %xmm4, %xmm2
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
mulsd %xmm4, %xmm4
addsd %xmm2, %xmm4
mulsd 0xa1f0(%rip), %xmm1     # 0x1e140
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
mulsd 0xa248(%rip), %xmm1     # 0x1e1a8
movsd %xmm1, 0x18(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x13f7b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3220
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x13fa3
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3220
movq %rbx, %rdi
callq 0x3370