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

    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      owner;\n";
    currentFile << "}\n";
    currentFile << "// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n";
    currentFile << "\n";
    currentFile << "\n";

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

    vector<int> owners;
    int size;

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

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

    countFaces = 0;
    for (int i=0; i<nExternalFaces; i++)
    {
        convert << ownerOfExternalFace(i, Nx, Ny, Nz)  << "\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, -0x3c(%rbp)
movl %r8d, -0x38(%rbp)
movl %ecx, -0x34(%rbp)
movl %edx, %r13d
movl %esi, %r14d
movl %edi, %r12d
leaq 0x2ba9(%rip), %rsi      # 0x6516
leaq -0x280(%rbp), %rbx
pushq $0x10
popq %rdx
movq %rbx, %rdi
callq 0x2170
leaq 0x2699(%rip), %rsi      # 0x601f
movq %rbx, %rdi
callq 0x2140
leaq 0x26db(%rip), %rsi      # 0x6070
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2719(%rip), %rsi      # 0x60c1
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2757(%rip), %rsi      # 0x6112
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2795(%rip), %rsi      # 0x6163
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x27d3(%rip), %rsi      # 0x61b4
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2811(%rip), %rsi      # 0x6205
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x284f(%rip), %rsi      # 0x6256
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2942(%rip), %rsi      # 0x635c
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2833(%rip), %rsi      # 0x6260
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2836(%rip), %rsi      # 0x6276
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2a4a(%rip), %rsi      # 0x649d
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq -0x3f8(%rbp), %rdi
callq 0x2190
leaq 0x2a47(%rip), %rsi      # 0x64b9
leaq -0x3f8(%rbp), %r15
movq %r15, %rdi
callq 0x2140
movq %rax, %rdi
movl %r12d, %esi
callq 0x2280
leaq 0x2a41(%rip), %rsi      # 0x64d4
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movl %r14d, %esi
callq 0x2280
leaq 0x2a31(%rip), %rsi      # 0x64de
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movl %r13d, %esi
callq 0x2280
leaq 0x2a21(%rip), %rsi      # 0x64e8
movq %rax, %rdi
callq 0x2140
movl %r13d, %esi
subl -0x34(%rbp), %esi
movq %rax, %rdi
callq 0x2280
leaq 0x27ef(%rip), %rsi      # 0x62d3
movq %rax, %rdi
callq 0x2140
leaq -0x3f0(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x2220
leaq -0x280(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2120
leaq -0x60(%rbp), %rdi
callq 0x20a0
leaq 0x2795(%rip), %rsi      # 0x62b1
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x29ff(%rip), %rsi      # 0x652e
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2896(%rip), %rsi      # 0x63d8
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x279d(%rip), %rsi      # 0x62f2
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2914(%rip), %rsi      # 0x647c
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x2901(%rip), %rsi      # 0x647c
leaq -0x280(%rbp), %rdi
callq 0x2140
movq -0x3f8(%rbp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2260
leaq 0x28da(%rip), %rsi      # 0x647d
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x48e0
leaq -0x60(%rbp), %rsi
leaq -0x3f0(%rbp), %rdi
callq 0x21e0
leaq -0x60(%rbp), %rdi
callq 0x20a0
leaq -0x3f8(%rbp), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0x2280
leaq 0x2898(%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, -0x64(%rbp)
movaps %xmm0, (%rax)
leaq -0x60(%rbp), %rbx
leaq 0x286b(%rip), %r14      # 0x647c
movl $0x0, -0x30(%rbp)
xorl %r13d, %r13d
cmpl -0x64(%rbp), %r13d
je 0x3d16
movq %rbx, %rdi
movl %r13d, %r12d
movl %r13d, %esi
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %ecx
movl 0x10(%rbp), %r8d
callq 0x3f02
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x4bc4
movq %rbx, %rdi
callq 0x4a12
movq -0x78(%rbp), %rbx
subq -0x80(%rbp), %rbx
shrq $0x2, %rbx
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
addl %ebx, -0x30(%rbp)
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x3c92
movq -0x80(%rbp), %rax
movl (%rax,%r13,4), %esi
movq %r15, %rdi
callq 0x2280
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
incq %r13
jmp 0x3c6d
cmpl $0xf4240, -0x30(%rbp)   # imm = 0xF4240
leaq -0x60(%rbp), %rbx
movl %r12d, %r13d
jle 0x3d0e
movq %rbx, %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x2220
leaq -0x280(%rbp), %rdi
movq %rbx, %rsi
callq 0x2120
movq %rbx, %rdi
callq 0x20a0
movq -0x3f8(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x2260
movq %rbx, %rdi
leaq 0x2796(%rip), %rsi      # 0x647d
leaq -0x29(%rbp), %rdx
callq 0x48e0
leaq -0x3f0(%rbp), %rdi
movq %rbx, %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x20a0
movl $0x0, -0x30(%rbp)
incl %r13d
jmp 0x3c1b
xorl %r12d, %r12d
movl -0x34(%rbp), %ebx
testl %ebx, %ebx
cmovlel %r12d, %ebx
leaq -0x60(%rbp), %r14
xorl %r13d, %r13d
cmpl %r13d, %ebx
je 0x3dda
movl %r13d, %edi
movl -0x38(%rbp), %esi
movl -0x3c(%rbp), %edx
movl 0x10(%rbp), %ecx
callq 0x3fb8
movq %r15, %rdi
movl %eax, %esi
callq 0x2280
movq %rax, %rdi
leaq 0x2725(%rip), %rsi      # 0x647c
callq 0x2140
cmpl $0xf4240, %r12d         # imm = 0xF4240
jl 0x3dcf
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 %r15, %rdi
xorl %esi, %esi
callq 0x2260
movq %r14, %rdi
leaq 0x26d3(%rip), %rsi      # 0x647d
leaq -0x29(%rbp), %rdx
callq 0x48e0
leaq -0x3f0(%rbp), %rdi
movq %r14, %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x20a0
xorl %r12d, %r12d
jmp 0x3dd2
incl %r12d
incl %r13d
jmp 0x3d29
leaq -0x60(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x2220
leaq -0x280(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2120
leaq -0x60(%rbp), %rdi
callq 0x20a0
leaq 0x25d1(%rip), %rsi      # 0x63db
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x265f(%rip), %rsi      # 0x647c
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x264c(%rip), %rsi      # 0x647c
leaq -0x280(%rbp), %rdi
callq 0x2140
leaq 0x259b(%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 0x3ebf
jmp 0x3ed6
jmp 0x3e96
jmp 0x3ecd
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x20a0
jmp 0x3ee2
jmp 0x3ecd
jmp 0x3eaa
jmp 0x3ed6
movq %rax, %rbx
jmp 0x3eee
jmp 0x3ebf
jmp 0x3ed6
jmp 0x3ed6
jmp 0x3ebf
jmp 0x3ebf
jmp 0x3ed6
jmp 0x3ed6
jmp 0x3ed6
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x20a0
jmp 0x3ed9
movq %rax, %rbx
jmp 0x3ee2
jmp 0x3ed6
jmp 0x3ed6
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