// File: /workspace/github_c_makefile_star2_O1/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, -0x54(%rbp)
movl %edi, %r14d
leaq 0x2b23(%rip), %rsi      # 0x649d
leaq -0x270(%rbp), %rbx
movq %rbx, %rdi
movl $0x10, %edx
callq 0x2170
leaq 0x26a6(%rip), %rsi      # 0x603b
movl $0x50, %edx
movq %rbx, %rdi
callq 0x2180
leaq 0x26e3(%rip), %rsi      # 0x608c
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x271c(%rip), %rsi      # 0x60dd
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x2755(%rip), %rsi      # 0x612e
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x278e(%rip), %rsi      # 0x617f
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x27c7(%rip), %rsi      # 0x61d0
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x2800(%rip), %rsi      # 0x6221
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x2839(%rip), %rsi      # 0x6272
leaq -0x270(%rbp), %rdi
movl $0x9, %edx
callq 0x2180
leaq 0x2927(%rip), %rsi      # 0x6378
leaq -0x270(%rbp), %rdi
movl $0x2, %edx
callq 0x2180
leaq 0x2813(%rip), %rsi      # 0x627c
leaq -0x270(%rbp), %rdi
movl $0x15, %edx
callq 0x2180
leaq 0x2811(%rip), %rsi      # 0x6292
leaq -0x270(%rbp), %rdi
movl $0x17, %edx
callq 0x2180
leaq 0x2a20(%rip), %rsi      # 0x64b9
leaq -0x270(%rbp), %rdi
movl $0x1b, %edx
callq 0x2180
leaq -0x3e8(%rbp), %rdi
callq 0x21a0
leaq 0x2a18(%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 0x2a06(%rip), %rsi      # 0x64f0
movl $0x9, %edx
movq %rax, %rdi
callq 0x2180
movq %r14, %rdi
movl -0x54(%rbp), %esi
callq 0x22a0
movq %rax, %r14
leaq 0x29ee(%rip), %rsi      # 0x64fa
movl $0x9, %edx
movq %rax, %rdi
callq 0x2180
movq %r14, %rdi
movl %r12d, %esi
callq 0x22a0
movq %rax, %r14
leaq 0x29d6(%rip), %rsi      # 0x6504
movl $0x11, %edx
movq %rax, %rdi
callq 0x2180
subl %r13d, %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x22a0
leaq 0x279f(%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), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x3b9a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
leaq 0x272c(%rip), %rsi      # 0x62cd
leaq -0x270(%rbp), %rdi
movl $0x25, %edx
callq 0x2180
leaq 0x295d(%rip), %rsi      # 0x6516
leaq -0x270(%rbp), %rdi
movl $0x1b, %edx
callq 0x2180
leaq 0x2823(%rip), %rsi      # 0x63f4
leaq -0x270(%rbp), %rdi
movl $0x2, %edx
callq 0x2180
leaq 0x2725(%rip), %rsi      # 0x630e
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq 0x2897(%rip), %rsi      # 0x6498
leaq -0x270(%rbp), %rdi
movl $0x1, %edx
callq 0x2180
leaq 0x287f(%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
movq %r14, (%rdi)
leaq 0x284c(%rip), %rdx      # 0x6499
movq %rdx, %rsi
callq 0x5646
leaq -0x50(%rbp), %rsi
leaq -0x3e0(%rbp), %rdi
callq 0x21f0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x3c7a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
leaq -0x3e8(%rbp), %rdi
movl %r12d, %esi
callq 0x22a0
leaq 0x2806(%rip), %rsi      # 0x6496
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
xorl %ebx, %ebx
cmpl $0x0, -0x54(%rbp)
jle 0x3e25
leaq 0x27e8(%rip), %r12      # 0x6498
movl $0x0, -0x58(%rbp)
xorl %r13d, %r13d
xorl %r14d, %r14d
leaq -0x50(%rbp), %rdi
movq %rbx, -0x70(%rbp)
movl %ebx, %esi
movl -0x64(%rbp), %edx
movl -0x68(%rbp), %ecx
movl 0x10(%rbp), %r8d
callq 0x402b
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
testq %r13, %r13
je 0x3d08
subq %r13, %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x2160
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x3d1d
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
subq %r15, %rbx
shrq $0x2, %rbx
testl %ebx, %ebx
movq -0x60(%rbp), %r13
jle 0x3d60
addl %ebx, -0x58(%rbp)
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movl (%r15,%r14,4), %esi
leaq -0x3e8(%rbp), %rdi
callq 0x22a0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
incq %r14
cmpq %r14, %rbx
jne 0x3d38
cmpl $0xf4240, -0x58(%rbp)   # imm = 0xF4240
movq -0x70(%rbp), %rbx
jle 0x3e0e
leaq -0x50(%rbp), %r13
movq %r13, %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x2240
leaq -0x40(%rbp), %r14
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x270(%rbp), %rdi
callq 0x2180
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x3db1
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
movq %r14, -0x50(%rbp)
movq %r13, %rdi
leaq 0x26be(%rip), %rdx      # 0x6499
movq %rdx, %rsi
callq 0x5646
leaq -0x3e0(%rbp), %rdi
movq %r13, %rsi
callq 0x21f0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x3e07
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
movl $0x0, -0x58(%rbp)
incl %ebx
movq %r15, %r13
movq -0x60(%rbp), %rax
movq %rax, %r14
cmpl -0x54(%rbp), %ebx
jne 0x3cbd
jmp 0x3e2a
xorl %eax, %eax
xorl %r15d, %r15d
movq %rax, %r12
leaq -0x50(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x2240
leaq -0x40(%rbp), %r14
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x270(%rbp), %rdi
movq %r12, %r13
callq 0x2180
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x3e6d
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
leaq 0x2583(%rip), %rsi      # 0x63f7
leaq -0x270(%rbp), %rdi
movl $0x2, %edx
callq 0x2180
leaq 0x260c(%rip), %rsi      # 0x6498
leaq -0x270(%rbp), %rdi
movl $0x1, %edx
callq 0x2180
leaq 0x25f4(%rip), %rsi      # 0x6498
leaq -0x270(%rbp), %rdi
movl $0x1, %edx
callq 0x2180
leaq 0x253e(%rip), %rsi      # 0x63fa
leaq -0x270(%rbp), %rdi
movl $0x50, %edx
callq 0x2180
leaq -0x270(%rbp), %rdi
callq 0x21b0
testq %r15, %r15
je 0x3eec
subq %r15, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x2160
movq 0x50bd(%rip), %rsi      # 0x8fb0
leaq -0x3e8(%rbp), %rdi
callq 0x20d0
leaq -0x378(%rbp), %rdi
callq 0x2070
movq 0x5096(%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 %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x3f70
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
jmp 0x3f70
movq %rax, %rbx
movq %r12, %r13
jmp 0x3fe5
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
jne 0x3f95
jmp 0x3ff8
jmp 0x3fd2
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ff8
movq -0x40(%rbp), %rsi
incq %rsi
jmp 0x3ff3
jmp 0x3fd2
jmp 0x3fcd
jmp 0x3fe2
jmp 0x3faf
jmp 0x3faa
jmp 0x3faa
movq %rax, %rbx
jmp 0x3fc7
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x3fc7
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2160
movq -0x60(%rbp), %r13
jmp 0x3fe5
movq %rax, %rbx
jmp 0x4017
movq %rax, %rbx
jmp 0x3ff8
movq %rax, %rbx
movq %r13, %r15
movq %r14, %r13
jmp 0x3fe5
movq %rax, %rbx
testq %r15, %r15
je 0x3ff8
subq %r15, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x2160
movq 0x4fb1(%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