#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 */
int /*<<< orphan*/ CloseFile(int /*<<< orphan*/ **);
scalar_t__ GetALine(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *OpenFile(char *, char *);
int /*<<< orphan*/ callSystem(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, double *);
void monthlyClimate2(int nSites, double latitudes[], double longitudes[],
                     char *siteDirs[], int yearLow, int yearHigh, int type) {
  char temp[4096], inBuf[4096], systemCall[32784];
  int i, j, yr, mo, yrHigh = yearHigh, yrLow = yearLow;
  double value;
  if (type == 0)
    sprintf(temp, "%s%s", "griblargeC2//", "pgbh06.gdas.R_H.2m.grb2");
  else if (type == 1)
    sprintf(temp, "%s%s", "griblargeC2//", "flxf06.gdas.WND.10m.grb2");
  else if (type == 2)
    sprintf(temp, "%s%s", "griblargeC2//", "flxf06.gdas.T_CDC.EATM.grb2");
  sprintf(systemCall, "./wgrib2 %s", temp);
  for (i = 0; i < nSites; i++) {
    sprintf(systemCall, "%s -lon %5.4f %5.4f", systemCall, longitudes[i],
            latitudes[i]);
  }
  sprintf(systemCall,
          "%s | grep -o ',val=[\\-]*[0-9.0-9]\\{1,\\}[e]*[\\-]*[0-9]*'",
          systemCall);
  if (type == 0)
    sprintf(systemCall, "%s > temporary_dy//rh.txt", systemCall);
  else if (type == 1)
    sprintf(systemCall, "%s > temporary_dy//ws.txt", systemCall);
  else if (type == 2)
    sprintf(systemCall, "%s > temporary_dy//cc.txt", systemCall);
  callSystem(systemCall);
  FILE *siteFiles[nSites];
  for (i = 0; i < nSites; i++) {
    if (type == 0)
      sprintf(temp, "%s//rh.txt", siteDirs[i]);
    else if (type == 1)
      sprintf(temp, "%s//ws.txt", siteDirs[i]);
    else if (type == 2)
      sprintf(temp, "%s//cc.txt", siteDirs[i]);
    siteFiles[i] = OpenFile(temp, "w");
  }
  if (type == 0)
    sprintf(temp, "temporary_dy//rh.txt");
  else if (type == 1)
    sprintf(temp, "temporary_dy//ws.txt");
  else if (type == 2)
    sprintf(temp, "temporary_dy//cc.txt");
  FILE *inFile = OpenFile(temp, "r");
  if (yrHigh == 2010) {
    yrHigh = 2009;
    if (yearLow == 2010)
      yrLow = 2009;
  }
  i = j = 0;
  mo = 1;
  yr = 1979;
  while (GetALine(inFile, inBuf) && (yr <= yrHigh)) {
    sscanf(inBuf, ",val=%lf", &value);
    if (yr >= yrLow)
      fprintf(siteFiles[i], "%5.6f\n", value);
    i++;
    if (i >= nSites) {
      i = 0;
      if (type == 1) {
        j++;
        if (j > 1) {
          mo++;
          j = 0;
        }
      } else
        mo++;
      if (mo > 12) {
        mo = 1;
        yr++;
      }
    }
  }
  for (i = 0; i < nSites; i++)
    CloseFile(&siteFiles[i]);
  CloseFile(&inFile);
}


x86 assembly (clang, -O0):
<monthlyClimate2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa090,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0xa054(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xa058(%rbp)
cmpl   $0x0,0x10(%rbp)
jne    11d9 <monthlyClimate2+0x69>
lea    -0x1030(%rbp),%rdi
lea    0xe41(%rip),%rsi
lea    0xe3f(%rip),%rdx
lea    0xe46(%rip),%rcx
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1242 <monthlyClimate2+0xd2>
cmpl   $0x1,0x10(%rbp)
jne    120b <monthlyClimate2+0x9b>
lea    -0x1030(%rbp),%rdi
lea    0xe0f(%rip),%rsi
lea    0xe0d(%rip),%rdx
lea    0xe2c(%rip),%rcx
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    123d <monthlyClimate2+0xcd>
cmpl   $0x2,0x10(%rbp)
jne    1238 <monthlyClimate2+0xc8>
lea    -0x1030(%rbp),%rdi
lea    0xddd(%rip),%rsi
lea    0xddb(%rip),%rdx
lea    0xe13(%rip),%rcx
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    123d <monthlyClimate2+0xcd>
jmp    1242 <monthlyClimate2+0xd2>
lea    -0xa040(%rbp),%rdi
lea    -0x1030(%rbp),%rdx
lea    0xe09(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
movl   $0x0,-0xa044(%rbp)
mov    -0xa044(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12c7 <monthlyClimate2+0x157>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0xa044(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0xa044(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xdc0(%rip),%rsi
mov    $0x2,%al
call   1090 <sprintf@plt>
mov    -0xa044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa044(%rbp)
jmp    1268 <monthlyClimate2+0xf8>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
lea    0xda4(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
cmpl   $0x0,0x10(%rbp)
jne    130e <monthlyClimate2+0x19e>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
lea    0xdb6(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1369 <monthlyClimate2+0x1f9>
cmpl   $0x1,0x10(%rbp)
jne    1339 <monthlyClimate2+0x1c9>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
lea    0xda5(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1364 <monthlyClimate2+0x1f4>
cmpl   $0x2,0x10(%rbp)
jne    135f <monthlyClimate2+0x1ef>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
lea    0xd94(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1364 <monthlyClimate2+0x1f4>
jmp    1369 <monthlyClimate2+0x1f9>
lea    -0xa040(%rbp),%rdi
call   1060 <callSystem@plt>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0xa068(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa080(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xa070(%rbp)
movl   $0x0,-0xa044(%rbp)
mov    -0xa044(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1498 <monthlyClimate2+0x328>
cmpl   $0x0,0x10(%rbp)
jne    13f1 <monthlyClimate2+0x281>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd21(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    145c <monthlyClimate2+0x2ec>
cmpl   $0x1,0x10(%rbp)
jne    1424 <monthlyClimate2+0x2b4>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcf9(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1457 <monthlyClimate2+0x2e7>
cmpl   $0x2,0x10(%rbp)
jne    1452 <monthlyClimate2+0x2e2>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcd1(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1457 <monthlyClimate2+0x2e7>
jmp    145c <monthlyClimate2+0x2ec>
lea    -0x1030(%rbp),%rdi
lea    0xcbd(%rip),%rsi
call   1040 <OpenFile@plt>
mov    %rax,%rdx
mov    -0xa080(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xa044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa044(%rbp)
jmp    13af <monthlyClimate2+0x23f>
cmpl   $0x0,0x10(%rbp)
jne    14bc <monthlyClimate2+0x34c>
lea    -0x1030(%rbp),%rdi
lea    0xc0d(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1509 <monthlyClimate2+0x399>
cmpl   $0x1,0x10(%rbp)
jne    14e0 <monthlyClimate2+0x370>
lea    -0x1030(%rbp),%rdi
lea    0xc03(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1504 <monthlyClimate2+0x394>
cmpl   $0x2,0x10(%rbp)
jne    14ff <monthlyClimate2+0x38f>
lea    -0x1030(%rbp),%rdi
lea    0xbf9(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1504 <monthlyClimate2+0x394>
jmp    1509 <monthlyClimate2+0x399>
lea    -0x1030(%rbp),%rdi
lea    0xc12(%rip),%rsi
call   1040 <OpenFile@plt>
mov    %rax,-0xa078(%rbp)
cmpl   $0x7da,-0xa054(%rbp)
jne    1559 <monthlyClimate2+0x3e9>
movl   $0x7d9,-0xa054(%rbp)
cmpl   $0x7da,-0x24(%rbp)
jne    1554 <monthlyClimate2+0x3e4>
movl   $0x7d9,-0xa058(%rbp)
jmp    1559 <monthlyClimate2+0x3e9>
movl   $0x0,-0xa048(%rbp)
movl   $0x0,-0xa044(%rbp)
movl   $0x1,-0xa050(%rbp)
movl   $0x7bb,-0xa04c(%rbp)
mov    -0xa078(%rbp),%rdi
lea    -0x2030(%rbp),%rsi
call   1070 <GetALine@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa081(%rbp)
je     15be <monthlyClimate2+0x44e>
mov    -0xa04c(%rbp),%eax
cmp    -0xa054(%rbp),%eax
setle  %al
mov    %al,-0xa081(%rbp)
mov    -0xa081(%rbp),%al
test   $0x1,%al
jne    15d1 <monthlyClimate2+0x461>
jmp    16ce <monthlyClimate2+0x55e>
lea    -0x2030(%rbp),%rdi
lea    0xb4c(%rip),%rsi
lea    -0xa060(%rbp),%rdx
call   1080 <sscanf@plt>
mov    -0xa04c(%rbp),%eax
cmp    -0xa058(%rbp),%eax
jl     1623 <monthlyClimate2+0x4b3>
mov    -0xa080(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movsd  -0xa060(%rbp),%xmm0
ff
lea    0xb16(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xa044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa044(%rbp)
mov    -0xa044(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     16c9 <monthlyClimate2+0x559>
movl   $0x0,-0xa044(%rbp)
cmpl   $0x1,0x10(%rbp)
jne    168f <monthlyClimate2+0x51f>
mov    -0xa048(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa048(%rbp)
cmpl   $0x1,-0xa048(%rbp)
jle    168a <monthlyClimate2+0x51a>
mov    -0xa050(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa050(%rbp)
movl   $0x0,-0xa048(%rbp)
jmp    169e <monthlyClimate2+0x52e>
mov    -0xa050(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa050(%rbp)
cmpl   $0xc,-0xa050(%rbp)
jle    16c4 <monthlyClimate2+0x554>
movl   $0x1,-0xa050(%rbp)
mov    -0xa04c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa04c(%rbp)
jmp    16c9 <monthlyClimate2+0x559>
jmp    1581 <monthlyClimate2+0x411>
movl   $0x0,-0xa044(%rbp)
mov    -0xa044(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1715 <monthlyClimate2+0x5a5>
mov    -0xa080(%rbp),%rdi
movslq -0xa044(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <CloseFile@plt>
mov    -0xa044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa044(%rbp)
jmp    16d8 <monthlyClimate2+0x568>
lea    -0xa078(%rbp),%rdi
call   1030 <CloseFile@plt>
mov    -0xa068(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monthlyClimate2>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa048,%rsp
mov    %r9d,-0x30(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %edi,-0x34(%rbp)
mov    0x10(%rbp),%eax
test   %eax,%eax
mov    %r8d,-0x2c(%rbp)
mov    %rsi,%r12
mov    %rdx,%rbx
je     11b3 <monthlyClimate2+0x43>
cmp    $0x1,%eax
je     11bc <monthlyClimate2+0x4c>
cmp    $0x2,%eax
jne    11df <monthlyClimate2+0x6f>
lea    0xe93(%rip),%rcx
jmp    11c3 <monthlyClimate2+0x53>
lea    0xe59(%rip),%rcx
jmp    11c3 <monthlyClimate2+0x53>
lea    0xe68(%rip),%rcx
lea    0xe36(%rip),%rsi
lea    0xe34(%rip),%rdx
lea    -0x1060(%rbp),%rdi
xor    %eax,%eax
call   1090 <sprintf@plt>
lea    0xe7a(%rip),%rsi
lea    -0xa070(%rbp),%rdi
lea    -0x1060(%rbp),%rdx
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,%r13d
test   %eax,%eax
jle    1239 <monthlyClimate2+0xc9>
xor    %r14d,%r14d
lea    -0xa070(%rbp),%r15
nop
movsd  (%rbx,%r14,8),%xmm0
movsd  (%r12,%r14,8),%xmm1
mov    %r15,%rdi
lea    0xe46(%rip),%rsi
mov    %r15,%rdx
mov    $0x2,%al
call   1090 <sprintf@plt>
add    $0x1,%r14
cmp    %r14,%r13
jne    1210 <monthlyClimate2+0xa0>
lea    0xe40(%rip),%rsi
lea    -0xa070(%rbp),%rdi
mov    %rdi,%rdx
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    0x10(%rbp),%eax
test   %eax,%eax
je     126b <monthlyClimate2+0xfb>
cmp    $0x1,%eax
je     1274 <monthlyClimate2+0x104>
cmp    $0x2,%eax
jne    128c <monthlyClimate2+0x11c>
lea    0xe83(%rip),%rsi
jmp    127b <monthlyClimate2+0x10b>
lea    0xe46(%rip),%rsi
jmp    127b <monthlyClimate2+0x10b>
lea    0xe57(%rip),%rsi
lea    -0xa070(%rbp),%rdi
mov    %rdi,%rdx
xor    %eax,%eax
call   1090 <sprintf@plt>
lea    -0xa070(%rbp),%rdi
call   1060 <callSystem@plt>
mov    %rsp,-0x50(%rbp)
mov    %rsp,%rbx
lea    0xf(,%r13,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
cmpl   $0x0,-0x34(%rbp)
jle    1322 <monthlyClimate2+0x1b2>
lea    -0x1060(%rbp),%r14
lea    0xe62(%rip),%r12
xor    %r15d,%r15d
jmp    1301 <monthlyClimate2+0x191>
nopw   0x0(%rax,%rax,1)
lea    0xe45(%rip),%rsi
mov    -0x40(%rbp),%rax
mov    (%rax,%r15,8),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <OpenFile@plt>
mov    %rax,(%rbx,%r15,8)
add    $0x1,%r15
cmp    %r15,%r13
je     1322 <monthlyClimate2+0x1b2>
lea    0xdfe(%rip),%rsi
mov    0x10(%rbp),%eax
test   %eax,%eax
je     12d7 <monthlyClimate2+0x167>
lea    0xdfb(%rip),%rsi
cmp    $0x1,%eax
je     12d7 <monthlyClimate2+0x167>
cmp    $0x2,%eax
je     12d0 <monthlyClimate2+0x160>
jmp    12e9 <monthlyClimate2+0x179>
mov    0x10(%rbp),%eax
test   %eax,%eax
je     134d <monthlyClimate2+0x1dd>
cmp    $0x2,%eax
je     1367 <monthlyClimate2+0x1f7>
cmp    $0x1,%eax
jne    1386 <monthlyClimate2+0x216>
movups 0xd9d(%rip),%xmm0
movaps %xmm0,-0x1060(%rbp)
movabs $0x7478742e73772f,%rax
jmp    137f <monthlyClimate2+0x20f>
movups 0xd69(%rip),%xmm0
movaps %xmm0,-0x1060(%rbp)
movabs $0x7478742e68722f,%rax
jmp    137f <monthlyClimate2+0x20f>
movups 0xd83(%rip),%xmm0
movaps %xmm0,-0x1060(%rbp)
movabs $0x7478742e63632f,%rax
mov    %rax,-0x1053(%rbp)
lea    0xd9c(%rip),%rsi
lea    -0x1060(%rbp),%rdi
call   1040 <OpenFile@plt>
mov    -0x30(%rbp),%ecx
cmp    $0x7da,%ecx
mov    $0x7d9,%edx
cmove  %edx,%ecx
mov    %ecx,-0x30(%rbp)
mov    -0x2c(%rbp),%ecx
cmovne %ecx,%edx
mov    %rax,-0x48(%rbp)
cmp    $0x7da,%ecx
cmovne %ecx,%edx
mov    %edx,-0x40(%rbp)
lea    -0x2060(%rbp),%rsi
mov    %rax,%rdi
call   1070 <GetALine@plt>
test   %rax,%rax
je     149b <monthlyClimate2+0x32b>
cmpl   $0x7bb,-0x30(%rbp)
jl     149b <monthlyClimate2+0x32b>
mov    $0x7bb,%r14d
xor    %r12d,%r12d
movl   $0x0,-0x2c(%rbp)
mov    $0x1,%r15d
xchg   %ax,%ax
lea    -0x2060(%rbp),%rdi
lea    0xd1d(%rip),%rsi
lea    -0x58(%rbp),%rdx
call   1080 <sscanf@plt>
cmp    -0x40(%rbp),%r14d
jl     1435 <monthlyClimate2+0x2c5>
movslq %r12d,%rax
mov    (%rbx,%rax,8),%rdi
movsd  -0x58(%rbp),%xmm0
lea    0xd04(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x1,%r12d
cmp    -0x34(%rbp),%r12d
jl     147c <monthlyClimate2+0x30c>
cmpl   $0x1,0x10(%rbp)
jne    1460 <monthlyClimate2+0x2f0>
xor    %eax,%eax
xor    %ecx,%ecx
cmpl   $0x0,-0x2c(%rbp)
setle  %al
setg   %cl
add    %ecx,%r15d
mov    %eax,-0x2c(%rbp)
jmp    1464 <monthlyClimate2+0x2f4>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
xor    %eax,%eax
cmp    $0xd,%r15d
setge  %al
mov    $0x1,%ecx
cmovge %ecx,%r15d
add    %eax,%r14d
xor    %r12d,%r12d
mov    -0x48(%rbp),%rdi
lea    -0x2060(%rbp),%rsi
call   1070 <GetALine@plt>
test   %rax,%rax
je     149b <monthlyClimate2+0x32b>
cmp    -0x30(%rbp),%r14d
jle    1400 <monthlyClimate2+0x290>
cmpl   $0x0,-0x34(%rbp)
jle    14c2 <monthlyClimate2+0x352>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <CloseFile@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r13
jne    14b0 <monthlyClimate2+0x340>
lea    -0x48(%rbp),%rdi
call   1030 <CloseFile@plt>
mov    -0x50(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [14 x i8] c"griblargeC2//\00"
@.str.2 = [24 x i8] c"pgbh06.gdas.R_H.2m.grb2\00"
@.str.3 = [25 x i8] c"flxf06.gdas.WND.10m.grb2\00"
@.str.4 = [28 x i8] c"flxf06.gdas.T_CDC.EATM.grb2\00"
@.str.5 = [12 x i8] c"./wgrib2 %s\00"
@.str.6 = [20 x i8] c"%s -lon %5.4f %5.4f\00"
@.str.7 = [56 x i8] c"%s | grep -o ',val=[\\-]*[0-9.0-9]\\{1,\\}[e]*[\\-]*[0-9]*'\00"
@.str.8 = [26 x i8] c"%s > temporary_dy//rh.txt\00"
@.str.9 = [26 x i8] c"%s > temporary_dy//ws.txt\00"
@.str.10 = [26 x i8] c"%s > temporary_dy//cc.txt\00"
@.str.11 = [11 x i8] c"%s//rh.txt\00"
@.str.12 = [11 x i8] c"%s//ws.txt\00"
@.str.13 = [11 x i8] c"%s//cc.txt\00"
@.str.14 = [2 x i8] c"w\00"
@.str.15 = [21 x i8] c"temporary_dy//rh.txt\00"
@.str.16 = [21 x i8] c"temporary_dy//ws.txt\00"
@.str.17 = [21 x i8] c"temporary_dy//cc.txt\00"
@.str.18 = [2 x i8] c"r\00"
@.str.19 = [9 x i8] c",val=%lf\00"
@.str.20 = [7 x i8] c"%5.6f\0A\00"
define void @monthlyClimate2(i32 %0, double* %1, double* %2, i8** %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca i8**
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca [4096 x i8]
%16 = alloca [4096 x i8]
%17 = alloca [32784 x i8]
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double
%25 = alloca i8*
%26 = alloca i64
%27 = alloca i32*
store i32 %0, i32* %8
store double* %1, double** %9
store double* %2, double** %10
store i8** %3, i8*** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%28 = load i32, i32* %13
store i32 %28, i32* %22
%29 = load i32, i32* %12
store i32 %29, i32* %23
%30 = load i32, i32* %14
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %7
%33 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%34 = call i32 (i8*, i8*, ...) @sprintf(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %49
35: ; preds = %7
%36 = load i32, i32* %14
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%40 = call i32 (i8*, i8*, ...) @sprintf(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %48
41: ; preds = %35
%42 = load i32, i32* %14
%43 = icmp eq i32 %42, 2
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%46 = call i32 (i8*, i8*, ...) @sprintf(i8* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %47
47: ; preds = %44, %41
br label %48
48: ; preds = %47, %38
br label %49
49: ; preds = %48, %32
%50 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%51 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%52 = call i32 (i8*, i8*, ...) @sprintf(i8* %50, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %51)
store i32 0, i32* %18
br label %53
53: ; preds = %71, %49
%54 = load i32, i32* %18
%55 = load i32, i32* %8
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %74
57: ; preds = %53
%58 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%59 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%60 = load double*, double** %10
%61 = load i32, i32* %18
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = load double*, double** %9
%66 = load i32, i32* %18
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
%69 = load double, double* %68
%70 = call i32 (i8*, i8*, ...) @sprintf(i8* %58, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %59, double %64, double %69)
br label %71
71: ; preds = %57
%72 = load i32, i32* %18
%73 = add nsw i32 %72, 1
store i32 %73, i32* %18
br label %53
74: ; preds = %53
%75 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%76 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%77 = call i32 (i8*, i8*, ...) @sprintf(i8* %75, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i8* %76)
%78 = load i32, i32* %14
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %84
80: ; preds = %74
%81 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%82 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%83 = call i32 (i8*, i8*, ...) @sprintf(i8* %81, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i8* %82)
br label %100
84: ; preds = %74
%85 = load i32, i32* %14
%86 = icmp eq i32 %85, 1
br i1 %86, label %87, label %91
87: ; preds = %84
%88 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%89 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%90 = call i32 (i8*, i8*, ...) @sprintf(i8* %88, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %89)
br label %99
91: ; preds = %84
%92 = load i32, i32* %14
%93 = icmp eq i32 %92, 2
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%96 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%97 = call i32 (i8*, i8*, ...) @sprintf(i8* %95, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* %96)
br label %98
98: ; preds = %94, %91
br label %99
99: ; preds = %98, %87
br label %100
100: ; preds = %99, %80
%101 = getelementptr inbounds [32784 x i8], [32784 x i8]* %17, i64 0, i64 0
%102 = call i32 @callSystem(i8* %101)
%103 = load i32, i32* %8
%104 = zext i32 %103 to i64
%105 = call i8* @llvm.stacksave()
store i8* %105, i8** %25
%106 = alloca i32*, i64 %104
store i64 %104, i64* %26
store i32 0, i32* %18
br label %107
107: ; preds = %152, %100
%108 = load i32, i32* %18
%109 = load i32, i32* %8
%110 = icmp slt i32 %108, %109
br i1 %110, label %111, label %155
111: ; preds = %107
%112 = load i32, i32* %14
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %122
114: ; preds = %111
%115 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%116 = load i8**, i8*** %11
%117 = load i32, i32* %18
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8*, i8** %116, i64 %118
%120 = load i8*, i8** %119
%121 = call i32 (i8*, i8*, ...) @sprintf(i8* %115, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* %120)
br label %146
122: ; preds = %111
%123 = load i32, i32* %14
%124 = icmp eq i32 %123, 1
br i1 %124, label %125, label %133
125: ; preds = %122
%126 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%127 = load i8**, i8*** %11
%128 = load i32, i32* %18
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8*, i8** %127, i64 %129
%131 = load i8*, i8** %130
%132 = call i32 (i8*, i8*, ...) @sprintf(i8* %126, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8* %131)
br label %145
133: ; preds = %122
%134 = load i32, i32* %14
%135 = icmp eq i32 %134, 2
br i1 %135, label %136, label %144
136: ; preds = %133
%137 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%138 = load i8**, i8*** %11
%139 = load i32, i32* %18
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8*, i8** %138, i64 %140
%142 = load i8*, i8** %141
%143 = call i32 (i8*, i8*, ...) @sprintf(i8* %137, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8* %142)
br label %144
144: ; preds = %136, %133
br label %145
145: ; preds = %144, %125
br label %146
146: ; preds = %145, %114
%147 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%148 = call i32* @OpenFile(i8* %147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%149 = load i32, i32* %18
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i32*, i32** %106, i64 %150
store i32* %148, i32** %151
br label %152
152: ; preds = %146
%153 = load i32, i32* %18
%154 = add nsw i32 %153, 1
store i32 %154, i32* %18
br label %107
155: ; preds = %107
%156 = load i32, i32* %14
%157 = icmp eq i32 %156, 0
br i1 %157, label %158, label %161
158: ; preds = %155
%159 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%160 = call i32 (i8*, i8*, ...) @sprintf(i8* %159, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %175
161: ; preds = %155
%162 = load i32, i32* %14
%163 = icmp eq i32 %162, 1
br i1 %163, label %164, label %167
164: ; preds = %161
%165 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%166 = call i32 (i8*, i8*, ...) @sprintf(i8* %165, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0))
br label %174
167: ; preds = %161
%168 = load i32, i32* %14
%169 = icmp eq i32 %168, 2
br i1 %169, label %170, label %173
170: ; preds = %167
%171 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%172 = call i32 (i8*, i8*, ...) @sprintf(i8* %171, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0))
br label %173
173: ; preds = %170, %167
br label %174
174: ; preds = %173, %164
br label %175
175: ; preds = %174, %158
%176 = getelementptr inbounds [4096 x i8], [4096 x i8]* %15, i64 0, i64 0
%177 = call i32* @OpenFile(i8* %176, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %177, i32** %27
%178 = load i32, i32* %22
%179 = icmp eq i32 %178, 2010
br i1 %179, label %180, label %185
180: ; preds = %175
store i32 2009, i32* %22
%181 = load i32, i32* %12
%182 = icmp eq i32 %181, 2010
br i1 %182, label %183, label %184
183: ; preds = %180
store i32 2009, i32* %23
br label %184
184: ; preds = %183, %180
br label %185
185: ; preds = %184, %175
store i32 0, i32* %19
store i32 0, i32* %18
store i32 1, i32* %21
store i32 1979, i32* %20
br label %186
186: ; preds = %238, %185
%187 = load i32*, i32** %27
%188 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%189 = call i64 @GetALine(i32* %187, i8* %188)
%190 = icmp ne i64 %189, 0
br i1 %190, label %191, label %195
191: ; preds = %186
%192 = load i32, i32* %20
%193 = load i32, i32* %22
%194 = icmp sle i32 %192, %193
br label %195
195: ; preds = %191, %186
%196 = phi i1 [ false, %186 ], [ %194, %191 ]
br i1 %196, label %197, label %239
197: ; preds = %195
%198 = getelementptr inbounds [4096 x i8], [4096 x i8]* %16, i64 0, i64 0
%199 = call i32 @sscanf(i8* %198, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), double* %24)
%200 = load i32, i32* %20
%201 = load i32, i32* %23
%202 = icmp sge i32 %200, %201
br i1 %202, label %203, label %210
203: ; preds = %197
%204 = load i32, i32* %18
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds i32*, i32** %106, i64 %205
%207 = load i32*, i32** %206
%208 = load double, double* %24
%209 = call i32 @fprintf(i32* %207, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), double %208)
br label %210
210: ; preds = %203, %197
%211 = load i32, i32* %18
%212 = add nsw i32 %211, 1
store i32 %212, i32* %18
%213 = load i32, i32* %18
%214 = load i32, i32* %8
%215 = icmp sge i32 %213, %214
br i1 %215, label %216, label %238
216: ; preds = %210
store i32 0, i32* %18
%217 = load i32, i32* %14
%218 = icmp eq i32 %217, 1
br i1 %218, label %219, label %228
219: ; preds = %216
%220 = load i32, i32* %19
%221 = add nsw i32 %220, 1
store i32 %221, i32* %19
%222 = load i32, i32* %19
%223 = icmp sgt i32 %222, 1
br i1 %223, label %224, label %227
224: ; preds = %219
%225 = load i32, i32* %21
%226 = add nsw i32 %225, 1
store i32 %226, i32* %21
store i32 0, i32* %19
br label %227
227: ; preds = %224, %219
br label %231
228: ; preds = %216
%229 = load i32, i32* %21
%230 = add nsw i32 %229, 1
store i32 %230, i32* %21
br label %231
231: ; preds = %228, %227
%232 = load i32, i32* %21
%233 = icmp sgt i32 %232, 12
br i1 %233, label %234, label %237
234: ; preds = %231
store i32 1, i32* %21
%235 = load i32, i32* %20
%236 = add nsw i32 %235, 1
store i32 %236, i32* %20
br label %237
237: ; preds = %234, %231
br label %238
238: ; preds = %237, %210
br label %186
239: ; preds = %195
store i32 0, i32* %18
br label %240
240: ; preds = %249, %239
%241 = load i32, i32* %18
%242 = load i32, i32* %8
%243 = icmp slt i32 %241, %242
br i1 %243, label %244, label %252
244: ; preds = %240
%245 = load i32, i32* %18
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds i32*, i32** %106, i64 %246
%248 = call i32 @CloseFile(i32** %247)
br label %249
249: ; preds = %244
%250 = load i32, i32* %18
%251 = add nsw i32 %250, 1
store i32 %251, i32* %18
br label %240
252: ; preds = %240
%253 = call i32 @CloseFile(i32** %27)
%254 = load i8*, i8** %25
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [14 x i8] c"griblargeC2//\00"
@.str.2 = [24 x i8] c"pgbh06.gdas.R_H.2m.grb2\00"
@.str.3 = [25 x i8] c"flxf06.gdas.WND.10m.grb2\00"
@.str.4 = [28 x i8] c"flxf06.gdas.T_CDC.EATM.grb2\00"
@.str.5 = [12 x i8] c"./wgrib2 %s\00"
@.str.6 = [20 x i8] c"%s -lon %5.4f %5.4f\00"
@.str.7 = [56 x i8] c"%s | grep -o ',val=[\\-]*[0-9.0-9]\\{1,\\}[e]*[\\-]*[0-9]*'\00"
@.str.8 = [26 x i8] c"%s > temporary_dy//rh.txt\00"
@.str.9 = [26 x i8] c"%s > temporary_dy//ws.txt\00"
@.str.10 = [26 x i8] c"%s > temporary_dy//cc.txt\00"
@.str.11 = [11 x i8] c"%s//rh.txt\00"
@.str.12 = [11 x i8] c"%s//ws.txt\00"
@.str.13 = [11 x i8] c"%s//cc.txt\00"
@.str.14 = [2 x i8] c"w\00"
@.str.15 = [21 x i8] c"temporary_dy//rh.txt\00"
@.str.16 = [21 x i8] c"temporary_dy//ws.txt\00"
@.str.17 = [21 x i8] c"temporary_dy//cc.txt\00"
@.str.18 = [2 x i8] c"r\00"
@.str.19 = [9 x i8] c",val=%lf\00"
@.str.20 = [7 x i8] c"%5.6f\0A\00"
define void @monthlyClimate2(i32 %0, double* nocapture %1, double* nocapture %2, i8** nocapture %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca [4096 x i8]
%9 = alloca [4096 x i8]
%10 = alloca [32784 x i8]
%11 = alloca double
%12 = alloca i32*
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%15 = getelementptr inbounds [32784 x i8], [32784 x i8]* %10, i64 0, i64 0
%16 = bitcast double* %11 to i8*
%17 = icmp eq i32 %6, 0
br i1 %17, label %20, label %18
18: ; preds = %7
switch i32 %6, label %23 [
i32 1, label %20
i32 2, label %19
]
19: ; preds = %18
br label %20
20: ; preds = %18, %7, %19
%21 = phi i8* [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), %19 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), %7 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), %18 ]
%22 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %20, %18
%24 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%25 = icmp sgt i32 %0, 0
br i1 %25, label %26, label %37
26: ; preds = %23
%27 = zext i32 %0 to i64
br label %28
28: ; preds = %26, %28
%29 = phi i64 [ 0, %26 ], [ %35, %28 ]
%30 = getelementptr inbounds double, double* %2, i64 %29
%31 = load double, double* %30
%32 = getelementptr inbounds double, double* %1, i64 %29
%33 = load double, double* %32
%34 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %15, double %31, double %33)
%35 = add nuw nsw i64 %29, 1
%36 = icmp eq i64 %35, %27
br i1 %36, label %37, label %28
37: ; preds = %28, %23
%38 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i8* %15)
br i1 %17, label %41, label %39
39: ; preds = %37
switch i32 %6, label %44 [
i32 1, label %41
i32 2, label %40
]
40: ; preds = %39
br label %41
41: ; preds = %39, %37, %40
%42 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), %40 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), %37 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), %39 ]
%43 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) %42, i8* %15)
br label %44
44: ; preds = %41, %39
%45 = call i32 @callSystem(i8* %15)
%46 = zext i32 %0 to i64
%47 = call i8* @llvm.stacksave()
%48 = alloca i32*, i64 %46
br i1 %25, label %49, label %63
49: ; preds = %44, %58
%50 = phi i64 [ %61, %58 ], [ 0, %44 ]
br i1 %17, label %53, label %51
51: ; preds = %49
switch i32 %6, label %58 [
i32 1, label %53
i32 2, label %52
]
52: ; preds = %51
br label %53
53: ; preds = %51, %49, %52
%54 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), %52 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), %49 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), %51 ]
%55 = getelementptr inbounds i8*, i8** %3, i64 %50
%56 = load i8*, i8** %55
%57 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* dereferenceable(1) %54, i8* %56)
br label %58
58: ; preds = %53, %51
%59 = call i32* @OpenFile(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%60 = getelementptr inbounds i32*, i32** %48, i64 %50
store i32* %59, i32** %60
%61 = add nuw nsw i64 %50, 1
%62 = icmp eq i64 %61, %46
br i1 %62, label %63, label %49
63: ; preds = %58, %44
br i1 %17, label %64, label %65
64: ; preds = %63
br label %68
65: ; preds = %63
switch i32 %6, label %68 [
i32 1, label %66
i32 2, label %67
]
66: ; preds = %65
br label %68
67: ; preds = %65
br label %68
68: ; preds = %65, %66, %67, %64
%69 = bitcast i32** %12 to i8*
%70 = call i32* @OpenFile(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %70, i32** %12
%71 = icmp eq i32 %5, 2010
%72 = icmp eq i32 %4, 2010
%73 = select i1 %71, i32 2009, i32 %5
%74 = and i1 %72, %71
%75 = select i1 %74, i32 2009, i32 %4
%76 = call i64 @GetALine(i32* %70, i8* %14)
%77 = icmp ne i64 %76, 0
%78 = icmp sgt i32 %73, 1978
%79 = and i1 %77, %78
br i1 %79, label %80, label %82
80: ; preds = %68
%81 = icmp eq i32 %6, 1
br label %83
82: ; preds = %115, %68
br i1 %25, label %125, label %131
83: ; preds = %80, %115
%84 = phi i32 [ 0, %80 ], [ %119, %115 ]
%85 = phi i32 [ 0, %80 ], [ %118, %115 ]
%86 = phi i32 [ 1, %80 ], [ %117, %115 ]
%87 = phi i32 [ 1979, %80 ], [ %116, %115 ]
%88 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), double* %11)
%89 = icmp slt i32 %87, %75
br i1 %89, label %96, label %90
90: ; preds = %83
%91 = sext i32 %84 to i64
%92 = getelementptr inbounds i32*, i32** %48, i64 %91
%93 = load i32*, i32** %92
%94 = load double, double* %11
%95 = call i32 @fprintf(i32* %93, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), double %94)
br label %96
96: ; preds = %90, %83
%97 = add nsw i32 %84, 1
%98 = icmp slt i32 %97, %0
br i1 %98, label %115, label %99
99: ; preds = %96
br i1 %81, label %100, label %106
100: ; preds = %99
%101 = icmp sgt i32 %85, 0
%102 = zext i1 %101 to i32
%103 = add nsw i32 %86, %102
%104 = xor i1 %101, true
%105 = zext i1 %104 to i32
br label %108
106: ; preds = %99
%107 = add nsw i32 %86, 1
br label %108
108: ; preds = %100, %106
%109 = phi i32 [ %107, %106 ], [ %103, %100 ]
%110 = phi i32 [ %85, %106 ], [ %105, %100 ]
%111 = icmp sgt i32 %109, 12
%112 = zext i1 %111 to i32
%113 = add nsw i32 %87, %112
%114 = select i1 %111, i32 1, i32 %109
br label %115
115: ; preds = %108, %96
%116 = phi i32 [ %87, %96 ], [ %113, %108 ]
%117 = phi i32 [ %86, %96 ], [ %114, %108 ]
%118 = phi i32 [ %85, %96 ], [ %110, %108 ]
%119 = phi i32 [ %97, %96 ], [ 0, %108 ]
%120 = load i32*, i32** %12
%121 = call i64 @GetALine(i32* %120, i8* %14)
%122 = icmp ne i64 %121, 0
%123 = icmp sle i32 %116, %73
%124 = select i1 %122, i1 %123, i1 false
br i1 %124, label %83, label %82
125: ; preds = %82, %125
%126 = phi i64 [ %129, %125 ], [ 0, %82 ]
%127 = getelementptr inbounds i32*, i32** %48, i64 %126
%128 = call i32 @CloseFile(i32** %127)
%129 = add nuw nsw i64 %126, 1
%130 = icmp eq i64 %129, %46
br i1 %130, label %131, label %125
131: ; preds = %125, %82
%132 = call i32 @CloseFile(i32** %12)
ret void
}