// File: /workspace/github_c_makefile_star2_O2/ZmengXu[P]boxMesh/boxMesh.C
// Function: writeNeighbour(int, int, int, int, int, int, int)
void writeNeighbour(int nPoints, int nCells, int nFaces, int nExternalFaces, int Nx, int Ny, int Nz)
{
    ofstream currentFile("constant/polyMesh/neighbour");

    currentFile << "/*--------------------------------*- C++ -*----------------------------------*\\\n";
    currentFile << "| =========                 |                                                 |\n";
    currentFile << "| \\\\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |\n";
    currentFile << "|  \\\\    /   O peration     | Version:  2.3.0                                 |\n";
    currentFile << "|   \\\\  /    A nd           | Web:      www.OpenFOAM.org                      |\n";
    currentFile << "|    \\\\/     M anipulation  |                                                 |\n";
    currentFile << "\\*---------------------------------------------------------------------------*/\n";
    currentFile << "FoamFile\n";
    currentFile << "{\n";
    currentFile << "    version     2.0;\n";
    currentFile << "    format      ascii;\n";
    currentFile << "    class       labelList;\n";

    ostringstream convert;
    convert << "    note        \"nPoints: " << nPoints << " nCells: " << nCells << " nFaces: " << nFaces << " nInternalFaces: " << nFaces-nExternalFaces << "\";\n";
    currentFile << convert.str();

    currentFile << "    location    \"constant/polyMesh\";\n";
    currentFile << "    object      neighbour;\n";
    currentFile << "}\n";
    currentFile << "// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n";
    currentFile << "\n";
    currentFile << "\n";

    convert.clear();
    convert.str("");
    convert << nFaces-nExternalFaces << "\n(\n";

    vector<int> neighbours;
    int size;

    int countFaces = 0;
    for (int i=0; i<nCells; i++)
    {
        neighbours = neighboursOfInternalFacesOfCell(i, Nx, Ny, Nz);

        size = neighbours.size();
        for (int j=0; j<size; j++)
        {
            convert << neighbours[j] << "\n";
            countFaces++;
        }
        if (countFaces>CLEAR_OSTRINGSTREAM)
        {
            countFaces = 0;
            currentFile << convert.str();
            convert.clear();
            convert.str("");
        }
    }

    currentFile << convert.str();

    currentFile << ")\n";
    currentFile << "\n";
    currentFile << "\n";
    currentFile << "// ************************************************************************* //\n";
    currentFile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3d8, %rsp            # imm = 0x3D8
movl %r9d, -0x58(%rbp)
movl %r8d, -0x54(%rbp)
movl %ecx, -0x2c(%rbp)
movl %edx, %r15d
movl %esi, %r14d
movl %edi, %r13d
leaq 0x30de(%rip), %rsi      # 0x6481
leaq -0x280(%rbp), %rbx
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0x2170
leaq 0x2c63(%rip), %rsi      # 0x601f
movq %rbx, %rdi
callq 0x2140
leaq 0x2ca5(%rip), %rsi      # 0x6070
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2ce3(%rip), %rsi      # 0x60c1
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2d21(%rip), %rsi      # 0x6112
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2d5f(%rip), %rsi      # 0x6163
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2d9d(%rip), %rsi      # 0x61b4
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2ddb(%rip), %rsi      # 0x6205
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2e19(%rip), %rsi      # 0x6256
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2f0c(%rip), %rsi      # 0x635c
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2dfd(%rip), %rsi      # 0x6260
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2e00(%rip), %rsi      # 0x6276
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x3014(%rip), %rsi      # 0x649d
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq -0x3f8(%rbp), %rdi
callq 0x2190
leaq 0x3011(%rip), %rsi      # 0x64b9
leaq -0x3f8(%rbp), %r12
movq %r12, %rdi
callq 0x2140
movq %rax, %rdi
movl %r13d, %esi
callq 0x2280
leaq 0x300b(%rip), %rsi      # 0x64d4
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movl %r14d, %esi
callq 0x2280
leaq 0x2ffb(%rip), %rsi      # 0x64de
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movl %r15d, %esi
callq 0x2280
leaq 0x2feb(%rip), %rsi      # 0x64e8
movq %rax, %rdi
callq 0x2140
subl -0x2c(%rbp), %r15d
movq %rax, %rdi
movl %r15d, %esi
callq 0x2280
leaq 0x2db8(%rip), %rsi      # 0x62d3
movq %rax, %rdi
callq 0x2140
leaq -0x3f0(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x2220
leaq -0x280(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq 0x2d5e(%rip), %rsi      # 0x62b1
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2f94(%rip), %rsi      # 0x64fa
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2e5f(%rip), %rsi      # 0x63d8
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2d66(%rip), %rsi      # 0x62f2
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2edd(%rip), %rsi      # 0x647c
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2eca(%rip), %rsi      # 0x647c
leaq -0x280(%rbp), %rdi
callq 0x2140
movq -0x3f8(%rbp), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x2260
leaq 0x2ea3(%rip), %rsi      # 0x647d
leaq -0x50(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x48e0
leaq -0x50(%rbp), %rsi
leaq -0x3f0(%rbp), %rdi
callq 0x21e0
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq -0x3f8(%rbp), %r12
movq %r12, %rdi
movl %r15d, %esi
callq 0x2280
leaq 0x2e61(%rip), %rsi      # 0x647a
movq %rax, %rdi
callq 0x2140
xorps %xmm0, %xmm0
leaq -0x80(%rbp), %rax
andq $0x0, 0x10(%rax)
xorl %ecx, %ecx
testl %r14d, %r14d
cmovlel %ecx, %r14d
movl %r14d, -0x5c(%rbp)
movaps %xmm0, (%rax)
leaq -0x50(%rbp), %r14
leaq 0x2e34(%rip), %r15      # 0x647c
movl $0x0, -0x2c(%rbp)
xorl %r13d, %r13d
cmpl -0x5c(%rbp), %r13d
je 0x3750
movq %r14, %rdi
movl %r13d, %ebx
movl %r13d, %esi
movl -0x54(%rbp), %edx
movl -0x58(%rbp), %ecx
movl 0x10(%rbp), %r8d
callq 0x386e
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0x4bc4
movq %r14, %rdi
callq 0x4a12
movq -0x78(%rbp), %r14
subq -0x80(%rbp), %r14
shrq $0x2, %r14
testl %r14d, %r14d
movl $0x0, %eax
cmovlel %eax, %r14d
addl %r14d, -0x2c(%rbp)
xorl %r13d, %r13d
cmpq %r13, %r14
je 0x36cc
movq -0x80(%rbp), %rax
movl (%rax,%r13,4), %esi
movq %r12, %rdi
callq 0x2280
movq %rax, %rdi
movq %r15, %rsi
callq 0x2140
incq %r13
jmp 0x36a7
cmpl $0xf4240, -0x2c(%rbp)   # imm = 0xF4240
leaq -0x50(%rbp), %r14
movl %ebx, %r13d
jle 0x3748
movq %r14, %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x2220
leaq -0x280(%rbp), %rdi
movq %r14, %rsi
callq 0x2120
movq %r14, %rdi
callq 0x20a0
movq -0x3f8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
xorl %esi, %esi
callq 0x2260
movq %r14, %rdi
leaq 0x2d5c(%rip), %rsi      # 0x647d
leaq -0x2d(%rbp), %rdx
callq 0x48e0
leaq -0x3f0(%rbp), %rdi
movq %r14, %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x20a0
movl $0x0, -0x2c(%rbp)
incl %r13d
jmp 0x3652
leaq -0x50(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x2220
leaq -0x280(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2120
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq 0x2c5b(%rip), %rsi      # 0x63db
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2ce9(%rip), %rsi      # 0x647c
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2cd6(%rip), %rsi      # 0x647c
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2c25(%rip), %rsi      # 0x63de
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq -0x280(%rbp), %rdi
callq 0x21a0
leaq -0x80(%rbp), %rdi
callq 0x4a12
leaq -0x3f8(%rbp), %rdi
callq 0x2040
leaq -0x280(%rbp), %rdi
callq 0x21d0
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x382d
jmp 0x3842
jmp 0x380c
jmp 0x383b
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x20a0
jmp 0x384e
jmp 0x383b
jmp 0x3820
jmp 0x3842
movq %rax, %rbx
jmp 0x385a
jmp 0x382d
jmp 0x3842
jmp 0x3842
jmp 0x3842
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x20a0
jmp 0x3845
movq %rax, %rbx
jmp 0x384e
jmp 0x3842
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x4a12
leaq -0x3f8(%rbp), %rdi
callq 0x2040
leaq -0x280(%rbp), %rdi
callq 0x21d0
movq %rbx, %rdi
callq 0x2290