// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/data_probe.c
// Function: WriteCurveProbeData
void WriteCurveProbeData(const Time *time, const Space *space, const Model *model)
{
    if (0 == time->dataN[PROCV]) {
        return;
    }
    FILE *fp = NULL;
    String fname = {'\0'};
    const Partition *const part = &(space->part);
    const Node *const node = space->node;
    const Geometry *const geo = &(space->geo);
    const Polyhedron *poly = NULL;
    int idx = 0; /* linear array index math variable */
    Real Uo[DIMUo] = {0.0};
    const IntVec nMin = {part->ns[PHY][X][MIN], part->ns[PHY][Y][MIN], part->ns[PHY][Z][MIN]};
    const IntVec nMax = {part->ns[PHY][X][MAX], part->ns[PHY][Y][MAX], part->ns[PHY][Z][MAX]};
    const RealVec sMin = {part->domain[X][MIN], part->domain[Y][MIN], part->domain[Z][MIN]};
    const RealVec d = {part->d[X], part->d[Y], part->d[Z]};
    const RealVec dd = {part->dd[X], part->dd[Y], part->dd[Z]};
    const IntVec ng = {part->ng[X], part->ng[Y], part->ng[Z]};
    RealVec pG = {0.0}; /* ghost point */
    RealVec pO = {0.0}; /* boundary point */
    RealVec pI = {0.0}; /* image point */
    RealVec N = {0.0}; /* normal */
    int box[DIMS][LIMIT] = {{0}}; /* bounding box in node space */
    for (int n = 0; n < geo->totN; ++n) {
        poly = geo->poly + n;
        snprintf(fname, sizeof(fname), "%s%03d_%05d.csv", "curve_probe_", n + 1, time->stepC);
        fp = Fopen(fname, "w");
        fprintf(fp, "# x, y, z, Nx, Ny, Nz, rho, u, v, w, p, T <time=%.6g>\n", time->now);
        /* determine search range according to bounding box of polyhedron and valid node space */
        for (int s = 0; s < DIMS; ++s) {
            box[s][MIN] = ConfineSpace(MapNode(poly->box[s][MIN], sMin[s], dd[s], ng[s]), nMin[s], nMax[s]);
            box[s][MAX] = ConfineSpace(MapNode(poly->box[s][MAX], sMin[s], dd[s], ng[s]), nMin[s], nMax[s]) + 1;
        }
        for (int k = box[Z][MIN]; k < box[Z][MAX]; ++k) {
            for (int j = box[Y][MIN]; j < box[Y][MAX]; ++j) {
                for (int i = box[X][MIN]; i < box[X][MAX]; ++i) {
                    idx = IndexNode(k, j, i, part->n[Y], part->n[X]);
                    if ((1 != node[idx].gst) || (n + 1 != node[idx].did)) {
                        continue;
                    }
                    pG[X] = MapPoint(i, sMin[X], d[X], ng[X]);
                    pG[Y] = MapPoint(j, sMin[Y], d[Y], ng[Y]);
                    pG[Z] = MapPoint(k, sMin[Z], d[Z], ng[Z]);
                    ComputeGeometricData(pG, node[idx].fid, poly, pO, pI, N);
                    MapPrimitive(model->gamma, model->gasR, node[idx].U[TO], Uo);
                    fprintf(fp, "%.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g\n",
                            pO[X], pO[Y], pO[Z], N[X], N[Y], N[Z], Uo[0], Uo[1], Uo[2], Uo[3], Uo[4], Uo[5]);
                }
            }
        }
        fclose(fp);
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl 0x14(%rcx), %eax
jne 0x11837
jmp 0x11f05
movq $0x0, -0x20(%rbp)
leaq -0xf0(%rbp), %rdi
xorl %esi, %esi
movl $0xc8, %edx
callq 0x20d0
movq -0x10(%rbp), %rax
addq $0x28, %rax
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x108(%rbp)
movq $0x0, -0x110(%rbp)
movl $0x0, -0x114(%rbp)
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x20d0
movq -0xf8(%rbp), %rax
movl 0x1a0(%rax), %eax
movl %eax, -0x15c(%rbp)
movq -0xf8(%rbp), %rax
movl 0x1a8(%rax), %eax
movl %eax, -0x158(%rbp)
movq -0xf8(%rbp), %rax
movl 0x1b0(%rax), %eax
movl %eax, -0x154(%rbp)
movq -0xf8(%rbp), %rax
movl 0x1a4(%rax), %eax
movl %eax, -0x168(%rbp)
movq -0xf8(%rbp), %rax
movl 0x1ac(%rax), %eax
movl %eax, -0x164(%rbp)
movq -0xf8(%rbp), %rax
movl 0x1b4(%rax), %eax
movl %eax, -0x160(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x3c8(%rax), %xmm0
movsd %xmm0, -0x180(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x3d8(%rax), %xmm0
movsd %xmm0, -0x178(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x3e8(%rax), %xmm0
movsd %xmm0, -0x170(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x1a0(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x198(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x190(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, -0x1c0(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x50(%rax), %xmm0
movsd %xmm0, -0x1b8(%rbp)
movq -0xf8(%rbp), %rax
movsd 0x58(%rax), %xmm0
movsd %xmm0, -0x1b0(%rbp)
movq -0xf8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x1cc(%rbp)
movq -0xf8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x1c8(%rbp)
movq -0xf8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x1c4(%rbp)
leaq -0x1f0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x230(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x250(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x270(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
movl $0x0, -0x274(%rbp)
movl -0x274(%rbp), %eax
movq -0x108(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x11f03
movq -0x108(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x274(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movq %rax, -0x110(%rbp)
leaq -0xf0(%rbp), %rdi
movl -0x274(%rbp), %r8d
addl $0x1, %r8d
movq -0x8(%rbp), %rax
movl 0x8(%rax), %r9d
movl $0xc8, %esi
leaq 0x15ed1(%rip), %rdx     # 0x2799d
leaq 0x15f11(%rip), %rcx     # 0x279e4
movb $0x0, %al
callq 0x20b0
leaq -0xf0(%rbp), %rdi
leaq 0x15394(%rip), %rsi     # 0x26e7c
callq 0xbf90
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movsd 0x48(%rax), %xmm0
leaq 0x15eec(%rip), %rsi     # 0x279f1
movb $0x1, %al
callq 0x2140
movl $0x0, -0x278(%rbp)
cmpl $0x3, -0x278(%rbp)
jge 0x11c45
movq -0x110(%rbp), %rax
addq $0x1d0, %rax            # imm = 0x1D0
movslq -0x278(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movslq -0x278(%rbp), %rax
movsd -0x180(%rbp,%rax,8), %xmm1
movslq -0x278(%rbp), %rax
movsd -0x1c0(%rbp,%rax,8), %xmm2
movslq -0x278(%rbp), %rax
movl -0x1cc(%rbp,%rax,4), %edi
callq 0x95b0
movl %eax, %edi
movslq -0x278(%rbp), %rax
movl -0x15c(%rbp,%rax,4), %esi
movslq -0x278(%rbp), %rax
movl -0x168(%rbp,%rax,4), %edx
callq 0x95f0
movl %eax, %ecx
movslq -0x278(%rbp), %rax
movl %ecx, -0x270(%rbp,%rax,8)
movq -0x110(%rbp), %rax
addq $0x1d0, %rax            # imm = 0x1D0
movslq -0x278(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movslq -0x278(%rbp), %rax
movsd -0x180(%rbp,%rax,8), %xmm1
movslq -0x278(%rbp), %rax
movsd -0x1c0(%rbp,%rax,8), %xmm2
movslq -0x278(%rbp), %rax
movl -0x1cc(%rbp,%rax,4), %edi
callq 0x95b0
movl %eax, %edi
movslq -0x278(%rbp), %rax
movl -0x15c(%rbp,%rax,4), %esi
movslq -0x278(%rbp), %rax
movl -0x168(%rbp,%rax,4), %edx
callq 0x95f0
movl %eax, %ecx
addl $0x1, %ecx
movslq -0x278(%rbp), %rax
movl %ecx, -0x26c(%rbp,%rax,8)
movl -0x278(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x278(%rbp)
jmp 0x11b16
movl -0x260(%rbp), %eax
movl %eax, -0x27c(%rbp)
movl -0x27c(%rbp), %eax
cmpl -0x25c(%rbp), %eax
jge 0x11ee6
movl -0x268(%rbp), %eax
movl %eax, -0x280(%rbp)
movl -0x280(%rbp), %eax
cmpl -0x264(%rbp), %eax
jge 0x11ed0
movl -0x270(%rbp), %eax
movl %eax, -0x284(%rbp)
movl -0x284(%rbp), %eax
cmpl -0x26c(%rbp), %eax
jge 0x11eba
movl -0x27c(%rbp), %edi
movl -0x280(%rbp), %esi
movl -0x284(%rbp), %edx
movq -0xf8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0xf8(%rbp), %rax
movl 0xc(%rax), %r8d
callq 0x9500
movl %eax, -0x114(%rbp)
movq -0x100(%rbp), %rcx
movslq -0x114(%rbp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rcx
movl $0x1, %eax
cmpl 0xc(%rcx), %eax
jne 0x11d18
movl -0x274(%rbp), %eax
addl $0x1, %eax
movq -0x100(%rbp), %rcx
movslq -0x114(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
je 0x11d1d
jmp 0x11ea6
movl -0x284(%rbp), %edi
movsd -0x180(%rbp), %xmm0
movsd -0x1a0(%rbp), %xmm1
movl -0x1cc(%rbp), %esi
callq 0x9690
movsd %xmm0, -0x1f0(%rbp)
movl -0x280(%rbp), %edi
movsd -0x178(%rbp), %xmm0
movsd -0x198(%rbp), %xmm1
movl -0x1c8(%rbp), %esi
callq 0x9690
movsd %xmm0, -0x1e8(%rbp)
movl -0x27c(%rbp), %edi
movsd -0x170(%rbp), %xmm0
movsd -0x190(%rbp), %xmm1
movl -0x1c4(%rbp), %esi
callq 0x9690
movsd %xmm0, -0x1e0(%rbp)
leaq -0x1f0(%rbp), %rdi
movq -0x100(%rbp), %rax
movslq -0x114(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %esi
movq -0x110(%rbp), %rdx
leaq -0x210(%rbp), %rcx
leaq -0x230(%rbp), %r8
leaq -0x250(%rbp), %r9
callq 0x104e0
movq -0x18(%rbp), %rax
movsd 0x40(%rax), %xmm0
movq -0x18(%rbp), %rax
movsd 0x48(%rax), %xmm1
movq -0x100(%rbp), %rdi
movslq -0x114(%rbp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rdi
addq $0x10, %rdi
leaq -0x150(%rbp), %rsi
callq 0x9250
movq -0x20(%rbp), %rdi
movsd -0x210(%rbp), %xmm0
movsd -0x208(%rbp), %xmm1
movsd -0x200(%rbp), %xmm2
movsd -0x250(%rbp), %xmm3
movsd -0x248(%rbp), %xmm4
movsd -0x240(%rbp), %xmm5
movsd -0x150(%rbp), %xmm6
movsd -0x148(%rbp), %xmm7
movsd -0x140(%rbp), %xmm11
movsd -0x138(%rbp), %xmm10
movsd -0x130(%rbp), %xmm9
movsd -0x128(%rbp), %xmm8
leaq 0x15c71(%rip), %rsi     # 0x27af5
movsd %xmm11, (%rsp)
movsd %xmm10, 0x8(%rsp)
movsd %xmm9, 0x10(%rsp)
movsd %xmm8, 0x18(%rsp)
movb $0x8, %al
callq 0x2140
movl -0x284(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x284(%rbp)
jmp 0x11c8d
jmp 0x11ebc
movl -0x280(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x280(%rbp)
jmp 0x11c6f
jmp 0x11ed2
movl -0x27c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27c(%rbp)
jmp 0x11c51
movq -0x20(%rbp), %rdi
callq 0x2080
movl -0x274(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x274(%rbp)
jmp 0x11a6e
jmp 0x11f05
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
nop