// File: /workspace/github_cpp_makefile_star2_O3/jamesliu516[P]amrdg2d/wall4amrdg2013.cpp
// Function: bilinearIntplt(std::vector<bodygridclass*, std::allocator<bodygridclass*>>&, pointxy const*, privariables&)
void bilinearIntplt(vector< OctCell * > &grid, const PXYZ *px, JBBL &ingrid1)
{
    double amatrix[20];
    double ujie[4];
    SHBL shu;
    PXYZ pxdc; //px����Ӧ�ĶԳƵ�����
    int i;

    for( i=0; i<4; i++)
    {
        amatrix[i * 5 + 0] =1.0;
        amatrix[i * 5 + 1] = grid[i]->xc1;
        amatrix[i * 5 + 2] = grid[i]->yc1;
        amatrix[i * 5 + 3] = grid[i]->xc1 * grid[i]->yc1;
    }

    for(i=0; i<4; i++)
    {
        amatrix[i * 5 + 4] = grid[i]->dof[0][0];
    }

    gem(amatrix, 4, ujie);

    shu.q = ujie[0] + ujie[1] * px->x + ujie[2] * px->y + ujie[3] * px->x * px->y;

    for( i=0; i<4; i++)
    {
        amatrix[i * 5 + 0] =1.0;
        amatrix[i * 5 + 1] = grid[i]->xc1;
        amatrix[i * 5 + 2] = grid[i]->yc1;
        amatrix[i * 5 + 3] = grid[i]->xc1 * grid[i]->yc1;
    }

    for(i=0; i<4; i++)
    {
        amatrix[i * 5 + 4] = grid[i]->dof[1][0];
    }

    gem(amatrix, 4, ujie);

    shu.qu = ujie[0] + ujie[1] * px->x + ujie[2] * px->y + ujie[3] * px->x * px->y;

    for( i=0; i<4; i++)
    {
        amatrix[i * 5 + 0] =1.0;
        amatrix[i * 5 + 1] = grid[i]->xc1;
        amatrix[i * 5 + 2] = grid[i]->yc1;
        amatrix[i * 5 + 3] = grid[i]->xc1 * grid[i]->yc1;
    }

    for(i=0; i<4; i++)
    {
        amatrix[i * 5 + 4] = grid[i]->dof[2][0];
    }

    gem(amatrix, 4, ujie);

    shu.qv = ujie[0] + ujie[1] * px->x + ujie[2] * px->y + ujie[3] * px->x * px->y;

    for( i=0; i<4; i++)
    {
        amatrix[i * 5 + 0] =1.0;
        amatrix[i * 5 + 1] = grid[i]->xc1;
        amatrix[i * 5 + 2] = grid[i]->yc1;
        amatrix[i * 5 + 3] = grid[i]->xc1 * grid[i]->yc1;
    }

    for(i=0; i<4; i++)
    {
        amatrix[i * 5 + 4] = grid[i]->dof[3][0];
    }

    gem(amatrix, 4, ujie);

    shu.te = ujie[0] + ujie[1] * px->x + ujie[2] * px->y + ujie[3] * px->x * px->y;

    shblToJbbl(&shu, &ingrid1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
xorl %ecx, %ecx
movabsq $0x3ff0000000000000, %r13 # imm = 0x3FF0000000000000
movq %rax, %rdx
movq %r13, 0xe0(%rsp,%rcx,8)
movq (%rdx), %rsi
movupd 0x278(%rsi), %xmm0
movupd %xmm0, 0xe8(%rsp,%rcx,8)
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
mulsd %xmm0, %xmm1
movsd %xmm1, 0xf8(%rsp,%rcx,8)
addq $0x5, %rcx
addq $0x8, %rdx
cmpq $0x14, %rcx
jne 0x13313
movl $0x4, %ecx
movq (%rax), %rdx
movsd 0x30(%rdx), %xmm0
movsd %xmm0, 0xe0(%rsp,%rcx,8)
addq $0x5, %rcx
addq $0x8, %rax
cmpq $0x18, %rcx
jne 0x13357
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %r12
movl $0x4, %esi
movq %r12, %rdx
callq 0x12f94
movsd (%r12), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x8(%r12), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x8(%r14), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x10(%r12), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x18(%r12), %xmm0
movapd %xmm0, 0x20(%rsp)
movq (%r15), %rax
xorl %ecx, %ecx
movq %rax, %rdx
movq %r13, 0xe0(%rsp,%rcx,8)
movq (%rdx), %rsi
movupd 0x278(%rsi), %xmm0
movupd %xmm0, 0xe8(%rsp,%rcx,8)
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
mulsd %xmm0, %xmm1
movsd %xmm1, 0xf8(%rsp,%rcx,8)
addq $0x5, %rcx
addq $0x8, %rdx
cmpq $0x14, %rcx
jne 0x133e5
movl $0x4, %ecx
movq (%rax), %rdx
movsd 0x60(%rdx), %xmm0
movsd %xmm0, 0xe0(%rsp,%rcx,8)
addq $0x5, %rcx
addq $0x8, %rax
cmpq $0x18, %rcx
jne 0x13429
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %r12
movl $0x4, %esi
movq %r12, %rdx
callq 0x12f94
movaps (%r12), %xmm0
movaps %xmm0, 0x90(%rsp)
movups 0x8(%r12), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd (%r14), %xmm0
movaps %xmm0, 0x80(%rsp)
movsd 0x8(%r14), %xmm0
movaps %xmm0, 0xb0(%rsp)
movaps 0x10(%r12), %xmm0
movaps %xmm0, 0xa0(%rsp)
movsd 0x18(%r12), %xmm0
movapd %xmm0, (%rsp)
movq (%r15), %rax
xorl %ecx, %ecx
movq %rax, %rdx
movq %r13, 0xe0(%rsp,%rcx,8)
movq (%rdx), %rsi
movupd 0x278(%rsi), %xmm0
movupd %xmm0, 0xe8(%rsp,%rcx,8)
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
mulsd %xmm0, %xmm1
movsd %xmm1, 0xf8(%rsp,%rcx,8)
addq $0x5, %rcx
addq $0x8, %rdx
cmpq $0x14, %rcx
jne 0x134ba
movl $0x4, %ecx
movq (%rax), %rdx
movsd 0x90(%rdx), %xmm0
movsd %xmm0, 0xe0(%rsp,%rcx,8)
addq $0x5, %rcx
addq $0x8, %rax
cmpq $0x18, %rcx
jne 0x134fe
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %r12
movl $0x4, %esi
movq %r12, %rdx
callq 0x12f94
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
movsd (%r14), %xmm2
movsd 0x8(%r14), %xmm3
movaps %xmm3, 0x70(%rsp)
movsd 0x10(%r12), %xmm3
movaps %xmm3, 0x60(%rsp)
movsd 0x18(%r12), %xmm3
movq (%r15), %rax
xorl %ecx, %ecx
movq %rax, %rdx
movq %r13, 0xe0(%rsp,%rcx,8)
movq (%rdx), %rsi
movupd 0x278(%rsi), %xmm4
movupd %xmm4, 0xe8(%rsp,%rcx,8)
movapd %xmm4, %xmm5
unpckhpd %xmm4, %xmm5            # xmm5 = xmm5[1],xmm4[1]
mulsd %xmm4, %xmm5
movsd %xmm5, 0xf8(%rsp,%rcx,8)
addq $0x5, %rcx
addq $0x8, %rdx
cmpq $0x14, %rcx
jne 0x13575
movl $0x4, %ecx
movq (%rax), %rdx
movsd 0xc0(%rdx), %xmm4
movsd %xmm4, 0xe0(%rsp,%rcx,8)
addq $0x5, %rcx
addq $0x8, %rax
cmpq $0x18, %rcx
jne 0x135b9
movapd 0x80(%rsp), %xmm4
unpcklpd %xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0]
movapd (%rsp), %xmm2
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
mulpd %xmm4, %xmm2
movapd %xmm2, (%rsp)
movapd 0x10(%rsp), %xmm2
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
movapd 0x90(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd %xmm4, %xmm2
addpd %xmm1, %xmm2
movapd %xmm2, 0x10(%rsp)
movapd 0x20(%rsp), %xmm3
movsd 0x38(%rsp), %xmm0
mulsd %xmm0, %xmm3
movsd 0x48(%rsp), %xmm2
mulsd %xmm0, %xmm2
addsd 0x40(%rsp), %xmm2
movsd 0x58(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm3
addsd %xmm0, %xmm3
movapd %xmm3, 0x20(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %r15
movl $0x4, %esi
movq %r15, %rdx
callq 0x12f94
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
movsd 0x8(%r15), %xmm2
mulsd %xmm0, %xmm2
addsd (%r15), %xmm2
movsd 0x10(%r15), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
mulsd 0x18(%r15), %xmm0
mulsd %xmm1, %xmm0
addsd %xmm3, %xmm0
movapd 0x20(%rsp), %xmm3
movsd %xmm3, (%rbx)
movapd 0xa0(%rsp), %xmm1
unpcklpd 0x60(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
movapd 0xb0(%rsp), %xmm2
unpcklpd 0x70(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
mulpd %xmm2, %xmm1
addpd 0x10(%rsp), %xmm1
mulpd (%rsp), %xmm2
addpd %xmm1, %xmm2
movapd %xmm3, %xmm1
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
divpd %xmm1, %xmm2
movupd %xmm2, 0x8(%rbx)
movapd %xmm2, %xmm1
mulpd %xmm2, %xmm1
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
mulsd %xmm2, %xmm2
addsd %xmm1, %xmm2
movapd %xmm3, %xmm1
mulsd 0x9a20(%rip), %xmm1     # 0x1d140
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
mulsd 0x9a78(%rip), %xmm1     # 0x1d1a8
movsd %xmm1, 0x18(%rbx)
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq