// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/cfd_parameters.c
// Function: SetNodeNumber
static void SetNodeNumber(Space *space, Model *model)
{
    Partition *const part = &(space->part);
    /* check and mark collapsed space */
    part->collapse = COLLAPSEN;
    if (0 == (part->m[Z] - 1)) {
        part->collapse = COLLAPSEZ;
    }
    if (0 == (part->m[Y] - 1)) {
        part->collapse = 2 * part->collapse + COLLAPSEY;
    }
    if (0 == (part->m[X] - 1)) {
        part->collapse = 2 * part->collapse + COLLAPSEX;
    }
    /* set stencil width and ghost layers required by numerical scheme */
    switch (model->sScheme) {
        case WENOTHREE:
            model->sL = -1; model->sR = 2; part->gl = 2;
            break;
        case WENOFIVE:
            model->sL = -2; model->sR = 3; part->gl = 3;
            break;
        default:
            break;
    }
    /*
     * Number of ghost node layers of each spatial dimension.
     * Note that the global boundary accounts for one ghost layer,
     * except in the periodic boundary condition, in which the
     * global boundary should be treated as normal node layers.
     */
    for (int s = 0; s < DIMS; ++s) {
        part->ng[s] = part->gl - 1;
    }
    /* adjust according to dimension collapse */
    if (OPTSPLIT == model->multidim) {
        switch (part->collapse) {
            case COLLAPSEN:
                break;
            case COLLAPSEX:
                part->ng[X] = 0;
                break;
            case COLLAPSEY:
                part->ng[Y] = 0;
                break;
            case COLLAPSEZ:
                part->ng[Z] = 0;
                break;
            case COLLAPSEXY:
                part->ng[X] = 0;
                part->ng[Y] = 0;
                break;
            case COLLAPSEXZ:
                part->ng[X] = 0;
                part->ng[Z] = 0;
                break;
            case COLLAPSEYZ:
                part->ng[Y] = 0;
                part->ng[Z] = 0;
                break;
            default:
                break;
        }
    }
    /* adjust for periodic boundary conditions */
    for (int s = 0, p = PWB; s < DIMS; ++s, p = p + 2) {
        if (PERIODIC == part->typeBC[p]) {
            part->ng[s] = part->gl;
        }
    }
    /* mesh and node number on each spatial dimension */
    for (int s = 0; s < DIMS; ++s) {
        /* ensure at least two inner cells per dimension */
        part->m[s] = MaxInt(part->m[s], 2);
        /* total number of nodes (including ghost nodes) */
        part->n[s] = part->m[s] + 1 + 2 * part->ng[s];
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
subl $0x1, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xb302
movq -0x18(%rbp), %rax
movl $0x3, 0x28(%rax)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x1, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xb325
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
shll %ecx
addl $0x2, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %ecx
subl $0x1, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xb347
movq -0x18(%rbp), %rax
movl 0x28(%rax), %ecx
shll %ecx
addl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0xb361
jmp 0xb357
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0xb384
jmp 0xb3a7
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl $0x2, 0xc(%rax)
movq -0x18(%rbp), %rax
movl $0x2, 0x24(%rax)
jmp 0xb3a9
movq -0x10(%rbp), %rax
movl $0xfffffffe, 0x8(%rax)  # imm = 0xFFFFFFFE
movq -0x10(%rbp), %rax
movl $0x3, 0xc(%rax)
movq -0x18(%rbp), %rax
movl $0x3, 0x24(%rax)
jmp 0xb3a9
jmp 0xb3a9
movl $0x0, -0x1c(%rbp)
cmpl $0x3, -0x1c(%rbp)
jge 0xb3d7
movq -0x18(%rbp), %rax
movl 0x24(%rax), %edx
subl $0x1, %edx
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, 0x18(%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb3b0
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl 0x10(%rcx), %eax
jne 0xb484
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
movq %rax, -0x38(%rbp)
subq $0x8, %rax
ja 0xb480
movq -0x38(%rbp), %rax
leaq 0x1c36a(%rip), %rcx     # 0x27770
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xb482
movq -0x18(%rbp), %rax
movl $0x0, 0x18(%rax)
jmp 0xb482
movq -0x18(%rbp), %rax
movl $0x0, 0x1c(%rax)
jmp 0xb482
movq -0x18(%rbp), %rax
movl $0x0, 0x20(%rax)
jmp 0xb482
movq -0x18(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x1c(%rax)
jmp 0xb482
movq -0x18(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x20(%rax)
jmp 0xb482
movq -0x18(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x20(%rax)
jmp 0xb482
jmp 0xb482
jmp 0xb484
movl $0x0, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
cmpl $0x3, -0x20(%rbp)
jge 0xb4da
movq -0x18(%rbp), %rax
movq 0x390(%rax), %rcx
movslq -0x24(%rbp), %rdx
movl $0x4, %eax
cmpl (%rcx,%rdx,4), %eax
jne 0xb4c4
movq -0x18(%rbp), %rax
movl 0x24(%rax), %edx
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl %edx, 0x18(%rax,%rcx,4)
jmp 0xb4c6
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0xb492
movl $0x0, -0x28(%rbp)
cmpl $0x3, -0x28(%rbp)
jge 0xb53e
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %edi
movl $0x2, %esi
callq 0x9660
movl %eax, %edx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl 0x18(%rax,%rcx,4), %eax
shll %eax
addl %eax, %edx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, 0xc(%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xb4e1
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)