// File: jamesliu516[P]amrdg2d/initial_data.cpp
// Function: initialDataGrid()
void initialDataGrid()
{
    double xc, yc, dx, dy;

    double gs4pts[4]={-0.861136311594053,-0.339981043584856,0.339981043584856,0.861136311594053};
    double wei4pts[4]={0.347854845137454, 0.652145154862546, 0.652145154862546,0.347854845137454};
    Node *current;
    current = HeadListAllGrid;  
    OctCell *lsbl=NULL;    
    double jfSum=0.0;
    while(current != NULL)
    {		
        lsbl = current->cell;
        xc=lsbl->xc1;
        yc=lsbl->yc1;  
        dx=lsbl->dx;
        dy=lsbl->dy;
        lsbl->set_invM();     
 //       if(lsbl->flag % 2== 0 ) {   
        if(1 ) {   
            for(int imm=1; imm<=4; imm++)  {
                for(int i=0; i<=nDOF-1; i++) {
                    jfSum=0.0;
                    for(int m0=0;m0<4;++m0){
                        for(int m1=0;m1<4;++m1){
                            jfSum+=wei4pts[m0]*wei4pts[m1]*
                                funcMult(fun_u0Gen_ar[imm-1],fun_ar[i],
                                    xc+0.5*dx*gs4pts[m1], yc+0.5*dy*gs4pts[m0],
                                    xc,yc,dx,dy);
                        }
                    }
                    jfSum*=0.5*dx*dy;

                    lsbl->dof0[imm-1][i]=lsbl->dof[imm-1][i]=
                        lsbl->invM[i]*jfSum;		    
                }	        
            }
            //----
            for(int imm=1; imm<=4; imm++)  {
                lsbl->dof0[imm-1][0]=lsbl->dof[imm-1][0]=u0xy(0.0, 0.0, xc,yc,dx,dy,imm);
                for(int i=1; i<=nDOF-1; i++) {
                    lsbl->dof0[imm-1][i]=lsbl->dof[imm-1][i]=0.0;		    
                }	        
            }
            //=====
        }   
        current = current->next;
    }
    //      string ifile("IN//in280.plt");
    //       read_sol_data(ifile);       

    }

// Assembly:
subq $0xa8, %rsp
movq 0xa6f2(%rip), %rax      # 0x3f920
movq %rax, 0x60(%rsp)
movq 0xa6ee(%rip), %rax      # 0x3f928
movq %rax, 0x68(%rsp)
movq 0xa6ea(%rip), %rax      # 0x3f930
movq %rax, 0x70(%rsp)
movq 0xa6e6(%rip), %rax      # 0x3f938
movq %rax, 0x78(%rsp)
movq 0xa6e2(%rip), %rax      # 0x3f940
movq %rax, 0x40(%rsp)
movq 0xa6de(%rip), %rax      # 0x3f948
movq %rax, 0x48(%rsp)
movq 0xa6da(%rip), %rax      # 0x3f950
movq %rax, 0x50(%rsp)
movq 0xa6d6(%rip), %rax      # 0x3f958
movq %rax, 0x58(%rsp)
leaq 0x1b412(%rip), %rax     # 0x506a0
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x35638
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movsd 0x278(%rax), %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0x30(%rsp), %rax
movsd 0x280(%rax), %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0x30(%rsp), %rax
movsd 0x288(%rax), %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x30(%rsp), %rax
movsd 0x290(%rax), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x30(%rsp), %rdi
callq 0x5010
movl $0x1, 0x24(%rsp)
cmpl $0x4, 0x24(%rsp)
jg 0x35523
movl $0x0, 0x20(%rsp)
cmpl $0x5, 0x20(%rsp)
jg 0x35511
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
movl $0x0, 0x1c(%rsp)
cmpl $0x4, 0x1c(%rsp)
jge 0x3547c
movl $0x0, 0x18(%rsp)
cmpl $0x4, 0x18(%rsp)
jge 0x3546a
movslq 0x1c(%rsp), %rax
movsd 0x40(%rsp,%rax,8), %xmm0
movslq 0x18(%rsp), %rax
mulsd 0x40(%rsp,%rax,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movl 0x24(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x15f1a(%rip), %rax     # 0x4b2c0
movq (%rax,%rcx,8), %rdi
movslq 0x20(%rsp), %rcx
leaq 0x15f2a(%rip), %rax     # 0x4b2e0
movq (%rax,%rcx,8), %rsi
movsd 0xa0(%rsp), %xmm1
movsd 0x9d75(%rip), %xmm0     # 0x3f140
mulsd 0x90(%rsp), %xmm0
movslq 0x18(%rsp), %rax
movsd 0x60(%rsp,%rax,8), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x98(%rsp), %xmm2
movsd 0x9d48(%rip), %xmm1     # 0x3f140
mulsd 0x88(%rsp), %xmm1
movslq 0x1c(%rsp), %rax
movsd 0x60(%rsp,%rax,8), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0xa0(%rsp), %xmm2
movsd 0x98(%rsp), %xmm3
movsd 0x90(%rsp), %xmm4
movsd 0x88(%rsp), %xmm5
callq 0x34b90
movaps %xmm0, %xmm2
movsd 0x8(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x3536e
jmp 0x3546c
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x3535b
movsd 0x9cbc(%rip), %xmm0     # 0x3f140
mulsd 0x90(%rsp), %xmm0
mulsd 0x88(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x30(%rsp), %rax
movslq 0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
mulsd 0x28(%rsp), %xmm0
movq 0x30(%rsp), %rax
addq $0x30, %rax
movl 0x24(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x30(%rsp), %rax
addq $0xf0, %rax
movl 0x24(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x3533f
jmp 0x35513
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x3532c
movl $0x1, 0x14(%rsp)
cmpl $0x4, 0x14(%rsp)
jg 0x35625
movsd 0xa0(%rsp), %xmm2
movsd 0x98(%rsp), %xmm3
movsd 0x90(%rsp), %xmm4
movsd 0x88(%rsp), %xmm5
movl 0x14(%rsp), %edi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x347b0
movq 0x30(%rsp), %rax
addq $0x30, %rax
movl 0x14(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x30(%rsp), %rax
addq $0xf0, %rax
movl 0x14(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movl $0x1, 0x10(%rsp)
cmpl $0x5, 0x10(%rsp)
jg 0x35613
movq 0x30(%rsp), %rax
addq $0x30, %rax
movl 0x14(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq 0x10(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x30(%rsp), %rax
addq $0xf0, %rax
movl 0x14(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq 0x10(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x355af
jmp 0x35615
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x3552b
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x352a8
addq $0xa8, %rsp
retq