// File: /workspace/github_c_makefile_star2_O0/ZmengXu[P]boxMesh/boxMesh.C
// Function: boxMesh(int, int, int, double, double, double)
void boxMesh(int Nx, int Ny, int Nz, double Lx, double Ly, double Lz)
{
    /* Create files
        constant/polyMesh/boundary
        constant/polyMesh/faces
        constant/polyMesh/neighbour
        constant/polyMesh/owner
        constant/polyMesh/points
    that would be created by calling OpenFOAM's blockMesh using the following
    blockMeshDict dictionary:

        vertices
        (
            (0     0     0    )
            (Nx*Lx 0     0    )
            (Nx*Lx Ny*Ly 0    )
            (0     Ny*Ly 0    )
            (0     0     Nz*Lz)
            (Nx*Lx 0     Nz*Lz)
            (Nx*Lx Ny*Ly Nz*Lz)
            (0     Ny*Ly Nz*Lz)
        );

        blocks
        (
            hex (0 1 2 3 4 5 6 7) (Nx Ny Nz) simpleGrading (1 1 1)
        );

        edges
        (
        );

        boundary
        (
        );

        mergePatchPairs
        (
        );
    */

    // Calculate number of points, faces and cells
    int nPoints        = (Nx+1)*(Ny+1)*(Nz+1);
    int nCells         = Nx*Ny*Nz;
    int nFaces         = Nx*Ny*(Nz+1)+Nx*Nz*(Ny+1)+Ny*Nz*(Nx+1);
    int nExternalFaces = 2*(Nx*Ny+Nx*Nz+Ny*Nz);

    // Write files
    writeBoundary(nFaces, nExternalFaces);
    writeFaces(nCells, nFaces, nExternalFaces, Nx, Ny, Nz);
    writeNeighbour(nPoints, nCells, nFaces, nExternalFaces, Nx, Ny, Nz);
    writeOwner(nPoints, nCells, nFaces, nExternalFaces, Nx, Ny, Nz);
    writePoints(nPoints, Nx, Ny, Nz, Lx, Ly, Lz);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movsd %xmm2, -0x28(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl %eax, -0x2c(%rbp)
movl -0x4(%rbp), %eax
imull -0x8(%rbp), %eax
imull -0xc(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x4(%rbp), %eax
imull -0x8(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
movl -0x4(%rbp), %ecx
imull -0xc(%rbp), %ecx
movl -0x8(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
addl %ecx, %eax
movl -0x8(%rbp), %ecx
imull -0xc(%rbp), %ecx
movl -0x4(%rbp), %edx
addl $0x1, %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0x4(%rbp), %eax
imull -0x8(%rbp), %eax
movl -0x4(%rbp), %ecx
imull -0xc(%rbp), %ecx
addl %ecx, %eax
movl -0x8(%rbp), %ecx
imull -0xc(%rbp), %ecx
addl %ecx, %eax
shll %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %edi
movl -0x38(%rbp), %esi
callq 0x2520
movl -0x30(%rbp), %edi
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
movl -0x4(%rbp), %ecx
movl -0x8(%rbp), %r8d
movl -0xc(%rbp), %r9d
callq 0x2900
movl -0x2c(%rbp), %edi
movl -0x30(%rbp), %esi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x4(%rbp), %r8d
movl -0x8(%rbp), %r9d
movl -0xc(%rbp), %eax
movl %eax, (%rsp)
callq 0x3cf0
movl -0x2c(%rbp), %edi
movl -0x30(%rbp), %esi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x4(%rbp), %r8d
movl -0x8(%rbp), %r9d
movl -0xc(%rbp), %eax
movl %eax, (%rsp)
callq 0x45a0
movl -0x2c(%rbp), %edi
movl -0x4(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0xc(%rbp), %ecx
movsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
movsd -0x28(%rbp), %xmm2
callq 0x5540
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)