// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
leaq 0x1254a(%rip), %rax     # 0x28610
leaq 0x5953(%rip), %r13      # 0x1ba20
leaq 0x592c(%rip), %rbp      # 0x1ba00
movq (%rax), %rax
testq %rax, %rax
je 0x16377
movq %rax, 0x50(%rsp)
movq 0x8(%rax), %rbx
movsd 0x278(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x280(%rbx), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x288(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x290(%rbx), %xmm0
movsd %xmm0, 0x38(%rsp)
movq %rbx, %rdi
callq 0x43ce
movsd 0x8(%rsp), %xmm1
movsd 0x5041(%rip), %xmm0     # 0x1b178
mulsd %xmm0, %xmm1
movsd 0x38(%rsp), %xmm3
movapd %xmm3, %xmm2
mulsd %xmm0, %xmm2
movsd %xmm2, 0x70(%rsp)
movsd %xmm1, 0x80(%rsp)
mulsd %xmm3, %xmm1
movsd %xmm1, 0x58(%rsp)
leaq 0x30(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0xf0(%rbx), %rax
movq %rax, 0x20(%rsp)
pushq $0x1
popq %r14
movq %rbx, 0x30(%rsp)
cmpq $0x5, %r14
je 0x16302
leaq -0x1(%r14), %rax
imulq $0x30, %rax, %rcx
movq 0x28(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x60(%rsp)
addq 0x20(%rsp), %rcx
movq %rcx, 0x68(%rsp)
xorl %ebx, %ebx
cmpq $0x6, %rbx
je 0x162f5
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
xorl %eax, %eax
cmpq $0x4, %rax
je 0x162c3
movsd (%r13,%rax,8), %xmm0
movsd %xmm0, 0x88(%rsp)
movq %rax, 0x78(%rsp)
movsd (%rbp,%rax,8), %xmm0
mulsd 0x70(%rsp), %xmm0
addsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
xorl %r12d, %r12d
cmpq $0x20, %r12
je 0x162b6
movsd (%r12,%r13), %xmm0
mulsd 0x88(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
leaq 0xd02c(%rip), %rax      # 0x23250
movq (%rax,%rbx,8), %r15
movsd (%r12,%rbp), %xmm0
mulsd 0x80(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0x48(%rsp), %xmm1
leaq 0xcfdd(%rip), %rax      # 0x23230
callq *-0x8(%rax,%r14,8)
movsd %xmm0, 0x98(%rsp)
movsd 0x90(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x40(%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
movsd 0x38(%rsp), %xmm5
callq *%r15
mulsd 0x98(%rsp), %xmm0
mulsd 0xa0(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
addq $0x8, %r12
jmp 0x161fb
movq 0x78(%rsp), %rax
incq %rax
jmp 0x161c1
movsd 0x18(%rsp), %xmm0
mulsd 0x58(%rsp), %xmm0
movq 0x30(%rsp), %rax
mulsd (%rax,%rbx,8), %xmm0
movq 0x60(%rsp), %rax
movsd %xmm0, (%rax,%rbx,8)
movq 0x68(%rsp), %rax
movsd %xmm0, (%rax,%rbx,8)
incq %rbx
jmp 0x161ab
incq %r14
movq 0x30(%rsp), %rbx
jmp 0x16180
addq $0xf8, %rbx
pushq $0x1
popq %r14
cmpq $0x5, %r14
je 0x16369
xorpd %xmm0, %xmm0
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm4
movl %r14d, %edi
callq 0x15d0a
imulq $0x30, %r14, %rax
movq 0x28(%rsp), %rcx
movsd %xmm0, -0x30(%rcx,%rax)
movq 0x20(%rsp), %rcx
movsd %xmm0, -0x30(%rcx,%rax)
xorl %eax, %eax
cmpq $0x5, %rax
je 0x16360
andq $0x0, -0xc0(%rbx,%rax,8)
andq $0x0, (%rbx,%rax,8)
incq %rax
jmp 0x16347
incq %r14
addq $0x30, %rbx
jmp 0x1630d
movq 0x50(%rsp), %rax
addq $0x10, %rax
jmp 0x160d4
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)