// File: /workspace/github_cpp_makefile_star2_O1/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 0x12454(%rip), %rax     # 0x2a610
movq (%rax), %rax
testq %rax, %rax
je 0x18580
leaq 0x6881(%rip), %rsi      # 0x1ea50
leaq 0x685a(%rip), %rdi      # 0x1ea30
leaq 0xd053(%rip), %r8       # 0x25230
leaq 0xd06c(%rip), %r9       # 0x25250
xorpd %xmm6, %xmm6
movhpd 0x67c8(%rip), %xmm6     # xmm6 = xmm6[0],mem[0]
movapd %xmm6, 0x90(%rsp)
movq %rax, 0x20(%rsp)
movq 0x8(%rax), %r12
movsd 0x278(%r12), %xmm3
movsd 0x280(%r12), %xmm5
movsd 0x288(%r12), %xmm4
movsd 0x290(%r12), %xmm6
movapd %xmm4, %xmm0
unpcklpd %xmm4, %xmm0            # xmm0 = xmm0[0],xmm4[0]
movapd 0x5e16(%rip), %xmm1     # 0x1e050
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 0x5e01(%rip), %xmm1     # 0x1e060
divpd %xmm0, %xmm1
divpd %xmm2, %xmm1
movupd %xmm1, 0x18(%r12)
movhpd %xmm1, 0x28(%r12)
movapd %xmm4, 0x80(%rsp)
movsd 0x5ec2(%rip), %xmm0     # 0x1e148
mulsd %xmm0, %xmm4
movapd %xmm6, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, 0xb0(%rsp)
movapd %xmm4, %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 %xmm3, 0x10(%rsp)
movapd %xmm4, 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 %xmm4, %xmm0
addsd %xmm3, %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
movaps 0xd0(%rsp), %xmm5
callq *0x70(%rsp)
movq %r12, %rdx
movaps 0xc0(%rsp), %xmm4
movsd 0x10(%rsp), %xmm3
movq %rbx, %r9
movq %r14, %r8
movq %r13, %rdi
leaq 0x6677(%rip), %rsi      # 0x1ea50
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 0x1833b
movq 0x50(%rsp), %rax
incq %rax
cmpq $0x4, %rax
movsd 0x8(%rsp), %xmm5
jne 0x18311
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 0x1830b
incq %r15
cmpq $0x5, %r15
movq 0x30(%rsp), %r13
movq 0x28(%rsp), %rbp
jne 0x182ec
xorpd %xmm0, %xmm0
movapd 0x80(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm3, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %cl
movsd 0x6530(%rip), %xmm0     # 0x1e9c0
ja 0x18496
xorpd %xmm0, %xmm0
movb %cl, %al
shll $0x3, %eax
leaq 0x653e(%rip), %rcx      # 0x1e9e0
movsd (%rax,%rcx), %xmm1
leaq 0x6542(%rip), %rcx      # 0x1e9f0
movsd (%rax,%rcx), %xmm2
addq $0xf8, %r12
movl $0x1, %eax
xorl %edx, %edx
leaq 0x12418(%rip), %r10     # 0x2a8e0
movabsq $0x3ff6666666666666, %r11 # imm = 0x3FF6666666666666
movabsq $0x3ff0000000000000, %rbx # imm = 0x3FF0000000000000
xorps %xmm4, %xmm4
movaps 0x64ea(%rip), %xmm5     # 0x1e9d0
leaq 0x123d3(%rip), %r14     # 0x2a8c0
movapd 0x90(%rsp), %xmm6
leaq 0x6523(%rip), %r15      # 0x1ea20
movq %r11, (%r10)
movq %rbx, 0x18(%r10)
movups %xmm4, 0x8(%r10)
movups %xmm5, (%r14)
movupd %xmm6, 0x10(%r14)
leal -0x1(%rax), %ecx
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movapd %xmm2, %xmm3
jmp 0x18535
xorpd %xmm3, %xmm3
jmp 0x18535
movapd %xmm1, %xmm3
jmp 0x18535
movapd %xmm0, %xmm3
leaq (%rax,%rax,2), %rcx
shlq $0x4, %rcx
movsd %xmm3, -0x30(%r13,%rcx)
movsd %xmm3, -0x30(%rbp,%rcx)
xorl %ecx, %ecx
movq %rdx, -0xc0(%r12,%rcx,8)
movq %rdx, (%r12,%rcx,8)
incq %rcx
cmpq $0x5, %rcx
jne 0x1854c
incq %rax
addq $0x30, %r12
cmpq $0x5, %rax
jne 0x184fd
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x181f9
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop