// File: jamesliu516[P]amrdg2d/multi_value_cell.cpp
// Function: find_multivalue_cell(pointxy const&)
void find_multivalue_cell(const PXYZ &sharppoint)
{
    double hcx, hcy;
    OctCell *cellflow=NULL;
    OctCell *in_this_cell=NULL;
    OctCell *ppvec[9]={NULL};
   // PXYZ point;
   // point=wallpoint[n_sharp_point];
    mvalue_set.clear();
    for(int i=1;i<=Nx*Ny;++i){
        cellflow=bodygrid+i;
        hcx=cellflow->dx;
        hcy=cellflow->dy;

        if(sharppoint.x < cellflow->xc1 + 0.5 * hcx + ERRS
            && sharppoint.x > cellflow->xc1 - 0.5 * hcx - ERRS
            && sharppoint.y < cellflow->yc1 + 0.5 * hcy + ERRS
            && sharppoint.y > cellflow->yc1 - 0.5 * hcy - ERRS){
            in_this_cell=cellflow;
            break;
        }
    }

    find_sol_refp(ppvec,in_this_cell);
    ppvec[8]=in_this_cell;
    for(int i=0; i<9;++i)
        insert_cell2(ppvec[i],mvalue_set);

    for(set<OctCell*>::iterator it_set=mvalue_set.begin();
        it_set!=mvalue_set.end();++it_set) {
        (*it_set)->mvflg=true;
    }
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, 0x70(%rsp)
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x3150
leaq 0x13147(%rip), %rdi     # 0x507b0
callq 0xb670
movl $0x1, 0x1c(%rsp)
cmpl $0x1f3b, 0x1c(%rsp)     # imm = 0x1F3B
jg 0x3d806
leaq 0xdce5(%rip), %rax      # 0x4b370
movq (%rax), %rax
movslq 0x1c(%rsp), %rcx
imulq $0x360, %rcx, %rcx      # imm = 0x360
addq %rcx, %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movsd 0x288(%rax), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x78(%rsp), %rax
movsd 0x290(%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x90(%rsp), %rax
movsd (%rax), %xmm1
movq 0x78(%rsp), %rax
movsd 0x278(%rax), %xmm2
movsd 0x88(%rsp), %xmm0
movsd 0x1a48(%rip), %xmm3     # 0x3f140
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
movsd 0x1a40(%rip), %xmm2     # 0x3f148
addsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3d7f4
movq 0x90(%rsp), %rax
movsd (%rax), %xmm0
movq 0x78(%rsp), %rax
movsd 0x278(%rax), %xmm2
movsd 0x88(%rsp), %xmm1
movsd 0x19f8(%rip), %xmm3     # 0x3f138
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x19f8(%rip), %xmm2     # 0x3f148
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x3d7f4
movq 0x90(%rsp), %rax
movsd 0x8(%rax), %xmm1
movq 0x78(%rsp), %rax
movsd 0x280(%rax), %xmm2
movsd 0x80(%rsp), %xmm0
movsd 0x19b7(%rip), %xmm3     # 0x3f140
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
movsd 0x19af(%rip), %xmm2     # 0x3f148
addsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3d7f4
movq 0x90(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x78(%rsp), %rax
movsd 0x280(%rax), %xmm2
movsd 0x80(%rsp), %xmm1
movsd 0x196a(%rip), %xmm3     # 0x3f138
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x196a(%rip), %xmm2     # 0x3f148
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x3d7f4
movq 0x78(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x3d806
jmp 0x3d7f6
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x3d676
leaq 0x20(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x3b130
movq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movl $0x0, 0x18(%rsp)
cmpl $0x9, 0x18(%rsp)
jge 0x3d851
movslq 0x18(%rsp), %rax
movq 0x20(%rsp,%rax,8), %rdi
leaq 0x12f71(%rip), %rsi     # 0x507b0
callq 0x3d590
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x3d827
leaq 0x12f58(%rip), %rdi     # 0x507b0
callq 0xb6f0
movq %rax, 0x10(%rsp)
leaq 0x12f47(%rip), %rdi     # 0x507b0
callq 0xb740
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xb720
testb $0x1, %al
jne 0x3d888
jmp 0x3d8a8
leaq 0x10(%rsp), %rdi
callq 0xb770
movq (%rax), %rax
movb $0x1, 0x1b4(%rax)
leaq 0x10(%rsp), %rdi
callq 0xb850
jmp 0x3d862
addq $0x98, %rsp
retq