// File: /workspace/github_cpp_makefile_star2_O3/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 $0xe8, %rsp
leaq 0x11970(%rip), %rax     # 0x29610
movq (%rax), %rax
testq %rax, %rax
je 0x18083
leaq 0x5d9d(%rip), %rsi      # 0x1da50
leaq 0x5d76(%rip), %rdi      # 0x1da30
leaq 0xc56f(%rip), %r8       # 0x24230
leaq 0xc588(%rip), %r9       # 0x24250
xorpd %xmm4, %xmm4
movhpd 0x5cc4(%rip), %xmm4     # xmm4 = xmm4[0],mem[0]
movapd %xmm4, 0x90(%rsp)
movq %rax, 0x20(%rsp)
movq 0x8(%rax), %r12
movsd 0x278(%r12), %xmm4
movsd 0x280(%r12), %xmm5
movsd 0x288(%r12), %xmm3
movsd 0x290(%r12), %xmm6
movapd %xmm3, %xmm0
unpcklpd %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0]
movapd 0x5332(%rip), %xmm1     # 0x1d050
divpd %xmm0, %xmm1
movapd %xmm6, %xmm2
unpcklpd %xmm6, %xmm2            # xmm2 = xmm2[0],xmm6[0]
divpd %xmm2, %xmm1
movupd %xmm1, (%r12)
movhpd %xmm1, 0x10(%r12)
movapd 0x531d(%rip), %xmm1     # 0x1d060
divpd %xmm0, %xmm1
divpd %xmm2, %xmm1
movupd %xmm1, 0x18(%r12)
movhpd %xmm1, 0x28(%r12)
movapd %xmm3, 0x80(%rsp)
movsd 0x53de(%rip), %xmm0     # 0x1d148
mulsd %xmm0, %xmm3
movapd %xmm6, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, 0xb0(%rsp)
movapd %xmm3, %xmm0
movapd %xmm6, 0xd0(%rsp)
mulsd %xmm6, %xmm0
movapd %xmm0, 0xa0(%rsp)
leaq 0x30(%r12), %r13
leaq 0xf0(%r12), %rbp
movl $0x1, %r15d
movq %r12, 0x38(%rsp)
movq %r13, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
movsd %xmm4, 0x10(%rsp)
movapd %xmm3, 0xc0(%rsp)
movsd %xmm5, 0x8(%rsp)
leaq -0x1(%r15), %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rax
leaq (%rax,%r13), %rdx
movq %rdx, 0x40(%rsp)
addq %rbp, %rax
movq %rax, 0x48(%rsp)
xorl %edx, %edx
xorpd %xmm0, %xmm0
xorl %eax, %eax
movsd (%rsi,%rax,8), %xmm1
movsd %xmm1, 0x58(%rsp)
movq %rax, 0x50(%rsp)
movsd (%rdi,%rax,8), %xmm1
mulsd 0xb0(%rsp), %xmm1
addsd %xmm5, %xmm1
movsd %xmm1, 0x18(%rsp)
xorl %ebp, %ebp
movsd %xmm0, (%rsp)
movsd (%rbp,%rsi), %xmm0
mulsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movq (%r9,%rdx,8), %rax
movq %rax, 0x70(%rsp)
movsd (%rbp,%rdi), %xmm0
mulsd %xmm3, %xmm0
addsd %xmm4, %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x18(%rsp), %xmm1
movq %rdi, %r13
movq %r8, %r14
movq %r9, %rbx
movq %rdx, %r12
callq *-0x8(%r8,%r15,8)
movsd %xmm0, 0x68(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm3
movaps 0x80(%rsp), %xmm4
movapd 0xd0(%rsp), %xmm5
callq *0x70(%rsp)
movq %r12, %rdx
movaps 0xc0(%rsp), %xmm3
movsd 0x10(%rsp), %xmm4
movq %rbx, %r9
movq %r14, %r8
movq %r13, %rdi
leaq 0x5b92(%rip), %rsi      # 0x1da50
mulsd 0x68(%rsp), %xmm0
mulsd 0x78(%rsp), %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
addq $0x8, %rbp
cmpq $0x20, %rbp
jne 0x17e1f
movq 0x50(%rsp), %rax
incq %rax
cmpq $0x4, %rax
movsd 0x8(%rsp), %xmm5
jne 0x17df5
mulsd 0xa0(%rsp), %xmm0
movq 0x38(%rsp), %r12
mulsd (%r12,%rdx,8), %xmm0
movq 0x40(%rsp), %rax
movsd %xmm0, (%rax,%rdx,8)
movq 0x48(%rsp), %rax
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
cmpq $0x6, %rdx
jne 0x17def
incq %r15
cmpq $0x5, %r15
movq 0x30(%rsp), %r13
movq 0x28(%rsp), %rbp
jne 0x17dd0
xorpd %xmm1, %xmm1
movapd 0x80(%rsp), %xmm10
mulsd %xmm1, %xmm10
addsd %xmm4, %xmm10
addq $0xf8, %r12
movl $0x1, %eax
xorl %edx, %edx
leaq 0x11964(%rip), %r10     # 0x298e0
movabsq $0x3ff6666666666666, %r11 # imm = 0x3FF6666666666666
movabsq $0x3ff0000000000000, %rbx # imm = 0x3FF0000000000000
xorps %xmm2, %xmm2
movaps 0x5a36(%rip), %xmm3     # 0x1d9d0
leaq 0x1191f(%rip), %r14     # 0x298c0
movapd 0x90(%rsp), %xmm4
leaq 0x5a6f(%rip), %r15      # 0x1da20
movsd 0x59ff(%rip), %xmm5     # 0x1d9b8
movsd 0x51ef(%rip), %xmm6     # 0x1d1b0
movsd 0x59e7(%rip), %xmm7     # 0x1d9b0
movsd 0x59ce(%rip), %xmm8     # 0x1d9a0
movsd 0x59cd(%rip), %xmm9     # 0x1d9a8
movq %r11, (%r10)
movq %rbx, 0x18(%r10)
movups %xmm2, 0x8(%r10)
movups %xmm3, (%r14)
movupd %xmm4, 0x10(%r14)
xorpd %xmm0, %xmm0
leal -0x1(%rax), %ecx
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
ucomisd %xmm10, %xmm1
movapd %xmm5, %xmm0
ja 0x18034
movapd %xmm6, %xmm0
jmp 0x18034
ucomisd %xmm10, %xmm1
movapd %xmm7, %xmm0
ja 0x18034
xorpd %xmm0, %xmm0
jmp 0x18034
ucomisd %xmm10, %xmm1
movapd %xmm8, %xmm0
ja 0x18034
movapd %xmm9, %xmm0
leaq (%rax,%rax,2), %rcx
shlq $0x4, %rcx
movsd %xmm0, -0x30(%r13,%rcx)
movsd %xmm0, -0x30(%rbp,%rcx)
xorl %ecx, %ecx
movq %rdx, -0xc0(%r12,%rcx,8)
movq %rdx, (%r12,%rcx,8)
incq %rcx
cmpq $0x5, %rcx
jne 0x1804b
incq %rax
addq $0x30, %r12
cmpq $0x5, %rax
jne 0x17fdb
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x17cdd
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)