#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double atof(char *);
double atoi(char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strtok(char *, char *);
int /*<<< orphan*/ write_curvilinear_mesh(char *, int, int *, float *, int,
                                          int *, int *, char const **,
                                          float **);
int main(int argc, char *argv[]) {
  FILE *file = fopen(argv[1], "r");
  char str[500];
  int dims[] = {96, 96, 288};
  int nvars = 1;
  int vardims[] = {1};
  int centering[] = {1};
  int i, j, k;
  const char *varnames[] = {"zonal"};
  float *pts = (float *)malloc(96 * 96 * 288 * 3 * sizeof(float));
  float *zonal = (float *)malloc(96 * 96 * 288 * sizeof(float));
  float *vars[] = {(float *)zonal};
  int x = 0;
  int y = 0;
  int z = 0;
  int index = 0;
  for (int i = 0; i < 288; i++) {
    for (int j = 0; j < 96; j++) {
      for (int k = 0; k < 96; k++) {
        pts[index++] = k;
        pts[index++] = j;
        pts[index++] = i;
      }
    }
  }
  while (fgets(str, 500, file) != NULL) {
    char line[500];
    strcpy(line, str);
    if ((index / 3) % 10000 == 0) {
      printf("Processed %d lines\n", index / 3);
    }
    if (strlen(line) >= 2) {
      int count = 0;
      for (char *token = strtok(line, "\t"); token != NULL;
           token = strtok(NULL, "\t")) {
        if (count < 3) {
          double point_val = atoi(token);
          if (count == 0) {
            x = point_val;
          } else if (count == 1) {
            y = point_val;
          } else {
            z = point_val;
          }
          count++;
        } else {
          double val = atof(token);
          int pos = z * 96 * 96 + y * 96 + x;
          zonal[pos] = val;
        }
      }
    }
  }
  int pos = 30 * 96 * 96 + 21 * 96 + 50;
  printf("%f\n", zonal[pos]);
  write_curvilinear_mesh(argv[2], 1, dims, pts, nvars, vardims, centering,
                         varnames, vars);
  free(zonal);
  free(pts);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe28(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    0xe3c(%rip),%rax
mov    %rax,-0x21c(%rbp)
mov    0xe37(%rip),%eax
mov    %eax,-0x214(%rbp)
movl   $0x1,-0x220(%rbp)
mov    0xe25(%rip),%eax
mov    %eax,-0x224(%rbp)
mov    0xe19(%rip),%eax
mov    %eax,-0x228(%rbp)
mov    0x2bf4(%rip),%rax
mov    %rax,-0x240(%rbp)
mov    $0x1e60000,%edi
call   1090 <malloc@plt>
mov    %rax,-0x248(%rbp)
mov    $0xa20000,%edi
call   1090 <malloc@plt>
mov    %rax,-0x250(%rbp)
mov    -0x250(%rbp),%rax
mov    %rax,-0x258(%rbp)
movl   $0x0,-0x25c(%rbp)
movl   $0x0,-0x260(%rbp)
movl   $0x0,-0x264(%rbp)
movl   $0x0,-0x268(%rbp)
movl   $0x0,-0x26c(%rbp)
cmpl   $0x120,-0x26c(%rbp)
jge    1389 <main+0x1d9>
movl   $0x0,-0x270(%rbp)
cmpl   $0x60,-0x270(%rbp)
jge    1370 <main+0x1c0>
movl   $0x0,-0x274(%rbp)
cmpl   $0x60,-0x274(%rbp)
jge    1357 <main+0x1a7>
cvtsi2ssl -0x274(%rbp),%xmm0
ff
mov    -0x248(%rbp),%rax
mov    -0x268(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x268(%rbp)
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
cvtsi2ssl -0x270(%rbp),%xmm0
ff
mov    -0x248(%rbp),%rax
mov    -0x268(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x268(%rbp)
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
cvtsi2ssl -0x26c(%rbp),%xmm0
ff
mov    -0x248(%rbp),%rax
mov    -0x268(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x268(%rbp)
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x274(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x274(%rbp)
jmp    12be <main+0x10e>
jmp    135c <main+0x1ac>
mov    -0x270(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x270(%rbp)
jmp    12a7 <main+0xf7>
jmp    1375 <main+0x1c5>
mov    -0x26c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x26c(%rbp)
jmp    128d <main+0xdd>
jmp    138e <main+0x1de>
lea    -0x210(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x1f4,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1549 <main+0x399>
lea    -0x470(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x268(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    $0x2710,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13fd <main+0x24d>
mov    -0x268(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
lea    0xc10(%rip),%rdi
call   1070 <printf@plt>
lea    -0x470(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x2,%eax
jl     1544 <main+0x394>
movl   $0x0,-0x474(%rbp)
lea    -0x470(%rbp),%rdi
lea    0xbf2(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x480(%rbp)
cmpq   $0x0,-0x480(%rbp)
je     153f <main+0x38f>
cmpl   $0x3,-0x474(%rbp)
jge    14cc <main+0x31c>
mov    -0x480(%rbp),%rdi
call   10d0 <atoi@plt>
movsd  %xmm0,-0x488(%rbp)
ff
cmpl   $0x0,-0x474(%rbp)
jne    1485 <main+0x2d5>
cvttsd2si -0x488(%rbp),%eax
ff
mov    %eax,-0x25c(%rbp)
jmp    14b8 <main+0x308>
cmpl   $0x1,-0x474(%rbp)
jne    14a5 <main+0x2f5>
cvttsd2si -0x488(%rbp),%eax
ff
mov    %eax,-0x260(%rbp)
jmp    14b3 <main+0x303>
cvttsd2si -0x488(%rbp),%eax
ff
mov    %eax,-0x264(%rbp)
jmp    14b8 <main+0x308>
mov    -0x474(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x474(%rbp)
jmp    151e <main+0x36e>
mov    -0x480(%rbp),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x490(%rbp)
ff
imul   $0x60,-0x264(%rbp),%eax
imul   $0x60,%eax,%eax
imul   $0x60,-0x260(%rbp),%ecx
add    %ecx,%eax
add    -0x25c(%rbp),%eax
mov    %eax,-0x494(%rbp)
movsd  -0x490(%rbp),%xmm0
ff
cvtsd2ss %xmm0,%xmm0
mov    -0x250(%rbp),%rax
movslq -0x494(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    1523 <main+0x373>
xor    %eax,%eax
mov    %eax,%edi
lea    0xaee(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x480(%rbp)
jmp    1436 <main+0x286>
jmp    1544 <main+0x394>
jmp    138e <main+0x1de>
movl   $0x44012,-0x498(%rbp)
mov    -0x250(%rbp),%rax
movslq -0x498(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xab1(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x21c(%rbp),%rdx
mov    -0x248(%rbp),%rcx
mov    -0x220(%rbp),%r8d
lea    -0x224(%rbp),%r9
lea    -0x228(%rbp),%r11
lea    -0x240(%rbp),%r10
lea    -0x258(%rbp),%rax
mov    $0x1,%esi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   10a0 <write_curvilinear_mesh@plt>
mov    -0x250(%rbp),%rdi
call   1030 <free@plt>
mov    -0x248(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x4b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x448,%rsp
mov    %rsi,0x20(%rsp)
mov    0x8(%rsi),%rdi
lea    0xe5f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,0x10(%rsp)
mov    0xe7b(%rip),%eax
mov    %eax,0x48(%rsp)
mov    0xe68(%rip),%rax
mov    %rax,0x40(%rsp)
movl   $0x1,0xc(%rsp)
movl   $0x1,0x8(%rsp)
lea    0xe2a(%rip),%rax
mov    %rax,0x38(%rsp)
mov    $0x1e60000,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    $0xa20000,%edi
call   1090 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %rax,0x30(%rsp)
xor    %ebp,%ebp
movaps 0xdc8(%rip),%xmm8
movdqa 0xdcf(%rip),%xmm9
movdqa 0xdd6(%rip),%xmm10
xor    %eax,%eax
nopl   0x0(%rax)
xorps  %xmm3,%xmm3
cvtsi2ss %eax,%xmm3
shufps $0x0,%xmm3,%xmm3
xor    %ecx,%ecx
nopl   (%rax)
movslq %ebp,%rbp
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
shufps $0x0,%xmm0,%xmm0
lea    (%rbx,%rbp,4),%rdx
add    $0x120,%rbp
xor    %esi,%esi
movaps %xmm8,%xmm5
nop
cvtdq2ps %xmm5,%xmm7
movaps %xmm3,%xmm6
shufps $0xd4,%xmm7,%xmm6
movaps %xmm0,%xmm4
movlhps %xmm7,%xmm4
shufps $0x82,%xmm6,%xmm4
movaps %xmm3,%xmm6
shufps $0x11,%xmm0,%xmm6
movaps %xmm7,%xmm1
unpckhpd %xmm0,%xmm1
movaps %xmm6,%xmm2
shufps $0x82,%xmm1,%xmm2
movaps %xmm0,%xmm1
shufps $0xff,%xmm3,%xmm1
shufps $0x23,%xmm3,%xmm7
shufps $0x82,%xmm1,%xmm7
movups %xmm7,0x20(%rdx,%rsi,1)
movups %xmm2,0x10(%rdx,%rsi,1)
movups %xmm4,(%rdx,%rsi,1)
movaps %xmm5,%xmm2
paddd  %xmm9,%xmm2
cvtdq2ps %xmm2,%xmm2
movaps %xmm3,%xmm4
shufps $0xd4,%xmm2,%xmm4
movaps %xmm0,%xmm7
movlhps %xmm2,%xmm7
shufps $0x82,%xmm4,%xmm7
movaps %xmm2,%xmm4
unpckhpd %xmm0,%xmm4
shufps $0x82,%xmm4,%xmm6
shufps $0x23,%xmm3,%xmm2
shufps $0x82,%xmm1,%xmm2
movups %xmm2,0x50(%rdx,%rsi,1)
movups %xmm6,0x40(%rdx,%rsi,1)
movups %xmm7,0x30(%rdx,%rsi,1)
paddd  %xmm10,%xmm5
add    $0x60,%rsi
cmp    $0x480,%rsi
jne    1280 <main+0xd0>
add    $0x1,%ecx
cmp    $0x60,%ecx
jne    1260 <main+0xb0>
add    $0x1,%eax
cmp    $0x120,%eax
jne    1250 <main+0xa0>
lea    0x50(%rsp),%rdi
mov    $0x1f4,%esi
mov    0x10(%rsp),%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     14a7 <main+0x2f7>
movslq %ebp,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
movslq %eax,%rdx
imul   $0x68db8bad,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
imul   $0x2710,%eax,%eax
cvtsi2ss %edx,%xmm0
movss  %xmm0,0x4(%rsp)
sub    %eax,%edx
mov    %rdx,0x28(%rsp)
xor    %r14d,%r14d
lea    0x250(%rsp),%rbp
lea    0x50(%rsp),%r15
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    13d8 <main+0x228>
xchg   %ax,%ax
lea    0x50(%rsp),%r15
mov    %r15,%rdi
mov    $0x1f4,%esi
mov    0x10(%rsp),%rdx
call   1080 <fgets@plt>
test   %rax,%rax
lea    0x250(%rsp),%rbp
je     14a7 <main+0x2f7>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
cmpl   $0x0,0x28(%rsp)
jne    13fc <main+0x24c>
lea    0xc47(%rip),%rdi
movss  0x4(%rsp),%xmm0
call   1070 <printf@plt>
mov    %rbp,%rdi
call   1060 <strlen@plt>
cmp    $0x2,%eax
jl     13b0 <main+0x200>
mov    %rbp,%rdi
lea    0xc39(%rip),%rbp
mov    %rbp,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
je     13b0 <main+0x200>
xor    %r15d,%r15d
jmp    146d <main+0x2bd>
cs nopw 0x0(%rax,%rax,1)
nop
call   1050 <atof@plt>
lea    0x0(%r13,%r13,8),%eax
shl    $0xa,%eax
lea    (%r12,%r12,2),%ecx
shl    $0x5,%ecx
add    %eax,%ecx
add    %r14d,%ecx
cvtsd2ss %xmm0,%xmm0
movslq %ecx,%rax
mov    0x18(%rsp),%rcx
movss  %xmm0,(%rcx,%rax,4)
xor    %edi,%edi
mov    %rbp,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
je     13b0 <main+0x200>
mov    %rax,%rdi
cmp    $0x2,%r15d
jg     1430 <main+0x280>
call   10d0 <atoi@plt>
cmp    $0x1,%r15d
je     1491 <main+0x2e1>
test   %r15d,%r15d
jne    149c <main+0x2ec>
cvttsd2si %xmm0,%r14d
add    $0x1,%r15d
jmp    145a <main+0x2aa>
cvttsd2si %xmm0,%r12d
add    $0x1,%r15d
jmp    145a <main+0x2aa>
cvttsd2si %xmm0,%r13d
add    $0x1,%r15d
jmp    145a <main+0x2aa>
mov    0x18(%rsp),%rbp
movss  0x110048(%rbp),%xmm0
lea    0xb93(%rip),%rdi
call   1070 <printf@plt>
mov    0x20(%rsp),%rax
mov    0x10(%rax),%rdi
sub    $0x8,%rsp
lea    0x38(%rsp),%rax
lea    0x40(%rsp),%r11
lea    0x10(%rsp),%r10
lea    0x48(%rsp),%rdx
lea    0x14(%rsp),%r9
mov    $0x1,%esi
mov    %rbx,%rcx
mov    $0x1,%r8d
push   %rax
push   %r11
push   %r10
call   10a0 <write_curvilinear_mesh@plt>
add    $0x20,%rsp
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x448,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@__const.main.dims = [3 x i32] [i32 96, i32 96, i32 288]
@__const.main.vardims = [1 x i32] [i32 1]
@__const.main.centering = [1 x i32] [i32 1]
@.str.1 = [6 x i8] c"zonal\00"
@__const.main.varnames = [1 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [20 x i8] c"Processed %d lines\0A\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [500 x i8]
%8 = alloca [3 x i32]
%9 = alloca i32
%10 = alloca [1 x i32]
%11 = alloca [1 x i32]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [1 x i8*]
%16 = alloca float*
%17 = alloca float*
%18 = alloca [1 x float*]
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca [500 x i8]
%27 = alloca i32
%28 = alloca i8*
%29 = alloca double
%30 = alloca double
%31 = alloca i32
%32 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32* @fopen(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %36, i32** %6
%37 = bitcast [3 x i32]* %8 to i8*
store i32 1, i32* %9
%38 = bitcast [1 x i32]* %10 to i8*
%39 = bitcast [1 x i32]* %11 to i8*
%40 = bitcast [1 x i8*]* %15 to i8*
%41 = call i64 @malloc(i32 31850496)
%42 = inttoptr i64 %41 to float*
store float* %42, float** %16
%43 = call i64 @malloc(i32 10616832)
%44 = inttoptr i64 %43 to float*
store float* %44, float** %17
%45 = getelementptr inbounds [1 x float*], [1 x float*]* %18, i64 0, i64 0
%46 = load float*, float** %17
store float* %46, float** %45
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %21
store i32 0, i32* %22
store i32 0, i32* %23
br label %47
47: ; preds = %88, %2
%48 = load i32, i32* %23
%49 = icmp slt i32 %48, 288
br i1 %49, label %50, label %91
50: ; preds = %47
store i32 0, i32* %24
br label %51
51: ; preds = %84, %50
%52 = load i32, i32* %24
%53 = icmp slt i32 %52, 96
br i1 %53, label %54, label %87
54: ; preds = %51
store i32 0, i32* %25
br label %55
55: ; preds = %80, %54
%56 = load i32, i32* %25
%57 = icmp slt i32 %56, 96
br i1 %57, label %58, label %83
58: ; preds = %55
%59 = load i32, i32* %25
%60 = sitofp i32 %59 to float
%61 = load float*, float** %16
%62 = load i32, i32* %22
%63 = add nsw i32 %62, 1
store i32 %63, i32* %22
%64 = sext i32 %62 to i64
%65 = getelementptr inbounds float, float* %61, i64 %64
store float %60, float* %65
%66 = load i32, i32* %24
%67 = sitofp i32 %66 to float
%68 = load float*, float** %16
%69 = load i32, i32* %22
%70 = add nsw i32 %69, 1
store i32 %70, i32* %22
%71 = sext i32 %69 to i64
%72 = getelementptr inbounds float, float* %68, i64 %71
store float %67, float* %72
%73 = load i32, i32* %23
%74 = sitofp i32 %73 to float
%75 = load float*, float** %16
%76 = load i32, i32* %22
%77 = add nsw i32 %76, 1
store i32 %77, i32* %22
%78 = sext i32 %76 to i64
%79 = getelementptr inbounds float, float* %75, i64 %78
store float %74, float* %79
br label %80
80: ; preds = %58
%81 = load i32, i32* %25
%82 = add nsw i32 %81, 1
store i32 %82, i32* %25
br label %55
83: ; preds = %55
br label %84
84: ; preds = %83
%85 = load i32, i32* %24
%86 = add nsw i32 %85, 1
store i32 %86, i32* %24
br label %51
87: ; preds = %51
br label %88
88: ; preds = %87
%89 = load i32, i32* %23
%90 = add nsw i32 %89, 1
store i32 %90, i32* %23
br label %47
91: ; preds = %47
br label %92
92: ; preds = %165, %91
%93 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%94 = load i32*, i32** %6
%95 = call i32* @fgets(i8* %93, i32 500, i32* %94)
%96 = icmp ne i32* %95, null
br i1 %96, label %97, label %166
97: ; preds = %92
%98 = getelementptr inbounds [500 x i8], [500 x i8]* %26, i64 0, i64 0
%99 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%100 = call i32 @strcpy(i8* %98, i8* %99)
%101 = load i32, i32* %22
%102 = sdiv i32 %101, 3
%103 = srem i32 %102, 10000
%104 = icmp eq i32 %103, 0
br i1 %104, label %105, label %110
105: ; preds = %97
%106 = load i32, i32* %22
%107 = sdiv i32 %106, 3
%108 = sitofp i32 %107 to float
%109 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), float %108)
br label %110
110: ; preds = %105, %97
%111 = getelementptr inbounds [500 x i8], [500 x i8]* %26, i64 0, i64 0
%112 = call i32 @strlen(i8* %111)
%113 = icmp sge i32 %112, 2
br i1 %113, label %114, label %165
114: ; preds = %110
store i32 0, i32* %27
%115 = getelementptr inbounds [500 x i8], [500 x i8]* %26, i64 0, i64 0
%116 = call i8* @strtok(i8* %115, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %116, i8** %28
br label %117
117: ; preds = %162, %114
%118 = load i8*, i8** %28
%119 = icmp ne i8* %118, null
br i1 %119, label %120, label %164
120: ; preds = %117
%121 = load i32, i32* %27
%122 = icmp slt i32 %121, 3
br i1 %122, label %123, label %144
123: ; preds = %120
%124 = load i8*, i8** %28
%125 = call double @atoi(i8* %124)
store double %125, double* %29
%126 = load i32, i32* %27
%127 = icmp eq i32 %126, 0
br i1 %127, label %128, label %131
128: ; preds = %123
%129 = load double, double* %29
%130 = fptosi double %129 to i32
store i32 %130, i32* %19
br label %141
131: ; preds = %123
%132 = load i32, i32* %27
%133 = icmp eq i32 %132, 1
br i1 %133, label %134, label %137
134: ; preds = %131
%135 = load double, double* %29
%136 = fptosi double %135 to i32
store i32 %136, i32* %20
br label %140
137: ; preds = %131
%138 = load double, double* %29
%139 = fptosi double %138 to i32
store i32 %139, i32* %21
br label %140
140: ; preds = %137, %134
br label %141
141: ; preds = %140, %128
%142 = load i32, i32* %27
%143 = add nsw i32 %142, 1
store i32 %143, i32* %27
br label %161
144: ; preds = %120
%145 = load i8*, i8** %28
%146 = call double @atof(i8* %145)
store double %146, double* %30
%147 = load i32, i32* %21
%148 = mul nsw i32 %147, 96
%149 = mul nsw i32 %148, 96
%150 = load i32, i32* %20
%151 = mul nsw i32 %150, 96
%152 = add nsw i32 %149, %151
%153 = load i32, i32* %19
%154 = add nsw i32 %152, %153
store i32 %154, i32* %31
%155 = load double, double* %30
%156 = fptrunc double %155 to float
%157 = load float*, float** %17
%158 = load i32, i32* %31
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds float, float* %157, i64 %159
store float %156, float* %160
br label %161
161: ; preds = %144, %141
br label %162
162: ; preds = %161
%163 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %163, i8** %28
br label %117
164: ; preds = %117
br label %165
165: ; preds = %164, %110
br label %92
166: ; preds = %92
store i32 278546, i32* %32
%167 = load float*, float** %17
%168 = load i32, i32* %32
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds float, float* %167, i64 %169
%171 = load float, float* %170
%172 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), float %171)
%173 = load i8**, i8*** %5
%174 = getelementptr inbounds i8*, i8** %173, i64 2
%175 = load i8*, i8** %174
%176 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%177 = load float*, float** %16
%178 = load i32, i32* %9
%179 = getelementptr inbounds [1 x i32], [1 x i32]* %10, i64 0, i64 0
%180 = getelementptr inbounds [1 x i32], [1 x i32]* %11, i64 0, i64 0
%181 = getelementptr inbounds [1 x i8*], [1 x i8*]* %15, i64 0, i64 0
%182 = getelementptr inbounds [1 x float*], [1 x float*]* %18, i64 0, i64 0
%183 = call i32 @write_curvilinear_mesh(i8* %175, i32 1, i32* %176, float* %177, i32 %178, i32* %179, i32* %180, i8** %181, float** %182)
%184 = load float*, float** %17
%185 = call i32 @free(float* %184)
%186 = load float*, float** %16
%187 = call i32 @free(float* %186)
%188 = load i32, i32* %3
ret i32 %188
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@__const.main.dims = [3 x i32] [i32 96, i32 96, i32 288]
@.str.1 = [6 x i8] c"zonal\00"
@.str.2 = [20 x i8] c"Processed %d lines\0A\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [500 x i8]
%4 = alloca [3 x i32]
%5 = alloca [1 x i32]
%6 = alloca [1 x i32]
%7 = alloca [1 x i8*]
%8 = alloca [1 x float*]
%9 = alloca [500 x i8]
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%14 = bitcast [3 x i32]* %4 to i8*
%15 = bitcast [1 x i32]* %5 to i8*
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 1, i32* %16
%17 = bitcast [1 x i32]* %6 to i8*
%18 = getelementptr inbounds [1 x i32], [1 x i32]* %6, i64 0, i64 0
store i32 1, i32* %18
%19 = bitcast [1 x i8*]* %7 to i8*
%20 = bitcast [1 x i8*]* %7 to i64*
store i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64* %20
%21 = tail call i64 @malloc(i32 31850496)
%22 = inttoptr i64 %21 to float*
%23 = tail call i64 @malloc(i32 10616832)
%24 = inttoptr i64 %23 to float*
%25 = bitcast [1 x float*]* %8 to i8*
%26 = getelementptr inbounds [1 x float*], [1 x float*]* %8, i64 0, i64 0
store float* %24, float** %26
br label %27
27: ; preds = %2, %75
%28 = phi i64 [ 0, %2 ], [ %50, %75 ]
%29 = phi i32 [ 0, %2 ], [ %76, %75 ]
%30 = sitofp i32 %29 to float
%31 = insertelement <4 x float> poison, float %30, i64 0
%32 = shufflevector <4 x float> %31, <4 x float> poison, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 undef, i32 undef, i32 undef, i32 undef>
%33 = shufflevector <4 x float> %31, <4 x float> poison, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 undef, i32 undef, i32 undef, i32 undef>
br label %44
34: ; preds = %75
%35 = call i32* @fgets(i8* %13, i32 500, i32* %12)
%36 = icmp eq i32* %35, null
br i1 %36, label %136, label %37
37: ; preds = %34
%38 = trunc i64 %50 to i32
%39 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 0
%40 = sdiv i32 %38, 3
%41 = srem i32 %40, 10000
%42 = icmp eq i32 %41, 0
%43 = sitofp i32 %40 to float
br label %81
44: ; preds = %27, %78
%45 = phi i64 [ %28, %27 ], [ %50, %78 ]
%46 = phi i32 [ 0, %27 ], [ %79, %78 ]
%47 = shl i64 %45, 32
%48 = ashr exact i64 %47, 32
%49 = sitofp i32 %46 to float
%50 = add nsw i64 %48, 288
%51 = insertelement <4 x float> poison, float %49, i64 0
%52 = shufflevector <4 x float> %51, <4 x float> poison, <4 x i32> zeroinitializer
br label %53
53: ; preds = %53, %44
%54 = phi i64 [ 0, %44 ], [ %72, %53 ]
%55 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %44 ], [ %73, %53 ]
%56 = mul nuw nsw i64 %54, 3
%57 = add nsw i64 %48, %56
%58 = sitofp <4 x i32> %55 to <4 x float>
%59 = getelementptr inbounds float, float* %22, i64 %57
%60 = bitcast float* %59 to <12 x float>*
%61 = shufflevector <4 x float> %58, <4 x float> %52, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%62 = shufflevector <8 x float> %61, <8 x float> %32, <12 x i32> <i32 0, i32 4, i32 8, i32 1, i32 5, i32 9, i32 2, i32 6, i32 10, i32 3, i32 7, i32 11>
store <12 x float> %62, <12 x float>* %60
%63 = or i64 %54, 4
%64 = add <4 x i32> %55, <i32 4, i32 4, i32 4, i32 4>
%65 = mul nuw nsw i64 %63, 3
%66 = add nsw i64 %48, %65
%67 = sitofp <4 x i32> %64 to <4 x float>
%68 = getelementptr inbounds float, float* %22, i64 %66
%69 = bitcast float* %68 to <12 x float>*
%70 = shufflevector <4 x float> %67, <4 x float> %52, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%71 = shufflevector <8 x float> %70, <8 x float> %33, <12 x i32> <i32 0, i32 4, i32 8, i32 1, i32 5, i32 9, i32 2, i32 6, i32 10, i32 3, i32 7, i32 11>
store <12 x float> %71, <12 x float>* %69
%72 = add nuw nsw i64 %54, 8
%73 = add <4 x i32> %55, <i32 8, i32 8, i32 8, i32 8>
%74 = icmp eq i64 %72, 96
br i1 %74, label %78, label %53
75: ; preds = %78
%76 = add nuw nsw i32 %29, 1
%77 = icmp eq i32 %76, 288
br i1 %77, label %34, label %27
78: ; preds = %53
%79 = add nuw nsw i32 %46, 1
%80 = icmp eq i32 %79, 96
br i1 %80, label %75, label %44
81: ; preds = %37, %130
%82 = phi i32 [ 0, %37 ], [ %133, %130 ]
%83 = phi i32 [ 0, %37 ], [ %132, %130 ]
%84 = phi i32 [ 0, %37 ], [ %131, %130 ]
%85 = call i32 @strcpy(i8* %39, i8* %13)
br i1 %42, label %86, label %88
86: ; preds = %81
%87 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), float %43)
br label %88
88: ; preds = %86, %81
%89 = call i32 @strlen(i8* %39)
%90 = icmp sgt i32 %89, 1
br i1 %90, label %91, label %130
91: ; preds = %88
%92 = call i8* @strtok(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%93 = icmp eq i8* %92, null
br i1 %93, label %130, label %94
94: ; preds = %91, %123
%95 = phi i32 [ %127, %123 ], [ %82, %91 ]
%96 = phi i32 [ %126, %123 ], [ %83, %91 ]
%97 = phi i32 [ %125, %123 ], [ %84, %91 ]
%98 = phi i8* [ %128, %123 ], [ %92, %91 ]
%99 = phi i32 [ %124, %123 ], [ 0, %91 ]
%100 = icmp slt i32 %99, 3
br i1 %100, label %101, label %114
101: ; preds = %94
%102 = call double @atoi(i8* %98)
switch i32 %99, label %107 [
i32 0, label %103
i32 1, label %105
]
103: ; preds = %101
%104 = fptosi double %102 to i32
br label %109
105: ; preds = %101
%106 = fptosi double %102 to i32
br label %109
107: ; preds = %101
%108 = fptosi double %102 to i32
br label %109
109: ; preds = %105, %107, %103
%110 = phi i32 [ %97, %103 ], [ %97, %105 ], [ %108, %107 ]
%111 = phi i32 [ %96, %103 ], [ %106, %105 ], [ %96, %107 ]
%112 = phi i32 [ %104, %103 ], [ %95, %105 ], [ %95, %107 ]
%113 = add nsw i32 %99, 1
br label %123
114: ; preds = %94
%115 = call double @atof(i8* %98)
%116 = mul i32 %97, 9216
%117 = mul nsw i32 %96, 96
%118 = add nsw i32 %117, %116
%119 = add nsw i32 %118, %95
%120 = fptrunc double %115 to float
%121 = sext i32 %119 to i64
%122 = getelementptr inbounds float, float* %24, i64 %121
store float %120, float* %122
br label %123
123: ; preds = %109, %114
%124 = phi i32 [ %113, %109 ], [ %99, %114 ]
%125 = phi i32 [ %110, %109 ], [ %97, %114 ]
%126 = phi i32 [ %111, %109 ], [ %96, %114 ]
%127 = phi i32 [ %112, %109 ], [ %95, %114 ]
%128 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%129 = icmp eq i8* %128, null
br i1 %129, label %130, label %94
130: ; preds = %123, %91, %88
%131 = phi i32 [ %84, %88 ], [ %84, %91 ], [ %125, %123 ]
%132 = phi i32 [ %83, %88 ], [ %83, %91 ], [ %126, %123 ]
%133 = phi i32 [ %82, %88 ], [ %82, %91 ], [ %127, %123 ]
%134 = call i32* @fgets(i8* %13, i32 500, i32* %12)
%135 = icmp eq i32* %134, null
br i1 %135, label %136, label %81
136: ; preds = %130, %34
%137 = getelementptr inbounds float, float* %24, i64 278546
%138 = load float, float* %137
%139 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), float %138)
%140 = getelementptr inbounds i8*, i8** %1, i64 2
%141 = load i8*, i8** %140
%142 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%143 = getelementptr inbounds [1 x i8*], [1 x i8*]* %7, i64 0, i64 0
%144 = call i32 @write_curvilinear_mesh(i8* %141, i32 1, i32* %142, float* %22, i32 1, i32* %16, i32* %18, i8** %143, float** %26)
%145 = call i32 @free(float* %24)
%146 = call i32 @free(float* %22)
ret i32 0
}