#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  const float rain[5][12] = {
      {4.3, 4.3, 4.3, 3.0, 2.0, 1.2, 0.2, 0.2, 0.4, 2.4, 3.5, 6.6},
      {8.5, 8.2, 1.2, 1.6, 2.4, 0.0, 5.2, 0.9, 0.3, 0.9, 1.4, 7.3},
      {9.1, 8.5, 6.7, 4.3, 2.1, 0.8, 0.2, 0.2, 1.1, 2.3, 6.1, 8.4},
      {7.2, 9.9, 8.4, 3.3, 1.2, 0.8, 0.4, 0.0, 0.6, 1.7, 4.3, 6.2},
      {7.6, 5.6, 3.8, 2.8, 3.8, 0.2, 0.0, 0.0, 0.0, 1.3, 2.6, 5.2}};
  int year, month;
  float subtot, total;
  printf(" YEAR RAINFALL (inches) \n");
  for (year = 0, total = 0; year < 5; year++) {
    for (month = 0, subtot = 0; month < 12; month++)
      subtot += rain[year][month];
    printf("%5d %15.1f\n", 2000 + year, subtot);
    total += subtot;
  }
  printf("\nThe yearly average is %.1f inches.\n\n", total / 5);
  printf("MONTHLY AVERAGES: \n\n");
  printf(" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec\n");
  for (month = 0; month < 12; month++) {
    for (year = 0, subtot = 0; year < 5; year++)
      subtot += rain[year][month];
    printf("%4.1f ", subtot / 5);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xed0(%rip),%rsi
mov    $0xf0,%edx
call   1040 <memcpy@plt>
lea    0xfaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x104(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x110(%rbp)
ff
cmpl   $0x5,-0x104(%rbp)
jge    1233 <main+0x113>
movl   $0x0,-0x108(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10c(%rbp)
ff
cmpl   $0xc,-0x108(%rbp)
jge    11e1 <main+0xc1>
movslq -0x104(%rbp),%rcx
lea    -0x100(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movslq -0x108(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x10c(%rbp),%xmm0
ff
movss  %xmm0,-0x10c(%rbp)
ff
mov    -0x108(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x108(%rbp)
jmp    118f <main+0x6f>
mov    -0x104(%rbp),%esi
add    $0x7d0,%esi
movss  -0x10c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xf1a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10c(%rbp),%xmm0
ff
addss  -0x110(%rbp),%xmm0
ff
movss  %xmm0,-0x110(%rbp)
ff
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    116d <main+0x4d>
movss  -0x110(%rbp),%xmm0
ff
movss  0xdbd(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x108(%rbp)
cmpl   $0xc,-0x108(%rbp)
jge    132d <main+0x20d>
movl   $0x0,-0x104(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10c(%rbp)
ff
cmpl   $0x5,-0x104(%rbp)
jge    12f3 <main+0x1d3>
movslq -0x104(%rbp),%rcx
lea    -0x100(%rbp),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movslq -0x108(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x10c(%rbp),%xmm0
ff
movss  %xmm0,-0x10c(%rbp)
ff
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    12a1 <main+0x181>
movss  -0x10c(%rbp),%xmm0
ff
movss  0xcfd(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe81(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x108(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x108(%rbp)
jmp    127f <main+0x15f>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xffb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7d0,%ebp
xor    %ebx,%ebx
lea    0xebf(%rip),%r15
lea    0xfa8(%rip),%r14
xorps  %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
movss  %xmm0,0x4(%rsp)
movss  (%rbx,%r15,1),%xmm0
addss  0xe90(%rip),%xmm0
addss  0x4(%rbx,%r15,1),%xmm0
addss  0x8(%rbx,%r15,1),%xmm0
addss  0xc(%rbx,%r15,1),%xmm0
addss  0x10(%rbx,%r15,1),%xmm0
addss  0x14(%rbx,%r15,1),%xmm0
addss  0x18(%rbx,%r15,1),%xmm0
addss  0x1c(%rbx,%r15,1),%xmm0
addss  0x20(%rbx,%r15,1),%xmm0
addss  0x24(%rbx,%r15,1),%xmm0
addss  0x28(%rbx,%r15,1),%xmm0
addss  0x2c(%rbx,%r15,1),%xmm0
movss  %xmm0,(%rsp)
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    %ebp,%esi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
add    $0x1,%ebp
add    $0x30,%rbx
cmp    $0xf0,%rbx
jne    1160 <main+0x30>
divss  0xe03(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf04(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xf3c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf44(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffffffffffffff4,%rbp
lea    0xefd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movss  0x30(%r15,%rbp,4),%xmm0
addss  0xdb5(%rip),%xmm0
addss  0x60(%r15,%rbp,4),%xmm0
addss  0x90(%r15,%rbp,4),%xmm0
addss  0xc0(%r15,%rbp,4),%xmm0
addss  0xf0(%r15,%rbp,4),%xmm0
divss  0xd84(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
inc    %rbp
jne    1240 <main+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.rain = [5 x [12 x float]] [[12 x float] [float 0x4011333340000000, float 0x4011333340000000, float 0x4011333340000000, float 3.000000e+00, float 2.000000e+00, float 0x3FF3333340000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FD99999A0000000, float 0x4003333340000000, float 3.500000e+00, float 0x401A666660000000], [12 x float] [float 8.500000e+00, float 0x4020666660000000, float 0x3FF3333340000000, float 0x3FF99999A0000000, float 0x4003333340000000, float 0.000000e+00, float 0x4014CCCCC0000000, float 0x3FECCCCCC0000000, float 0x3FD3333340000000, float 0x3FECCCCCC0000000, float 0x3FF6666660000000, float 0x401D333340000000], [12 x float] [float 0x4022333340000000, float 8.500000e+00, float 0x401ACCCCC0000000, float 0x4011333340000000, float 0x4000CCCCC0000000, float 0x3FE99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FF19999A0000000, float 0x4002666660000000, float 0x4018666660000000, float 0x4020CCCCC0000000], [12 x float] [float 0x401CCCCCC0000000, float 0x4023CCCCC0000000, float 0x4020CCCCC0000000, float 0x400A666660000000, float 0x3FF3333340000000, float 0x3FE99999A0000000, float 0x3FD99999A0000000, float 0.000000e+00, float 0x3FE3333340000000, float 0x3FFB333340000000, float 0x4011333340000000, float 0x4018CCCCC0000000], [12 x float] [float 0x401E666660000000, float 0x4016666660000000, float 0x400E666660000000, float 0x4006666660000000, float 0x400E666660000000, float 0x3FC99999A0000000, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0x3FF4CCCCC0000000, float 0x4004CCCCC0000000, float 0x4014CCCCC0000000]]
@.str = [26 x i8] c" YEAR RAINFALL (inches) \0A\00"
@.str.1 = [12 x i8] c"%5d %15.1f\0A\00"
@.str.2 = [38 x i8] c"\0AThe yearly average is %.1f inches.\0A\0A\00"
@.str.3 = [21 x i8] c"MONTHLY AVERAGES: \0A\0A\00"
@.str.4 = [50 x i8] c" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec\0A\00"
@.str.5 = [7 x i8] c"%4.1f \00"
@.str.6 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [12 x float]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = bitcast [5 x [12 x float]]* %2 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
store float 0.000000e+00, float* %6
br label %9
9: ; preds = %38, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %41
12: ; preds = %9
store i32 0, i32* %4
store float 0.000000e+00, float* %5
br label %13
13: ; preds = %26, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 12
br i1 %15, label %16, label %29
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* %2, i64 0, i64 %18
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [12 x float], [12 x float]* %19, i64 0, i64 %21
%23 = load float, float* %22
%24 = load float, float* %5
%25 = fadd float %24, %23
store float %25, float* %5
br label %26
26: ; preds = %16
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %13
29: ; preds = %13
%30 = load i32, i32* %3
%31 = add nsw i32 2000, %30
%32 = load float, float* %5
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %31, double %33)
%35 = load float, float* %5
%36 = load float, float* %6
%37 = fadd float %36, %35
store float %37, float* %6
br label %38
38: ; preds = %29
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %9
41: ; preds = %9
%42 = load float, float* %6
%43 = fdiv float %42, 5.000000e+00
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %48
48: ; preds = %73, %41
%49 = load i32, i32* %4
%50 = icmp slt i32 %49, 12
br i1 %50, label %51, label %76
51: ; preds = %48
store i32 0, i32* %3
store float 0.000000e+00, float* %5
br label %52
52: ; preds = %65, %51
%53 = load i32, i32* %3
%54 = icmp slt i32 %53, 5
br i1 %54, label %55, label %68
55: ; preds = %52
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* %2, i64 0, i64 %57
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [12 x float], [12 x float]* %58, i64 0, i64 %60
%62 = load float, float* %61
%63 = load float, float* %5
%64 = fadd float %63, %62
store float %64, float* %5
br label %65
65: ; preds = %55
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
store i32 %67, i32* %3
br label %52
68: ; preds = %52
%69 = load float, float* %5
%70 = fdiv float %69, 5.000000e+00
%71 = fpext float %70 to double
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %71)
br label %73
73: ; preds = %68
%74 = load i32, i32* %4
%75 = add nsw i32 %74, 1
store i32 %75, i32* %4
br label %48
76: ; preds = %48
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.rain = [5 x [12 x float]] [[12 x float] [float 0x4011333340000000, float 0x4011333340000000, float 0x4011333340000000, float 3.000000e+00, float 2.000000e+00, float 0x3FF3333340000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FD99999A0000000, float 0x4003333340000000, float 3.500000e+00, float 0x401A666660000000], [12 x float] [float 8.500000e+00, float 0x4020666660000000, float 0x3FF3333340000000, float 0x3FF99999A0000000, float 0x4003333340000000, float 0.000000e+00, float 0x4014CCCCC0000000, float 0x3FECCCCCC0000000, float 0x3FD3333340000000, float 0x3FECCCCCC0000000, float 0x3FF6666660000000, float 0x401D333340000000], [12 x float] [float 0x4022333340000000, float 8.500000e+00, float 0x401ACCCCC0000000, float 0x4011333340000000, float 0x4000CCCCC0000000, float 0x3FE99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FF19999A0000000, float 0x4002666660000000, float 0x4018666660000000, float 0x4020CCCCC0000000], [12 x float] [float 0x401CCCCCC0000000, float 0x4023CCCCC0000000, float 0x4020CCCCC0000000, float 0x400A666660000000, float 0x3FF3333340000000, float 0x3FE99999A0000000, float 0x3FD99999A0000000, float 0.000000e+00, float 0x3FE3333340000000, float 0x3FFB333340000000, float 0x4011333340000000, float 0x4018CCCCC0000000], [12 x float] [float 0x401E666660000000, float 0x4016666660000000, float 0x400E666660000000, float 0x4006666660000000, float 0x400E666660000000, float 0x3FC99999A0000000, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0x3FF4CCCCC0000000, float 0x4004CCCCC0000000, float 0x4014CCCCC0000000]]
@.str.1 = [12 x i8] c"%5d %15.1f\0A\00"
@.str.2 = [38 x i8] c"\0AThe yearly average is %.1f inches.\0A\0A\00"
@.str.5 = [7 x i8] c"%4.1f \00"
@str = [25 x i8] c" YEAR RAINFALL (inches) \00"
@str.7 = [20 x i8] c"MONTHLY AVERAGES: \0A\00"
@str.8 = [49 x i8] c" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i64 [ 0, %0 ], [ %46, %2 ]
%4 = phi float [ 0.000000e+00, %0 ], [ %45, %2 ]
%5 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 0
%6 = load float, float* %5
%7 = fadd float %6, 0.000000e+00
%8 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 1
%9 = load float, float* %8
%10 = fadd float %7, %9
%11 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 2
%12 = load float, float* %11
%13 = fadd float %10, %12
%14 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 3
%15 = load float, float* %14
%16 = fadd float %13, %15
%17 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 4
%18 = load float, float* %17
%19 = fadd float %16, %18
%20 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 5
%21 = load float, float* %20
%22 = fadd float %19, %21
%23 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 6
%24 = load float, float* %23
%25 = fadd float %22, %24
%26 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 7
%27 = load float, float* %26
%28 = fadd float %25, %27
%29 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 8
%30 = load float, float* %29
%31 = fadd float %28, %30
%32 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 9
%33 = load float, float* %32
%34 = fadd float %31, %33
%35 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 10
%36 = load float, float* %35
%37 = fadd float %34, %36
%38 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 %3, i64 11
%39 = load float, float* %38
%40 = fadd float %37, %39
%41 = fpext float %40 to double
%42 = trunc i64 %3 to i32
%43 = add i32 %42, 2000
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %43, double %41)
%45 = fadd float %4, %40
%46 = add nuw nsw i64 %3, 1
%47 = icmp eq i64 %46, 5
br i1 %47, label %48, label %2
48: ; preds = %2
%49 = fdiv float %45, 5.000000e+00
%50 = fpext float %49 to double
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %50)
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.8, i64 0, i64 0))
br label %54
54: ; preds = %48, %54
%55 = phi i64 [ 0, %48 ], [ %74, %54 ]
%56 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 0, i64 %55
%57 = load float, float* %56
%58 = fadd float %57, 0.000000e+00
%59 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 1, i64 %55
%60 = load float, float* %59
%61 = fadd float %58, %60
%62 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 2, i64 %55
%63 = load float, float* %62
%64 = fadd float %61, %63
%65 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 3, i64 %55
%66 = load float, float* %65
%67 = fadd float %64, %66
%68 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* @__const.main.rain, i64 0, i64 4, i64 %55
%69 = load float, float* %68
%70 = fadd float %67, %69
%71 = fdiv float %70, 5.000000e+00
%72 = fpext float %71 to double
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %72)
%74 = add nuw nsw i64 %55, 1
%75 = icmp eq i64 %74, 12
br i1 %75, label %76, label %54
76: ; preds = %54
%77 = tail call i32 @putchar(i32 10)
ret i32 0
}