// File: /workspace/github_cpp_makefile_star2_O2/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 0xfa3c(%rip), %rax      # 0x28610
movq (%rax), %r14
leaq 0x18(%rsp), %rbx
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movq %rbx, %rdi
callq 0xc11c
andq $0x0, 0x1da2c(%rip)     # 0x36620
andq $0x0, 0x1da2c(%rip)     # 0x36628
andq $0x0, 0x1da2c(%rip)     # 0x36630
andl $0x0, 0x1da2d(%rip)     # 0x36638
leaq 0xfc4e(%rip), %r15      # 0x28860
leaq 0xfc57(%rip), %r12      # 0x28870
leaq 0xfc60(%rip), %r13      # 0x28880
testq %r14, %r14
je 0x18d7c
movq 0x8(%r14), %rbp
cmpw $0x0, 0x1b0(%rbp)
jne 0x18d73
cmpw $0x0, (%r14)
jne 0x18d73
movsd 0x278(%rbp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc3aa
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x280(%rbp), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xc3aa
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
leaq 0xfbbf(%rip), %rsi      # 0x28850
callq 0xc344
callq 0xc13d
movsd %xmm0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc344
callq 0xc13d
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc344
callq 0xc13d
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xc344
callq 0xc13d
movsd 0x2fac(%rip), %xmm1     # 0x1bc90
movsd (%rsp), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x18d73
movsd 0x10(%rsp), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x18d73
movsd 0x8(%rsp), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x18d73
ucomisd %xmm1, %xmm0
jbe 0x18d73
movq %rbp, %rdi
callq 0x18b02
movsd 0x238(%rbp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x1d8f3(%rip), %xmm0    # 0x36620
movsd %xmm0, 0x1d8eb(%rip)    # 0x36620
movsd 0x240(%rbp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x1d8df(%rip), %xmm0    # 0x36628
movsd %xmm0, 0x1d8d7(%rip)    # 0x36628
movsd 0x248(%rbp), %xmm0
mulsd %xmm0, %xmm0
addsd 0x1d8cb(%rip), %xmm0    # 0x36630
movsd %xmm0, 0x1d8c3(%rip)    # 0x36630
incl 0x1d8c5(%rip)           # 0x36638
movq 0x10(%r14), %r14
jmp 0x18c20
movsd 0x1d89c(%rip), %xmm0    # 0x36620
cvtsi2sdl 0x1d8ac(%rip), %xmm1 # 0x36638
divsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jb 0x18da0
sqrtsd %xmm0, %xmm0
jmp 0x18da9
callq 0x3180
xorpd %xmm2, %xmm2
movsd %xmm0, 0x1d86f(%rip)    # 0x36620
cvtsi2sdl 0x1d87f(%rip), %xmm1 # 0x36638
movsd 0x1d867(%rip), %xmm0    # 0x36628
divsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0x18dd1
sqrtsd %xmm0, %xmm0
jmp 0x18dd6
callq 0x3180
movsd %xmm0, 0x1d84a(%rip)    # 0x36628
movsd 0x1d84a(%rip), %xmm0    # 0x36630
cvtsi2sdl 0x1d84a(%rip), %xmm1 # 0x36638
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x18e02
sqrtsd %xmm0, %xmm0
jmp 0x18e07
callq 0x3180
movsd %xmm0, 0x1d821(%rip)    # 0x36630
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq