#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*/ time_t;
struct tm {
  scalar_t__ tm_min;
  scalar_t__ tm_hour;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, float, float, float,
                           float, float, float, float, float, float, float,
                           float, float, float, float);
int sscanf(char *, char *, int *, int *, int *, float *, float *, float *,
           float *, float *, float *, float *, float *, float *, float *,
           float *, float *, float *, float *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc < 4) {
    printf("This utility processes a rtl-wx CSV by rtl-wx \n");
    printf("by combining multiple source file lines per line of output\n");
    printf("  Usage: processCSV <sourcefile> <destfile> <lines of source per "
           "line of output>\n",
           argv[0]);
    printf("Example: processCSV rtl-wx-15min rtl-wx-2hr.csv 8\n", argv[0]);
    exit(0);
  }
  char *sourceFilename = argv[1];
  char *newFilename = argv[2];
  int numSamplesToInclude = atoi(argv[3]);
  FILE *newfd, *sourcefd;
  if ((newfd = fopen(newFilename, "w")) == NULL) {
    fprintf(stderr,
            "RTL-Wx: Unable to open %s file for writing.  Exiting...\n\n",
            newFilename);
    exit(1);
  }
  if ((sourcefd = fopen(sourceFilename, "rt")) == NULL) {
    fprintf(stderr,
            "RTL-Wx: Unable to open %s file for reading.  Exiting...\n\n",
            sourceFilename);
    exit(1);
  }
  fprintf(newfd,
          "Time,efergyWatts,owlWatts,fuelGallonsBurned,oduTemp,oduDewpoint,"
          "iduTemp,iduDewpoint,ext1Temp,ext1Dewpoint,ext2Temp,ext2Dewpoint,"
          "ext3Temp,ext3Dewpoint,ext4Temp,ext4Dewpoint,iduSealevelPressure\n");
  int timestampA, efergyWattsA = 0, owlWattsA = 0;
  float fuelGallonsA = 0, oduTempA = 0, oduDewpointA = 0, iduTempA = 0,
        iduDewpointA = 0, ext1TempA = 0, ext1DewpointA = 0, ext2TempA = 0,
        ext2DewpointA = 0, ext3TempA = 0, ext3DewpointA = 0, ext4TempA = 0,
        ext4DewpointA = 0, iduPressureA = 0;
  char sourceLine[500];
  int samples = 0;
  int foundStartSample = 0;
  int linesWritten = 0, linesParsed = 0, linesSkipped = 0;
  while (fgets(sourceLine, 500, sourcefd) != NULL) {
    int timestamp, efergyWatts, owlWatts;
    float fuelGallons, oduTemp, oduDewpoint, iduTemp, iduDewpoint, ext1Temp,
        ext1Dewpoint, ext2Temp, ext2Dewpoint, ext3Temp, ext3Dewpoint, ext4Temp,
        ext4Dewpoint, iduPressure;
    int numRead = sscanf(
        sourceLine, "%lu,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",
        &timestamp, &efergyWatts, &owlWatts, &fuelGallons, &oduTemp,
        &oduDewpoint, &iduTemp, &iduDewpoint, &ext1Temp, &ext1Dewpoint,
        &ext2Temp, &ext2Dewpoint, &ext3Temp, &ext3Dewpoint, &ext4Temp,
        &ext4Dewpoint, &iduPressure);
    time_t sampleTime = (time_t)timestamp;
    struct tm *localTime = localtime(&sampleTime);
    if ((numRead == 17) && (foundStartSample == 0)) {
      if ((localTime->tm_min == 0) && (localTime->tm_hour == 0))
        foundStartSample = 1;
    }
    if ((numRead == 17) && (foundStartSample)) {
      samples++;
      linesParsed++;
      efergyWattsA += efergyWatts;
      fuelGallonsA += fuelGallons;
      owlWattsA += owlWatts;
      iduTempA += iduTemp;
      iduDewpointA += iduDewpoint;
      iduPressureA += iduPressure;
      oduTempA += oduTemp;
      oduDewpointA += oduDewpoint;
      ext1TempA += ext1Temp;
      ext1DewpointA += ext1Dewpoint;
      ext2TempA += ext2Temp;
      ext2DewpointA += ext2Dewpoint;
      ext3TempA += ext3Temp;
      ext3DewpointA += ext3Dewpoint;
      ext4TempA += ext4Temp;
      ext4DewpointA += ext4Dewpoint;
      if (samples == numSamplesToInclude) {
        efergyWattsA /= samples;
        owlWattsA /= samples;
        iduTempA /= samples;
        iduDewpointA /= samples;
        iduPressureA /= samples;
        oduTempA /= samples;
        oduDewpointA /= samples;
        ext1TempA /= samples;
        ext1DewpointA /= samples;
        ext2TempA /= samples;
        ext2DewpointA /= samples;
        ext3TempA /= samples;
        ext3DewpointA /= samples;
        ext4TempA /= samples;
        ext4DewpointA /= samples;
        char lineToAppend[500];
        sprintf(lineToAppend,
                "%lu,%d,%d,%4.2f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3."
                "1f,%3.1f,%3.1f,%3.1f,%3.1f,%5.2f\n",
                timestamp + 900, efergyWattsA, owlWattsA, fuelGallonsA,
                oduTempA, oduDewpointA, iduTempA, iduDewpointA, ext1TempA,
                ext1DewpointA, ext2TempA, ext2DewpointA, ext3TempA,
                ext3DewpointA, ext4TempA, ext4DewpointA, iduPressureA);
        fprintf(newfd, lineToAppend);
        samples = 0;
        efergyWattsA = 0;
        owlWattsA = 0;
        fuelGallonsA = 0;
        oduTempA = 0;
        oduDewpointA = 0;
        iduTempA = 0;
        iduDewpointA = 0;
        ext1TempA = 0;
        ext1DewpointA = 0;
        ext2TempA = 0;
        ext2DewpointA = 0;
        ext3TempA = 0;
        ext3DewpointA = 0;
        ext4TempA = 0;
        ext4DewpointA = 0, iduPressureA = 0;
        linesWritten++;
      }
    } else
      linesSkipped++;
  }
  printf("Program Stats: Skipped %d lines.  Parsed %d lines.  Wrote %d lines\n",
         linesSkipped, linesParsed, linesWritten);
  fclose(sourcefd);
  fclose(newfd);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x578,%rsp
movl   $0x0,-0x2c(%rbp)
mov    %edi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
cmpl   $0x4,-0x30(%rbp)
jge    1219 <main+0x79>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
jne    1285 <main+0xe5>
mov    0x2d7a(%rip),%rax
movslq (%rax),%rdi
mov    -0x48(%rbp),%rdx
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
jne    12c9 <main+0x129>
mov    0x2d36(%rip),%rax
movslq (%rax),%rdi
mov    -0x40(%rbp),%rdx
lea    0xe78(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x58(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x74(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x7c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x94(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0xa4(%rbp)
ff
movl   $0x0,-0x2a4(%rbp)
movl   $0x0,-0x2a8(%rbp)
movl   $0x0,-0x2ac(%rbp)
movl   $0x0,-0x2b0(%rbp)
movl   $0x0,-0x2b4(%rbp)
lea    -0x2a0(%rbp),%rdi
mov    -0x60(%rbp),%rdx
mov    $0x1f4,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     19ea <main+0x84a>
lea    -0x2a0(%rbp),%rdi
lea    0xe58(%rip),%rsi
lea    -0x2b8(%rbp),%rdx
lea    -0x2bc(%rbp),%rcx
lea    -0x2c0(%rbp),%r8
lea    -0x2c4(%rbp),%r9
lea    -0x2c8(%rbp),%rax
mov    %rax,-0x530(%rbp)
lea    -0x2cc(%rbp),%rax
mov    %rax,-0x528(%rbp)
lea    -0x2d0(%rbp),%rax
mov    %rax,-0x520(%rbp)
lea    -0x2d4(%rbp),%rax
mov    %rax,-0x518(%rbp)
lea    -0x2d8(%rbp),%rax
mov    %rax,-0x510(%rbp)
lea    -0x2dc(%rbp),%r13
lea    -0x2e0(%rbp),%r12
lea    -0x2e4(%rbp),%r15
lea    -0x2e8(%rbp),%r14
lea    -0x2ec(%rbp),%rbx
lea    -0x2f0(%rbp),%r11
lea    -0x2f4(%rbp),%r10
lea    -0x2f8(%rbp),%rax
mov    %rax,-0x508(%rbp)
mov    -0x530(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x528(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x520(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0x518(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    -0x510(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0x508(%rbp),%rax
mov    %r13,0x28(%rsp)
mov    %r12,0x30(%rsp)
mov    %r15,0x38(%rsp)
mov    %r14,0x40(%rsp)
mov    %rbx,0x48(%rsp)
mov    %r11,0x50(%rsp)
mov    %r10,0x58(%rsp)
mov    %rax,0x60(%rsp)
call   1080 <sscanf@plt>
mov    %eax,-0x2fc(%rbp)
mov    -0x2b8(%rbp),%eax
mov    %eax,-0x300(%rbp)
lea    -0x300(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x308(%rbp)
cmpl   $0x11,-0x2fc(%rbp)
jne    1554 <main+0x3b4>
cmpl   $0x0,-0x2a8(%rbp)
jne    1554 <main+0x3b4>
mov    -0x308(%rbp),%rax
cmpq   $0x0,(%rax)
jne    154f <main+0x3af>
mov    -0x308(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    154f <main+0x3af>
movl   $0x1,-0x2a8(%rbp)
jmp    1554 <main+0x3b4>
cmpl   $0x11,-0x2fc(%rbp)
jne    19d6 <main+0x836>
cmpl   $0x0,-0x2a8(%rbp)
je     19d6 <main+0x836>
mov    -0x2a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a4(%rbp)
mov    -0x2b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2b0(%rbp)
mov    -0x2bc(%rbp),%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x68(%rbp)
movss  -0x2c4(%rbp),%xmm0
ff
addss  -0x70(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
mov    -0x2c0(%rbp),%eax
add    -0x6c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
movss  -0x2d0(%rbp),%xmm0
ff
addss  -0x7c(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x2d4(%rbp),%xmm0
ff
addss  -0x80(%rbp),%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x2f8(%rbp),%xmm0
ff
addss  -0xa4(%rbp),%xmm0
ff
movss  %xmm0,-0xa4(%rbp)
ff
movss  -0x2c8(%rbp),%xmm0
ff
addss  -0x74(%rbp),%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x2cc(%rbp),%xmm0
ff
addss  -0x78(%rbp),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x2d8(%rbp),%xmm0
ff
addss  -0x84(%rbp),%xmm0
ff
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x2dc(%rbp),%xmm0
ff
addss  -0x88(%rbp),%xmm0
ff
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x2e0(%rbp),%xmm0
ff
addss  -0x8c(%rbp),%xmm0
ff
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x2e4(%rbp),%xmm0
ff
addss  -0x90(%rbp),%xmm0
ff
movss  %xmm0,-0x90(%rbp)
ff
movss  -0x2e8(%rbp),%xmm0
ff
addss  -0x94(%rbp),%xmm0
ff
movss  %xmm0,-0x94(%rbp)
ff
movss  -0x2ec(%rbp),%xmm0
ff
addss  -0x98(%rbp),%xmm0
ff
movss  %xmm0,-0x98(%rbp)
ff
movss  -0x2f0(%rbp),%xmm0
ff
addss  -0x9c(%rbp),%xmm0
ff
movss  %xmm0,-0x9c(%rbp)
ff
movss  -0x2f4(%rbp),%xmm0
ff
addss  -0xa0(%rbp),%xmm0
ff
movss  %xmm0,-0xa0(%rbp)
ff
mov    -0x2a4(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jne    19d1 <main+0x831>
mov    -0x2a4(%rbp),%ecx
mov    -0x68(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x68(%rbp)
mov    -0x2a4(%rbp),%ecx
mov    -0x6c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x6c(%rbp)
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x7c(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x7c(%rbp)
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x80(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x80(%rbp)
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0xa4(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0xa4(%rbp)
ff
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x74(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x74(%rbp)
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x78(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x78(%rbp)
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x84(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x88(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x8c(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x90(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x94(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x94(%rbp)
ff
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x98(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0x9c(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
cvtsi2ssl -0x2a4(%rbp),%xmm1
ff
movss  -0xa0(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
lea    -0x500(%rbp),%rdi
mov    -0x2b8(%rbp),%edx
add    $0x384,%edx
mov    -0x68(%rbp),%ecx
mov    -0x6c(%rbp),%r8d
movss  -0x70(%rbp),%xmm0
movss  -0x74(%rbp),%xmm1
movss  -0x78(%rbp),%xmm2
movss  -0x7c(%rbp),%xmm3
movss  -0x80(%rbp),%xmm4
movss  -0x84(%rbp),%xmm5
ff
movss  -0x88(%rbp),%xmm6
ff
movss  -0x8c(%rbp),%xmm7
ff
movss  -0x90(%rbp),%xmm13
ff ff
movss  -0x94(%rbp),%xmm12
ff ff
movss  -0x98(%rbp),%xmm11
ff ff
movss  -0x9c(%rbp),%xmm10
ff ff
movss  -0xa0(%rbp),%xmm9
ff ff
movss  -0xa4(%rbp),%xmm8
ff ff
lea    0x980(%rip),%rsi
movss  %xmm13,(%rsp)
movss  %xmm12,0x8(%rsp)
movss  %xmm11,0x10(%rsp)
movss  %xmm10,0x18(%rsp)
movss  %xmm9,0x20(%rsp)
movss  %xmm8,0x28(%rsp)
call   10b0 <sprintf@plt>
mov    -0x58(%rbp),%rdi
lea    -0x500(%rbp),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x2a4(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x74(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x7c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x94(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0xa4(%rbp)
ff
mov    -0x2ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2ac(%rbp)
jmp    19e5 <main+0x845>
mov    -0x2b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2b4(%rbp)
jmp    13a6 <main+0x206>
mov    -0x2b4(%rbp),%esi
mov    -0x2b0(%rbp),%edx
mov    -0x2ac(%rbp),%ecx
lea    0x8bb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x60(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x58(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4a8,%rsp
cmp    $0x3,%edi
jg     120d <main+0x4d>
lea    0x1034(%rip),%rdi
call   1040 <puts@plt>
lea    0x1057(%rip),%rdi
call   1040 <puts@plt>
lea    0x1086(%rip),%rdi
call   1040 <puts@plt>
lea    0x10cb(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
mov    0x8(%rsi),%rbp
mov    0x10(%rsi),%rbx
mov    0x18(%rsi),%rdi
call   10b0 <atoi@plt>
mov    %eax,0x50(%rsp)
lea    0xdd7(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
mov    %rax,0x58(%rsp)
test   %rax,%rax
jne    1251 <main+0x91>
mov    0x2d9e(%rip),%rax
movslq (%rax),%rdi
lea    0xdb6(%rip),%rsi
mov    %rbx,%rdx
jmp    1279 <main+0xb9>
lea    0xde4(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
jne    128a <main+0xca>
mov    0x2d74(%rip),%rax
movslq (%rax),%rdi
lea    0xdc9(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    %rax,%rbx
lea    0xde5(%rip),%rdi
mov    $0xc0,%esi
mov    $0x1,%edx
mov    0x58(%rsp),%rcx
call   10e0 <fwrite@plt>
lea    0xb0(%rsp),%rdi
mov    $0x1f4,%esi
mov    %rbx,0xa8(%rsp)
mov    %rbx,%rdx
call   1070 <fgets@plt>
movl   $0x0,0x44(%rsp)
movl   $0x0,0x48(%rsp)
mov    $0x0,%r14d
test   %rax,%rax
jne    1317 <main+0x157>
lea    0xee6(%rip),%rdi
mov    %r14d,%esi
mov    0x48(%rsp),%edx
mov    0x44(%rsp),%ecx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xa8(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x58(%rsp),%rdi
call   1050 <fclose@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
cvtsi2ssl 0x50(%rsp),%xmm0
movss  %xmm0,0x60(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x40(%rsp)
movl   $0x0,0x4c(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x3c(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x38(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x34(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x2c(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x24(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x28(%rsp)
lea    0xb0(%rsp),%rbp
mov    $0x0,%r13d
mov    $0x0,%r14d
movl   $0x0,0x48(%rsp)
movl   $0x0,0x44(%rsp)
mov    $0x0,%ebx
mov    $0x0,%r12d
jmp    1405 <main+0x245>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
mov    %r15,%rbp
mov    %r15,%rdi
mov    $0x1f4,%esi
mov    0xa8(%rsp),%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     12e0 <main+0x120>
sub    $0x8,%rsp
mov    %rbp,%r15
mov    %rbp,%rdi
lea    0xd24(%rip),%rsi
lea    0x5c(%rsp),%rdx
lea    0xac(%rsp),%rcx
lea    0xa8(%rsp),%r8
lea    0xa4(%rsp),%r9
lea    0x70(%rsp),%rax
push   %rax
lea    0x7c(%rsp),%rax
push   %rax
lea    0x88(%rsp),%rax
push   %rax
lea    0x94(%rsp),%rax
push   %rax
lea    0xa0(%rsp),%rax
push   %rax
lea    0xac(%rsp),%rax
push   %rax
lea    0xb8(%rsp),%rax
push   %rax
lea    0xc4(%rsp),%rax
push   %rax
lea    0xd0(%rsp),%rax
push   %rax
lea    0xdc(%rsp),%rax
push   %rax
lea    0xe8(%rsp),%rax
push   %rax
lea    0xf4(%rsp),%rax
push   %rax
lea    0x100(%rsp),%rax
push   %rax
call   1090 <sscanf@plt>
add    $0x70,%rsp
mov    %eax,%ebp
mov    0x54(%rsp),%eax
mov    %eax,0x64(%rsp)
lea    0x64(%rsp),%rdi
call   1030 <localtime@plt>
cmp    $0x11,%ebp
jne    1540 <main+0x380>
test   %ebx,%ebx
movss  0x40(%rsp),%xmm8
movss  0x3c(%rsp),%xmm7
movss  0x38(%rsp),%xmm6
movss  0x34(%rsp),%xmm5
movss  0x30(%rsp),%xmm4
movss  0x2c(%rsp),%xmm3
movss  0x28(%rsp),%xmm0
movss  0x24(%rsp),%xmm2
movss  0x20(%rsp),%xmm1
movss  0x1c(%rsp),%xmm10
movss  0x18(%rsp),%xmm11
movss  0x14(%rsp),%xmm12
movss  0x10(%rsp),%xmm13
movss  0xc(%rsp),%xmm14
jne    159a <main+0x3da>
xor    %ebx,%ebx
cmpq   $0x0,(%rax)
jne    13e0 <main+0x220>
xor    %ebx,%ebx
cmpq   $0x0,0x8(%rax)
sete   %bl
jmp    159a <main+0x3da>
xchg   %ax,%ax
movss  0x40(%rsp),%xmm8
movss  0x3c(%rsp),%xmm7
movss  0x38(%rsp),%xmm6
movss  0x34(%rsp),%xmm5
movss  0x30(%rsp),%xmm4
movss  0x2c(%rsp),%xmm3
movss  0x28(%rsp),%xmm0
movss  0x24(%rsp),%xmm2
movss  0x20(%rsp),%xmm1
movss  0x1c(%rsp),%xmm10
movss  0x18(%rsp),%xmm11
movss  0x14(%rsp),%xmm12
movss  0x10(%rsp),%xmm13
movss  0xc(%rsp),%xmm14
cmp    $0x11,%ebp
jne    13e0 <main+0x220>
test   %ebx,%ebx
je     13e0 <main+0x220>
add    $0x1,%r12d
mov    0x4c(%rsp),%eax
add    0xa4(%rsp),%eax
addss  0x9c(%rsp),%xmm0
add    0xa0(%rsp),%r13d
addss  0x90(%rsp),%xmm3
addss  0x8c(%rsp),%xmm4
addss  0x68(%rsp),%xmm8
addss  0x98(%rsp),%xmm1
addss  0x94(%rsp),%xmm2
addss  0x88(%rsp),%xmm5
addss  0x84(%rsp),%xmm6
addss  0x80(%rsp),%xmm7
addss  0x7c(%rsp),%xmm10
addss  0x78(%rsp),%xmm11
addss  0x74(%rsp),%xmm12
addss  0x70(%rsp),%xmm13
addl   $0x1,0x48(%rsp)
addss  0x6c(%rsp),%xmm14
mov    0x50(%rsp),%esi
cmp    %esi,%r12d
jne    1794 <main+0x5d4>
cltd
idiv   %esi
mov    %eax,%ecx
mov    %r13d,%eax
cltd
idiv   %esi
movss  0x60(%rsp),%xmm9
divss  %xmm9,%xmm3
divss  %xmm9,%xmm4
divss  %xmm9,%xmm8
divss  %xmm9,%xmm1
divss  %xmm9,%xmm2
divss  %xmm9,%xmm5
divss  %xmm9,%xmm6
divss  %xmm9,%xmm7
divss  %xmm9,%xmm10
divss  %xmm9,%xmm11
divss  %xmm9,%xmm12
divss  %xmm9,%xmm13
divss  %xmm9,%xmm14
mov    0x54(%rsp),%edx
mov    $0x384,%esi
add    %esi,%edx
sub    $0x30,%rsp
movss  %xmm8,0x28(%rsp)
movss  %xmm14,0x20(%rsp)
movss  %xmm13,0x18(%rsp)
movss  %xmm12,0x10(%rsp)
movss  %xmm11,0x8(%rsp)
movss  %xmm10,(%rsp)
lea    0x2e0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xa8b(%rip),%rsi
mov    %eax,%r8d
call   10c0 <sprintf@plt>
add    $0x30,%rsp
xor    %r12d,%r12d
mov    0x58(%rsp),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
addl   $0x1,0x44(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x28(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x24(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x2c(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x34(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x38(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x3c(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x40(%rsp)
xor    %r13d,%r13d
movl   $0x0,0x4c(%rsp)
jmp    13e4 <main+0x224>
mov    %eax,0x4c(%rsp)
movss  %xmm14,0xc(%rsp)
movss  %xmm13,0x10(%rsp)
movss  %xmm12,0x14(%rsp)
movss  %xmm11,0x18(%rsp)
movss  %xmm10,0x1c(%rsp)
movss  %xmm1,0x20(%rsp)
movss  %xmm2,0x24(%rsp)
movss  %xmm0,0x28(%rsp)
movss  %xmm3,0x2c(%rsp)
movss  %xmm4,0x30(%rsp)
movss  %xmm5,0x34(%rsp)
movss  %xmm6,0x38(%rsp)
movss  %xmm7,0x3c(%rsp)
movss  %xmm8,0x40(%rsp)
jmp    13e4 <main+0x224>

LLVM IR (-O0):
%struct.tm = type { i64, i64 }
@.str = [48 x i8] c"This utility processes a rtl-wx CSV by rtl-wx \0A\00"
@.str.1 = [60 x i8] c"by combining multiple source file lines per line of output\0A\00"
@.str.2 = [82 x i8] c" Usage: processCSV <sourcefile> <destfile> <lines of source per line of output>\0A\00"
@.str.3 = [51 x i8] c"Example: processCSV rtl-wx-15min rtl-wx-2hr.csv 8\0A\00"
@.str.4 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.5 = [58 x i8] c"RTL-Wx: Unable to open %s file for writing. Exiting...\0A\0A\00"
@.str.6 = [3 x i8] c"rt\00"
@.str.7 = [58 x i8] c"RTL-Wx: Unable to open %s file for reading. Exiting...\0A\0A\00"
@.str.8 = [193 x i8] c"Time,efergyWatts,owlWatts,fuelGallonsBurned,oduTemp,oduDewpoint,iduTemp,iduDewpoint,ext1Temp,ext1Dewpoint,ext2Temp,ext2Dewpoint,ext3Temp,ext3Dewpoint,ext4Temp,ext4Dewpoint,iduSealevelPressure\0A\00"
@.str.9 = [52 x i8] c"%lu,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f\00"
@.str.10 = [95 x i8] c"%lu,%d,%d,%4.2f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%5.2f\0A\00"
@.str.11 = [68 x i8] c"Program Stats: Skipped %d lines. Parsed %d lines. Wrote %d lines\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca [500 x i8]
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca float
%38 = alloca float
%39 = alloca float
%40 = alloca float
%41 = alloca float
%42 = alloca float
%43 = alloca float
%44 = alloca float
%45 = alloca float
%46 = alloca float
%47 = alloca float
%48 = alloca float
%49 = alloca float
%50 = alloca float
%51 = alloca i32
%52 = alloca i32
%53 = alloca %struct.tm*
%54 = alloca [500 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%55 = load i32, i32* %4
%56 = icmp slt i32 %55, 4
br i1 %56, label %57, label %69
57: ; preds = %2
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 0
%62 = load i8*, i8** %61
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.2, i64 0, i64 0), i8* %62)
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0), i8* %66)
%68 = call i32 @exit(i32 0)
unreachable
69: ; preds = %2
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 1
%72 = load i8*, i8** %71
store i8* %72, i8** %6
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 2
%75 = load i8*, i8** %74
store i8* %75, i8** %7
%76 = load i8**, i8*** %5
%77 = getelementptr inbounds i8*, i8** %76, i64 3
%78 = load i8*, i8** %77
%79 = call i32 @atoi(i8* %78)
store i32 %79, i32* %8
%80 = load i8*, i8** %7
%81 = call i32* @fopen(i8* %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %81, i32** %9
%82 = icmp eq i32* %81, null
br i1 %82, label %83, label %90
83: ; preds = %69
%84 = load i32, i32* @stderr
%85 = sext i32 %84 to i64
%86 = inttoptr i64 %85 to i32*
%87 = load i8*, i8** %7
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i8* %87)
%89 = call i32 @exit(i32 1)
unreachable
90: ; preds = %69
%91 = load i8*, i8** %6
%92 = call i32* @fopen(i8* %91, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %92, i32** %10
%93 = icmp eq i32* %92, null
br i1 %93, label %94, label %101
94: ; preds = %90
%95 = load i32, i32* @stderr
%96 = sext i32 %95 to i64
%97 = inttoptr i64 %96 to i32*
%98 = load i8*, i8** %6
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i8* %98)
%100 = call i32 @exit(i32 1)
unreachable
101: ; preds = %90
%102 = load i32*, i32** %9
%103 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %12
store i32 0, i32* %13
store float 0.000000e+00, float* %14
store float 0.000000e+00, float* %15
store float 0.000000e+00, float* %16
store float 0.000000e+00, float* %17
store float 0.000000e+00, float* %18
store float 0.000000e+00, float* %19
store float 0.000000e+00, float* %20
store float 0.000000e+00, float* %21
store float 0.000000e+00, float* %22
store float 0.000000e+00, float* %23
store float 0.000000e+00, float* %24
store float 0.000000e+00, float* %25
store float 0.000000e+00, float* %26
store float 0.000000e+00, float* %27
store i32 0, i32* %29
store i32 0, i32* %30
store i32 0, i32* %31
store i32 0, i32* %32
store i32 0, i32* %33
br label %104
104: ; preds = %281, %101
%105 = getelementptr inbounds [500 x i8], [500 x i8]* %28, i64 0, i64 0
%106 = load i32*, i32** %10
%107 = call i32* @fgets(i8* %105, i32 500, i32* %106)
%108 = icmp ne i32* %107, null
br i1 %108, label %109, label %282
109: ; preds = %104
%110 = getelementptr inbounds [500 x i8], [500 x i8]* %28, i64 0, i64 0
%111 = call i32 @sscanf(i8* %110, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i32* %34, i32* %35, i32* %36, float* %37, float* %38, float* %39, float* %40, float* %41, float* %42, float* %43, float* %44, float* %45, float* %46, float* %47, float* %48, float* %49, float* %50)
store i32 %111, i32* %51
%112 = load i32, i32* %34
store i32 %112, i32* %52
%113 = call %struct.tm* @localtime(i32* %52)
store %struct.tm* %113, %struct.tm** %53
%114 = load i32, i32* %51
%115 = icmp eq i32 %114, 17
br i1 %115, label %116, label %131
116: ; preds = %109
%117 = load i32, i32* %30
%118 = icmp eq i32 %117, 0
br i1 %118, label %119, label %131
119: ; preds = %116
%120 = load %struct.tm*, %struct.tm** %53
%121 = getelementptr inbounds %struct.tm, %struct.tm* %120, i32 0, i32 0
%122 = load i64, i64* %121
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %130
124: ; preds = %119
%125 = load %struct.tm*, %struct.tm** %53
%126 = getelementptr inbounds %struct.tm, %struct.tm* %125, i32 0, i32 1
%127 = load i64, i64* %126
%128 = icmp eq i64 %127, 0
br i1 %128, label %129, label %130
129: ; preds = %124
store i32 1, i32* %30
br label %130
130: ; preds = %129, %124, %119
br label %131
131: ; preds = %130, %116, %109
%132 = load i32, i32* %51
%133 = icmp eq i32 %132, 17
br i1 %133, label %134, label %278
134: ; preds = %131
%135 = load i32, i32* %30
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %278
137: ; preds = %134
%138 = load i32, i32* %29
%139 = add nsw i32 %138, 1
store i32 %139, i32* %29
%140 = load i32, i32* %32
%141 = add nsw i32 %140, 1
store i32 %141, i32* %32
%142 = load i32, i32* %35
%143 = load i32, i32* %12
%144 = add nsw i32 %143, %142
store i32 %144, i32* %12
%145 = load float, float* %37
%146 = load float, float* %14
%147 = fadd float %146, %145
store float %147, float* %14
%148 = load i32, i32* %36
%149 = load i32, i32* %13
%150 = add nsw i32 %149, %148
store i32 %150, i32* %13
%151 = load float, float* %40
%152 = load float, float* %17
%153 = fadd float %152, %151
store float %153, float* %17
%154 = load float, float* %41
%155 = load float, float* %18
%156 = fadd float %155, %154
store float %156, float* %18
%157 = load float, float* %50
%158 = load float, float* %27
%159 = fadd float %158, %157
store float %159, float* %27
%160 = load float, float* %38
%161 = load float, float* %15
%162 = fadd float %161, %160
store float %162, float* %15
%163 = load float, float* %39
%164 = load float, float* %16
%165 = fadd float %164, %163
store float %165, float* %16
%166 = load float, float* %42
%167 = load float, float* %19
%168 = fadd float %167, %166
store float %168, float* %19
%169 = load float, float* %43
%170 = load float, float* %20
%171 = fadd float %170, %169
store float %171, float* %20
%172 = load float, float* %44
%173 = load float, float* %21
%174 = fadd float %173, %172
store float %174, float* %21
%175 = load float, float* %45
%176 = load float, float* %22
%177 = fadd float %176, %175
store float %177, float* %22
%178 = load float, float* %46
%179 = load float, float* %23
%180 = fadd float %179, %178
store float %180, float* %23
%181 = load float, float* %47
%182 = load float, float* %24
%183 = fadd float %182, %181
store float %183, float* %24
%184 = load float, float* %48
%185 = load float, float* %25
%186 = fadd float %185, %184
store float %186, float* %25
%187 = load float, float* %49
%188 = load float, float* %26
%189 = fadd float %188, %187
store float %189, float* %26
%190 = load i32, i32* %29
%191 = load i32, i32* %8
%192 = icmp eq i32 %190, %191
br i1 %192, label %193, label %277
193: ; preds = %137
%194 = load i32, i32* %29
%195 = load i32, i32* %12
%196 = sdiv i32 %195, %194
store i32 %196, i32* %12
%197 = load i32, i32* %29
%198 = load i32, i32* %13
%199 = sdiv i32 %198, %197
store i32 %199, i32* %13
%200 = load i32, i32* %29
%201 = sitofp i32 %200 to float
%202 = load float, float* %17
%203 = fdiv float %202, %201
store float %203, float* %17
%204 = load i32, i32* %29
%205 = sitofp i32 %204 to float
%206 = load float, float* %18
%207 = fdiv float %206, %205
store float %207, float* %18
%208 = load i32, i32* %29
%209 = sitofp i32 %208 to float
%210 = load float, float* %27
%211 = fdiv float %210, %209
store float %211, float* %27
%212 = load i32, i32* %29
%213 = sitofp i32 %212 to float
%214 = load float, float* %15
%215 = fdiv float %214, %213
store float %215, float* %15
%216 = load i32, i32* %29
%217 = sitofp i32 %216 to float
%218 = load float, float* %16
%219 = fdiv float %218, %217
store float %219, float* %16
%220 = load i32, i32* %29
%221 = sitofp i32 %220 to float
%222 = load float, float* %19
%223 = fdiv float %222, %221
store float %223, float* %19
%224 = load i32, i32* %29
%225 = sitofp i32 %224 to float
%226 = load float, float* %20
%227 = fdiv float %226, %225
store float %227, float* %20
%228 = load i32, i32* %29
%229 = sitofp i32 %228 to float
%230 = load float, float* %21
%231 = fdiv float %230, %229
store float %231, float* %21
%232 = load i32, i32* %29
%233 = sitofp i32 %232 to float
%234 = load float, float* %22
%235 = fdiv float %234, %233
store float %235, float* %22
%236 = load i32, i32* %29
%237 = sitofp i32 %236 to float
%238 = load float, float* %23
%239 = fdiv float %238, %237
store float %239, float* %23
%240 = load i32, i32* %29
%241 = sitofp i32 %240 to float
%242 = load float, float* %24
%243 = fdiv float %242, %241
store float %243, float* %24
%244 = load i32, i32* %29
%245 = sitofp i32 %244 to float
%246 = load float, float* %25
%247 = fdiv float %246, %245
store float %247, float* %25
%248 = load i32, i32* %29
%249 = sitofp i32 %248 to float
%250 = load float, float* %26
%251 = fdiv float %250, %249
store float %251, float* %26
%252 = getelementptr inbounds [500 x i8], [500 x i8]* %54, i64 0, i64 0
%253 = load i32, i32* %34
%254 = add nsw i32 %253, 900
%255 = load i32, i32* %12
%256 = load i32, i32* %13
%257 = load float, float* %14
%258 = load float, float* %15
%259 = load float, float* %16
%260 = load float, float* %17
%261 = load float, float* %18
%262 = load float, float* %19
%263 = load float, float* %20
%264 = load float, float* %21
%265 = load float, float* %22
%266 = load float, float* %23
%267 = load float, float* %24
%268 = load float, float* %25
%269 = load float, float* %26
%270 = load float, float* %27
%271 = call i32 @sprintf(i8* %252, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.10, i64 0, i64 0), i32 %254, i32 %255, i32 %256, float %257, float %258, float %259, float %260, float %261, float %262, float %263, float %264, float %265, float %266, float %267, float %268, float %269, float %270)
%272 = load i32*, i32** %9
%273 = getelementptr inbounds [500 x i8], [500 x i8]* %54, i64 0, i64 0
%274 = call i32 (i32*, i8*, ...) @fprintf(i32* %272, i8* %273)
store i32 0, i32* %29
store i32 0, i32* %12
store i32 0, i32* %13
store float 0.000000e+00, float* %14
store float 0.000000e+00, float* %15
store float 0.000000e+00, float* %16
store float 0.000000e+00, float* %17
store float 0.000000e+00, float* %18
store float 0.000000e+00, float* %19
store float 0.000000e+00, float* %20
store float 0.000000e+00, float* %21
store float 0.000000e+00, float* %22
store float 0.000000e+00, float* %23
store float 0.000000e+00, float* %24
store float 0.000000e+00, float* %25
store float 0.000000e+00, float* %26
store float 0.000000e+00, float* %27
%275 = load i32, i32* %31
%276 = add nsw i32 %275, 1
store i32 %276, i32* %31
br label %277
277: ; preds = %193, %137
br label %281
278: ; preds = %134, %131
%279 = load i32, i32* %33
%280 = add nsw i32 %279, 1
store i32 %280, i32* %33
br label %281
281: ; preds = %278, %277
br label %104
282: ; preds = %104
%283 = load i32, i32* %33
%284 = load i32, i32* %32
%285 = load i32, i32* %31
%286 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.11, i64 0, i64 0), i32 %283, i32 %284, i32 %285)
%287 = load i32*, i32** %10
%288 = call i32 @fclose(i32* %287)
%289 = load i32*, i32** %9
%290 = call i32 @fclose(i32* %289)
%291 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.tm = type { i64, i64 }
@.str.4 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.5 = [58 x i8] c"RTL-Wx: Unable to open %s file for writing. Exiting...\0A\0A\00"
@.str.6 = [3 x i8] c"rt\00"
@.str.7 = [58 x i8] c"RTL-Wx: Unable to open %s file for reading. Exiting...\0A\0A\00"
@.str.8 = [193 x i8] c"Time,efergyWatts,owlWatts,fuelGallonsBurned,oduTemp,oduDewpoint,iduTemp,iduDewpoint,ext1Temp,ext1Dewpoint,ext2Temp,ext2Dewpoint,ext3Temp,ext3Dewpoint,ext4Temp,ext4Dewpoint,iduSealevelPressure\0A\00"
@.str.9 = [52 x i8] c"%lu,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f\00"
@.str.10 = [95 x i8] c"%lu,%d,%d,%4.2f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%3.1f,%5.2f\0A\00"
@.str.11 = [68 x i8] c"Program Stats: Skipped %d lines. Parsed %d lines. Wrote %d lines\0A\00"
@str = [47 x i8] c"This utility processes a rtl-wx CSV by rtl-wx \00"
@str.12 = [59 x i8] c"by combining multiple source file lines per line of output\00"
@str.13 = [81 x i8] c" Usage: processCSV <sourcefile> <destfile> <lines of source per line of output>\00"
@str.14 = [50 x i8] c"Example: processCSV rtl-wx-15min rtl-wx-2hr.csv 8\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [500 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca i32
%22 = alloca [500 x i8]
%23 = icmp slt i32 %0, 4
br i1 %23, label %24, label %30
24: ; preds = %2
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.12, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.13, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.14, i64 0, i64 0))
%29 = tail call i32 @exit(i32 0)
unreachable
30: ; preds = %2
%31 = getelementptr inbounds i8*, i8** %1, i64 1
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8*, i8** %1, i64 2
%34 = load i8*, i8** %33
%35 = getelementptr inbounds i8*, i8** %1, i64 3
%36 = load i8*, i8** %35
%37 = tail call i32 @atoi(i8* %36)
%38 = tail call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %46
40: ; preds = %30
%41 = load i32, i32* @stderr
%42 = sext i32 %41 to i64
%43 = inttoptr i64 %42 to i32*
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i8* %34)
%45 = tail call i32 @exit(i32 1)
unreachable
46: ; preds = %30
%47 = tail call i32* @fopen(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%48 = icmp eq i32* %47, null
br i1 %48, label %49, label %55
49: ; preds = %46
%50 = load i32, i32* @stderr
%51 = sext i32 %50 to i64
%52 = inttoptr i64 %51 to i32*
%53 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i8* %32)
%54 = tail call i32 @exit(i32 1)
unreachable
55: ; preds = %46
%56 = tail call i64 @fwrite(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.8, i64 0, i64 0), i64 192, i64 1, i32* %38)
%57 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%58 = call i32* @fgets(i8* %57, i32 500, i32* %47)
%59 = icmp eq i32* %58, null
br i1 %59, label %206, label %60
60: ; preds = %55
%61 = bitcast i32* %4 to i8*
%62 = bitcast i32* %5 to i8*
%63 = bitcast i32* %6 to i8*
%64 = bitcast float* %7 to i8*
%65 = bitcast float* %8 to i8*
%66 = bitcast float* %9 to i8*
%67 = bitcast float* %10 to i8*
%68 = bitcast float* %11 to i8*
%69 = bitcast float* %12 to i8*
%70 = bitcast float* %13 to i8*
%71 = bitcast float* %14 to i8*
%72 = bitcast float* %15 to i8*
%73 = bitcast float* %16 to i8*
%74 = bitcast float* %17 to i8*
%75 = bitcast float* %18 to i8*
%76 = bitcast float* %19 to i8*
%77 = bitcast float* %20 to i8*
%78 = bitcast i32* %21 to i8*
%79 = getelementptr inbounds [500 x i8], [500 x i8]* %22, i64 0, i64 0
%80 = sitofp i32 %37 to float
br label %81
81: ; preds = %60, %182
%82 = phi i32 [ 0, %60 ], [ %203, %182 ]
%83 = phi i32 [ 0, %60 ], [ %202, %182 ]
%84 = phi i32 [ 0, %60 ], [ %201, %182 ]
%85 = phi i32 [ 0, %60 ], [ %200, %182 ]
%86 = phi i32 [ 0, %60 ], [ %199, %182 ]
%87 = phi i32 [ 0, %60 ], [ %183, %182 ]
%88 = phi i32 [ 0, %60 ], [ %198, %182 ]
%89 = phi float [ 0.000000e+00, %60 ], [ %197, %182 ]
%90 = phi float [ 0.000000e+00, %60 ], [ %196, %182 ]
%91 = phi float [ 0.000000e+00, %60 ], [ %195, %182 ]
%92 = phi float [ 0.000000e+00, %60 ], [ %194, %182 ]
%93 = phi float [ 0.000000e+00, %60 ], [ %193, %182 ]
%94 = phi float [ 0.000000e+00, %60 ], [ %192, %182 ]
%95 = phi float [ 0.000000e+00, %60 ], [ %191, %182 ]
%96 = phi float [ 0.000000e+00, %60 ], [ %190, %182 ]
%97 = phi float [ 0.000000e+00, %60 ], [ %189, %182 ]
%98 = phi float [ 0.000000e+00, %60 ], [ %188, %182 ]
%99 = phi float [ 0.000000e+00, %60 ], [ %187, %182 ]
%100 = phi float [ 0.000000e+00, %60 ], [ %186, %182 ]
%101 = phi float [ 0.000000e+00, %60 ], [ %185, %182 ]
%102 = phi float [ 0.000000e+00, %60 ], [ %184, %182 ]
%103 = call i32 @sscanf(i8* %57, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i32* %4, i32* %5, i32* %6, float* %7, float* %8, float* %9, float* %10, float* %11, float* %12, float* %13, float* %14, float* %15, float* %16, float* %17, float* %18, float* %19, float* %20)
%104 = load i32, i32* %4
store i32 %104, i32* %21
%105 = call %struct.tm* @localtime(i32* %21)
%106 = icmp eq i32 %103, 17
%107 = icmp eq i32 %87, 0
%108 = select i1 %106, i1 %107, i1 false
br i1 %108, label %109, label %118
109: ; preds = %81
%110 = getelementptr inbounds %struct.tm, %struct.tm* %105, i64 0, i32 0
%111 = load i64, i64* %110
%112 = icmp eq i64 %111, 0
br i1 %112, label %113, label %179
113: ; preds = %109
%114 = getelementptr inbounds %struct.tm, %struct.tm* %105, i64 0, i32 1
%115 = load i64, i64* %114
%116 = icmp eq i64 %115, 0
%117 = zext i1 %116 to i32
br label %118
118: ; preds = %113, %81
%119 = phi i32 [ %87, %81 ], [ %117, %113 ]
%120 = icmp ne i32 %119, 0
%121 = select i1 %106, i1 %120, i1 false
br i1 %121, label %122, label %179
122: ; preds = %118
%123 = add nsw i32 %88, 1
%124 = add nsw i32 %85, 1
%125 = load i32, i32* %5
%126 = add nsw i32 %125, %82
%127 = load float, float* %7
%128 = fadd float %102, %127
%129 = load i32, i32* %6
%130 = add nsw i32 %129, %83
%131 = load float, float* %10
%132 = fadd float %99, %131
%133 = load float, float* %11
%134 = fadd float %98, %133
%135 = load float, float* %20
%136 = fadd float %89, %135
%137 = load float, float* %8
%138 = fadd float %101, %137
%139 = load float, float* %9
%140 = fadd float %100, %139
%141 = load float, float* %12
%142 = fadd float %97, %141
%143 = load float, float* %13
%144 = fadd float %96, %143
%145 = load float, float* %14
%146 = fadd float %95, %145
%147 = load float, float* %15
%148 = fadd float %94, %147
%149 = load float, float* %16
%150 = fadd float %93, %149
%151 = load float, float* %17
%152 = fadd float %92, %151
%153 = load float, float* %18
%154 = fadd float %91, %153
%155 = load float, float* %19
%156 = fadd float %90, %155
%157 = icmp eq i32 %123, %37
br i1 %157, label %158, label %182
158: ; preds = %122
%159 = sdiv i32 %126, %37
%160 = sdiv i32 %130, %37
%161 = fdiv float %132, %80
%162 = fdiv float %134, %80
%163 = fdiv float %136, %80
%164 = fdiv float %138, %80
%165 = fdiv float %140, %80
%166 = fdiv float %142, %80
%167 = fdiv float %144, %80
%168 = fdiv float %146, %80
%169 = fdiv float %148, %80
%170 = fdiv float %150, %80
%171 = fdiv float %152, %80
%172 = fdiv float %154, %80
%173 = fdiv float %156, %80
%174 = load i32, i32* %4
%175 = add nsw i32 %174, 900
%176 = call i32 @sprintf(i8* %79, i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @.str.10, i64 0, i64 0), i32 %175, i32 %159, i32 %160, float %128, float %164, float %165, float %161, float %162, float %166, float %167, float %168, float %169, float %170, float %171, float %172, float %173, float %163)
%177 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* %79)
%178 = add nsw i32 %86, 1
br label %182
179: ; preds = %109, %118
%180 = phi i32 [ %119, %118 ], [ 0, %109 ]
%181 = add nsw i32 %84, 1
br label %182
182: ; preds = %122, %158, %179
%183 = phi i32 [ %119, %158 ], [ %119, %122 ], [ %180, %179 ]
%184 = phi float [ 0.000000e+00, %158 ], [ %128, %122 ], [ %102, %179 ]
%185 = phi float [ 0.000000e+00, %158 ], [ %138, %122 ], [ %101, %179 ]
%186 = phi float [ 0.000000e+00, %158 ], [ %140, %122 ], [ %100, %179 ]
%187 = phi float [ 0.000000e+00, %158 ], [ %132, %122 ], [ %99, %179 ]
%188 = phi float [ 0.000000e+00, %158 ], [ %134, %122 ], [ %98, %179 ]
%189 = phi float [ 0.000000e+00, %158 ], [ %142, %122 ], [ %97, %179 ]
%190 = phi float [ 0.000000e+00, %158 ], [ %144, %122 ], [ %96, %179 ]
%191 = phi float [ 0.000000e+00, %158 ], [ %146, %122 ], [ %95, %179 ]
%192 = phi float [ 0.000000e+00, %158 ], [ %148, %122 ], [ %94, %179 ]
%193 = phi float [ 0.000000e+00, %158 ], [ %150, %122 ], [ %93, %179 ]
%194 = phi float [ 0.000000e+00, %158 ], [ %152, %122 ], [ %92, %179 ]
%195 = phi float [ 0.000000e+00, %158 ], [ %154, %122 ], [ %91, %179 ]
%196 = phi float [ 0.000000e+00, %158 ], [ %156, %122 ], [ %90, %179 ]
%197 = phi float [ 0.000000e+00, %158 ], [ %136, %122 ], [ %89, %179 ]
%198 = phi i32 [ 0, %158 ], [ %123, %122 ], [ %88, %179 ]
%199 = phi i32 [ %178, %158 ], [ %86, %122 ], [ %86, %179 ]
%200 = phi i32 [ %124, %158 ], [ %124, %122 ], [ %85, %179 ]
%201 = phi i32 [ %84, %158 ], [ %84, %122 ], [ %181, %179 ]
%202 = phi i32 [ 0, %158 ], [ %130, %122 ], [ %83, %179 ]
%203 = phi i32 [ 0, %158 ], [ %126, %122 ], [ %82, %179 ]
%204 = call i32* @fgets(i8* %57, i32 500, i32* %47)
%205 = icmp eq i32* %204, null
br i1 %205, label %206, label %81
206: ; preds = %182, %55
%207 = phi i32 [ 0, %55 ], [ %199, %182 ]
%208 = phi i32 [ 0, %55 ], [ %200, %182 ]
%209 = phi i32 [ 0, %55 ], [ %201, %182 ]
%210 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.11, i64 0, i64 0), i32 %209, i32 %208, i32 %207)
%211 = call i32 @fclose(i32* %47)
%212 = call i32 @fclose(i32* %38)
%213 = call i32 @exit(i32 0)
unreachable
}