#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("%3.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>
lea    -0x100(%rbp),%rax
movslq -0x104(%rbp),%rcx
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    0xf1b(%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    0xed5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%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>
lea    -0x100(%rbp),%rax
movslq -0x104(%rbp),%rcx
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    0xe2c(%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    0xf3d(%rip),%rdi
call   1040 <puts@plt>
lea    0xf45(%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 = [27 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 = [49 x i8] c"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec\0A\00"
@.str.5 = [7 x i8] c"%3.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 ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
store float 0.000000e+00, float* %6
br label %9
9: ; preds = %40, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %43
12: ; preds = %9
store i32 0, i32* %4
store float 0.000000e+00, float* %5
br label %13
13: ; preds = %28, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 12
br i1 %15, label %16, label %31
16: ; preds = %13
%17 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* %2, i64 0, i64 0
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [12 x float], [12 x float]* %17, i64 %19
%21 = getelementptr inbounds [12 x float], [12 x float]* %20, i64 0, i64 0
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
%25 = load float, float* %24
%26 = load float, float* %5
%27 = fadd float %26, %25
store float %27, float* %5
br label %28
28: ; preds = %16
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %13
31: ; preds = %13
%32 = load i32, i32* %3
%33 = add nsw i32 2000, %32
%34 = load float, float* %5
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %33, double %35)
%37 = load float, float* %5
%38 = load float, float* %6
%39 = fadd float %38, %37
store float %39, float* %6
br label %40
40: ; preds = %31
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %9
43: ; preds = %9
%44 = load float, float* %6
%45 = fdiv float %44, 5.000000e+00
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %50
50: ; preds = %77, %43
%51 = load i32, i32* %4
%52 = icmp slt i32 %51, 12
br i1 %52, label %53, label %80
53: ; preds = %50
store i32 0, i32* %3
store float 0.000000e+00, float* %5
br label %54
54: ; preds = %69, %53
%55 = load i32, i32* %3
%56 = icmp slt i32 %55, 5
br i1 %56, label %57, label %72
57: ; preds = %54
%58 = getelementptr inbounds [5 x [12 x float]], [5 x [12 x float]]* %2, i64 0, i64 0
%59 = load i32, i32* %3
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [12 x float], [12 x float]* %58, i64 %60
%62 = getelementptr inbounds [12 x float], [12 x float]* %61, i64 0, i64 0
%63 = load i32, i32* %4
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds float, float* %62, i64 %64
%66 = load float, float* %65
%67 = load float, float* %5
%68 = fadd float %67, %66
store float %68, float* %5
br label %69
69: ; preds = %57
%70 = load i32, i32* %3
%71 = add nsw i32 %70, 1
store i32 %71, i32* %3
br label %54
72: ; preds = %54
%73 = load float, float* %5
%74 = fdiv float %73, 5.000000e+00
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %75)
br label %77
77: ; preds = %72
%78 = load i32, i32* %4
%79 = add nsw i32 %78, 1
store i32 %79, i32* %4
br label %50
80: ; preds = %50
%81 = 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"%3.1f \00"
@str = [26 x i8] c" YEAR RAINFALL (inches) \00"
@str.7 = [20 x i8] c"MONTHLY AVERAGES: \0A\00"
@str.8 = [48 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 ([26 x i8], [26 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 ([48 x i8], [48 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
}