// File: /workspace/github_c_makefile_star2_O3/mohuangrui[P]ArtraCFD/fluid_dynamics.c
// Function: LLLU
static void LLLU(const Real dt, const Real coeA, const Real coeB, const int to,
        const int tn, const int tm, const int p, Space *space, const Model *model)
{
    const Partition *const part = &(space->part);
    Node *const node = space->node;
    int idx = 0; /* linear array index math variable */
    int i = 0, j = 0, k = 0; /* index with normal order */
    const int h[DIMS][DIMS] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; /* direction indicator */
    Real RHS[5][DIMU] = {{0.0}}; /* spatial operator */
    Real *restrict FhatR = RHS[0]; /* reconstructed numerical convective flux vector */
    Real *restrict FhatL = RHS[1]; /* reconstructed numerical convective flux vector */
    Real *restrict FvhatR = RHS[2]; /* reconstructed numerical diffusive flux vector */
    Real *restrict FvhatL = RHS[3]; /* reconstructed numerical diffusive flux vector */
    Real *restrict Phi = RHS[4]; /* right hand side vector */
    Real *temp = NULL;
    const IntVec partn = {part->n[X], part->n[Y], part->n[Z]};
    const RealVec dd = {part->dd[X], part->dd[Y], part->dd[Z]};
    const RealVec r = {dt * dd[X], dt * dd[Y], dt * dd[Z]};
    int s = 0, sN = 0; /* space sweep control for the operator p */
    switch (p) {
        case PHI: /* source term */
            s = 0; sN = s + 1;
            break;
        case DIMS: /* all spatial operators */
            s = 0; sN = DIMS;
            break;
        default: /* individual spatial operator */
            s = p; sN = s + 1;
            break;
    }
    /* space sweep with dimension priority */
    for (; s < sN; ++s) {
        for (int ks = part->np[s][Z][MIN]; ks < part->np[s][Z][MAX]; ++ks) {
            for (int js = part->np[s][Y][MIN]; js < part->np[s][Y][MAX]; ++js) {
                for (int is = part->np[s][X][MIN], state = 0; is < part->np[s][X][MAX]; ++is) {
                    switch (s) {
                        case X:
                            i = is; j = js; k = ks;
                            break;
                        case Y:
                            i = js; j = is; k = ks;
                            break;
                        case Z:
                            i = js; j = ks; k = is;
                            break;
                        default:
                            break;
                    }
                    idx = IndexNode(k, j, i, partn[Y], partn[X]);
                    if (0 != node[idx].did) {
                        state = 0; /* mark domain change and boundary occurrence */
                        continue;
                    }
                    switch (p) {
                        case PHI:
                            ComputePhi(tn, k, j, i, partn, node, model, Phi);
                            SolveOperator(OPTSPLIT, s, coeA, coeB, node[idx].U[to], node[idx].U[tn], node[idx].U[tm], dt, Phi);
                            continue;
                        default:
                            break;
                    }
                    switch (state) {
                        case 1: /* inherit numerical flux from the previous node */
                            temp = FhatL;
                            FhatL = FhatR;
                            FhatR = temp;
                            temp = FvhatL;
                            FvhatL = FvhatR;
                            FvhatR = temp;
                            break;
                        default: /* compute numerical flux at left interface */
                            ComputeFhat(tn, s, k - h[s][Z], j - h[s][Y], i - h[s][X], partn, node, model, FhatL);
                            ComputeFvhat(tn, s, k - h[s][Z], j - h[s][Y], i - h[s][X], partn, dd, node, model, FvhatL);
                            state = 1;
                            break;
                    }
                    ComputeFhat(tn, s, k, j, i, partn, node, model, FhatR);
                    ComputeFvhat(tn, s, k, j, i, partn, dd, node, model, FvhatR);
                    LU(FhatR, FhatL, FvhatR, FvhatL, Phi);
                    SolveOperator(model->multidim, s, coeA, coeB, node[idx].U[to], node[idx].U[tn], node[idx].U[tm], r[s], Phi);
                }
            }
        }
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %r8, 0x28(%rsp)
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %ebp
movl %edi, %r15d
movsd %xmm2, 0x98(%rsp)
movsd %xmm1, 0x90(%rsp)
movaps %xmm0, 0xb0(%rsp)
movq (%rcx), %rax
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xf0(%rsp)
movl $0x1, %eax
movl %eax, 0xe0(%rsp)
movl %eax, 0xf0(%rsp)
movl %eax, 0x100(%rsp)
leaq 0x130(%rsp), %rdi
xorl %r13d, %r13d
movl $0xc8, %edx
movq %rdi, 0x50(%rsp)
xorl %esi, %esi
callq 0x20d0
movapd 0xb0(%rsp), %xmm3
movq 0x34(%rbx), %rax
movq %rax, 0x38(%rsp)
movl 0x3c(%rbx), %eax
movl %eax, 0x40(%rsp)
movupd 0x70(%rbx), %xmm0
movapd %xmm0, 0xc0(%rsp)
movsd 0x80(%rbx), %xmm1
movsd %xmm1, 0xd0(%rsp)
movapd %xmm3, %xmm2
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
mulpd %xmm0, %xmm2
movapd %xmm2, 0x110(%rsp)
mulsd %xmm3, %xmm1
movsd %xmm1, 0x120(%rsp)
cmpl $0x4, %r14d
movq %r14, 0x70(%rsp)
je 0x10d0e
cmpl $0x3, %r14d
jne 0x10d18
movl $0x3, %eax
xorl %r9d, %r9d
jmp 0x10d1f
xorl %r9d, %r9d
movl $0x1, %eax
jmp 0x10d1f
leal 0x1(%r14), %eax
movslq %r14d, %r9
leaq 0x158(%rsp), %rcx
movq %rcx, 0x58(%rsp)
leaq 0x180(%rsp), %rcx
movq %rcx, 0x48(%rsp)
leaq 0x1a8(%rsp), %r14
addq $0x1f8, %rbx            # imm = 0x1F8
movl %r15d, %ecx
movq %rcx, 0x78(%rsp)
movl %ebp, %ecx
movq %rcx, 0x88(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movq %rbx, 0xa0(%rsp)
movl %r15d, 0xc(%rsp)
movl %eax, 0x6c(%rsp)
leaq (%r9,%r9,2), %rax
movl 0x10(%rbx,%rax,8), %edx
movl 0x14(%rbx,%rax,8), %ecx
movl %edx, 0x10(%rsp)
cmpl %ecx, %edx
jge 0x111d3
leaq (%rbx,%rax,8), %rsi
leaq (%rsp,%rax,4), %rax
addq $0xe0, %rax
movq %rax, 0xa8(%rsp)
movl 0xc(%rsi), %eax
movq 0x70(%rsp), %rbx
movq %r9, 0x18(%rsp)
movq %rsi, 0x60(%rsp)
movl 0x8(%rsi), %edx
movl %edx, 0x14(%rsp)
cmpl %eax, %edx
jge 0x111c1
movl 0x4(%rsi), %ecx
movl (%rsi), %ebp
cmpl %ecx, %ebp
jge 0x111ac
xorl %r15d, %r15d
movl 0x4(%rsp), %r8d
movl 0x8(%rsp), %ecx
cmpl $0x2, %r9d
je 0x10e14
movl 0x14(%rsp), %edx
movl %ebp, %esi
movl 0x10(%rsp), %edi
cmpl $0x1, %r9d
je 0x10e1e
movl %r8d, %edx
movl %ecx, %esi
movl %r13d, %edi
testl %r9d, %r9d
jne 0x10e1e
movl %ebp, %edx
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %eax
movl %eax, %edi
jmp 0x10e1e
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %esi
movl %ebp, %edi
movl 0x38(%rsp), %r8d
movl 0x3c(%rsp), %ecx
movq %rdi, 0x20(%rsp)
movl %esi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
callq 0x7d53
cltq
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %r13
xorl %eax, %eax
movq 0x30(%rsp), %r9
cmpl $0x0, (%r9,%r13)
jne 0x10f0b
addq %r9, %r13
cmpl $0x4, %ebx
jne 0x10f2f
movl 0xc(%rsp), %edi
movq 0x20(%rsp), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
leaq 0x38(%rsp), %r8
leaq 0x1d0(%rsp), %rax
pushq %rax
pushq 0x30(%rsp)
callq 0x18488
addq $0x10, %rsp
leaq 0x10(%r13), %rax
movq 0x78(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq 0x10(%r13,%rcx,8), %rcx
movq 0x88(%rsp), %rdx
leaq (%rdx,%rdx,4), %rdx
leaq 0x10(,%rdx,8), %rdx
addq %r13, %rdx
xorl %esi, %esi
movsd 0x98(%rsp), %xmm2
movsd 0x90(%rsp), %xmm3
movapd 0xb0(%rsp), %xmm4
movsd 0x1d0(%rsp,%rsi), %xmm0
mulsd %xmm4, %xmm0
addsd (%rcx,%rsi), %xmm0
mulsd %xmm2, %xmm0
movsd (%rax,%rsi), %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%rsi)
addq $0x8, %rsi
cmpq $0x28, %rsi
jne 0x10ed6
movl %r15d, %eax
movq 0x20(%rsp), %r13
movq 0x18(%rsp), %r9
movq 0x60(%rsp), %rsi
incl %ebp
movl 0x4(%rsi), %ecx
movl %eax, %r15d
cmpl %ecx, %ebp
jl 0x10dda
jmp 0x111a9
cmpl $0x1, %r15d
jne 0x10f67
movq 0x58(%rsp), %r15
movq 0x50(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x28(%rsp), %r10
movq %r14, %r12
movq 0x48(%rsp), %rax
movq %rax, 0x80(%rsp)
movl 0xc(%rsp), %ebx
movq 0x18(%rsp), %r14
jmp 0x11012
movq 0x20(%rsp), %r15
movl %r15d, %edx
movq 0xa8(%rsp), %rbx
subl 0x8(%rbx), %edx
movl 0x8(%rsp), %r12d
movl %r12d, %ecx
subl 0x4(%rbx), %ecx
movl 0x4(%rsp), %r8d
subl (%rbx), %r8d
subq $0x8, %rsp
movl 0x14(%rsp), %edi
movq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %r9
pushq 0x60(%rsp)
pushq 0x38(%rsp)
pushq 0x48(%rsp)
callq 0xb6d4
addq $0x20, %rsp
movq %r14, %rax
movl %r15d, %edx
subl 0x8(%rbx), %edx
subl 0x4(%rbx), %r12d
movl 0x4(%rsp), %r8d
subl (%rbx), %r8d
movl 0xc(%rsp), %ebx
movl %ebx, %edi
movq 0x18(%rsp), %rsi
movq %rsi, %r14
movl %r12d, %ecx
leaq 0x38(%rsp), %r9
movq %rax, 0x80(%rsp)
pushq %rax
movq 0x30(%rsp), %r12
pushq %r12
pushq 0x40(%rsp)
leaq 0xd8(%rsp), %rax
pushq %rax
callq 0xce5c
addq $0x20, %rsp
movq 0x50(%rsp), %r15
movq %r12, %r10
movq 0x48(%rsp), %r12
subq $0x8, %rsp
movl %ebx, %edi
movl %r14d, %esi
movq 0x28(%rsp), %r14
movl %r14d, %edx
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %r8d
leaq 0x40(%rsp), %r9
pushq %r15
pushq %r10
pushq 0x48(%rsp)
movq %r10, %rbx
callq 0xb6d4
addq $0x20, %rsp
movl 0xc(%rsp), %edi
movq 0x18(%rsp), %rsi
movl %r14d, %edx
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r8d
leaq 0x38(%rsp), %r9
pushq %r12
pushq %rbx
pushq 0x40(%rsp)
leaq 0xd8(%rsp), %rax
pushq %rax
callq 0xce5c
addq $0x20, %rsp
xorl %eax, %eax
movq 0x58(%rsp), %rcx
movq 0x80(%rsp), %r14
movsd (%rcx,%rax), %xmm0
subsd (%r15,%rax), %xmm0
addsd (%r12,%rax), %xmm0
subsd (%r14,%rax), %xmm0
movsd %xmm0, 0x1d0(%rsp,%rax)
addq $0x8, %rax
cmpq $0x28, %rax
jne 0x11087
movq 0x88(%rsp), %rax
leaq (%rax,%rax,4), %rax
leaq 0x10(,%rax,8), %rax
addq %r13, %rax
movq 0x18(%rsp), %r9
movsd 0x110(%rsp,%r9,8), %xmm0
testq %r9, %r9
movq 0x70(%rsp), %rbx
movsd 0x98(%rsp), %xmm3
movsd 0x90(%rsp), %xmm4
movq 0x60(%rsp), %rsi
je 0x11142
movq 0x28(%rsp), %rcx
cmpl $0x1, 0x10(%rcx)
jne 0x11142
mulsd %xmm3, %xmm0
xorl %ecx, %ecx
movq 0x20(%rsp), %r13
movsd 0x1d0(%rsp,%rcx,8), %xmm1
mulsd %xmm0, %xmm1
addsd (%rax,%rcx,8), %xmm1
movsd %xmm1, (%rax,%rcx,8)
incq %rcx
cmpq $0x5, %rcx
jne 0x1110e
movl $0x1, %eax
movq %r15, 0x50(%rsp)
movq %r12, 0x48(%rsp)
jmp 0x10f1a
movq 0x78(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq 0x10(,%rcx,8), %rcx
addq %r13, %rcx
addq $0x10, %r13
xorl %edx, %edx
movsd 0x1d0(%rsp,%rdx), %xmm1
mulsd %xmm0, %xmm1
addsd (%rcx,%rdx), %xmm1
mulsd %xmm3, %xmm1
movsd (%r13,%rdx), %xmm2
mulsd %xmm4, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, (%rax,%rdx)
addq $0x8, %rdx
cmpq $0x28, %rdx
jne 0x1115c
movl $0x1, %eax
movq %r15, 0x50(%rsp)
movq %r12, 0x48(%rsp)
movq 0x20(%rsp), %r13
jmp 0x10f1a
movl 0xc(%rsi), %eax
movl 0x14(%rsp), %edx
incl %edx
movl %edx, 0x14(%rsp)
cmpl %eax, %edx
jl 0x10dcd
movl 0x14(%rsi), %ecx
movl 0x10(%rsp), %edx
incl %edx
movl %edx, 0x10(%rsp)
cmpl %ecx, %edx
jl 0x10dbb
incq %r9
movl 0x6c(%rsp), %eax
cmpl %r9d, %eax
movq 0xa0(%rsp), %rbx
jne 0x10d7b
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)