// File: /workspace/github_c_makefile_star2_O3/mohuangrui[P]ArtraCFD/data_probe.c
// Function: WriteLineProbeData
void WriteLineProbeData(const Time *time, const Space *space, const Model *model)
{
    if (0 == time->dataN[PROLN]) {
        return;
    }
    FILE *fp = NULL;
    String fname = {'\0'};
    const Partition *const part = &(space->part);
    const Node *const node = space->node;
    int idx = 0; /* linear array index math variable */
    int idxOld = 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 p1 = {0.0};
    RealVec p2 = {0.0};
    RealVec dl = {0.0};
    int stepN = 0;
    int i = 0, j = 0, k = 0;
    for (int n = 0; n < time->dataN[PROLN]; ++n) {
        snprintf(fname, sizeof(fname), "%s%03d_%05d.csv", "line_probe_", n + 1, time->stepC);
        fp = Fopen(fname, "w");
        fprintf(fp, "# x, y, z, rho, u, v, w, p, T <time=%.6g>\n", time->now);
        p1[X] = time->lp[n][0];
        p1[Y] = time->lp[n][1];
        p1[Z] = time->lp[n][2];
        p2[X] = time->lp[n][3];
        p2[Y] = time->lp[n][4];
        p2[Z] = time->lp[n][5];
        stepN = MaxInt(time->lp[n][6] - 1, 1);
        dl[X] = (p2[X] - p1[X]) / (Real)(stepN);
        dl[Y] = (p2[Y] - p1[Y]) / (Real)(stepN);
        dl[Z] = (p2[Z] - p1[Z]) / (Real)(stepN);
        idxOld = -1; /* used to avoid repeating node for tiny step sizes */
        for (int m = 0; m <= stepN; ++m) {
            i = ConfineSpace(MapNode(p1[X] + m * dl[X], sMin[X], dd[X], ng[X]), nMin[X], nMax[X]);
            j = ConfineSpace(MapNode(p1[Y] + m * dl[Y], sMin[Y], dd[Y], ng[Y]), nMin[Y], nMax[Y]);
            k = ConfineSpace(MapNode(p1[Z] + m * dl[Z], sMin[Z], dd[Z], ng[Z]), nMin[Z], nMax[Z]);
            idx = IndexNode(k, j, i, part->n[Y], part->n[X]);
            if (idxOld == idx) {
                continue;
            }
            idxOld = idx; /* record */
            p2[X] = MapPoint(i, sMin[X], d[X], ng[X]);
            p2[Y] = MapPoint(j, sMin[Y], d[Y], ng[Y]);
            p2[Z] = MapPoint(k, sMin[Z], d[Z], ng[Z]);
            MapPrimitive(model->gamma, model->gasR, node[idx].U[TO], Uo);
            fprintf(fp, "%.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g\n",
                    p2[X], p2[Y], p2[Z], Uo[0], Uo[1], Uo[2], Uo[3], Uo[4], Uo[5]);
        }
        fclose(fp);
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdx, 0xc0(%rsp)
movl 0x10(%rdi), %ebx
testl %ebx, %ebx
je 0xc214
movq %rsi, %rbp
movq %rdi, %r14
leaq 0x120(%rsp), %rdi
movl $0xc8, %edx
xorl %esi, %esi
callq 0x20d0
movq (%rbp), %rax
movq %rax, 0xb8(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x110(%rsp)
movapd %xmm0, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
testl %ebx, %ebx
jle 0xc214
movl 0x1c8(%rbp), %eax
movl %eax, 0x54(%rsp)
movl 0x1d0(%rbp), %eax
movl %eax, 0x50(%rsp)
movl 0x1d8(%rbp), %eax
movl %eax, 0x4c(%rsp)
movl 0x1cc(%rbp), %eax
movl %eax, 0x48(%rsp)
movl 0x1d4(%rbp), %eax
movl %eax, 0x44(%rsp)
movl 0x1dc(%rbp), %eax
movl %eax, 0x40(%rsp)
movsd 0x3f0(%rbp), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x400(%rbp), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x410(%rbp), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x58(%rbp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0x60(%rbp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0x68(%rbp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0x70(%rbp), %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0x78(%rbp), %xmm0
movsd %xmm0, 0xe0(%rsp)
movsd 0x80(%rbp), %xmm0
movsd %xmm0, 0xd8(%rsp)
movl 0x40(%rbp), %eax
movl %eax, 0x14(%rsp)
movl 0x44(%rbp), %eax
movl %eax, 0x10(%rsp)
movl 0x48(%rbp), %eax
movl %eax, 0xc(%rsp)
xorl %ebx, %ebx
movq %r14, 0x90(%rsp)
leaq 0x1(%rbx), %r8
movl 0x8(%r14), %r9d
movl $0xc8, %esi
leaq 0x120(%rsp), %r15
movq %r15, %rdi
leaq 0x109f1(%rip), %rdx     # 0x1c8c5
leaq 0x109fa(%rip), %rcx     # 0x1c8d5
movq %r8, 0x98(%rsp)
xorl %eax, %eax
callq 0x20b0
movq %r15, %rdi
leaq 0xfe34(%rip), %rsi      # 0x1bd28
callq 0x9026
movsd 0x48(%r14), %xmm0
movq %rax, 0x58(%rsp)
movq %rax, %rdi
leaq 0x109d3(%rip), %rsi     # 0x1c8e1
movb $0x1, %al
callq 0x2160
movq 0x60(%r14), %rax
imulq $0x38, %rbx, %rcx
movsd (%rax,%rcx), %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x8(%rax,%rcx), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x10(%rax,%rcx), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x18(%rax,%rcx), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x20(%rax,%rcx), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rax,%rcx), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x30(%rax,%rcx), %xmm0
addsd 0x1063e(%rip), %xmm0    # 0x1c5b0
cvttsd2si %xmm0, %edi
movl $0x1, %esi
callq 0x7db0
testl %eax, %eax
js 0xc1ed
movl %eax, %ebx
movsd 0x30(%rsp), %xmm1
subsd 0x70(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
movsd 0x28(%rsp), %xmm1
subsd 0x68(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x28(%rsp)
movsd 0x20(%rsp), %xmm1
subsd 0x60(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
incl %ebx
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
xorpd %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
mulsd 0x30(%rsp), %xmm0
addsd 0x70(%rsp), %xmm0
movsd 0x88(%rsp), %xmm1
movsd 0xe8(%rsp), %xmm2
movl 0x14(%rsp), %edi
callq 0x7d83
movl %eax, %edi
movl 0x54(%rsp), %esi
movl 0x48(%rsp), %edx
callq 0x7d9a
movl %eax, %r12d
movsd 0x38(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
addsd 0x68(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0xe0(%rsp), %xmm2
movl 0x10(%rsp), %edi
callq 0x7d83
movl %eax, %edi
movl 0x50(%rsp), %esi
movl 0x44(%rsp), %edx
callq 0x7d9a
movl %eax, %r13d
movsd 0x38(%rsp), %xmm0
mulsd 0x20(%rsp), %xmm0
addsd 0x60(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0xd8(%rsp), %xmm2
movl 0xc(%rsp), %edi
callq 0x7d83
movl %eax, %edi
movl 0x4c(%rsp), %esi
movl 0x40(%rsp), %edx
callq 0x7d9a
movl %eax, %r15d
movl 0x34(%rbp), %r8d
movq %rbp, %r14
movl 0x38(%rbp), %ecx
movl %eax, %edi
movl %r13d, %esi
movl %r12d, %edx
callq 0x7d53
cmpl %eax, 0x18(%rsp)
je 0xc1d4
movl %eax, %ebp
movl %r12d, %edi
movsd 0x88(%rsp), %xmm0
movsd 0xb0(%rsp), %xmm1
movl 0x14(%rsp), %esi
callq 0x7db8
movsd %xmm0, 0x18(%rsp)
movl %r13d, %edi
movsd 0x80(%rsp), %xmm0
movsd 0xa8(%rsp), %xmm1
movl 0x10(%rsp), %esi
callq 0x7db8
movsd %xmm0, 0xd0(%rsp)
movl %r15d, %edi
movsd 0x78(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm1
movl 0xc(%rsp), %esi
callq 0x7db8
movsd %xmm0, 0xc8(%rsp)
movq 0xc0(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd 0x48(%rax), %xmm1
movslq %ebp, %rax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rax
movq 0xb8(%rsp), %rcx
leaq (%rcx,%rax), %rdi
addq $0x10, %rdi
leaq 0xf0(%rsp), %rsi
callq 0x7c16
movsd 0xf0(%rsp), %xmm3
movsd 0xf8(%rsp), %xmm4
movsd 0x100(%rsp), %xmm5
movsd 0x108(%rsp), %xmm6
movsd 0x110(%rsp), %xmm7
movsd 0x118(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq 0x58(%rsp), %rdi
leaq 0x1087e(%rip), %rsi     # 0x1ca2f
movsd 0x18(%rsp), %xmm0
movsd 0xd0(%rsp), %xmm1
movsd 0xc8(%rsp), %xmm2
movb $0x8, %al
callq 0x2160
movl %ebp, 0x18(%rsp)
movsd 0x38(%rsp), %xmm0
addsd 0xce26(%rip), %xmm0     # 0x19008
decl %ebx
movq %r14, %rbp
jne 0xbfe1
movq 0x58(%rsp), %rdi
callq 0x2080
movq 0x90(%rsp), %r14
movslq 0x10(%r14), %rax
movq 0x98(%rsp), %rbx
cmpq %rax, %rbx
jl 0xbeb5
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq