// File: /workspace/github_c_makefile_star2_O1/mohuangrui[P]ArtraCFD/data_stream.c
// Function: ReadPolyStateData
void ReadPolyStateData(const int pm, const int pn, FILE *fp, Geometry *const geo)
{
    const char *fmtI = ParseFormat("%lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %d");
    const char *fmtJ = ParseFormat("%lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg, %lg");
    Polyhedron *poly  = NULL;
    const Real zero = 0.0;
    for (int n = pm; n < pn; ++n) {
        poly = geo->poly + n;
        Sread(fp, 16, fmtI,
                &(poly->O[X]), &(poly->O[Y]), &(poly->O[Z]), &(poly->r),
                &(poly->V[TO][X]), &(poly->V[TO][Y]), &(poly->V[TO][Z]),
                &(poly->W[TO][X]), &(poly->W[TO][Y]), &(poly->W[TO][Z]),
                &(poly->rho), &(poly->T), &(poly->cf),
                &(poly->area), &(poly->volume), &(poly->mid));
        Sread(fp, 16, fmtJ,
                &(poly->at[TO][X]), &(poly->at[TO][Y]), &(poly->at[TO][Z]),
                &(poly->ar[TO][X]), &(poly->ar[TO][Y]), &(poly->ar[TO][Z]),
                &(poly->at[TN][X]), &(poly->at[TN][Y]), &(poly->at[TN][Z]),
                &(poly->g[X]), &(poly->g[Y]), &(poly->g[Z]),
                &(poly->ar[TN][X]), &(poly->ar[TN][Y]), &(poly->ar[TN][Z]),
                &(poly->to));
        if (zero >= poly->to) {
            poly->to = FLT_MAX;
        }
        if (geo->sphN > n) {
            poly->faceN = 0; /* analytical polyhedron tag */
            poly->facet = NULL;
        }
        for (int s = 0; s < DIMS; ++s) {
            poly->V[TN][s] = poly->V[TO][s];
            poly->W[TN][s] = poly->W[TO][s];
        }
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %rbx
movq %rdx, 0x48(%rsp)
movl %esi, %ebp
movl %edi, %r13d
leaq 0x10abc(%rip), %rdi     # 0x1d9e5
callq 0x8fb6
movq %rax, 0x68(%rsp)
leaq 0x10af9(%rip), %rdi     # 0x1da33
callq 0x8fb6
movq %rax, 0x60(%rsp)
cmpl %ebp, %r13d
jge 0xd1f2
movslq %r13d, %r13
movslq %ebp, %rax
movq %rax, 0x50(%rsp)
imulq $0x238, %r13, %rcx      # imm = 0x238
addq $0xc8, %rcx
movq %rbx, 0x58(%rsp)
movq %rcx, 0x70(%rsp)
movq 0x10(%rbx), %r12
imulq $0x238, %r13, %rbp      # imm = 0x238
leaq (%r12,%rbp), %rcx
addq $0x20, %rcx
leaq 0x28(%r12,%rbp), %r8
leaq 0x30(%r12,%rbp), %r9
leaq 0x18(%r12,%rbp), %rax
movq %rax, 0x40(%rsp)
leaq 0x80(%r12,%rbp), %rax
movq %rax, 0x38(%rsp)
leaq 0x88(%r12,%rbp), %rax
movq %rax, 0x30(%rsp)
leaq 0x90(%r12,%rbp), %rax
movq %rax, 0x28(%rsp)
leaq 0xb0(%r12,%rbp), %rax
movq %rax, 0x20(%rsp)
leaq 0xb8(%r12,%rbp), %rax
movq %rax, 0x18(%rsp)
leaq 0xc0(%r12,%rbp), %rax
movq %rax, 0x10(%rsp)
leaq 0x1a8(%r12,%rbp), %rax
movq %rax, 0x8(%rsp)
leaq 0x1b0(%r12,%rbp), %r10
leaq 0x1b8(%r12,%rbp), %r11
leaq (%r12,%rbp), %r15
addq $0x1c0, %r15            # imm = 0x1C0
leaq (%r12,%rbp), %rbx
addq $0x1c8, %rbx            # imm = 0x1C8
leaq (%r12,%rbp), %r14
addq $0x10, %r14
subq $0x8, %rsp
movq 0x50(%rsp), %rdi
movl $0x10, %esi
movq 0x70(%rsp), %rdx
xorl %eax, %eax
pushq %r14
pushq %rbx
pushq %r15
pushq %r11
pushq %r10
pushq 0x38(%rsp)
pushq 0x48(%rsp)
pushq 0x58(%rsp)
pushq 0x68(%rsp)
pushq 0x78(%rsp)
pushq 0x88(%rsp)
pushq 0x98(%rsp)
pushq 0xa8(%rsp)
callq 0x941f
addq $0x70, %rsp
leaq (%r12,%rbp), %rcx
addq $0xe0, %rcx
leaq 0xe8(%r12,%rbp), %r8
leaq 0xf0(%r12,%rbp), %r9
leaq 0x128(%r12,%rbp), %rax
movq %rax, 0x40(%rsp)
leaq 0x130(%r12,%rbp), %rax
movq %rax, 0x38(%rsp)
leaq 0x138(%r12,%rbp), %rax
movq %rax, 0x30(%rsp)
leaq 0xf8(%r12,%rbp), %rax
movq %rax, 0x28(%rsp)
leaq 0x100(%r12,%rbp), %rax
movq %rax, 0x20(%rsp)
leaq 0x108(%r12,%rbp), %rax
movq %rax, 0x18(%rsp)
leaq 0x110(%r12,%rbp), %rax
movq %rax, 0x10(%rsp)
leaq 0x118(%r12,%rbp), %rax
movq %rax, 0x8(%rsp)
leaq 0x120(%r12,%rbp), %r11
leaq 0x140(%r12,%rbp), %r15
leaq (%r12,%rbp), %r14
addq $0x148, %r14            # imm = 0x148
leaq (%r12,%rbp), %r10
addq $0x150, %r10            # imm = 0x150
leaq (%r12,%rbp), %rbx
addq $0x1a0, %rbx            # imm = 0x1A0
subq $0x8, %rsp
movq 0x50(%rsp), %rdi
movl $0x10, %esi
movq 0x68(%rsp), %rdx
xorl %eax, %eax
pushq %rbx
pushq %r10
pushq %r14
pushq %r15
pushq %r11
pushq 0x38(%rsp)
pushq 0x48(%rsp)
pushq 0x58(%rsp)
pushq 0x68(%rsp)
pushq 0x78(%rsp)
pushq 0x88(%rsp)
pushq 0x98(%rsp)
pushq 0xa8(%rsp)
callq 0x941f
addq $0x70, %rsp
xorpd %xmm0, %xmm0
ucomisd (%rbx), %xmm0
jb 0xd18b
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, (%rbx)
movq 0x58(%rsp), %rbx
movslq 0x4(%rbx), %rax
cmpq %rax, %r13
movq 0x70(%rsp), %rcx
jge 0xd1b3
addq %r12, %rbp
movl $0x0, (%rbp)
movq $0x0, 0x230(%rbp)
addq %rcx, %r12
movq $-0x3, %rax
movsd -0x30(%r12,%rax,8), %xmm0
movsd (%r12,%rax,8), %xmm1
movsd %xmm0, -0x18(%r12,%rax,8)
movsd %xmm1, 0x18(%r12,%rax,8)
incq %rax
jne 0xd1bd
incq %r13
addq $0x238, %rcx            # imm = 0x238
cmpq 0x50(%rsp), %r13
jne 0xcf6b
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq