// File: /workspace/github_c_makefile_star2_O3/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 $0x3c8, %rsp            # imm = 0x3C8
movl %r9d, -0x68(%rbp)
movl %r8d, -0x64(%rbp)
movl %ecx, %r13d
movl %edx, %r12d
movl %esi, -0x5c(%rbp)
movl %edi, %r14d
leaq 0x2ae3(%rip), %rsi      # 0x649d
leaq -0x270(%rbp), %rbx
movq %rbx, %rdi
movl $0x10, %edx
callq 0x2170
leaq 0x2666(%rip), %rsi      # 0x603b
movl $0x50, %edx
movq %rbx, %rdi
callq 0x2180
leaq 0x26a3(%rip), %rsi      # 0x608c
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x26dc(%rip), %rsi      # 0x60dd
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x2715(%rip), %rsi      # 0x612e
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x274e(%rip), %rsi      # 0x617f
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x2787(%rip), %rsi      # 0x61d0
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x27c0(%rip), %rsi      # 0x6221
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x27f9(%rip), %rsi      # 0x6272
leaq -0x270(%rbp), %rdi
movl $0x9, %edx
callq 0x2180
leaq 0x28e7(%rip), %rsi      # 0x6378
leaq -0x270(%rbp), %rdi
movl $0x2, %edx
callq 0x2180
leaq 0x27d3(%rip), %rsi      # 0x627c
leaq -0x270(%rbp), %rdi
movl $0x15, %edx
callq 0x2180
leaq 0x27d1(%rip), %rsi      # 0x6292
leaq -0x270(%rbp), %rdi
movl $0x17, %edx
callq 0x2180
leaq 0x29e0(%rip), %rsi      # 0x64b9
leaq -0x270(%rbp), %rdi
movl $0x1b, %edx
callq 0x2180
leaq -0x3e8(%rbp), %rdi
callq 0x21a0
leaq 0x29d8(%rip), %rsi      # 0x64d5
leaq -0x3e8(%rbp), %rdi
movl $0x1a, %edx
callq 0x2180
leaq -0x3e8(%rbp), %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x22a0
movq %rax, %r14
leaq 0x29c6(%rip), %rsi      # 0x64f0
movl $0x9, %edx
movq %rax, %rdi
callq 0x2180
movq %r14, %rdi
movl -0x5c(%rbp), %esi
callq 0x22a0
movq %rax, %r14
leaq 0x29ae(%rip), %rsi      # 0x64fa
movl $0x9, %edx
movq %rax, %rdi
callq 0x2180
movq %r14, %rdi
movl %r12d, %esi
callq 0x22a0
movq %rax, %r14
leaq 0x2996(%rip), %rsi      # 0x6504
movl $0x11, %edx
movq %rax, %rdi
callq 0x2180
subl %r13d, %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x22a0
leaq 0x275f(%rip), %rsi      # 0x62ef
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
leaq -0x3e0(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x2240
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x270(%rbp), %rdi
callq 0x2180
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bda
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
leaq 0x26ec(%rip), %rsi      # 0x62cd
leaq -0x270(%rbp), %rdi
movl $0x25, %edx
callq 0x2180
leaq 0x291d(%rip), %rsi      # 0x6516
leaq -0x270(%rbp), %rdi
movl $0x1b, %edx
callq 0x2180
leaq 0x27e3(%rip), %rsi      # 0x63f4
leaq -0x270(%rbp), %rdi
movl $0x2, %edx
callq 0x2180
leaq 0x26e5(%rip), %rsi      # 0x630e
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x2857(%rip), %rsi      # 0x6498
leaq -0x270(%rbp), %rdi
movl $0x1, %edx
callq 0x2180
leaq 0x283f(%rip), %rsi      # 0x6498
leaq -0x270(%rbp), %rdi
movl $0x1, %edx
callq 0x2180
movq -0x3e8(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2280
leaq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
movq %rax, (%rdi)
leaq 0x2808(%rip), %rdx      # 0x6499
movq %rdx, %rsi
callq 0x56c6
leaq -0x50(%rbp), %rsi
leaq -0x3e0(%rbp), %rdi
callq 0x21f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3cc2
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
leaq -0x3e8(%rbp), %rdi
movl %r12d, %esi
callq 0x22a0
leaq 0x27be(%rip), %rsi      # 0x6496
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
xorl %ebx, %ebx
cmpl $0x0, -0x5c(%rbp)
jle 0x3e81
leaq -0x50(%rbp), %rdi
leaq 0x279c(%rip), %r15      # 0x6498
movl $0x0, -0x60(%rbp)
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %r14, %r12
movq %rbx, -0x70(%rbp)
movl %ebx, %esi
movl -0x64(%rbp), %edx
movl -0x68(%rbp), %ecx
movl 0x10(%rbp), %r8d
callq 0x4093
movq -0x50(%rbp), %r14
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
testq %r12, %r12
je 0x3d68
subq %r12, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x2160
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x3d68
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
subq %r14, %rbx
shrq $0x2, %rbx
testl %ebx, %ebx
jle 0x3e68
addl %ebx, -0x60(%rbp)
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
xorl %r12d, %r12d
movq -0x58(%rbp), %r13
movl (%r14,%r12,4), %esi
leaq -0x3e8(%rbp), %rdi
callq 0x22a0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
incq %r12
cmpq %r12, %rbx
jne 0x3d87
cmpl $0xf4240, -0x60(%rbp)   # imm = 0xF4240
movq -0x70(%rbp), %rbx
jle 0x3e70
leaq -0x50(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x2240
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x270(%rbp), %rdi
callq 0x2180
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3dfd
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
movq -0x3e8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x3e8(%rbp), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x2280
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %r12
movq %r12, %rdi
leaq 0x266a(%rip), %rdx      # 0x6499
movq %rdx, %rsi
callq 0x56c6
leaq -0x3e0(%rbp), %rdi
movq %r12, %rsi
callq 0x21f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3e5f
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
movl $0x0, -0x60(%rbp)
jmp 0x3e70
movq -0x58(%rbp), %r13
movq -0x70(%rbp), %rbx
incl %ebx
cmpl -0x5c(%rbp), %ebx
leaq -0x50(%rbp), %rdi
jne 0x3d09
jmp 0x3e87
xorl %r13d, %r13d
xorl %r14d, %r14d
leaq -0x50(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x2240
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x270(%rbp), %rdi
callq 0x2180
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3ec4
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
leaq 0x252c(%rip), %rsi      # 0x63f7
leaq -0x270(%rbp), %rdi
movl $0x2, %edx
callq 0x2180
leaq 0x25b5(%rip), %rsi      # 0x6498
leaq -0x270(%rbp), %rdi
movl $0x1, %edx
callq 0x2180
leaq 0x259d(%rip), %rsi      # 0x6498
leaq -0x270(%rbp), %rdi
movl $0x1, %edx
callq 0x2180
leaq 0x24e7(%rip), %rsi      # 0x63fa
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq -0x270(%rbp), %rdi
callq 0x21b0
testq %r14, %r14
je 0x3f43
subq %r14, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x2160
movq 0x5066(%rip), %rsi      # 0x8fb0
leaq -0x3e8(%rbp), %rdi
callq 0x20d0
leaq -0x378(%rbp), %rdi
callq 0x2070
movq 0x503f(%rip), %rax      # 0x8fa8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x268(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x270(%rbp,%rcx)
callq 0x2120
leaq -0x178(%rbp), %rdi
callq 0x2070
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, -0x58(%rbp)
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4044
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
jmp 0x4044
jmp 0x3ffe
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0x3fec
jmp 0x4035
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4060
movq -0x40(%rbp), %rsi
incq %rsi
jmp 0x405b
jmp 0x4035
jmp 0x4030
movq %r13, -0x58(%rbp)
movq %rax, %rbx
jmp 0x4044
jmp 0x400d
jmp 0x400d
jmp 0x4012
movq %rax, %rbx
jmp 0x4049
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4049
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
jmp 0x4049
movq %rax, %rbx
jmp 0x407f
movq %rax, %rbx
jmp 0x4060
movq %rax, %rbx
movq %r13, -0x58(%rbp)
movq %r12, %r14
testq %r14, %r14
je 0x4060
movq -0x58(%rbp), %r13
jmp 0x4052
movq %rax, %rbx
subq %r14, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x2160
movq 0x4f49(%rip), %rsi      # 0x8fb0
leaq -0x3e8(%rbp), %rdi
callq 0x20d0
leaq -0x378(%rbp), %rdi
callq 0x2070
leaq -0x270(%rbp), %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x22b0