// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/paraview_writer.c
// Function: WritePointPolyData
static void WritePointPolyData(const int pm, const int pn, const Geometry *const geo, PvSet *pvSet)
{
    snprintf(pvSet->fname, sizeof(PvStr), "%s%s", pvSet->bname, pvSet->fext);
    FILE *fp = Fopen(pvSet->fname, "w");
    PvReal data = 0.0; /* paraview scalar data */
    PvReal Vec[3] = {0.0}; /* paraview vector data */
    fprintf(fp, "<?xml version=\"1.0\"?>\n");
    fprintf(fp, "<VTKFile type=\"PolyData\" version=\"1.0\" byte_order=\"%s\">\n", pvSet->byteOrder);
    fprintf(fp, "  <PolyData>\n");
    fprintf(fp, "    <Piece NumberOfPoints=\"%d\" NumberOfVerts=\"1\" NumberOfPolys=\"0\">\n", (pn - pm));
    fprintf(fp, "      <PointData>\n");
    for (int s = 0; s < pvSet->scaN; ++s) {
        fprintf(fp, "        <DataArray type=\"%s\" Name=\"%s\" format=\"ascii\">\n", pvSet->floatType, pvSet->sca[s]);
        fprintf(fp, "          ");
        for (int n = pm; n < pn; ++n) {
            switch (s) {
                case 0:
                    data = geo->poly[n].r;
                    break;
                case 1:
                    data = n + 1;
                    break;
                default:
                    break;
            }
            fprintf(fp, "%.6g ", data);
        }
        fprintf(fp, "\n        </DataArray>\n");
    }
    for (int s = 0; s < pvSet->vecN; ++s) {
        fprintf(fp, "        <DataArray type=\"%s\" Name=\"%s\" NumberOfComponents=\"3\" format=\"ascii\">\n", pvSet->floatType, pvSet->vec[s]);
        fprintf(fp, "          ");
        for (int n = pm; n < pn; ++n) {
            Vec[X] = geo->poly[n].V[TO][X];
            Vec[Y] = geo->poly[n].V[TO][Y];
            Vec[Z] = geo->poly[n].V[TO][Z];
            fprintf(fp, "%.6g %.6g %.6g ", Vec[X], Vec[Y], Vec[Z]);
        }
        fprintf(fp, "\n        </DataArray>\n");
    }
    fprintf(fp, "      </PointData>\n");
    fprintf(fp, "      <CellData>\n");
    fprintf(fp, "      </CellData>\n");
    fprintf(fp, "      <Points>\n");
    fprintf(fp, "        <DataArray type=\"%s\" Name=\"points\" NumberOfComponents=\"3\" format=\"ascii\">\n", pvSet->floatType);
    fprintf(fp, "          ");
    for (int n = pm; n < pn; ++n) {
        Vec[X] = geo->poly[n].O[X];
        Vec[Y] = geo->poly[n].O[Y];
        Vec[Z] = geo->poly[n].O[Z];
        fprintf(fp, "%.6g %.6g %.6g ", Vec[X], Vec[Y], Vec[Z]);
    }
    fprintf(fp, "\n        </DataArray>\n");
    fprintf(fp, "      </Points>\n");
    fprintf(fp, "      <Verts>\n");
    fprintf(fp, "        <DataArray type=\"%s\" Name=\"connectivity\" format=\"ascii\">\n", pvSet->intType);
    fprintf(fp, "          ");
    for (int n = pm; n < pn; ++n) {
        fprintf(fp, "%d ", n);
    }
    fprintf(fp, "\n        </DataArray>\n");
    fprintf(fp, "        <DataArray type=\"%s\" Name=\"offsets\" format=\"ascii\">\n", pvSet->intType);
    fprintf(fp, "          ");
    fprintf(fp, "%d ", (pn - pm));
    fprintf(fp, "\n        </DataArray>\n");
    fprintf(fp, "      </Verts>\n");
    fprintf(fp, "      <Polys>\n");
    fprintf(fp, "      </Polys>\n");
    fprintf(fp, "    </Piece>\n");
    fprintf(fp, "  </PolyData>\n");
    fprintf(fp, "</VTKFile>\n");
    fprintf(fp, "<!--\n");
    WritePolyStateData(pm, pn, fp, geo);
    fprintf(fp, "-->\n");
    fclose(fp);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
movq -0x18(%rbp), %rcx
addq $0x50, %rcx
movq -0x18(%rbp), %r8
addq $0xf0, %r8
movl $0x50, %esi
leaq 0xb1b4(%rip), %rdx      # 0x29ad4
movb $0x0, %al
callq 0x20b0
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
leaq 0x8543(%rip), %rsi      # 0x26e7c
callq 0xbf90
movq %rax, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
movq -0x20(%rbp), %rdi
leaq 0xbab3(%rip), %rsi      # 0x2a418
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x230, %rdx            # imm = 0x230
leaq 0xbdbe(%rip), %rsi      # 0x2a740
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xbde5(%rip), %rsi      # 0x2a779
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
movl -0x8(%rbp), %edx
subl -0x4(%rbp), %edx
leaq 0xbddb(%rip), %rsi      # 0x2a787
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xbbe6(%rip), %rsi      # 0x2a5a4
movb $0x0, %al
callq 0x2140
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x280(%rcx), %eax
jge 0x1eabf
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x1e0, %rdx            # imm = 0x1E0
movq -0x18(%rbp), %rcx
addq $0x284, %rcx            # imm = 0x284
movslq -0x44(%rbp), %rax
imulq $0xa, %rax, %rax
addq %rax, %rcx
leaq 0xbbac(%rip), %rsi      # 0x2a5b7
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xbbd2(%rip), %rsi      # 0x2a5ef
movb $0x0, %al
callq 0x2140
movl -0x4(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1ea9f
movl -0x44(%rbp), %eax
movl %eax, -0x5c(%rbp)
testl %eax, %eax
je 0x1ea48
jmp 0x1ea3e
movl -0x5c(%rbp), %eax
subl $0x1, %eax
je 0x1ea6a
jmp 0x1ea7b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x48(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x1ea7d
movl -0x48(%rbp), %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x1ea7d
jmp 0x1ea7d
movq -0x20(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
leaq 0xbbdd(%rip), %rsi      # 0x2a66a
movb $0x1, %al
callq 0x2140
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1ea2a
movq -0x20(%rbp), %rdi
leaq 0xbb50(%rip), %rsi      # 0x2a5fa
movb $0x0, %al
callq 0x2140
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1e9cc
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x2e8(%rcx), %eax
jge 0x1ebe8
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x1e0, %rdx            # imm = 0x1E0
movq -0x18(%rbp), %rcx
addq $0x2ec, %rcx            # imm = 0x2EC
movslq -0x4c(%rbp), %rax
imulq $0xa, %rax, %rax
addq %rax, %rcx
leaq 0xbb0c(%rip), %rsi      # 0x2a611
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xbad8(%rip), %rsi      # 0x2a5ef
movb $0x0, %al
callq 0x2140
movl -0x4(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1ebc8
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x50(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movsd 0x80(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x50(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movsd 0x88(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x50(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movsd 0x90(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
leaq 0xbaad(%rip), %rsi      # 0x2a660
movb $0x3, %al
callq 0x2140
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x1eb24
movq -0x20(%rbp), %rdi
leaq 0xba27(%rip), %rsi      # 0x2a5fa
movb $0x0, %al
callq 0x2140
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1eac6
movq -0x20(%rbp), %rdi
leaq 0xba7d(%rip), %rsi      # 0x2a670
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba7f(%rip), %rsi      # 0x2a684
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba7f(%rip), %rsi      # 0x2a696
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba80(%rip), %rsi      # 0x2a6a9
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x1e0, %rdx            # imm = 0x1E0
leaq 0xba73(%rip), %rsi      # 0x2a6b9
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xb997(%rip), %rsi      # 0x2a5ef
movb $0x0, %al
callq 0x2140
movl -0x4(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1ed00
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
leaq 0xb975(%rip), %rsi      # 0x2a660
movb $0x3, %al
callq 0x2140
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1ec65
movq -0x20(%rbp), %rdi
leaq 0xb8ef(%rip), %rsi      # 0x2a5fa
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xb9ef(%rip), %rsi      # 0x2a70c
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba9d(%rip), %rsi      # 0x2a7cc
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x190, %rdx            # imm = 0x190
leaq 0xba8f(%rip), %rsi      # 0x2a7db
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xb891(%rip), %rsi      # 0x2a5ef
movb $0x0, %al
callq 0x2140
movl -0x4(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1ed93
movq -0x20(%rbp), %rdi
movl -0x58(%rbp), %edx
leaq 0xbbb6(%rip), %rsi      # 0x2a937
movb $0x0, %al
callq 0x2140
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x1ed6b
movq -0x20(%rbp), %rdi
leaq 0xb85c(%rip), %rsi      # 0x2a5fa
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x190, %rdx            # imm = 0x190
leaq 0xba62(%rip), %rsi      # 0x2a81d
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xb822(%rip), %rsi      # 0x2a5ef
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
movl -0x8(%rbp), %edx
subl -0x4(%rbp), %edx
leaq 0xbb52(%rip), %rsi      # 0x2a937
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xb803(%rip), %rsi      # 0x2a5fa
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba51(%rip), %rsi      # 0x2a85a
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba4f(%rip), %rsi      # 0x2a86a
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba4c(%rip), %rsi      # 0x2a879
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xb8de(%rip), %rsi      # 0x2a71d
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba38(%rip), %rsi      # 0x2a889
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xb628(%rip), %rsi      # 0x2a48b
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
leaq 0xba6f(%rip), %rsi      # 0x2a8e4
movb $0x0, %al
callq 0x2140
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
callq 0x12170
movq -0x20(%rbp), %rdi
leaq 0xba92(%rip), %rsi      # 0x2a92c
movb $0x0, %al
callq 0x2140
movq -0x20(%rbp), %rdi
callq 0x2080
addq $0x60, %rsp
popq %rbp
retq