#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float);
int fscanf(int /*<<< orphan*/ *, char *, float *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int main(int argc, char *argv[]) {
  FILE *rawfile, *rawccfile, *bcyfile, *bcmfile, *outfile;
  float tmp, sum1, sum2, sum3, sum4, data, bcmdata[35];
  float adjfrac;
  int i, j, k, n, day, mnth, year, nday, startwy, endwy, unitsw;
  int dpm[12] = {31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30};
  if (argc != 7) {
    printf("Wrong command line arguments: enter <bcmfile> <bcyfile> <outfile> "
           "<startyear> <endyear> <unit sw> ,\n");
    exit(0);
  }
  bcmfile = fopen(argv[1], "r");
  bcyfile = fopen(argv[2], "r");
  outfile = fopen(argv[3], "w");
  sscanf(argv[4], "%d", &startwy);
  sscanf(argv[5], "%d", &endwy);
  sscanf(argv[6], "%d", &unitsw);
  nday = 0;
  sum1 = 0;
  sum2 = 0;
  sum3 = 0;
  sum4 = 0;
  for (year = startwy; year <= endwy; year++) {
    if ((year % 4 == 0) && (((year % 100 == 0) && (year % 400 != 0)) == 0)) {
      dpm[4] = 29;
    } else {
      dpm[4] = 28;
    }
    for (mnth = 0; mnth < 12; mnth++) {
      fscanf(bcyfile, "%f", &sum1);
      for (day = 1; day <= dpm[mnth]; day++) {
        n++;
        if (fscanf(bcmfile, "%f", &tmp) != 1) {
          printf("Bad data or EOF encountered prematurely.\n");
          exit(0);
        }
        sum2 += tmp;
        bcmdata[(day - 1)] = tmp;
        if (day == dpm[mnth]) {
          if (sum1 == 0 || sum2 == 0)
            adjfrac = 0;
          else {
            if (unitsw == 0)
              adjfrac = sum1 / (sum2 / dpm[mnth]);
            if (unitsw == 1)
              adjfrac = (sum1 * 0.50417) / sum2;
          }
          for (j = 0; j < dpm[mnth]; j++) {
            fprintf(outfile, "%10.3f\n", adjfrac * bcmdata[j]);
          }
          sum2 = 0;
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x140(%rbp),%rdi
lea    0xe79(%rip),%rsi
mov    $0x30,%edx
call   1060 <memcpy@plt>
cmpl   $0x7,-0x8(%rbp)
je     11be <main+0x4e>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xed8(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xec0(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xeaa(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xe94(%rip),%rsi
lea    -0x108(%rbp),%rdx
call   1070 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
lea    0xe79(%rip),%rsi
lea    -0x10c(%rbp),%rdx
call   1070 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
lea    0xe5e(%rip),%rsi
lea    -0x110(%rbp),%rdx
call   1070 <sscanf@plt>
movl   $0x0,-0x104(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x108(%rbp),%eax
mov    %eax,-0x100(%rbp)
mov    -0x100(%rbp),%eax
cmp    -0x10c(%rbp),%eax
jg     1559 <main+0x3e9>
mov    -0x100(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1312 <main+0x1a2>
mov    -0x100(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x141(%rbp)
jne    12ef <main+0x17f>
mov    -0x100(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x141(%rbp)
mov    -0x141(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    1312 <main+0x1a2>
movl   $0x1d,-0x130(%rbp)
jmp    131c <main+0x1ac>
movl   $0x1c,-0x130(%rbp)
movl   $0x0,-0xfc(%rbp)
cmpl   $0xc,-0xfc(%rbp)
jge    1540 <main+0x3d0>
mov    -0x28(%rbp),%rdi
lea    0xd6e(%rip),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <fscanf@plt>
movl   $0x1,-0xf8(%rbp)
mov    -0xf8(%rbp),%eax
movslq -0xfc(%rbp),%rcx
cmp    -0x140(%rbp,%rcx,4),%eax
jg     1527 <main+0x3b7>
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xd27(%rip),%rsi
lea    -0x3c(%rbp),%rdx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
je     13aa <main+0x23a>
lea    0xd11(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
movss  -0x3c(%rbp),%xmm0
addss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x3c(%rbp),%xmm0
mov    -0xf8(%rbp),%eax
sub    $0x1,%eax
cltq
movss  %xmm0,-0xe0(%rbp,%rax,4)
ff ff
mov    -0xf8(%rbp),%eax
movslq -0xfc(%rbp),%rcx
cmp    -0x140(%rbp,%rcx,4),%eax
jne    150e <main+0x39e>
movss  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1408 <main+0x298>
jp     1408 <main+0x298>
jmp    141f <main+0x2af>
movss  -0x44(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    142f <main+0x2bf>
jp     142f <main+0x2bf>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xe4(%rbp)
ff
jmp    14a6 <main+0x336>
cmpl   $0x0,-0x110(%rbp)
jne    1466 <main+0x2f6>
movss  -0x40(%rbp),%xmm0
movss  -0x44(%rbp),%xmm1
movslq -0xfc(%rbp),%rax
cvtsi2ssl -0x140(%rbp,%rax,4),%xmm2
ff ff
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xe4(%rbp)
ff
cmpl   $0x1,-0x110(%rbp)
jne    14a1 <main+0x331>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb7c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x44(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xe4(%rbp)
ff
jmp    14a6 <main+0x336>
movl   $0x0,-0xec(%rbp)
mov    -0xec(%rbp),%eax
movslq -0xfc(%rbp),%rcx
cmp    -0x140(%rbp,%rcx,4),%eax
jge    1506 <main+0x396>
mov    -0x38(%rbp),%rdi
movss  -0xe4(%rbp),%xmm0
ff
movslq -0xec(%rbp),%rax
mulss  -0xe0(%rbp,%rax,4),%xmm0
ff ff
lea    0xbec(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    14b0 <main+0x340>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    1513 <main+0x3a3>
mov    -0xf8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    1351 <main+0x1e1>
jmp    152c <main+0x3bc>
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    1326 <main+0x1b6>
jmp    1545 <main+0x3d5>
mov    -0x100(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100(%rbp)
jmp    128d <main+0x11d>
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
cmp    $0x7,%edi
jne    1454 <main+0x2f4>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xe94(%rip),%rbx
mov    %rbx,%rsi
call   1070 <fopen@plt>
mov    %rax,%r15
mov    0x10(%rbp),%rdi
mov    %rbx,%rsi
call   1070 <fopen@plt>
mov    %rax,0x38(%rsp)
mov    0x18(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
mov    0x20(%rbp),%rdi
lea    0xe5e(%rip),%r12
lea    0x28(%rsp),%rdx
mov    %r12,%rsi
call   1060 <sscanf@plt>
mov    0x28(%rbp),%rdi
lea    0x18(%rsp),%rdx
mov    %r12,%rsi
call   1060 <sscanf@plt>
mov    0x30(%rbp),%rdi
lea    0x24(%rsp),%rdx
mov    %r12,%rsi
call   1060 <sscanf@plt>
movl   $0x0,0x1c(%rsp)
mov    0x28(%rsp),%esi
cmp    0x18(%rsp),%esi
jle    123b <main+0xdb>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe08(%rip),%r13
xorps  %xmm0,%xmm0
mov    %r15,0x48(%rsp)
jmp    1266 <main+0x106>
nopl   0x0(%rax)
mov    0x30(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    0x18(%rsp),%ecx
mov    %eax,%esi
movss  0xc(%rsp),%xmm0
jge    1227 <main+0xc7>
test   $0x3,%sil
jne    12ab <main+0x14b>
imul   $0xc28f5c29,%esi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1d,%eax
cmp    $0x28f5c28,%ecx
ja     12b0 <main+0x150>
movslq %esi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
mov    %esi,%edx
sub    %ecx,%edx
je     12b0 <main+0x150>
mov    $0x1c,%eax
movss  %xmm0,0xc(%rsp)
mov    %rsi,0x30(%rsp)
mov    %eax,0x60(%rsp)
xor    %ebp,%ebp
jmp    12ef <main+0x18f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  0x10(%rsp),%xmm2
movss  %xmm2,0x10(%rsp)
mov    0x40(%rsp),%rbp
add    $0x1,%rbp
cmp    $0xc,%rbp
je     1250 <main+0xf0>
mov    0x38(%rsp),%rdi
lea    0xd4c(%rip),%rsi
lea    0x1c(%rsp),%rdx
call   1040 <fscanf@plt>
mov    %rbp,0x40(%rsp)
mov    0x50(%rsp,%rbp,4),%ebp
test   %ebp,%ebp
jle    12d0 <main+0x170>
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x20(%rsp)
lea    0x1(%rbp),%r12d
mov    $0x1,%r14d
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
jmp    1355 <main+0x1f5>
nopw   0x0(%rax,%rax,1)
movss  %xmm1,0xc(%rsp)
movss  0x14(%rsp),%xmm2
add    $0x1,%r14
cmp    %r12,%r14
je     12d6 <main+0x176>
mov    %r15,%rdi
lea    0xce8(%rip),%rsi
lea    0x2c(%rsp),%rdx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
jne    1441 <main+0x2e1>
movss  0x2c(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm0,0x7c(%rsp,%r14,4)
cmp    %rbp,%r14
jne    1340 <main+0x1e0>
movss  0x1c(%rsp),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jne    139e <main+0x23e>
jnp    13f0 <main+0x290>
ucomiss 0xc63(%rip),%xmm1
jne    13a9 <main+0x249>
jnp    13f0 <main+0x290>
mov    0x24(%rsp),%eax
cmp    $0x1,%eax
je     13cb <main+0x26b>
movss  0x14(%rsp),%xmm2
test   %eax,%eax
jne    13f0 <main+0x290>
divss  0x20(%rsp),%xmm1
divss  %xmm1,%xmm0
movaps %xmm0,%xmm2
jmp    13f0 <main+0x290>
cvtss2sd %xmm0,%xmm0
mulsd  0xc29(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm2
cs nopw 0x0(%rax,%rax,1)
xor    %r15d,%r15d
movss  %xmm2,0x10(%rsp)
nopl   0x0(%rax)
movss  0x80(%rsp,%r15,4),%xmm0
mulss  %xmm2,%xmm0
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <fprintf@plt>
movss  0x10(%rsp),%xmm2
add    $0x1,%r15
cmp    %r15,%rbp
jne    1400 <main+0x2a0>
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  %xmm2,0x14(%rsp)
mov    0x48(%rsp),%r15
jmp    134c <main+0x1ec>
lea    0xc0a(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xc20(%rip),%rdi
jmp    1448 <main+0x2e8>

LLVM IR (-O0):
@__const.main.dpm = [12 x i32] [i32 31, i32 30, i32 31, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30]
@.str = [101 x i8] c"Wrong command line arguments: enter <bcmfile> <bcyfile> <outfile> <startyear> <endyear> <unit sw> ,\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [42 x i8] c"Bad data or EOF encountered prematurely.\0A\00"
@.str.6 = [8 x i8] c"%10.3f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca [35 x float]
%18 = alloca float
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca [12 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%31 = bitcast [12 x i32]* %30 to i8*
%32 = load i32, i32* %4
%33 = icmp ne i32 %32, 7
br i1 %33, label %34, label %37
34: ; preds = %2
%35 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%36 = call i32 @exit(i32 0)
unreachable
37: ; preds = %2
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %41, i32** %9
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i32* @fopen(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %45, i32** %8
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 3
%48 = load i8*, i8** %47
%49 = call i32* @fopen(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %49, i32** %10
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 4
%52 = load i8*, i8** %51
%53 = call i32 @sscanf(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %27)
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 5
%56 = load i8*, i8** %55
%57 = call i32 @sscanf(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %28)
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 6
%60 = load i8*, i8** %59
%61 = call i32 @sscanf(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %29)
store i32 0, i32* %26
store float 0.000000e+00, float* %12
store float 0.000000e+00, float* %13
store float 0.000000e+00, float* %14
store float 0.000000e+00, float* %15
%62 = load i32, i32* %27
store i32 %62, i32* %25
br label %63
63: ; preds = %187, %37
%64 = load i32, i32* %25
%65 = load i32, i32* %28
%66 = icmp sle i32 %64, %65
br i1 %66, label %67, label %190
67: ; preds = %63
%68 = load i32, i32* %25
%69 = srem i32 %68, 4
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %85
71: ; preds = %67
%72 = load i32, i32* %25
%73 = srem i32 %72, 100
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load i32, i32* %25
%77 = srem i32 %76, 400
%78 = icmp ne i32 %77, 0
br label %79
79: ; preds = %75, %71
%80 = phi i1 [ false, %71 ], [ %78, %75 ]
%81 = zext i1 %80 to i32
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %79
%84 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 4
store i32 29, i32* %84
br label %87
85: ; preds = %79, %67
%86 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 4
store i32 28, i32* %86
br label %87
87: ; preds = %85, %83
store i32 0, i32* %24
br label %88
88: ; preds = %183, %87
%89 = load i32, i32* %24
%90 = icmp slt i32 %89, 12
br i1 %90, label %91, label %186
91: ; preds = %88
%92 = load i32*, i32** %8
%93 = call i32 @fscanf(i32* %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %12)
store i32 1, i32* %23
br label %94
94: ; preds = %179, %91
%95 = load i32, i32* %23
%96 = load i32, i32* %24
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %97
%99 = load i32, i32* %98
%100 = icmp sle i32 %95, %99
br i1 %100, label %101, label %182
101: ; preds = %94
%102 = load i32, i32* %22
%103 = add nsw i32 %102, 1
store i32 %103, i32* %22
%104 = load i32*, i32** %9
%105 = call i32 @fscanf(i32* %104, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %11)
%106 = icmp ne i32 %105, 1
br i1 %106, label %107, label %110
107: ; preds = %101
%108 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%109 = call i32 @exit(i32 0)
unreachable
110: ; preds = %101
%111 = load float, float* %11
%112 = load float, float* %13
%113 = fadd float %112, %111
store float %113, float* %13
%114 = load float, float* %11
%115 = load i32, i32* %23
%116 = sub nsw i32 %115, 1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [35 x float], [35 x float]* %17, i64 0, i64 %117
store float %114, float* %118
%119 = load i32, i32* %23
%120 = load i32, i32* %24
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %121
%123 = load i32, i32* %122
%124 = icmp eq i32 %119, %123
br i1 %124, label %125, label %178
125: ; preds = %110
%126 = load float, float* %12
%127 = fcmp oeq float %126, 0.000000e+00
br i1 %127, label %131, label %128
128: ; preds = %125
%129 = load float, float* %13
%130 = fcmp oeq float %129, 0.000000e+00
br i1 %130, label %131, label %132
131: ; preds = %128, %125
store float 0.000000e+00, float* %18
br label %157
132: ; preds = %128
%133 = load i32, i32* %29
%134 = icmp eq i32 %133, 0
br i1 %134, label %135, label %145
135: ; preds = %132
%136 = load float, float* %12
%137 = load float, float* %13
%138 = load i32, i32* %24
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %139
%141 = load i32, i32* %140
%142 = sitofp i32 %141 to float
%143 = fdiv float %137, %142
%144 = fdiv float %136, %143
store float %144, float* %18
br label %145
145: ; preds = %135, %132
%146 = load i32, i32* %29
%147 = icmp eq i32 %146, 1
br i1 %147, label %148, label %156
148: ; preds = %145
%149 = load float, float* %12
%150 = fpext float %149 to double
%151 = fmul double %150, 5.041700e-01
%152 = load float, float* %13
%153 = fpext float %152 to double
%154 = fdiv double %151, %153
%155 = fptrunc double %154 to float
store float %155, float* %18
br label %156
156: ; preds = %148, %145
br label %157
157: ; preds = %156, %131
store i32 0, i32* %20
br label %158
158: ; preds = %174, %157
%159 = load i32, i32* %20
%160 = load i32, i32* %24
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %161
%163 = load i32, i32* %162
%164 = icmp slt i32 %159, %163
br i1 %164, label %165, label %177
165: ; preds = %158
%166 = load i32*, i32** %10
%167 = load float, float* %18
%168 = load i32, i32* %20
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [35 x float], [35 x float]* %17, i64 0, i64 %169
%171 = load float, float* %170
%172 = fmul float %167, %171
%173 = call i32 @fprintf(i32* %166, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), float %172)
br label %174
174: ; preds = %165
%175 = load i32, i32* %20
%176 = add nsw i32 %175, 1
store i32 %176, i32* %20
br label %158
177: ; preds = %158
store float 0.000000e+00, float* %13
br label %178
178: ; preds = %177, %110
br label %179
179: ; preds = %178
%180 = load i32, i32* %23
%181 = add nsw i32 %180, 1
store i32 %181, i32* %23
br label %94
182: ; preds = %94
br label %183
183: ; preds = %182
%184 = load i32, i32* %24
%185 = add nsw i32 %184, 1
store i32 %185, i32* %24
br label %88
186: ; preds = %88
br label %187
187: ; preds = %186
%188 = load i32, i32* %25
%189 = add nsw i32 %188, 1
store i32 %189, i32* %25
br label %63
190: ; preds = %63
%191 = load i32, i32* %3
ret i32 %191
}

LLVM IR (-O2):
@__const.main.dpm = [12 x i32] [i32 31, i32 30, i32 31, i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30]
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.6 = [8 x i8] c"%10.3f\0A\00"
@str = [41 x i8] c"Bad data or EOF encountered prematurely.\00"
@str.7 = [100 x i8] c"Wrong command line arguments: enter <bcmfile> <bcyfile> <outfile> <startyear> <endyear> <unit sw> ,\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca [35 x float]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [12 x i32]
%10 = bitcast float* %3 to i8*
%11 = bitcast float* %4 to i8*
%12 = bitcast [35 x float]* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i32* %8 to i8*
%16 = bitcast [12 x i32]* %9 to i8*
%17 = icmp eq i32 %0, 7
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str.7, i64 0, i64 0))
%20 = tail call i32 @exit(i32 0)
unreachable
21: ; preds = %2
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = tail call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = tail call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = getelementptr inbounds i8*, i8** %1, i64 3
%29 = load i8*, i8** %28
%30 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%31 = getelementptr inbounds i8*, i8** %1, i64 4
%32 = load i8*, i8** %31
%33 = call i32 @sscanf(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%34 = getelementptr inbounds i8*, i8** %1, i64 5
%35 = load i8*, i8** %34
%36 = call i32 @sscanf(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%37 = getelementptr inbounds i8*, i8** %1, i64 6
%38 = load i8*, i8** %37
%39 = call i32 @sscanf(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
store float 0.000000e+00, float* %4
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = icmp sgt i32 %40, %41
br i1 %42, label %128, label %43
43: ; preds = %21
%44 = getelementptr inbounds [12 x i32], [12 x i32]* %9, i64 0, i64 4
br label %45
45: ; preds = %43, %124
%46 = phi float [ 0.000000e+00, %43 ], [ %121, %124 ]
%47 = phi i32 [ %40, %43 ], [ %125, %124 ]
%48 = phi float [ undef, %43 ], [ %120, %124 ]
%49 = and i32 %47, 3
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %57
51: ; preds = %45
%52 = srem i32 %47, 100
%53 = icmp eq i32 %52, 0
%54 = srem i32 %47, 400
%55 = icmp ne i32 %54, 0
%56 = and i1 %53, %55
br i1 %56, label %57, label %58
57: ; preds = %51, %45
br label %58
58: ; preds = %51, %57
%59 = phi i32 [ 28, %57 ], [ 29, %51 ]
store i32 %59, i32* %44
br label %60
60: ; preds = %58, %119
%61 = phi i64 [ 0, %58 ], [ %122, %119 ]
%62 = phi float [ %46, %58 ], [ %121, %119 ]
%63 = phi float [ %48, %58 ], [ %120, %119 ]
%64 = call i32 @fscanf(i32* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %4)
%65 = getelementptr inbounds [12 x i32], [12 x i32]* %9, i64 0, i64 %61
%66 = load i32, i32* %65
%67 = icmp slt i32 %66, 1
br i1 %67, label %119, label %68
68: ; preds = %60
%69 = sitofp i32 %66 to float
%70 = zext i32 %66 to i64
%71 = add nuw i32 %66, 1
%72 = zext i32 %71 to i64
br label %73
73: ; preds = %68, %114
%74 = phi i64 [ 1, %68 ], [ %117, %114 ]
%75 = phi float [ %62, %68 ], [ %116, %114 ]
%76 = phi float [ %63, %68 ], [ %115, %114 ]
%77 = call i32 @fscanf(i32* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%78 = icmp eq i32 %77, 1
br i1 %78, label %82, label %79
79: ; preds = %73
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%81 = call i32 @exit(i32 0)
unreachable
82: ; preds = %73
%83 = load float, float* %3
%84 = fadd float %75, %83
%85 = add nsw i64 %74, -1
%86 = getelementptr inbounds [35 x float], [35 x float]* %5, i64 0, i64 %85
store float %83, float* %86
%87 = icmp eq i64 %74, %70
br i1 %87, label %88, label %114
88: ; preds = %82
%89 = load float, float* %4
%90 = fcmp oeq float %89, 0.000000e+00
%91 = fcmp oeq float %84, 0.000000e+00
%92 = select i1 %90, i1 true, i1 %91
br i1 %92, label %104, label %93
93: ; preds = %88
%94 = load i32, i32* %8
switch i32 %94, label %104 [
i32 0, label %95
i32 1, label %98
]
95: ; preds = %93
%96 = fdiv float %84, %69
%97 = fdiv float %89, %96
br label %104
98: ; preds = %93
%99 = fpext float %89 to double
%100 = fmul double %99, 5.041700e-01
%101 = fpext float %84 to double
%102 = fdiv double %100, %101
%103 = fptrunc double %102 to float
br label %104
104: ; preds = %98, %88, %95, %93
%105 = phi float [ %103, %98 ], [ 0.000000e+00, %88 ], [ %97, %95 ], [ %76, %93 ]
br label %106
106: ; preds = %104, %106
%107 = phi i64 [ 0, %104 ], [ %112, %106 ]
%108 = getelementptr inbounds [35 x float], [35 x float]* %5, i64 0, i64 %107
%109 = load float, float* %108
%110 = fmul float %105, %109
%111 = call i32 @fprintf(i32* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), float %110)
%112 = add nuw nsw i64 %107, 1
%113 = icmp eq i64 %112, %70
br i1 %113, label %114, label %106
114: ; preds = %106, %82
%115 = phi float [ %76, %82 ], [ %105, %106 ]
%116 = phi float [ %84, %82 ], [ 0.000000e+00, %106 ]
%117 = add nuw nsw i64 %74, 1
%118 = icmp eq i64 %117, %72
br i1 %118, label %119, label %73
119: ; preds = %114, %60
%120 = phi float [ %63, %60 ], [ %115, %114 ]
%121 = phi float [ %62, %60 ], [ %116, %114 ]
%122 = add nuw nsw i64 %61, 1
%123 = icmp eq i64 %122, 12
br i1 %123, label %124, label %60
124: ; preds = %119
%125 = add nsw i32 %47, 1
%126 = load i32, i32* %7
%127 = icmp slt i32 %47, %126
br i1 %127, label %45, label %128
128: ; preds = %124, %21
ret i32 0
}