// File: jamesliu516[P]amrdg2d/face_vec.cpp
// Function: face_vec1()
void face_vec1()//�Ƚ���
{
    vector<Facetmp> facestmp;

    Facetmp ftmp0;

    OctCell *pcell0;
    OctCell *pcell1;   
    Face fff0;

    Node *current;
    current = HeadListAllGrid;   
    faces.clear();
    //   int cnt=0;
    while(current != NULL) {
        //-------
        if(current->flg<=2) {
            pcell0=ftmp0.parent=current->cell;

            //south neighbor
            pcell1=SouthNeighbor(pcell0);           
            if(pcell1->reflag==0) {
                ftmp0.neighbor=pcell1;                 
                if(find(facestmp.begin(), facestmp.end(), ftmp0 ) == facestmp.end() ) {
                    facestmp.push_back(ftmp0);
                    fff0.parent=pcell0;
                    fff0.neighbor=pcell1;
                    fff0.nml[0]=0.0;
                    fff0.nml[1]=-1.0;
                    faces.push_back(fff0);
                    //         cnt++;
                }
            }

            //east neighbor
            pcell1=EastNeighbor(pcell0);           
            if(pcell1->reflag==0) {
                ftmp0.neighbor=pcell1;                 
                if(find(facestmp.begin(), facestmp.end(), ftmp0 ) == facestmp.end() ) {
                    facestmp.push_back(ftmp0);
                    fff0.parent=pcell0;
                    fff0.neighbor=pcell1;
                    fff0.nml[0]=1.0;
                    fff0.nml[1]=0.0;
                    faces.push_back(fff0);
                    //       cnt++;                    
                }
            }            

            //north neighbor
            pcell1=NorthNeighbor(pcell0);           
            if(pcell1->reflag==0) {
                ftmp0.neighbor=pcell1;                 
                if(find(facestmp.begin(), facestmp.end(), ftmp0 ) == facestmp.end() ) {
                    facestmp.push_back(ftmp0);
                    fff0.parent=pcell0;
                    fff0.neighbor=pcell1;
                    fff0.nml[0]=0.0;
                    fff0.nml[1]=1.0;
                    faces.push_back(fff0);
                    //        cnt++;                     
                }
            }                  

            //west neighbor
            pcell1=WestNeighbor(pcell0);           
            if(pcell1->reflag==0) {
                ftmp0.neighbor=pcell1;                 
                if(find(facestmp.begin(), facestmp.end(), ftmp0 ) == facestmp.end() ) {
                    facestmp.push_back(ftmp0);
                    fff0.parent=pcell0;
                    fff0.neighbor=pcell1;
                    fff0.nml[0]=-1.0;
                    fff0.nml[1]=0.0;
                    faces.push_back(fff0);
                    //      cnt++;                     
                }
            }                
        }
        //========
        //   cout<<cnt<<endl;
        current = current->next;
    }   
    cout<<facestmp.size()<<endl;
    facestmp.clear();
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
leaq 0x1e0(%rsp), %rdi
callq 0x13360
leaq 0x1d0(%rsp), %rdi
callq 0x13370
jmp 0x12b53
leaq 0xf0(%rsp), %rdi
callq 0x5490
jmp 0x12b62
leaq 0x3db37(%rip), %rax     # 0x506a0
movq (%rax), %rax
movq %rax, 0xe8(%rsp)
leaq 0x3db7d(%rip), %rdi     # 0x506f8
callq 0x13170
cmpq $0x0, 0xe8(%rsp)
je 0x13105
movq 0xe8(%rsp), %rax
movswl (%rax), %eax
cmpl $0x2, %eax
jg 0x130ec
movq 0xe8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x1d0(%rsp)
movq %rax, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rdi
callq 0x11a00
movq %rax, 0x60(%rsp)
jmp 0x12bd3
movq 0x60(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rax
movswl 0x1fc(%rax), %eax
cmpl $0x0, %eax
jne 0x12d2d
movq 0x1b0(%rsp), %rax
movq %rax, 0x1d8(%rsp)
leaq 0x1e0(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x13430
movq 0x50(%rsp), %rdi
movq %rax, 0xd8(%rsp)
callq 0x13460
movq %rax, 0xd0(%rsp)
movq 0xd8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
callq 0x133d0
movq %rax, 0x58(%rsp)
jmp 0x12c58
movq 0x58(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x13460
movq %rax, 0xc8(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x13390
testb $0x1, %al
jne 0x12c98
jmp 0x12d2b
leaq 0x1e0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x13490
jmp 0x12caf
movq 0x1b8(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq $0x0, 0x100(%rsp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x108(%rsp)
leaq 0x3da04(%rip), %rdi     # 0x506f8
leaq 0xf0(%rsp), %rsi
callq 0x13290
jmp 0x12d03
jmp 0x12d2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x13540
jmp 0x1315b
jmp 0x12d2d
movq 0x1b8(%rsp), %rdi
callq 0x118d0
movq %rax, 0x48(%rsp)
jmp 0x12d41
movq 0x48(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rax
movswl 0x1fc(%rax), %eax
cmpl $0x0, %eax
jne 0x12e72
movq 0x1b0(%rsp), %rax
movq %rax, 0x1d8(%rsp)
leaq 0x1e0(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x13430
movq 0x38(%rsp), %rdi
movq %rax, 0xb8(%rsp)
callq 0x13460
movq %rax, 0xb0(%rsp)
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
callq 0x133d0
movq %rax, 0x40(%rsp)
jmp 0x12dc6
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x13460
movq %rax, 0xa8(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x13390
testb $0x1, %al
jne 0x12e03
jmp 0x12e70
leaq 0x1e0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x13490
jmp 0x12e1a
movq 0x1b8(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0xf8(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x100(%rsp)
movq $0x0, 0x108(%rsp)
leaq 0x3d899(%rip), %rdi     # 0x506f8
leaq 0xf0(%rsp), %rsi
callq 0x13290
jmp 0x12e6e
jmp 0x12e70
jmp 0x12e72
movq 0x1b8(%rsp), %rdi
callq 0x11670
movq %rax, 0x30(%rsp)
jmp 0x12e86
movq 0x30(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rax
movswl 0x1fc(%rax), %eax
cmpl $0x0, %eax
jne 0x12fb7
movq 0x1b0(%rsp), %rax
movq %rax, 0x1d8(%rsp)
leaq 0x1e0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x13430
movq 0x20(%rsp), %rdi
movq %rax, 0x98(%rsp)
callq 0x13460
movq %rax, 0x90(%rsp)
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
callq 0x133d0
movq %rax, 0x28(%rsp)
jmp 0x12f0b
movq 0x28(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x13460
movq %rax, 0x88(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x13390
testb $0x1, %al
jne 0x12f48
jmp 0x12fb5
leaq 0x1e0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x13490
jmp 0x12f5f
movq 0x1b8(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq $0x0, 0x100(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x108(%rsp)
leaq 0x3d754(%rip), %rdi     # 0x506f8
leaq 0xf0(%rsp), %rsi
callq 0x13290
jmp 0x12fb3
jmp 0x12fb5
jmp 0x12fb7
movq 0x1b8(%rsp), %rdi
callq 0x117a0
movq %rax, 0x18(%rsp)
jmp 0x12fcb
movq 0x18(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rax
movswl 0x1fc(%rax), %eax
cmpl $0x0, %eax
jne 0x130ea
movq 0x1b0(%rsp), %rax
movq %rax, 0x1d8(%rsp)
leaq 0x1e0(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x13430
movq 0x8(%rsp), %rdi
movq %rax, 0x78(%rsp)
callq 0x13460
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
callq 0x133d0
movq %rax, 0x10(%rsp)
jmp 0x13044
movq 0x10(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x13460
movq %rax, 0x68(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x13390
testb $0x1, %al
jne 0x1307b
jmp 0x130e8
leaq 0x1e0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x13490
jmp 0x13092
movq 0x1b8(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0xf8(%rsp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x100(%rsp)
movq $0x0, 0x108(%rsp)
leaq 0x3d621(%rip), %rdi     # 0x506f8
leaq 0xf0(%rsp), %rsi
callq 0x13290
jmp 0x130e6
jmp 0x130e8
jmp 0x130ea
jmp 0x130ec
movq 0xe8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0xe8(%rsp)
jmp 0x12b80
leaq 0x1e0(%rsp), %rdi
callq 0x13500
movq %rax, %rsi
movq 0x37eb4(%rip), %rdi     # 0x4afd0
callq 0x30a0
movq %rax, (%rsp)
jmp 0x13127
movq (%rsp), %rdi
movq 0x37e86(%rip), %rsi     # 0x4afb8
callq 0x3290
jmp 0x13139
leaq 0x1e0(%rsp), %rdi
callq 0x13520
leaq 0x1e0(%rsp), %rdi
callq 0x13540
addq $0x1f8, %rsp            # imm = 0x1F8
retq
movq 0x1c8(%rsp), %rdi
callq 0x3440
nopl (%rax,%rax)