// File: /workspace/github_c_makefile_star2_O2/mohuangrui[P]ArtraCFD/data_probe.c
// Function: WritePointProbeData
void WritePointProbeData(const Time *time, const Space *space, const Model *model)
{
    if (0 == time->dataN[PROPT]) {
        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 */
    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 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};
    int i = 0, j = 0, k = 0;
    for (int n = 0; n < time->dataN[PROPT]; ++n) {
        snprintf(fname, sizeof(fname), "%s%03d.csv", "point_probe_", n + 1);
        fp = Fopen(fname, "a");
        if (0 == time->stepC) { /* initialization step */
            fprintf(fp, "# time, rho, u, v, w, p, T\n");
        }
        p1[X] = time->pp[n][0];
        p1[Y] = time->pp[n][1];
        p1[Z] = time->pp[n][2];
        i = ConfineSpace(MapNode(p1[X], sMin[X], dd[X], ng[X]), nMin[X], nMax[X]);
        j = ConfineSpace(MapNode(p1[Y], sMin[Y], dd[Y], ng[Y]), nMin[Y], nMax[Y]);
        k = ConfineSpace(MapNode(p1[Z], sMin[Z], dd[Z], ng[Z]), nMin[Z], nMax[Z]);
        idx = IndexNode(k, j, i, part->n[Y], part->n[X]);
        MapPrimitive(model->gamma, model->gasR, node[idx].U[TO], Uo);
        fprintf(fp, "%.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g\n",
                time->now, 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 $0x178, %rsp            # imm = 0x178
movq %rdx, 0x68(%rsp)
movl 0xc(%rdi), %ebp
testl %ebp, %ebp
je 0xb4c5
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xb0(%rsp), %rdi
movl $0xc8, %edx
xorl %esi, %esi
callq 0x20d0
movq (%rbx), %rax
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rax
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movl 0x1c8(%rbx), %eax
movl %eax, 0x24(%rsp)
movl 0x1d0(%rbx), %eax
movl %eax, 0x20(%rsp)
movl 0x1d8(%rbx), %eax
movl %eax, 0x1c(%rsp)
movl 0x1cc(%rbx), %eax
movl %eax, 0x18(%rsp)
movl 0x1d4(%rbx), %eax
movl %eax, 0x14(%rsp)
movl 0x1dc(%rbx), %eax
movl %eax, 0x10(%rsp)
movsd 0x3f0(%rbx), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x400(%rbx), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x410(%rbx), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x70(%rbx), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x78(%rbx), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x80(%rbx), %xmm0
movsd %xmm0, 0x28(%rsp)
movl 0x40(%rbx), %eax
movl %eax, 0xc(%rsp)
movl 0x44(%rbx), %eax
movl %eax, 0x8(%rsp)
movq %rbx, 0x60(%rsp)
movl 0x48(%rbx), %eax
movl %eax, 0x4(%rsp)
pushq $0x10
popq %rbx
xorl %r14d, %r14d
movslq %ebp, %rax
cmpq %rax, %r14
jge 0xb4c5
leal 0x1(%r14), %r8d
movl $0xc8, %esi
leaq 0xb0(%rsp), %r12
movq %r12, %rdi
leaq 0x1043d(%rip), %rdx     # 0x1b777
leaq 0x10441(%rip), %rcx     # 0x1b782
xorl %eax, %eax
callq 0x20b0
movq %r12, %rdi
leaq 0x1043d(%rip), %rsi     # 0x1b78f
callq 0x8820
movq %rax, %rbp
cmpl $0x0, 0x8(%r15)
jne 0xb376
leaq 0x10429(%rip), %rdi     # 0x1b791
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
movq %rbp, %rcx
callq 0x2210
movq 0x58(%r15), %rax
movsd -0x10(%rax,%rbx), %xmm0
movsd -0x8(%rax,%rbx), %xmm1
movsd %xmm1, 0x70(%rsp)
movsd (%rax,%rbx), %xmm1
movsd %xmm1, 0x78(%rsp)
movsd 0x50(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movl 0xc(%rsp), %edi
callq 0x761c
movl %eax, %edi
movl 0x24(%rsp), %esi
movl 0x18(%rsp), %edx
callq 0x7633
movl %eax, %r13d
movsd 0x70(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movl 0x8(%rsp), %edi
callq 0x761c
movl %eax, %edi
movl 0x20(%rsp), %esi
movl 0x14(%rsp), %edx
callq 0x7633
movl %eax, %r12d
movsd 0x78(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
movl 0x4(%rsp), %edi
callq 0x761c
movl %eax, %edi
movl 0x1c(%rsp), %esi
movl 0x10(%rsp), %edx
callq 0x7633
movq 0x60(%rsp), %rcx
movl 0x34(%rcx), %r8d
movl 0x38(%rcx), %ecx
movl %eax, %edi
movl %r12d, %esi
movl %r13d, %edx
callq 0x75ec
movq 0x68(%rsp), %rcx
movsd 0x40(%rcx), %xmm0
movsd 0x48(%rcx), %xmm1
cltq
imulq $0x88, %rax, %rax
movq 0x58(%rsp), %rcx
leaq (%rcx,%rax), %rdi
addq $0x10, %rdi
leaq 0x80(%rsp), %rsi
callq 0x74af
movsd 0x48(%r15), %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0x88(%rsp), %xmm2
movsd 0x90(%rsp), %xmm3
movsd 0x98(%rsp), %xmm4
movsd 0xa0(%rsp), %xmm5
movsd 0xa8(%rsp), %xmm6
movq %rbp, %rdi
leaq 0x1047d(%rip), %rsi     # 0x1b923
movb $0x7, %al
callq 0x2160
movq %rbp, %rdi
callq 0x2080
movl 0xc(%r15), %ebp
addq $0x18, %rbx
incq %r14
jmp 0xb313
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq