#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 /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, float *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int main(int argc, char *argv[]) {
  FILE *rawfile, *rawccfile, *bcdfile, *outfile;
  float tmp, sum1, sum2, sum3, sum4, data, bcmdata[35];
  int i, j, k, n, day, mnth, year, nday, startwy, endwy, unitsw, DayYear;
  int dpm[12] = {31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30};
  int tdeom[12] = {30, 60, 91, 122, 150, 181, 211, 242, 272, 303, 334, 364};
  int tdeoml[12] = {30, 60, 91, 122, 151, 182, 212, 243, 273, 304, 335, 365};
  float temp[4] = {0, 0, 0, 0};
  int leap = 0;
  if (argc != 5) {
    printf("Wrong command line arguments: enter <bcdfile> <outfile> "
           "<startyear> <endyear> ,\n");
    exit(0);
  }
  bcdfile = fopen(argv[1], "r");
  outfile = fopen(argv[2], "w");
  sscanf(argv[3], "%d", &startwy);
  sscanf(argv[4], "%d", &endwy);
  n = 0;
  i = 0;
  year = startwy;
  float OneYear[366];
  int EndJuly;
  while (n < DayYear || year <= endwy) {
    if ((year % 4 == 0) && (((year % 100 == 0) && (year % 400 != 0)) == 0)) {
      dpm[4] = 29;
      tdeom[4] = 152;
      DayYear = 365;
      leap = 1;
    } else {
      DayYear = 364;
      leap = 0;
    }
    fscanf(bcdfile, "%f", &tmp);
    OneYear[n] = tmp;
    if (leap == 1) {
      if (n == tdeoml[i] + 1) {
        float temp = OneYear[tdeoml[i]];
        OneYear[tdeoml[i]] =
            (3 * OneYear[tdeoml[i]] + OneYear[tdeoml[i] + 1]) / 4;
        OneYear[tdeoml[i] + 1] = (temp + 3 * OneYear[tdeoml[i] + 1]) / 4;
        i++;
      }
    } else {
      if (n == tdeom[i] + 1) {
        float temp = OneYear[tdeom[i]];
        OneYear[tdeom[i]] = (3 * OneYear[tdeom[i]] + OneYear[tdeom[i] + 1]) / 4;
        OneYear[tdeom[i] + 1] = (temp + 3 * OneYear[tdeom[i] + 1]) / 4;
        i++;
      }
    }
    if (n == DayYear) {
      year++;
      n = -1;
      i = 0;
      for (j = 0; j <= DayYear; j++) {
        fprintf(outfile, "%10.3f\n", OneYear[j]);
      }
    }
    n++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x780,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x140(%rbp),%rdi
lea    0xe69(%rip),%rsi
mov    $0x30,%edx
call   1070 <memcpy@plt>
lea    -0x170(%rbp),%rdi
lea    0xe81(%rip),%rsi
mov    $0x30,%edx
call   1070 <memcpy@plt>
lea    -0x1a0(%rbp),%rdi
lea    0xe99(%rip),%rsi
mov    $0x30,%edx
call   1070 <memcpy@plt>
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     121b <main+0x9b>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec7(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xeb1(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe9b(%rip),%rsi
lea    -0x104(%rbp),%rdx
call   1080 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xe80(%rip),%rsi
lea    -0x108(%rbp),%rdx
call   1080 <sscanf@plt>
movl   $0x0,-0xf0(%rbp)
movl   $0x0,-0xe4(%rbp)
mov    -0x104(%rbp),%eax
mov    %eax,-0xfc(%rbp)
mov    -0xf0(%rbp),%ecx
mov    $0x1,%al
cmp    -0x110(%rbp),%ecx
mov    %al,-0x77d(%rbp)
jl     12d0 <main+0x150>
mov    -0xfc(%rbp),%eax
cmp    -0x108(%rbp),%eax
setle  %al
mov    %al,-0x77d(%rbp)
mov    -0x77d(%rbp),%al
test   $0x1,%al
jne    12e3 <main+0x163>
jmp    168a <main+0x50a>
mov    -0xfc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1374 <main+0x1f4>
mov    -0xfc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x77e(%rbp)
jne    1333 <main+0x1b3>
mov    -0xfc(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x77e(%rbp)
mov    -0x77e(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    1374 <main+0x1f4>
movl   $0x1d,-0x130(%rbp)
movl   $0x98,-0x160(%rbp)
movl   $0x16d,-0x110(%rbp)
movl   $0x1,-0x1b4(%rbp)
jmp    1388 <main+0x208>
movl   $0x16c,-0x110(%rbp)
movl   $0x0,-0x1b4(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xd65(%rip),%rsi
lea    -0x34(%rbp),%rdx
call   1050 <fscanf@plt>
movss  -0x34(%rbp),%xmm0
movslq -0xf0(%rbp),%rax
movss  %xmm0,-0x770(%rbp,%rax,4)
ff ff
cmpl   $0x1,-0x1b4(%rbp)
jne    14d5 <main+0x355>
mov    -0xf0(%rbp),%eax
movslq -0xe4(%rbp),%rcx
mov    -0x1a0(%rbp,%rcx,4),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    14d0 <main+0x350>
movslq -0xe4(%rbp),%rax
movslq -0x1a0(%rbp,%rax,4),%rax
ff
movss  -0x770(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x778(%rbp)
ff
movslq -0xe4(%rbp),%rax
movslq -0x1a0(%rbp,%rax,4),%rax
ff
movss  -0x770(%rbp,%rax,4),%xmm0
ff ff
movslq -0xe4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    $0x1,%eax
cltq
movss  -0x770(%rbp,%rax,4),%xmm1
ff ff
movss  0xbcb(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xbb7(%rip),%xmm1
divss  %xmm1,%xmm0
movslq -0xe4(%rbp),%rax
movslq -0x1a0(%rbp,%rax,4),%rax
ff
movss  %xmm0,-0x770(%rbp,%rax,4)
ff ff
movss  -0x778(%rbp),%xmm1
ff
movslq -0xe4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    $0x1,%eax
cltq
movss  -0x770(%rbp,%rax,4),%xmm0
ff ff
movss  0xb73(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xb5f(%rip),%xmm1
divss  %xmm1,%xmm0
movslq -0xe4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    $0x1,%eax
cltq
movss  %xmm0,-0x770(%rbp,%rax,4)
ff ff
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    15ec <main+0x46c>
mov    -0xf0(%rbp),%eax
movslq -0xe4(%rbp),%rcx
mov    -0x170(%rbp,%rcx,4),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    15e7 <main+0x467>
movslq -0xe4(%rbp),%rax
movslq -0x170(%rbp,%rax,4),%rax
ff
movss  -0x770(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x77c(%rbp)
ff
movslq -0xe4(%rbp),%rax
movslq -0x170(%rbp,%rax,4),%rax
ff
movss  -0x770(%rbp,%rax,4),%xmm0
ff ff
movslq -0xe4(%rbp),%rax
mov    -0x170(%rbp,%rax,4),%eax
add    $0x1,%eax
cltq
movss  -0x770(%rbp,%rax,4),%xmm1
ff ff
movss  0xab4(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xaa0(%rip),%xmm1
divss  %xmm1,%xmm0
movslq -0xe4(%rbp),%rax
movslq -0x170(%rbp,%rax,4),%rax
ff
movss  %xmm0,-0x770(%rbp,%rax,4)
ff ff
movss  -0x77c(%rbp),%xmm1
ff
movslq -0xe4(%rbp),%rax
mov    -0x170(%rbp,%rax,4),%eax
add    $0x1,%eax
cltq
movss  -0x770(%rbp,%rax,4),%xmm0
ff ff
movss  0xa5c(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xa48(%rip),%xmm1
divss  %xmm1,%xmm0
movslq -0xe4(%rbp),%rax
mov    -0x170(%rbp,%rax,4),%eax
add    $0x1,%eax
cltq
movss  %xmm0,-0x770(%rbp,%rax,4)
ff ff
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    15ec <main+0x46c>
mov    -0xf0(%rbp),%eax
cmp    -0x110(%rbp),%eax
jne    1676 <main+0x4f6>
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
movl   $0xffffffff,-0xf0(%rbp)
ff ff ff
movl   $0x0,-0xe4(%rbp)
movl   $0x0,-0xe8(%rbp)
mov    -0xe8(%rbp),%eax
cmp    -0x110(%rbp),%eax
jg     1671 <main+0x4f1>
mov    -0x30(%rbp),%rdi
movslq -0xe8(%rbp),%rax
movss  -0x770(%rbp,%rax,4),%xmm0
ff ff
lea    0xaa3(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
jmp    162b <main+0x4ab>
jmp    1676 <main+0x4f6>
mov    -0xf0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf0(%rbp)
jmp    12a1 <main+0x121>
mov    -0x4(%rbp),%eax
add    $0x780,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x608,%rsp
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
cmp    $0x5,%edi
jne    1376 <main+0x216>
mov    %rsi,%r15
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,0x18(%rsp)
mov    0x10(%r15),%rdi
lea    0xeb1(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
mov    0x18(%r15),%rdi
lea    0xea0(%rip),%r12
lea    0x10(%rsp),%rdx
mov    %r12,%rsi
call   1060 <sscanf@plt>
mov    0x20(%r15),%rdi
lea    0xc(%rsp),%rdx
mov    %r12,%rsi
call   1060 <sscanf@plt>
mov    0x10(%rsp),%edx
cmp    0xc(%rsp),%edx
jle    1210 <main+0xb0>
xor    %eax,%eax
add    $0x608,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
lea    0xe61(%rip),%r13
xor    %r15d,%r15d
nopl   0x0(%rax)
mov    $0x16c,%r14d
test   $0x3,%dl
mov    %edx,0x8(%rsp)
jne    126f <main+0x10f>
imul   $0xc28f5c29,%edx,%eax
add    $0x51eb850,%eax
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
ja     1360 <main+0x200>
movslq %edx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
imul   $0x190,%eax,%eax
mov    %edx,%ecx
sub    %eax,%ecx
je     1360 <main+0x200>
xor    %r12d,%r12d
mov    0x18(%rsp),%rdi
lea    0xdf9(%rip),%rsi
lea    0x14(%rsp),%rdx
call   1040 <fscanf@plt>
movss  0x14(%rsp),%xmm0
movslq %r15d,%rax
movss  %xmm0,0x50(%rsp,%rax,4)
movslq %ebp,%rcx
test   %r12b,%r12b
je     12b0 <main+0x150>
lea    0xd9a(%rip),%rdx
mov    (%rdx,%rcx,4),%ecx
jmp    12b4 <main+0x154>
nopl   0x0(%rax,%rax,1)
mov    0x20(%rsp,%rcx,4),%ecx
lea    0x1(%rcx),%edx
cmp    %edx,%r15d
jne    12ff <main+0x19f>
movslq %ecx,%rcx
movss  0x50(%rsp,%rcx,4),%xmm1
movaps %xmm1,%xmm2
movss  0xd30(%rip),%xmm3
mulss  %xmm3,%xmm2
addss  %xmm0,%xmm2
movss  0xd24(%rip),%xmm4
mulss  %xmm4,%xmm2
movss  %xmm2,0x50(%rsp,%rcx,4)
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm4,%xmm0
movss  %xmm0,0x50(%rsp,%rax,4)
add    $0x1,%ebp
cmp    %r14d,%r15d
jne    1340 <main+0x1e0>
add    $0x1,%r15d
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movss  0x50(%rsp,%rbp,4),%xmm0
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1310 <main+0x1b0>
mov    0x8(%rsp),%edx
add    $0x1,%edx
xor    %ebp,%ebp
mov    $0xffffffff,%r15d
jmp    1344 <main+0x1e4>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%edx
add    $0x1,%r15d
cmp    %r14d,%r15d
jl     1220 <main+0xc0>
cmp    0xc(%rsp),%edx
jle    1220 <main+0xc0>
jmp    11fc <main+0x9c>
movl   $0x98,0x30(%rsp)
mov    $0x1,%r12b
mov    $0x16d,%r14d
jmp    1272 <main+0x112>
lea    0xd05(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

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]
@__const.main.tdeom = [12 x i32] [i32 30, i32 60, i32 91, i32 122, i32 150, i32 181, i32 211, i32 242, i32 272, i32 303, i32 334, i32 364]
@__const.main.tdeoml = [12 x i32] [i32 30, i32 60, i32 91, i32 122, i32 151, i32 182, i32 212, i32 243, i32 273, i32 304, i32 335, i32 365]
@.str = [81 x i8] c"Wrong command line arguments: enter <bcdfile> <outfile> <startyear> <endyear> ,\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 = [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 float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca [35 x float]
%17 = alloca i32
%18 = alloca i32
%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 [12 x i32]
%30 = alloca [12 x i32]
%31 = alloca [12 x i32]
%32 = alloca [4 x float]
%33 = alloca i32
%34 = alloca [366 x float]
%35 = alloca i32
%36 = alloca float
%37 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%38 = bitcast [12 x i32]* %29 to i8*
%39 = bitcast [12 x i32]* %30 to i8*
%40 = bitcast [12 x i32]* %31 to i8*
%41 = bitcast [4 x float]* %32 to i8*
store i32 0, i32* %33
%42 = load i32, i32* %4
%43 = icmp ne i32 %42, 5
br i1 %43, label %44, label %47
44: ; preds = %2
%45 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%46 = call i32 @exit(i32 0)
unreachable
47: ; preds = %2
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = call i32* @fopen(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %51, i32** %8
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 2
%54 = load i8*, i8** %53
%55 = call i32* @fopen(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %55, i32** %9
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 3
%58 = load i8*, i8** %57
%59 = call i32 @sscanf(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %25)
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 4
%62 = load i8*, i8** %61
%63 = call i32 @sscanf(i8* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %26)
store i32 0, i32* %20
store i32 0, i32* %17
%64 = load i32, i32* %25
store i32 %64, i32* %23
br label %65
65: ; preds = %246, %47
%66 = load i32, i32* %20
%67 = load i32, i32* %28
%68 = icmp slt i32 %66, %67
br i1 %68, label %73, label %69
69: ; preds = %65
%70 = load i32, i32* %23
%71 = load i32, i32* %26
%72 = icmp sle i32 %70, %71
br label %73
73: ; preds = %69, %65
%74 = phi i1 [ true, %65 ], [ %72, %69 ]
br i1 %74, label %75, label %249
75: ; preds = %73
%76 = load i32, i32* %23
%77 = srem i32 %76, 4
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %94
79: ; preds = %75
%80 = load i32, i32* %23
%81 = srem i32 %80, 100
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %87
83: ; preds = %79
%84 = load i32, i32* %23
%85 = srem i32 %84, 400
%86 = icmp ne i32 %85, 0
br label %87
87: ; preds = %83, %79
%88 = phi i1 [ false, %79 ], [ %86, %83 ]
%89 = zext i1 %88 to i32
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %94
91: ; preds = %87
%92 = getelementptr inbounds [12 x i32], [12 x i32]* %29, i64 0, i64 4
store i32 29, i32* %92
%93 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 4
store i32 152, i32* %93
store i32 365, i32* %28
store i32 1, i32* %33
br label %95
94: ; preds = %87, %75
store i32 364, i32* %28
store i32 0, i32* %33
br label %95
95: ; preds = %94, %91
%96 = load i32*, i32** %8
%97 = call i32 @fscanf(i32* %96, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %10)
%98 = load float, float* %10
%99 = load i32, i32* %20
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %100
store float %98, float* %101
%102 = load i32, i32* %33
%103 = icmp eq i32 %102, 1
br i1 %103, label %104, label %164
104: ; preds = %95
%105 = load i32, i32* %20
%106 = load i32, i32* %17
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [12 x i32], [12 x i32]* %31, i64 0, i64 %107
%109 = load i32, i32* %108
%110 = add nsw i32 %109, 1
%111 = icmp eq i32 %105, %110
br i1 %111, label %112, label %163
112: ; preds = %104
%113 = load i32, i32* %17
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [12 x i32], [12 x i32]* %31, i64 0, i64 %114
%116 = load i32, i32* %115
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %117
%119 = load float, float* %118
store float %119, float* %36
%120 = load i32, i32* %17
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [12 x i32], [12 x i32]* %31, i64 0, i64 %121
%123 = load i32, i32* %122
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %124
%126 = load float, float* %125
%127 = load i32, i32* %17
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [12 x i32], [12 x i32]* %31, i64 0, i64 %128
%130 = load i32, i32* %129
%131 = add nsw i32 %130, 1
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %132
%134 = load float, float* %133
%135 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %126, float %134)
%136 = fdiv float %135, 4.000000e+00
%137 = load i32, i32* %17
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [12 x i32], [12 x i32]* %31, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %141
store float %136, float* %142
%143 = load float, float* %36
%144 = load i32, i32* %17
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [12 x i32], [12 x i32]* %31, i64 0, i64 %145
%147 = load i32, i32* %146
%148 = add nsw i32 %147, 1
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %149
%151 = load float, float* %150
%152 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %151, float %143)
%153 = fdiv float %152, 4.000000e+00
%154 = load i32, i32* %17
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [12 x i32], [12 x i32]* %31, i64 0, i64 %155
%157 = load i32, i32* %156
%158 = add nsw i32 %157, 1
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %159
store float %153, float* %160
%161 = load i32, i32* %17
%162 = add nsw i32 %161, 1
store i32 %162, i32* %17
br label %163
163: ; preds = %112, %104
br label %224
164: ; preds = %95
%165 = load i32, i32* %20
%166 = load i32, i32* %17
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %167
%169 = load i32, i32* %168
%170 = add nsw i32 %169, 1
%171 = icmp eq i32 %165, %170
br i1 %171, label %172, label %223
172: ; preds = %164
%173 = load i32, i32* %17
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %174
%176 = load i32, i32* %175
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %177
%179 = load float, float* %178
store float %179, float* %37
%180 = load i32, i32* %17
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %181
%183 = load i32, i32* %182
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %184
%186 = load float, float* %185
%187 = load i32, i32* %17
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %188
%190 = load i32, i32* %189
%191 = add nsw i32 %190, 1
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %192
%194 = load float, float* %193
%195 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %186, float %194)
%196 = fdiv float %195, 4.000000e+00
%197 = load i32, i32* %17
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %198
%200 = load i32, i32* %199
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %201
store float %196, float* %202
%203 = load float, float* %37
%204 = load i32, i32* %17
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %205
%207 = load i32, i32* %206
%208 = add nsw i32 %207, 1
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %209
%211 = load float, float* %210
%212 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %211, float %203)
%213 = fdiv float %212, 4.000000e+00
%214 = load i32, i32* %17
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [12 x i32], [12 x i32]* %30, i64 0, i64 %215
%217 = load i32, i32* %216
%218 = add nsw i32 %217, 1
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %219
store float %213, float* %220
%221 = load i32, i32* %17
%222 = add nsw i32 %221, 1
store i32 %222, i32* %17
br label %223
223: ; preds = %172, %164
br label %224
224: ; preds = %223, %163
%225 = load i32, i32* %20
%226 = load i32, i32* %28
%227 = icmp eq i32 %225, %226
br i1 %227, label %228, label %246
228: ; preds = %224
%229 = load i32, i32* %23
%230 = add nsw i32 %229, 1
store i32 %230, i32* %23
store i32 -1, i32* %20
store i32 0, i32* %17
store i32 0, i32* %18
br label %231
231: ; preds = %242, %228
%232 = load i32, i32* %18
%233 = load i32, i32* %28
%234 = icmp sle i32 %232, %233
br i1 %234, label %235, label %245
235: ; preds = %231
%236 = load i32*, i32** %9
%237 = load i32, i32* %18
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds [366 x float], [366 x float]* %34, i64 0, i64 %238
%240 = load float, float* %239
%241 = call i32 @fprintf(i32* %236, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), float %240)
br label %242
242: ; preds = %235
%243 = load i32, i32* %18
%244 = add nsw i32 %243, 1
store i32 %244, i32* %18
br label %231
245: ; preds = %231
br label %246
246: ; preds = %245, %224
%247 = load i32, i32* %20
%248 = add nsw i32 %247, 1
store i32 %248, i32* %20
br label %65
249: ; preds = %73
%250 = load i32, i32* %3
ret i32 %250
}

LLVM IR (-O2):
@__const.main.tdeom = [12 x i32] [i32 30, i32 60, i32 91, i32 122, i32 150, i32 181, i32 211, i32 242, i32 272, i32 303, i32 334, i32 364]
@__const.main.tdeoml = [12 x i32] [i32 30, i32 60, i32 91, i32 122, i32 151, i32 182, i32 212, i32 243, i32 273, i32 304, i32 335, i32 365]
@.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 = [8 x i8] c"%10.3f\0A\00"
@str = [80 x i8] c"Wrong command line arguments: enter <bcdfile> <outfile> <startyear> <endyear> ,\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca [12 x i32]
%7 = alloca [366 x float]
%8 = bitcast float* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast [12 x i32]* %6 to i8*
%12 = icmp eq i32 %0, 5
br i1 %12, label %16, label %13
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 0)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = tail call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = call i32 @sscanf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%26 = getelementptr inbounds i8*, i8** %1, i64 4
%27 = load i8*, i8** %26
%28 = call i32 @sscanf(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%29 = load i32, i32* %4
%30 = bitcast [366 x float]* %7 to i8*
%31 = load i32, i32* %5
%32 = icmp sgt i32 %29, %31
br i1 %32, label %100, label %33
33: ; preds = %16
%34 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 4
br label %35
35: ; preds = %33, %91
%36 = phi i32 [ 0, %33 ], [ %94, %91 ]
%37 = phi i32 [ 0, %33 ], [ %95, %91 ]
%38 = phi i32 [ %29, %33 ], [ %92, %91 ]
%39 = and i32 %38, 3
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %48
41: ; preds = %35
%42 = srem i32 %38, 100
%43 = icmp eq i32 %42, 0
%44 = srem i32 %38, 400
%45 = icmp ne i32 %44, 0
%46 = and i1 %43, %45
br i1 %46, label %48, label %47
47: ; preds = %41
store i32 152, i32* %34
br label %48
48: ; preds = %41, %35, %47
%49 = phi i32 [ 365, %47 ], [ 364, %35 ], [ 364, %41 ]
%50 = phi i1 [ true, %47 ], [ false, %35 ], [ false, %41 ]
%51 = call i32 @fscanf(i32* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%52 = load float, float* %3
%53 = sext i32 %37 to i64
%54 = getelementptr inbounds [366 x float], [366 x float]* %7, i64 0, i64 %53
store float %52, float* %54
%55 = sext i32 %36 to i64
br i1 %50, label %56, label %61
56: ; preds = %48
%57 = getelementptr inbounds [12 x i32], [12 x i32]* @__const.main.tdeoml, i64 0, i64 %55
%58 = load i32, i32* %57
%59 = add nsw i32 %58, 1
%60 = icmp eq i32 %37, %59
br i1 %60, label %66, label %76
61: ; preds = %48
%62 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 %55
%63 = load i32, i32* %62
%64 = add nsw i32 %63, 1
%65 = icmp eq i32 %37, %64
br i1 %65, label %66, label %76
66: ; preds = %61, %56
%67 = phi i32 [ %58, %56 ], [ %63, %61 ]
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [366 x float], [366 x float]* %7, i64 0, i64 %68
%70 = load float, float* %69
%71 = call float @llvm.fmuladd.f32(float %70, float 3.000000e+00, float %52)
%72 = fmul float %71, 2.500000e-01
store float %72, float* %69
%73 = call float @llvm.fmuladd.f32(float %52, float 3.000000e+00, float %70)
%74 = fmul float %73, 2.500000e-01
store float %74, float* %54
%75 = add nsw i32 %36, 1
br label %76
76: ; preds = %66, %61, %56
%77 = phi i32 [ %36, %56 ], [ %36, %61 ], [ %75, %66 ]
%78 = icmp eq i32 %37, %49
br i1 %78, label %79, label %91
79: ; preds = %76
%80 = add nuw nsw i32 %37, 1
%81 = zext i32 %80 to i64
br label %82
82: ; preds = %79, %82
%83 = phi i64 [ 0, %79 ], [ %87, %82 ]
%84 = getelementptr inbounds [366 x float], [366 x float]* %7, i64 0, i64 %83
%85 = load float, float* %84
%86 = call i32 @fprintf(i32* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), float %85)
%87 = add nuw nsw i64 %83, 1
%88 = icmp eq i64 %87, %81
br i1 %88, label %89, label %82
89: ; preds = %82
%90 = add nsw i32 %38, 1
br label %91
91: ; preds = %89, %76
%92 = phi i32 [ %38, %76 ], [ %90, %89 ]
%93 = phi i32 [ %37, %76 ], [ -1, %89 ]
%94 = phi i32 [ %77, %76 ], [ 0, %89 ]
%95 = add nsw i32 %93, 1
%96 = icmp slt i32 %95, %49
%97 = load i32, i32* %5
%98 = icmp sle i32 %92, %97
%99 = select i1 %96, i1 true, i1 %98
br i1 %99, label %35, label %100
100: ; preds = %91, %16
ret i32 0
}