// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/ensight_writer.c
// Function: WritePointPolyData
static void WritePointPolyData(const int pm, const int pn, const Geometry *const geo, EnSet *enSet)
{
    snprintf(enSet->fname, sizeof(EnStr), "%s.geo", enSet->bname);
    FILE *fp = Fopen(enSet->fname, "wb");
    EnReal data = 0.0; /* the Ensight data format */
    int ne = 0; /* total number of nodes in a part */
    /* description at the beginning */
    strncpy(enSet->str, "C Binary", sizeof(EnStr));
    fwrite(enSet->str, sizeof(EnStr), 1, fp);
    strncpy(enSet->str, "Ensight Geometry File", sizeof(EnStr));
    fwrite(enSet->str, sizeof(EnStr), 1, fp);
    strncpy(enSet->str, "Written by ArtraCFD", sizeof(EnStr));
    fwrite(enSet->str, sizeof(EnStr), 1, fp);
    /* node id and extents settings */
    strncpy(enSet->str, "node id off", sizeof(EnStr));
    fwrite(enSet->str, sizeof(EnStr), 1, fp);
    strncpy(enSet->str, "element id off", sizeof(EnStr));
    fwrite(enSet->str, sizeof(EnStr), 1, fp);
    for (int p = enSet->part[MIN], pnum = 1; p < enSet->part[MAX]; ++p, ++pnum) {
        strncpy(enSet->str, "part", sizeof(EnStr));
        fwrite(enSet->str, sizeof(EnStr), 1, fp);
        fwrite(&pnum, sizeof(int), 1, fp);
        snprintf(enSet->str, sizeof(EnStr), "%d", pn - pm);
        fwrite(enSet->str, sizeof(EnStr), 1, fp);
        strncpy(enSet->str, enSet->dtype, sizeof(EnStr));
        fwrite(enSet->str, sizeof(EnStr), 1, fp);
        ne = pn - pm;
        fwrite(&ne, sizeof(int), 1, fp);
        for (int s = 0; s < DIMS; ++s) {
            for (int n = pm; n < pn; ++n) {
                data = geo->poly[n].O[s];
                fwrite(&data, sizeof(EnReal), 1, fp);
            }
        }
        strncpy(enSet->str, "point", sizeof(EnStr));
        fwrite(enSet->str, sizeof(EnStr), 1, fp);
        ne = pn - pm;
        fwrite(&ne, sizeof(int), 1, fp);
        for (int n = pm, m = 1; n < pn; ++n, ++m) {
            fwrite(&m, sizeof(int), 1, fp);
        }
    }
    fclose(fp);
    WritePolyVariable(pm, pn, geo, enSet);
    WritePolyState(pm, pn, geo, enSet);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %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
movl $0x50, %esi
leaq 0x11571(%rip), %rdx     # 0x28536
movb $0x0, %al
callq 0x20b0
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
leaq 0x11e8b(%rip), %rsi     # 0x28e69
callq 0xbf90
movq %rax, -0x20(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
leaq 0x11e64(%rip), %rsi     # 0x28e6c
movl $0x50, %edx
callq 0x2040
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
leaq 0x11e33(%rip), %rsi     # 0x28e75
movl $0x50, %edx
callq 0x2040
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
leaq 0x11e0f(%rip), %rsi     # 0x28e8b
movl $0x50, %edx
callq 0x2040
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
leaq 0x11de9(%rip), %rsi     # 0x28e9f
movl $0x50, %edx
callq 0x2040
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
leaq 0x11dbb(%rip), %rsi     # 0x28eab
movl $0x50, %edx
callq 0x2040
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movq -0x18(%rbp), %rax
movl 0x280(%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, -0x30(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x284(%rcx), %eax
jge 0x17356
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
leaq 0x11d69(%rip), %rsi     # 0x28eba
movl $0x50, %edx
callq 0x2040
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movq -0x20(%rbp), %rcx
leaq -0x30(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x21f0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movl -0x8(%rbp), %ecx
subl -0x4(%rbp), %ecx
movl $0x50, %esi
leaq 0x11cb9(%rip), %rdx     # 0x28e66
movb $0x0, %al
callq 0x20b0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x18(%rbp), %rsi
addq $0x230, %rsi            # imm = 0x230
movl $0x50, %edx
callq 0x2040
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movl -0x8(%rbp), %eax
subl -0x4(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rcx
leaq -0x28(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x21f0
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jge 0x172a3
movl -0x4(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x17296
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movslq -0x34(%rbp), %rcx
movsd 0x20(%rax,%rcx,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x20(%rbp), %rcx
leaq -0x24(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x21f0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x17243
jmp 0x17298
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x17237
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
leaq 0x11c32(%rip), %rsi     # 0x28ee7
movl $0x50, %edx
callq 0x2040
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0x21f0
movl -0x8(%rbp), %eax
subl -0x4(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rcx
leaq -0x28(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x21f0
movl -0x4(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x1, -0x40(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1733d
movq -0x20(%rbp), %rcx
leaq -0x40(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x21f0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x1730a
jmp 0x1733f
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1712c
movq -0x20(%rbp), %rdi
callq 0x2080
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x17390
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x177e0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)