// File: /workspace/github_c_makefile_star2_O3/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), %ebx
testl %ebx, %ebx
je 0xbd50
movq %rsi, %r14
movq %rdi, %r15
leaq 0xb0(%rsp), %rdi
movl $0xc8, %edx
xorl %esi, %esi
callq 0x20d0
movq %r14, 0x28(%rsp)
movq (%r14), %rax
movq %rax, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
testl %ebx, %ebx
jle 0xbd50
movq 0x28(%rsp), %rax
movl 0x1c8(%rax), %ecx
movl %ecx, 0x24(%rsp)
movl 0x1d0(%rax), %ecx
movl %ecx, 0x20(%rsp)
movl 0x1d8(%rax), %ecx
movl %ecx, 0x1c(%rsp)
movl 0x1cc(%rax), %ecx
movl %ecx, 0x18(%rsp)
movl 0x1d4(%rax), %ecx
movl %ecx, 0x14(%rsp)
movl 0x1dc(%rax), %ecx
movl %ecx, 0x10(%rsp)
movsd 0x3f0(%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x400(%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x410(%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x70(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x78(%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x80(%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movl 0x40(%rax), %ecx
movl %ecx, 0xc(%rsp)
movl 0x44(%rax), %ecx
movl %ecx, 0x8(%rsp)
movl 0x48(%rax), %eax
movl %eax, 0x4(%rsp)
movl $0x10, %r14d
xorl %r12d, %r12d
incq %r12
movl $0xc8, %esi
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
leaq 0x10cd5(%rip), %rdx     # 0x1c88f
leaq 0x10cd9(%rip), %rcx     # 0x1c89a
movl %r12d, %r8d
xorl %eax, %eax
callq 0x20b0
movq %rbx, %rdi
leaq 0x10cd2(%rip), %rsi     # 0x1c8a7
callq 0x9026
movq %rax, %r13
cmpl $0x0, 0x8(%r15)
jne 0xbbfd
movl $0x1b, %esi
movl $0x1, %edx
leaq 0x10cb4(%rip), %rdi     # 0x1c8a9
movq %r13, %rcx
callq 0x2200
movq 0x58(%r15), %rax
movsd -0x10(%rax,%r14), %xmm0
movsd -0x8(%rax,%r14), %xmm1
movsd %xmm1, 0x70(%rsp)
movsd (%rax,%r14), %xmm1
movsd %xmm1, 0x78(%rsp)
movsd 0x58(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movl 0xc(%rsp), %edi
callq 0x7d83
movl %eax, %edi
movl 0x24(%rsp), %esi
movl 0x18(%rsp), %edx
callq 0x7d9a
movl %eax, %ebp
movsd 0x70(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movl 0x8(%rsp), %edi
callq 0x7d83
movl %eax, %edi
movl 0x20(%rsp), %esi
movl 0x14(%rsp), %edx
callq 0x7d9a
movl %eax, %ebx
movsd 0x78(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movl 0x4(%rsp), %edi
callq 0x7d83
movl %eax, %edi
movl 0x1c(%rsp), %esi
movl 0x10(%rsp), %edx
callq 0x7d9a
movq 0x28(%rsp), %rcx
movl 0x34(%rcx), %r8d
movl 0x38(%rcx), %ecx
movl %eax, %edi
movl %ebx, %esi
movl %ebp, %edx
callq 0x7d53
movq 0x68(%rsp), %rcx
movsd 0x40(%rcx), %xmm0
movsd 0x48(%rcx), %xmm1
cltq
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rax
movq 0x60(%rsp), %rcx
leaq (%rcx,%rax), %rdi
addq $0x10, %rdi
leaq 0x80(%rsp), %rsi
callq 0x7c16
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 %r13, %rdi
leaq 0x10d0b(%rip), %rsi     # 0x1ca3b
movb $0x7, %al
callq 0x2160
movq %r13, %rdi
callq 0x2080
movslq 0xc(%r15), %rax
addq $0x18, %r14
cmpq %rax, %r12
jl 0xbba0
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq