// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/ensight_reader.c
// Function: ReadStructuredData
static void ReadStructuredData(Space *space, const Model *model, EnSet *enSet)
{
    FILE *fp = NULL;
    EnReal data = 0.0; /* the Ensight data format */
    const Partition *const part = &(space->part);
    Node *const node = space->node;
    Real *restrict U = NULL;
    int idx = 0; /* linear array index math variable */
    for (int s = 0; s < enSet->scaN; ++s) {
        snprintf(enSet->fname, sizeof(EnStr), "%s.%s", enSet->bname, enSet->sca[s]);
        fp = Fopen(enSet->fname, "rb");
        Fread(enSet->str, sizeof(EnStr), 1, fp);
        for (int p = enSet->part[MIN], pnum = 1; p < enSet->part[MAX]; ++p, ++pnum) {
            Fread(enSet->str, sizeof(EnStr), 1, fp);
            Fread(&pnum, sizeof(int), 1, fp);
            Fread(enSet->str, sizeof(EnStr), 1, fp);
            for (int k = part->ns[PAL][Z][MIN]; k < part->ns[PAL][Z][MAX]; ++k) {
                for (int j = part->ns[PAL][Y][MIN]; j < part->ns[PAL][Y][MAX]; ++j) {
                    for (int i = part->ns[PAL][X][MIN]; i < part->ns[PAL][X][MAX]; ++i) {
                        idx = IndexNode(k, j, i, part->n[Y], part->n[X]);
                        if (0 == s) {
                            /* geometric field initializer */
                            node[idx].did = NONE;
                            node[idx].fid = NONE;
                            node[idx].lid = NONE;
                            node[idx].gst = NONE;
                            memset(node[idx].U, 1, DIMT * sizeof(*node[idx].U));
                            if (InPartBox(k, j, i, part->ns[PIN])) {
                                node[idx].did = 0;
                                node[idx].fid = 0;
                                node[idx].lid = 0;
                                node[idx].gst = 0;
                            }
                        }
                        if (!InPartBox(k, j, i, part->ns[p])) {
                            continue;
                        }
                        /* data field initializer */
                        U = node[idx].U[TO];
                        Fread(&data, sizeof(EnReal), 1, fp);
                        switch (s) {
                            case 0: /* rho */
                                U[0] = data;
                                break;
                            case 1: /* u */
                                U[1] = U[0] * data;
                                break;
                            case 2: /* v */
                                U[2] = U[0] * data;
                                break;
                            case 3: /* w */
                                U[3] = U[0] * data;
                                break;
                            case 4: /* p */
                                U[4] = 0.5 * (U[1] * U[1] + U[2] * U[2] + U[3] * U[3]) / U[0] +
                                    data / (model->gamma - 1.0);
                                break;
                            default:
                                break;
                        }
                    }
                }
            }
        }
        fclose(fp);
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x288(%rcx), %eax
jge 0x15345
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
movq -0x18(%rbp), %rcx
addq $0x50, %rcx
movq -0x18(%rbp), %r8
addq $0x28c, %r8             # imm = 0x28C
movslq -0x48(%rbp), %rax
imulq $0xa, %rax, %rax
addq %rax, %r8
movl $0x50, %esi
leaq 0x1361b(%rip), %rdx     # 0x28524
movb $0x0, %al
callq 0x20b0
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
leaq 0x13608(%rip), %rsi     # 0x2852a
callq 0xbf90
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0xbfe0
movq -0x18(%rbp), %rax
movl 0x280(%rax), %eax
movl %eax, -0x4c(%rbp)
movl $0x1, -0x50(%rbp)
movl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x284(%rcx), %eax
jge 0x1532e
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0xbfe0
movq -0x20(%rbp), %rcx
leaq -0x50(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xbfe0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
movq -0x20(%rbp), %rcx
movl $0x50, %esi
movl $0x1, %edx
callq 0xbfe0
movq -0x30(%rbp), %rax
movl 0x1c8(%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x1cc(%rcx), %eax
jge 0x15315
movq -0x30(%rbp), %rax
movl 0x1c0(%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x1c4(%rcx), %eax
jge 0x15305
movq -0x30(%rbp), %rax
movl 0x1b8(%rax), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x1bc(%rcx), %eax
jge 0x152f5
movl -0x54(%rbp), %edi
movl -0x58(%rbp), %esi
movl -0x5c(%rbp), %edx
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x30(%rbp), %rax
movl 0xc(%rax), %r8d
callq 0x9500
movl %eax, -0x44(%rbp)
xorl %eax, %eax
cmpl -0x48(%rbp), %eax
jne 0x15156
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rdi
movslq -0x44(%rbp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rdi
addq $0x10, %rdi
movl $0x1, %esi
movl $0x78, %edx
callq 0x20d0
movl -0x54(%rbp), %edi
movl -0x58(%rbp), %esi
movl -0x5c(%rbp), %edx
movq -0x30(%rbp), %rcx
addq $0x68, %rcx
callq 0x9530
cmpl $0x0, %eax
je 0x15154
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x4(%rax)
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0xc(%rax)
jmp 0x15156
movl -0x54(%rbp), %edi
movl -0x58(%rbp), %esi
movl -0x5c(%rbp), %edx
movq -0x30(%rbp), %rcx
addq $0x68, %rcx
movslq -0x4c(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
callq 0x9530
cmpl $0x0, %eax
jne 0x15181
jmp 0x152e7
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rdx
movq %rdx, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rdx,8), %rcx
leaq 0x10(%rax,%rcx), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rcx
leaq -0x24(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0xbfe0
movl -0x48(%rbp), %eax
movq %rax, -0x68(%rbp)
subq $0x4, %rax
ja 0x152e3
movq -0x68(%rbp), %rax
leaq 0x12bc8(%rip), %rcx     # 0x27d98
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movss -0x24(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x152e5
movq -0x40(%rbp), %rax
movsd (%rax), %xmm0
movss -0x24(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x152e5
movq -0x40(%rbp), %rax
movsd (%rax), %xmm0
movss -0x24(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x10(%rax)
jmp 0x152e5
movq -0x40(%rbp), %rax
movsd (%rax), %xmm0
movss -0x24(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x18(%rax)
jmp 0x152e5
movq -0x40(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x40(%rbp), %rax
movsd 0x8(%rax), %xmm2
movq -0x40(%rbp), %rax
movsd 0x10(%rax), %xmm1
movq -0x40(%rbp), %rax
mulsd 0x10(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
movsd 0x18(%rax), %xmm1
movq -0x40(%rbp), %rax
movsd 0x18(%rax), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x12462(%rip), %xmm0    # 0x27708
mulsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
divsd (%rax), %xmm0
movss -0x24(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
movq -0x10(%rbp), %rax
movsd 0x40(%rax), %xmm2
movsd 0x12444(%rip), %xmm3    # 0x27710
subsd %xmm3, %xmm2
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x20(%rax)
jmp 0x152e5
jmp 0x152e5
jmp 0x152e7
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x15010
jmp 0x152f7
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x14ff0
jmp 0x15307
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x14fd0
jmp 0x15317
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x14f5d
movq -0x20(%rbp), %rdi
callq 0x2080
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x14ec1
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)