#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*/ fprintf(int /*<<< orphan*/ *, char *, double);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int /*<<< orphan*/ system(char *);
void monthlyClimate2(int nSites, double latitudes[], double longitudes[],
                     char *siteDirs[], int yearLow, int yearHigh, int type,
                     int printdebug) {
  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);
  system(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    0x18(%rbp),%eax
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    11dc <monthlyClimate2+0x6c>
lea    -0x1030(%rbp),%rdi
lea    0xe3e(%rip),%rsi
lea    0xe3c(%rip),%rdx
lea    0xe43(%rip),%rcx
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1245 <monthlyClimate2+0xd5>
cmpl   $0x1,0x10(%rbp)
jne    120e <monthlyClimate2+0x9e>
lea    -0x1030(%rbp),%rdi
lea    0xe0c(%rip),%rsi
lea    0xe0a(%rip),%rdx
lea    0xe29(%rip),%rcx
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1240 <monthlyClimate2+0xd0>
cmpl   $0x2,0x10(%rbp)
jne    123b <monthlyClimate2+0xcb>
lea    -0x1030(%rbp),%rdi
lea    0xdda(%rip),%rsi
lea    0xdd8(%rip),%rdx
lea    0xe10(%rip),%rcx
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1240 <monthlyClimate2+0xd0>
jmp    1245 <monthlyClimate2+0xd5>
lea    -0xa040(%rbp),%rdi
lea    -0x1030(%rbp),%rdx
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
movl   $0x0,-0xa044(%rbp)
mov    -0xa044(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12ca <monthlyClimate2+0x15a>
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    0xdbd(%rip),%rsi
mov    $0x2,%al
call   1090 <sprintf@plt>
mov    -0xa044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa044(%rbp)
jmp    126b <monthlyClimate2+0xfb>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
lea    0xda1(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
cmpl   $0x0,0x10(%rbp)
jne    1311 <monthlyClimate2+0x1a1>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
lea    0xdb3(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    136c <monthlyClimate2+0x1fc>
cmpl   $0x1,0x10(%rbp)
jne    133c <monthlyClimate2+0x1cc>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1367 <monthlyClimate2+0x1f7>
cmpl   $0x2,0x10(%rbp)
jne    1362 <monthlyClimate2+0x1f2>
lea    -0xa040(%rbp),%rdi
lea    -0xa040(%rbp),%rdx
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1367 <monthlyClimate2+0x1f7>
jmp    136c <monthlyClimate2+0x1fc>
lea    -0xa040(%rbp),%rdi
call   1050 <system@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    149b <monthlyClimate2+0x32b>
cmpl   $0x0,0x10(%rbp)
jne    13f4 <monthlyClimate2+0x284>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd1e(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    145f <monthlyClimate2+0x2ef>
cmpl   $0x1,0x10(%rbp)
jne    1427 <monthlyClimate2+0x2b7>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcf6(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    145a <monthlyClimate2+0x2ea>
cmpl   $0x2,0x10(%rbp)
jne    1455 <monthlyClimate2+0x2e5>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    145a <monthlyClimate2+0x2ea>
jmp    145f <monthlyClimate2+0x2ef>
lea    -0x1030(%rbp),%rdi
lea    0xcba(%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    13b2 <monthlyClimate2+0x242>
cmpl   $0x0,0x10(%rbp)
jne    14bf <monthlyClimate2+0x34f>
lea    -0x1030(%rbp),%rdi
lea    0xc0a(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    150c <monthlyClimate2+0x39c>
cmpl   $0x1,0x10(%rbp)
jne    14e3 <monthlyClimate2+0x373>
lea    -0x1030(%rbp),%rdi
lea    0xc00(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1507 <monthlyClimate2+0x397>
cmpl   $0x2,0x10(%rbp)
jne    1502 <monthlyClimate2+0x392>
lea    -0x1030(%rbp),%rdi
lea    0xbf6(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
jmp    1507 <monthlyClimate2+0x397>
jmp    150c <monthlyClimate2+0x39c>
lea    -0x1030(%rbp),%rdi
lea    0xc0f(%rip),%rsi
call   1040 <OpenFile@plt>
mov    %rax,-0xa078(%rbp)
cmpl   $0x7da,-0xa054(%rbp)
jne    155c <monthlyClimate2+0x3ec>
movl   $0x7d9,-0xa054(%rbp)
cmpl   $0x7da,-0x24(%rbp)
jne    1557 <monthlyClimate2+0x3e7>
movl   $0x7d9,-0xa058(%rbp)
jmp    155c <monthlyClimate2+0x3ec>
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     15c1 <monthlyClimate2+0x451>
mov    -0xa04c(%rbp),%eax
cmp    -0xa054(%rbp),%eax
setle  %al
mov    %al,-0xa081(%rbp)
mov    -0xa081(%rbp),%al
test   $0x1,%al
jne    15d4 <monthlyClimate2+0x464>
jmp    16d1 <monthlyClimate2+0x561>
lea    -0x2030(%rbp),%rdi
lea    0xb49(%rip),%rsi
lea    -0xa060(%rbp),%rdx
call   1080 <sscanf@plt>
mov    -0xa04c(%rbp),%eax
cmp    -0xa058(%rbp),%eax
jl     1626 <monthlyClimate2+0x4b6>
mov    -0xa080(%rbp),%rax
movslq -0xa044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movsd  -0xa060(%rbp),%xmm0
ff
lea    0xb13(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0xa044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa044(%rbp)
mov    -0xa044(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     16cc <monthlyClimate2+0x55c>
movl   $0x0,-0xa044(%rbp)
cmpl   $0x1,0x10(%rbp)
jne    1692 <monthlyClimate2+0x522>
mov    -0xa048(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa048(%rbp)
cmpl   $0x1,-0xa048(%rbp)
jle    168d <monthlyClimate2+0x51d>
mov    -0xa050(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa050(%rbp)
movl   $0x0,-0xa048(%rbp)
jmp    16a1 <monthlyClimate2+0x531>
mov    -0xa050(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa050(%rbp)
cmpl   $0xc,-0xa050(%rbp)
jle    16c7 <monthlyClimate2+0x557>
movl   $0x1,-0xa050(%rbp)
mov    -0xa04c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa04c(%rbp)
jmp    16cc <monthlyClimate2+0x55c>
jmp    1584 <monthlyClimate2+0x414>
movl   $0x0,-0xa044(%rbp)
mov    -0xa044(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1718 <monthlyClimate2+0x5a8>
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    16db <monthlyClimate2+0x56b>
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   1050 <system@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   1060 <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, i32 %7) {
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [4096 x i8]
%18 = alloca [4096 x i8]
%19 = alloca [32784 x i8]
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double
%27 = alloca i8*
%28 = alloca i64
%29 = alloca i32*
store i32 %0, i32* %9
store double* %1, double** %10
store double* %2, double** %11
store i8** %3, i8*** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%30 = load i32, i32* %14
store i32 %30, i32* %24
%31 = load i32, i32* %13
store i32 %31, i32* %25
%32 = load i32, i32* %15
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %8
%35 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%36 = call i32 (i8*, i8*, ...) @sprintf(i8* %35, 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 %51
37: ; preds = %8
%38 = load i32, i32* %15
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* %41, 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 %50
43: ; preds = %37
%44 = load i32, i32* %15
%45 = icmp eq i32 %44, 2
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%48 = call i32 (i8*, i8*, ...) @sprintf(i8* %47, 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 %49
49: ; preds = %46, %43
br label %50
50: ; preds = %49, %40
br label %51
51: ; preds = %50, %34
%52 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%53 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%54 = call i32 (i8*, i8*, ...) @sprintf(i8* %52, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %53)
store i32 0, i32* %20
br label %55
55: ; preds = %73, %51
%56 = load i32, i32* %20
%57 = load i32, i32* %9
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %76
59: ; preds = %55
%60 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%61 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%62 = load double*, double** %11
%63 = load i32, i32* %20
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %62, i64 %64
%66 = load double, double* %65
%67 = load double*, double** %10
%68 = load i32, i32* %20
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %67, i64 %69
%71 = load double, double* %70
%72 = call i32 (i8*, i8*, ...) @sprintf(i8* %60, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %61, double %66, double %71)
br label %73
73: ; preds = %59
%74 = load i32, i32* %20
%75 = add nsw i32 %74, 1
store i32 %75, i32* %20
br label %55
76: ; preds = %55
%77 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%78 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%79 = call i32 (i8*, i8*, ...) @sprintf(i8* %77, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i8* %78)
%80 = load i32, i32* %15
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %86
82: ; preds = %76
%83 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%84 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%85 = call i32 (i8*, i8*, ...) @sprintf(i8* %83, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i8* %84)
br label %102
86: ; preds = %76
%87 = load i32, i32* %15
%88 = icmp eq i32 %87, 1
br i1 %88, label %89, label %93
89: ; preds = %86
%90 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%91 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%92 = call i32 (i8*, i8*, ...) @sprintf(i8* %90, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %91)
br label %101
93: ; preds = %86
%94 = load i32, i32* %15
%95 = icmp eq i32 %94, 2
br i1 %95, label %96, label %100
96: ; preds = %93
%97 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%98 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%99 = call i32 (i8*, i8*, ...) @sprintf(i8* %97, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* %98)
br label %100
100: ; preds = %96, %93
br label %101
101: ; preds = %100, %89
br label %102
102: ; preds = %101, %82
%103 = getelementptr inbounds [32784 x i8], [32784 x i8]* %19, i64 0, i64 0
%104 = call i32 @system(i8* %103)
%105 = load i32, i32* %9
%106 = zext i32 %105 to i64
%107 = call i8* @llvm.stacksave()
store i8* %107, i8** %27
%108 = alloca i32*, i64 %106
store i64 %106, i64* %28
store i32 0, i32* %20
br label %109
109: ; preds = %154, %102
%110 = load i32, i32* %20
%111 = load i32, i32* %9
%112 = icmp slt i32 %110, %111
br i1 %112, label %113, label %157
113: ; preds = %109
%114 = load i32, i32* %15
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %124
116: ; preds = %113
%117 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%118 = load i8**, i8*** %12
%119 = load i32, i32* %20
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i8*, i8** %118, i64 %120
%122 = load i8*, i8** %121
%123 = call i32 (i8*, i8*, ...) @sprintf(i8* %117, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* %122)
br label %148
124: ; preds = %113
%125 = load i32, i32* %15
%126 = icmp eq i32 %125, 1
br i1 %126, label %127, label %135
127: ; preds = %124
%128 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%129 = load i8**, i8*** %12
%130 = load i32, i32* %20
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8*, i8** %129, i64 %131
%133 = load i8*, i8** %132
%134 = call i32 (i8*, i8*, ...) @sprintf(i8* %128, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8* %133)
br label %147
135: ; preds = %124
%136 = load i32, i32* %15
%137 = icmp eq i32 %136, 2
br i1 %137, label %138, label %146
138: ; preds = %135
%139 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%140 = load i8**, i8*** %12
%141 = load i32, i32* %20
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8*, i8** %140, i64 %142
%144 = load i8*, i8** %143
%145 = call i32 (i8*, i8*, ...) @sprintf(i8* %139, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8* %144)
br label %146
146: ; preds = %138, %135
br label %147
147: ; preds = %146, %127
br label %148
148: ; preds = %147, %116
%149 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%150 = call i32* @OpenFile(i8* %149, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%151 = load i32, i32* %20
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i32*, i32** %108, i64 %152
store i32* %150, i32** %153
br label %154
154: ; preds = %148
%155 = load i32, i32* %20
%156 = add nsw i32 %155, 1
store i32 %156, i32* %20
br label %109
157: ; preds = %109
%158 = load i32, i32* %15
%159 = icmp eq i32 %158, 0
br i1 %159, label %160, label %163
160: ; preds = %157
%161 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%162 = call i32 (i8*, i8*, ...) @sprintf(i8* %161, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %177
163: ; preds = %157
%164 = load i32, i32* %15
%165 = icmp eq i32 %164, 1
br i1 %165, label %166, label %169
166: ; preds = %163
%167 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%168 = call i32 (i8*, i8*, ...) @sprintf(i8* %167, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0))
br label %176
169: ; preds = %163
%170 = load i32, i32* %15
%171 = icmp eq i32 %170, 2
br i1 %171, label %172, label %175
172: ; preds = %169
%173 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%174 = call i32 (i8*, i8*, ...) @sprintf(i8* %173, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0))
br label %175
175: ; preds = %172, %169
br label %176
176: ; preds = %175, %166
br label %177
177: ; preds = %176, %160
%178 = getelementptr inbounds [4096 x i8], [4096 x i8]* %17, i64 0, i64 0
%179 = call i32* @OpenFile(i8* %178, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %179, i32** %29
%180 = load i32, i32* %24
%181 = icmp eq i32 %180, 2010
br i1 %181, label %182, label %187
182: ; preds = %177
store i32 2009, i32* %24
%183 = load i32, i32* %13
%184 = icmp eq i32 %183, 2010
br i1 %184, label %185, label %186
185: ; preds = %182
store i32 2009, i32* %25
br label %186
186: ; preds = %185, %182
br label %187
187: ; preds = %186, %177
store i32 0, i32* %21
store i32 0, i32* %20
store i32 1, i32* %23
store i32 1979, i32* %22
br label %188
188: ; preds = %240, %187
%189 = load i32*, i32** %29
%190 = getelementptr inbounds [4096 x i8], [4096 x i8]* %18, i64 0, i64 0
%191 = call i64 @GetALine(i32* %189, i8* %190)
%192 = icmp ne i64 %191, 0
br i1 %192, label %193, label %197
193: ; preds = %188
%194 = load i32, i32* %22
%195 = load i32, i32* %24
%196 = icmp sle i32 %194, %195
br label %197
197: ; preds = %193, %188
%198 = phi i1 [ false, %188 ], [ %196, %193 ]
br i1 %198, label %199, label %241
199: ; preds = %197
%200 = getelementptr inbounds [4096 x i8], [4096 x i8]* %18, i64 0, i64 0
%201 = call i32 @sscanf(i8* %200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), double* %26)
%202 = load i32, i32* %22
%203 = load i32, i32* %25
%204 = icmp sge i32 %202, %203
br i1 %204, label %205, label %212
205: ; preds = %199
%206 = load i32, i32* %20
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i32*, i32** %108, i64 %207
%209 = load i32*, i32** %208
%210 = load double, double* %26
%211 = call i32 @fprintf(i32* %209, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), double %210)
br label %212
212: ; preds = %205, %199
%213 = load i32, i32* %20
%214 = add nsw i32 %213, 1
store i32 %214, i32* %20
%215 = load i32, i32* %20
%216 = load i32, i32* %9
%217 = icmp sge i32 %215, %216
br i1 %217, label %218, label %240
218: ; preds = %212
store i32 0, i32* %20
%219 = load i32, i32* %15
%220 = icmp eq i32 %219, 1
br i1 %220, label %221, label %230
221: ; preds = %218
%222 = load i32, i32* %21
%223 = add nsw i32 %222, 1
store i32 %223, i32* %21
%224 = load i32, i32* %21
%225 = icmp sgt i32 %224, 1
br i1 %225, label %226, label %229
226: ; preds = %221
%227 = load i32, i32* %23
%228 = add nsw i32 %227, 1
store i32 %228, i32* %23
store i32 0, i32* %21
br label %229
229: ; preds = %226, %221
br label %233
230: ; preds = %218
%231 = load i32, i32* %23
%232 = add nsw i32 %231, 1
store i32 %232, i32* %23
br label %233
233: ; preds = %230, %229
%234 = load i32, i32* %23
%235 = icmp sgt i32 %234, 12
br i1 %235, label %236, label %239
236: ; preds = %233
store i32 1, i32* %23
%237 = load i32, i32* %22
%238 = add nsw i32 %237, 1
store i32 %238, i32* %22
br label %239
239: ; preds = %236, %233
br label %240
240: ; preds = %239, %212
br label %188
241: ; preds = %197
store i32 0, i32* %20
br label %242
242: ; preds = %251, %241
%243 = load i32, i32* %20
%244 = load i32, i32* %9
%245 = icmp slt i32 %243, %244
br i1 %245, label %246, label %254
246: ; preds = %242
%247 = load i32, i32* %20
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds i32*, i32** %108, i64 %248
%250 = call i32 @CloseFile(i32** %249)
br label %251
251: ; preds = %246
%252 = load i32, i32* %20
%253 = add nsw i32 %252, 1
store i32 %253, i32* %20
br label %242
254: ; preds = %242
%255 = call i32 @CloseFile(i32** %29)
%256 = load i8*, i8** %27
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, i32 %7) {
%9 = alloca [4096 x i8]
%10 = alloca [4096 x i8]
%11 = alloca [32784 x i8]
%12 = alloca double
%13 = alloca i32*
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%15 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%16 = getelementptr inbounds [32784 x i8], [32784 x i8]* %11, i64 0, i64 0
%17 = bitcast double* %12 to i8*
%18 = icmp eq i32 %6, 0
br i1 %18, label %21, label %19
19: ; preds = %8
switch i32 %6, label %24 [
i32 1, label %21
i32 2, label %20
]
20: ; preds = %19
br label %21
21: ; preds = %19, %8, %20
%22 = phi i8* [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), %20 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), %19 ]
%23 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, 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* %22)
br label %24
24: ; preds = %21, %19
%25 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %14)
%26 = icmp sgt i32 %0, 0
br i1 %26, label %27, label %38
27: ; preds = %24
%28 = zext i32 %0 to i64
br label %29
29: ; preds = %27, %29
%30 = phi i64 [ 0, %27 ], [ %36, %29 ]
%31 = getelementptr inbounds double, double* %2, i64 %30
%32 = load double, double* %31
%33 = getelementptr inbounds double, double* %1, i64 %30
%34 = load double, double* %33
%35 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %16, double %32, double %34)
%36 = add nuw nsw i64 %30, 1
%37 = icmp eq i64 %36, %28
br i1 %37, label %38, label %29
38: ; preds = %29, %24
%39 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0), i8* %16)
br i1 %18, label %42, label %40
40: ; preds = %38
switch i32 %6, label %45 [
i32 1, label %42
i32 2, label %41
]
41: ; preds = %40
br label %42
42: ; preds = %40, %38, %41
%43 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), %41 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), %38 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), %40 ]
%44 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) %43, i8* %16)
br label %45
45: ; preds = %42, %40
%46 = call i32 @system(i8* %16)
%47 = zext i32 %0 to i64
%48 = call i8* @llvm.stacksave()
%49 = alloca i32*, i64 %47
br i1 %26, label %50, label %64
50: ; preds = %45, %59
%51 = phi i64 [ %62, %59 ], [ 0, %45 ]
br i1 %18, label %54, label %52
52: ; preds = %50
switch i32 %6, label %59 [
i32 1, label %54
i32 2, label %53
]
53: ; preds = %52
br label %54
54: ; preds = %52, %50, %53
%55 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), %53 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), %50 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), %52 ]
%56 = getelementptr inbounds i8*, i8** %3, i64 %51
%57 = load i8*, i8** %56
%58 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, i8* dereferenceable(1) %55, i8* %57)
br label %59
59: ; preds = %54, %52
%60 = call i32* @OpenFile(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%61 = getelementptr inbounds i32*, i32** %49, i64 %51
store i32* %60, i32** %61
%62 = add nuw nsw i64 %51, 1
%63 = icmp eq i64 %62, %47
br i1 %63, label %64, label %50
64: ; preds = %59, %45
br i1 %18, label %65, label %66
65: ; preds = %64
br label %69
66: ; preds = %64
switch i32 %6, label %69 [
i32 1, label %67
i32 2, label %68
]
67: ; preds = %66
br label %69
68: ; preds = %66
br label %69
69: ; preds = %66, %67, %68, %65
%70 = bitcast i32** %13 to i8*
%71 = call i32* @OpenFile(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %71, i32** %13
%72 = icmp eq i32 %5, 2010
%73 = icmp eq i32 %4, 2010
%74 = select i1 %72, i32 2009, i32 %5
%75 = and i1 %73, %72
%76 = select i1 %75, i32 2009, i32 %4
%77 = call i64 @GetALine(i32* %71, i8* %15)
%78 = icmp ne i64 %77, 0
%79 = icmp sgt i32 %74, 1978
%80 = and i1 %78, %79
br i1 %80, label %81, label %83
81: ; preds = %69
%82 = icmp eq i32 %6, 1
br label %84
83: ; preds = %116, %69
br i1 %26, label %126, label %132
84: ; preds = %81, %116
%85 = phi i32 [ 0, %81 ], [ %120, %116 ]
%86 = phi i32 [ 0, %81 ], [ %119, %116 ]
%87 = phi i32 [ 1, %81 ], [ %118, %116 ]
%88 = phi i32 [ 1979, %81 ], [ %117, %116 ]
%89 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), double* %12)
%90 = icmp slt i32 %88, %76
br i1 %90, label %97, label %91
91: ; preds = %84
%92 = sext i32 %85 to i64
%93 = getelementptr inbounds i32*, i32** %49, i64 %92
%94 = load i32*, i32** %93
%95 = load double, double* %12
%96 = call i32 @fprintf(i32* %94, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), double %95)
br label %97
97: ; preds = %91, %84
%98 = add nsw i32 %85, 1
%99 = icmp slt i32 %98, %0
br i1 %99, label %116, label %100
100: ; preds = %97
br i1 %82, label %101, label %107
101: ; preds = %100
%102 = icmp sgt i32 %86, 0
%103 = zext i1 %102 to i32
%104 = add nsw i32 %87, %103
%105 = xor i1 %102, true
%106 = zext i1 %105 to i32
br label %109
107: ; preds = %100
%108 = add nsw i32 %87, 1
br label %109
109: ; preds = %101, %107
%110 = phi i32 [ %108, %107 ], [ %104, %101 ]
%111 = phi i32 [ %86, %107 ], [ %106, %101 ]
%112 = icmp sgt i32 %110, 12
%113 = zext i1 %112 to i32
%114 = add nsw i32 %88, %113
%115 = select i1 %112, i32 1, i32 %110
br label %116
116: ; preds = %109, %97
%117 = phi i32 [ %88, %97 ], [ %114, %109 ]
%118 = phi i32 [ %87, %97 ], [ %115, %109 ]
%119 = phi i32 [ %86, %97 ], [ %111, %109 ]
%120 = phi i32 [ %98, %97 ], [ 0, %109 ]
%121 = load i32*, i32** %13
%122 = call i64 @GetALine(i32* %121, i8* %15)
%123 = icmp ne i64 %122, 0
%124 = icmp sle i32 %117, %74
%125 = select i1 %123, i1 %124, i1 false
br i1 %125, label %84, label %83
126: ; preds = %83, %126
%127 = phi i64 [ %130, %126 ], [ 0, %83 ]
%128 = getelementptr inbounds i32*, i32** %49, i64 %127
%129 = call i32 @CloseFile(i32** %128)
%130 = add nuw nsw i64 %127, 1
%131 = icmp eq i64 %130, %47
br i1 %131, label %132, label %126
132: ; preds = %126, %83
%133 = call i32 @CloseFile(i32** %13)
ret void
}