// File: /workspace/github_cpp_makefile_star2_O1/jamesliu516[P]amrdg2d/solveAMR.cpp
// Function: getAllAdpParametersList()
void getAllAdpParametersList()
{
    Node *current;
    current = HeadListAllGrid;  
    OctCell *lsbl;

    Vec2D tpvec;
    double jl0,jl1,jl2,jl3;
    double maxhxy;
    Sigma_curl=0.0;
    Sigma_div=0.0;
    Sigma_pio=0.0;
    N_total_adpcell=0;
    maxhxy=max2(hx,hy);

    while(current != NULL)
    {		
        lsbl = current->cell;
        if(lsbl->flag == 0 && current->flg==0
            //   && lsbl->xc1<xOutlet-1.0*hx
            //    && lsbl->xc1>xInlet+1.0*hx
            //   && lsbl->yc1>ExtPnt1[1]+1.0*hy
            //   && lsbl->yc1<ExtPnt3[1]-1.0*hy
          ) {
#if IS_TUBE==1
            tpvec[0]=lsbl->xc1;
            tpvec[1]=lsbl->yc1;
            jl0=fabs(tpvec-ExtPnt0);
            jl1=fabs(tpvec-ExtPnt1);
            jl2=fabs(tpvec-ExtPnt2);
            jl3=fabs(tpvec-ExtPnt3);

            if(jl0>3.0*maxhxy && jl1>3.0*maxhxy
                && jl2 > 3.0*maxhxy && jl3>3.0*maxhxy){
#endif
                getAdaptiveParameters(lsbl);

                Sigma_curl += lsbl->tcur * lsbl->tcur;
                Sigma_div += lsbl->tdiv *lsbl->tdiv;			
                Sigma_pio+=lsbl->pio* lsbl->pio;

                ++N_total_adpcell;
#if IS_TUBE==1
            }
#endif
        }        
        current = current->next;
    }
    Sigma_curl = sqrt(Sigma_curl/N_total_adpcell);
    Sigma_div = sqrt(Sigma_div/N_total_adpcell);
    Sigma_pio = sqrt(Sigma_pio/N_total_adpcell);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0xf197(%rip), %rax      # 0x2a610
movq (%rax), %r14
leaq 0x18(%rsp), %rdi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0xd250
xorl %eax, %eax
movq %rax, 0x1d189(%rip)     # 0x38620
movq %rax, 0x1d18a(%rip)     # 0x38628
movq %rax, 0x1d18b(%rip)     # 0x38630
movl $0x0, 0x1d189(%rip)     # 0x38638
testq %r14, %r14
je 0x1b62b
leaq 0x18(%rsp), %rbx
leaq 0xf39c(%rip), %r15      # 0x2a860
leaq 0xf3a5(%rip), %r12      # 0x2a870
leaq 0xf3ae(%rip), %r13      # 0x2a880
movq 0x8(%r14), %rbp
cmpw $0x0, 0x1b0(%rbp)
jne 0x1b61e
cmpw $0x0, (%r14)
jne 0x1b61e
movsd 0x278(%rbp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0xd506
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x280(%rbp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xd506
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
leaq 0xf314(%rip), %rsi      # 0x2a850
callq 0xd4a0
callq 0xd271
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xd4a0
callq 0xd271
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd4a0
callq 0xd271
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xd4a0
callq 0xd271
movsd 0x3771(%rip), %xmm1     # 0x1ed00
movsd (%rsp), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x1b61e
movsd 0x10(%rsp), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x1b61e
movsd 0x8(%rsp), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x1b61e
ucomisd %xmm1, %xmm0
jbe 0x1b61e
movq %rbp, %rdi
callq 0x1b380
movsd 0x238(%rbp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x1d048(%rip), %xmm0    # 0x38620
movsd %xmm0, 0x1d040(%rip)    # 0x38620
movsd 0x240(%rbp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x1d034(%rip), %xmm0    # 0x38628
movsd %xmm0, 0x1d02c(%rip)    # 0x38628
movsd 0x248(%rbp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x1d020(%rip), %xmm0    # 0x38630
movsd %xmm0, 0x1d018(%rip)    # 0x38630
incl 0x1d01a(%rip)           # 0x38638
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x1b4d2
xorps %xmm1, %xmm1
cvtsi2sdl 0x1d002(%rip), %xmm1 # 0x38638
movsd 0x1cfe2(%rip), %xmm0    # 0x38620
divsd %xmm1, %xmm0
ucomisd 0x2b6e(%rip), %xmm0     # 0x1e1b8
jb 0x1b652
sqrtsd %xmm0, %xmm0
jmp 0x1b657
callq 0x31b0
movsd %xmm0, 0x1cfc1(%rip)    # 0x38620
movsd 0x1cfc1(%rip), %xmm0    # 0x38628
xorps %xmm1, %xmm1
cvtsi2sdl 0x1cfc6(%rip), %xmm1 # 0x38638
divsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jb 0x1b686
sqrtsd %xmm0, %xmm0
jmp 0x1b68f
callq 0x31b0
xorpd %xmm2, %xmm2
movsd %xmm0, 0x1cf91(%rip)    # 0x38628
xorps %xmm1, %xmm1
cvtsi2sdl 0x1cf96(%rip), %xmm1 # 0x38638
movsd 0x1cf86(%rip), %xmm0    # 0x38630
divsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0x1b6ba
sqrtsd %xmm0, %xmm0
jmp 0x1b6bf
callq 0x31b0
movsd %xmm0, 0x1cf69(%rip)    # 0x38630
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq