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

    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       faceList;\n";
    currentFile << "    location    \"constant/polyMesh\";\n";
    currentFile << "    object      faces;\n";
    currentFile << "}\n";
    currentFile << "// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n";
    currentFile << "\n";
    currentFile << "\n";

    ostringstream convert;
    convert << nFaces << "\n(\n";

    vector<int> points;
    vector<Points> faces;
    int size;

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

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

    countFaces = 0;
    for (int i=0; i<nExternalFaces; i++)
    {
        points = pointsOfExternalFace(i, Nx, Ny, Nz);
        convert << "4(" <<  points[0] << " " << points[1] << " " << points[2] << " " << points[3] << ")\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 $0x3f8, %rsp            # imm = 0x3F8
movl %r9d, -0x3c(%rbp)
movl %r8d, -0x38(%rbp)
movl %ecx, -0x34(%rbp)
movl %edx, -0x40(%rbp)
movl %esi, %ebx
movl %edi, %r15d
leaq 0x3cbd(%rip), %rsi      # 0x642f
leaq -0x2a0(%rbp), %r14
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0x2170
leaq 0x3894(%rip), %rsi      # 0x601f
movq %r14, %rdi
callq 0x2140
leaq 0x38d6(%rip), %rsi      # 0x6070
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3914(%rip), %rsi      # 0x60c1
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3952(%rip), %rsi      # 0x6112
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3990(%rip), %rsi      # 0x6163
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x39ce(%rip), %rsi      # 0x61b4
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3a0c(%rip), %rsi      # 0x6205
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3a4a(%rip), %rsi      # 0x6256
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3b3d(%rip), %rsi      # 0x635c
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3a2e(%rip), %rsi      # 0x6260
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3a31(%rip), %rsi      # 0x6276
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3bef(%rip), %rsi      # 0x6447
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3a46(%rip), %rsi      # 0x62b1
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3be4(%rip), %rsi      # 0x6462
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3b47(%rip), %rsi      # 0x63d8
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3a4e(%rip), %rsi      # 0x62f2
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3bc5(%rip), %rsi      # 0x647c
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3bb2(%rip), %rsi      # 0x647c
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq -0x418(%rbp), %rdi
callq 0x2190
leaq -0x418(%rbp), %rdi
movl %ebx, %esi
callq 0x2280
leaq 0x3b83(%rip), %rsi      # 0x647a
movq %rax, %rdi
callq 0x2140
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
andq $0x0, -0x70(%rbp)
leaq -0x60(%rbp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
movl %r15d, -0x44(%rbp)
leaq 0x3b53(%rip), %rbx      # 0x647e
leaq 0x3a87(%rip), %r14      # 0x63b9
leaq 0x3aa2(%rip), %r15      # 0x63db
movl $0x0, -0x30(%rbp)
xorl %esi, %esi
cmpl -0x44(%rbp), %esi
je 0x2ac4
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
movl %esi, -0x48(%rbp)
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x3c(%rbp), %r8d
callq 0x2d4c
leaq -0x60(%rbp), %rdi
movq %r12, %rsi
callq 0x4aba
movq %r12, %rdi
callq 0x48b4
movq -0x58(%rbp), %rax
subq -0x60(%rbp), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
addl %eax, -0x30(%rbp)
imulq $0x18, %rax, %r12
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x2a37
leaq -0x418(%rbp), %rdi
movq %rbx, %rsi
callq 0x2140
movq -0x60(%rbp), %rcx
movq (%rcx,%r13), %rcx
movl (%rcx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
movq -0x60(%rbp), %rcx
movq (%rcx,%r13), %rcx
movl 0x4(%rcx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
movq -0x60(%rbp), %rcx
movq (%rcx,%r13), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
movq -0x60(%rbp), %rcx
movq (%rcx,%r13), %rcx
movl 0xc(%rcx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
movq %r15, %rsi
callq 0x2140
addq $0x18, %r13
jmp 0x299f
cmpl $0xf4240, -0x30(%rbp)   # imm = 0xF4240
jle 0x2aba
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
leaq -0x410(%rbp), %rsi
callq 0x2220
leaq -0x2a0(%rbp), %rdi
movq %r12, %rsi
callq 0x2120
movq %r12, %rdi
callq 0x20a0
movq -0x418(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x418(%rbp), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x2260
movq %r12, %rdi
leaq 0x39ea(%rip), %rsi      # 0x647d
leaq -0x29(%rbp), %rdx
callq 0x48e0
leaq -0x410(%rbp), %rdi
movq %r12, %rsi
callq 0x21e0
movq %r12, %rdi
callq 0x20a0
movl $0x0, -0x30(%rbp)
movl -0x48(%rbp), %esi
incl %esi
jmp 0x2942
xorl %r14d, %r14d
movl -0x40(%rbp), %r13d
testl %r13d, %r13d
cmovlel %r14d, %r13d
leaq -0xa0(%rbp), %rbx
leaq 0x38d9(%rip), %r12      # 0x63b9
xorl %r15d, %r15d
cmpl %r15d, %r13d
je 0x2c18
movq %rbx, %rdi
movl %r15d, %esi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x3c(%rbp), %r8d
callq 0x2f84
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x4bc4
movq %rbx, %rdi
callq 0x4a12
leaq -0x418(%rbp), %rdi
leaq 0x395b(%rip), %rsi      # 0x647e
callq 0x2140
movq -0x80(%rbp), %rcx
movl (%rcx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
movq %r12, %rsi
callq 0x2140
movq -0x80(%rbp), %rcx
movl 0x4(%rcx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
movq %r12, %rsi
callq 0x2140
movq -0x80(%rbp), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
movq %r12, %rsi
callq 0x2140
movq -0x80(%rbp), %rcx
movl 0xc(%rcx), %esi
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
leaq 0x384d(%rip), %rsi      # 0x63db
callq 0x2140
cmpl $0xf4240, %r14d         # imm = 0xF4240
jl 0x2c0d
movq %rbx, %rdi
leaq -0x410(%rbp), %rsi
callq 0x2220
leaq -0x2a0(%rbp), %rdi
movq %rbx, %rsi
callq 0x2120
movq %rbx, %rdi
callq 0x20a0
movq -0x418(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x418(%rbp), %rax
addq %rax, %rdi
xorl %esi, %esi
callq 0x2260
movq %rbx, %rdi
leaq 0x3895(%rip), %rsi      # 0x647d
leaq -0x29(%rbp), %rdx
callq 0x48e0
leaq -0x410(%rbp), %rdi
movq %rbx, %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x20a0
xorl %r14d, %r14d
jmp 0x2c10
incl %r14d
incl %r15d
jmp 0x2ae3
leaq -0xa0(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x2220
leaq -0x2a0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x2120
leaq -0xa0(%rbp), %rdi
callq 0x20a0
leaq 0x378a(%rip), %rsi      # 0x63db
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3818(%rip), %rsi      # 0x647c
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3805(%rip), %rsi      # 0x647c
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq 0x3754(%rip), %rsi      # 0x63de
leaq -0x2a0(%rbp), %rdi
callq 0x2140
leaq -0x2a0(%rbp), %rdi
callq 0x21a0
leaq -0x60(%rbp), %rdi
callq 0x48b4
leaq -0x80(%rbp), %rdi
callq 0x4a12
leaq -0x418(%rbp), %rdi
callq 0x2040
leaq -0x2a0(%rbp), %rdi
callq 0x21d0
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2cfb
jmp 0x2d17
jmp 0x2d0c
movq %rax, %rbx
jmp 0x2d2c
jmp 0x2d17
jmp 0x2d17
jmp 0x2d17
jmp 0x2cfb
jmp 0x2cfb
jmp 0x2cfb
jmp 0x2d17
jmp 0x2d17
jmp 0x2d17
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x20a0
jmp 0x2d1a
movq %rax, %rbx
jmp 0x2d38
jmp 0x2d17
jmp 0x2d17
jmp 0x2d17
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x48b4
leaq -0x80(%rbp), %rdi
callq 0x4a12
leaq -0x418(%rbp), %rdi
callq 0x2040
leaq -0x2a0(%rbp), %rdi
callq 0x21d0
movq %rbx, %rdi
callq 0x2290