#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 *, ...);
void main() {
  float score[10][5] = {{80, 75, 90, 72, 74},  {85, 87, 89, 92, 100},
                        {87, 60, 61, 63, 68},  {70, 92, 88, 93, 96},
                        {87, 70, 81, 73, 88},  {78, 100, 58, 93, 96},
                        {87, 60, 61, 100, 93}, {94, 72, 88, 93, 100},
                        {87, 80, 71, 73, 68},  {80, 72, 88, 93, 96}};
  float course[10], avg, diff1 = 0, diff2 = 0;
  int i, j, rows = 10, cols = 5;
  float average(float num[], int);
  void maxscore(float num[][5], int, int);
  printf("The average score of every student:\n");
  for (i = 0; i < rows; i++) {
    printf("%6.2f ", average(score[i], cols));
    if (i % 5 == 4)
      printf("\n");
  }
  printf("The average score of every course:\n");
  for (i = 0; i < cols; i++) {
    for (j = 0; j < rows; j++) {
      course[j] = score[j][i];
    }
    printf("%6.2f ", average(course, rows));
  }
  maxscore(score, rows, cols);
  printf("The average score difference of every student:\n");
  for (i = 0; i < rows; i++) {
    avg = average(score[i], cols);
    diff1 += avg * avg;
    diff2 += avg;
  }
  diff1 = diff1 / rows;
  diff2 = diff2 / rows;
  printf("%6.2f", (diff1 - diff2 * diff2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0xd0(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0xc8,%edx
call   1050 <memcpy@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x108(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10c(%rbp)
ff
movl   $0xa,-0x118(%rbp)
movl   $0x5,-0x11c(%rbp)
lea    0xf34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x110(%rbp)
mov    -0x110(%rbp),%eax
cmp    -0x118(%rbp),%eax
jge    1227 <main+0xe7>
movslq -0x110(%rbp),%rax
lea    -0xd0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
mov    -0x11c(%rbp),%esi
call   1060 <average@plt>
cvtss2sd %xmm0,%xmm0
lea    0xf0b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x110(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x4,%edx
jne    120e <main+0xce>
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1213 <main+0xd3>
mov    -0x110(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110(%rbp)
jmp    11a5 <main+0x65>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x110(%rbp)
mov    -0x110(%rbp),%eax
cmp    -0x11c(%rbp),%eax
jge    12ea <main+0x1aa>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0x118(%rbp),%eax
jge    12b2 <main+0x172>
movslq -0x114(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x110(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movslq -0x114(%rbp),%rax
movss  %xmm0,-0x100(%rbp,%rax,4)
ff ff
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    125b <main+0x11b>
lea    -0x100(%rbp),%rdi
mov    -0x118(%rbp),%esi
call   1060 <average@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe1e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x110(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110(%rbp)
jmp    123f <main+0xff>
lea    -0xd0(%rbp),%rdi
mov    -0x118(%rbp),%esi
mov    -0x11c(%rbp),%edx
call   1030 <maxscore@plt>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x110(%rbp)
mov    -0x110(%rbp),%eax
cmp    -0x118(%rbp),%eax
jge    13a8 <main+0x268>
movslq -0x110(%rbp),%rax
lea    -0xd0(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
mov    -0x11c(%rbp),%esi
call   1060 <average@plt>
movss  %xmm0,-0x104(%rbp)
ff
movss  -0x104(%rbp),%xmm0
ff
movss  -0x104(%rbp),%xmm2
ff
movss  -0x108(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x108(%rbp)
ff
movss  -0x104(%rbp),%xmm0
ff
addss  -0x10c(%rbp),%xmm0
ff
movss  %xmm0,-0x10c(%rbp)
ff
mov    -0x110(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x110(%rbp)
jmp    131a <main+0x1da>
movss  -0x108(%rbp),%xmm0
ff
cvtsi2ssl -0x118(%rbp),%xmm1
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x108(%rbp)
ff
movss  -0x10c(%rbp),%xmm0
ff
cvtsi2ssl -0x118(%rbp),%xmm1
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x10c(%rbp)
ff
movss  -0x108(%rbp),%xmm1
ff
movss  -0x10c(%rbp),%xmm0
ff
movss  -0x10c(%rbp),%xmm2
ff
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd30(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
lea    0xe98(%rip),%rsi
lea    0x40(%rsp),%rdi
mov    $0xc8,%edx
call   1070 <memcpy@plt>
lea    0xf57(%rip),%rdi
call   1050 <puts@plt>
mov    $0x4,%r15b
xor    %ebp,%ebp
lea    0xf39(%rip),%r14
xor    %ebx,%ebx
jmp    11c4 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xff,%r15b
add    $0x1,%bl
add    $0x14,%rbp
cmp    $0xc8,%rbp
je     1205 <main+0xa5>
movzbl %bl,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%r12d
lea    (%rsp,%rbp,1),%rdi
add    $0x40,%rdi
mov    $0x5,%esi
call   1080 <average@plt>
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    %r15b,%r12b
jne    11b0 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x50>
lea    0xefd(%rip),%rdi
call   1050 <puts@plt>
movss  0x40(%rsp),%xmm0
movss  0x54(%rsp),%xmm1
movss  %xmm0,0x10(%rsp)
lea    0x54(%rsp),%r12
movss  %xmm1,0x14(%rsp)
lea    0x68(%rsp),%r15
movss  0x68(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
lea    0x7c(%rsp),%r14
movss  0x7c(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
lea    0x90(%rsp),%rbp
movss  0x90(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
movss  0xa4(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
movss  0xb8(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0xcc(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0xe0(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
movss  0xf4(%rsp),%xmm0
movss  %xmm0,0x34(%rsp)
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    $0xa,%esi
call   1080 <average@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe09(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x44(%rsp),%xmm0
movss  0x58(%rsp),%xmm1
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0x14(%rsp)
movss  0x6c(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x80(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
movss  0x94(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
movss  0xa8(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
movss  0xbc(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0xd0(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0xe4(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
movss  0xf8(%rsp),%xmm0
movss  %xmm0,0x34(%rsp)
mov    %r13,%rdi
mov    $0xa,%esi
call   1080 <average@plt>
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x48(%rsp),%xmm0
movss  0x5c(%rsp),%xmm1
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0x14(%rsp)
movss  0x70(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x84(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
movss  0x98(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
movss  0xac(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
movss  0xc0(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0xd4(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0xe8(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
movss  0xfc(%rsp),%xmm0
movss  %xmm0,0x34(%rsp)
mov    %r13,%rdi
mov    $0xa,%esi
call   1080 <average@plt>
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x4c(%rsp),%xmm0
movss  0x60(%rsp),%xmm1
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0x14(%rsp)
movss  0x74(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x88(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
movss  0x9c(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
movss  0xb0(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
movss  0xc4(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0xd8(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0xec(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
movss  0x100(%rsp),%xmm0
movss  %xmm0,0x34(%rsp)
mov    %r13,%rdi
mov    $0xa,%esi
call   1080 <average@plt>
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x50(%rsp),%xmm0
movss  0x64(%rsp),%xmm1
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0x14(%rsp)
movss  0x78(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x8c(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
movss  0xa0(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
movss  0xb4(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
movss  0xc8(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0xdc(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0xf0(%rsp),%xmm0
movss  %xmm0,0x30(%rsp)
movss  0x104(%rsp),%xmm0
movss  %xmm0,0x34(%rsp)
mov    %r13,%rdi
mov    $0xa,%esi
call   1080 <average@plt>
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x5,%edx
call   1040 <maxscore@plt>
lea    0xb95(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
xorps  %xmm1,%xmm1
addss  %xmm1,%xmm2
movss  %xmm2,0x8(%rsp)
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r12,%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm1
addss  0x8(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
mov    %r15,%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm1
addss  0x8(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
mov    %r14,%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm1
addss  0x8(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
mov    %rbp,%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm1
addss  0x8(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
lea    0xa4(%rsp),%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm1
addss  0x8(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
lea    0xb8(%rsp),%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm1
addss  0x8(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
lea    0xcc(%rsp),%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm1
addss  0x8(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
lea    0xe0(%rsp),%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movaps %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm1,%xmm1
addss  0x8(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
lea    0xf4(%rsp),%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movss  0xc(%rsp),%xmm2
addss  %xmm0,%xmm2
mulss  %xmm0,%xmm0
addss  0x8(%rsp),%xmm0
movss  0x877(%rip),%xmm1
divss  %xmm1,%xmm0
divss  %xmm1,%xmm2
mulss  %xmm2,%xmm2
subss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0x93b(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.score = [10 x [5 x float]] [[5 x float] [float 8.000000e+01, float 7.500000e+01, float 9.000000e+01, float 7.200000e+01, float 7.400000e+01], [5 x float] [float 8.500000e+01, float 8.700000e+01, float 8.900000e+01, float 9.200000e+01, float 1.000000e+02], [5 x float] [float 8.700000e+01, float 6.000000e+01, float 6.100000e+01, float 6.300000e+01, float 6.800000e+01], [5 x float] [float 7.000000e+01, float 9.200000e+01, float 8.800000e+01, float 9.300000e+01, float 9.600000e+01], [5 x float] [float 8.700000e+01, float 7.000000e+01, float 8.100000e+01, float 7.300000e+01, float 8.800000e+01], [5 x float] [float 7.800000e+01, float 1.000000e+02, float 5.800000e+01, float 9.300000e+01, float 9.600000e+01], [5 x float] [float 8.700000e+01, float 6.000000e+01, float 6.100000e+01, float 1.000000e+02, float 9.300000e+01], [5 x float] [float 9.400000e+01, float 7.200000e+01, float 8.800000e+01, float 9.300000e+01, float 1.000000e+02], [5 x float] [float 8.700000e+01, float 8.000000e+01, float 7.100000e+01, float 7.300000e+01, float 6.800000e+01], [5 x float] [float 8.000000e+01, float 7.200000e+01, float 8.800000e+01, float 9.300000e+01, float 9.600000e+01]]
@.str = [37 x i8] c"The average score of every student:\0A\00"
@.str.1 = [7 x i8] c"%6.2f \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [36 x i8] c"The average score of every course:\0A\00"
@.str.4 = [48 x i8] c"The average score difference of every student:\0A\00"
@.str.5 = [6 x i8] c"%6.2f\00"
define void @main() {
%1 = alloca [10 x [5 x float]]
%2 = alloca [10 x float]
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = bitcast [10 x [5 x float]]* %1 to i8*
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store i32 10, i32* %8
store i32 5, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %12
12: ; preds = %31, %0
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %34
16: ; preds = %12
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 %18
%20 = getelementptr inbounds [5 x float], [5 x float]* %19, i64 0, i64 0
%21 = load i32, i32* %9
%22 = call float @average(float* %20, i32 %21)
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %23)
%25 = load i32, i32* %6
%26 = srem i32 %25, 5
%27 = icmp eq i32 %26, 4
br i1 %27, label %28, label %30
28: ; preds = %16
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %16
br label %31
31: ; preds = %30
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %12
34: ; preds = %12
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %6
br label %36
36: ; preds = %65, %34
%37 = load i32, i32* %6
%38 = load i32, i32* %9
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %68
40: ; preds = %36
store i32 0, i32* %7
br label %41
41: ; preds = %56, %40
%42 = load i32, i32* %7
%43 = load i32, i32* %8
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %59
45: ; preds = %41
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 %47
%49 = load i32, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [5 x float], [5 x float]* %48, i64 0, i64 %50
%52 = load float, float* %51
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %54
store float %52, float* %55
br label %56
56: ; preds = %45
%57 = load i32, i32* %7
%58 = add nsw i32 %57, 1
store i32 %58, i32* %7
br label %41
59: ; preds = %41
%60 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 0
%61 = load i32, i32* %8
%62 = call float @average(float* %60, i32 %61)
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %63)
br label %65
65: ; preds = %59
%66 = load i32, i32* %6
%67 = add nsw i32 %66, 1
store i32 %67, i32* %6
br label %36
68: ; preds = %36
%69 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 0
%70 = load i32, i32* %8
%71 = load i32, i32* %9
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %73
73: ; preds = %91, %68
%74 = load i32, i32* %6
%75 = load i32, i32* %8
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %94
77: ; preds = %73
%78 = load i32, i32* %6
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 %79
%81 = getelementptr inbounds [5 x float], [5 x float]* %80, i64 0, i64 0
%82 = load i32, i32* %9
%83 = call float @average(float* %81, i32 %82)
store float %83, float* %3
%84 = load float, float* %3
%85 = load float, float* %3
%86 = load float, float* %4
%87 = call float @llvm.fmuladd.f32(float %84, float %85, float %86)
store float %87, float* %4
%88 = load float, float* %3
%89 = load float, float* %5
%90 = fadd float %89, %88
store float %90, float* %5
br label %91
91: ; preds = %77
%92 = load i32, i32* %6
%93 = add nsw i32 %92, 1
store i32 %93, i32* %6
br label %73
94: ; preds = %73
%95 = load float, float* %4
%96 = load i32, i32* %8
%97 = sitofp i32 %96 to float
%98 = fdiv float %95, %97
store float %98, float* %4
%99 = load float, float* %5
%100 = load i32, i32* %8
%101 = sitofp i32 %100 to float
%102 = fdiv float %99, %101
store float %102, float* %5
%103 = load float, float* %4
%104 = load float, float* %5
%105 = load float, float* %5
%106 = fneg float %104
%107 = call float @llvm.fmuladd.f32(float %106, float %105, float %103)
%108 = fpext float %107 to double
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %108)
ret void
}

LLVM IR (-O2):
@__const.main.score = [10 x [5 x float]] [[5 x float] [float 8.000000e+01, float 7.500000e+01, float 9.000000e+01, float 7.200000e+01, float 7.400000e+01], [5 x float] [float 8.500000e+01, float 8.700000e+01, float 8.900000e+01, float 9.200000e+01, float 1.000000e+02], [5 x float] [float 8.700000e+01, float 6.000000e+01, float 6.100000e+01, float 6.300000e+01, float 6.800000e+01], [5 x float] [float 7.000000e+01, float 9.200000e+01, float 8.800000e+01, float 9.300000e+01, float 9.600000e+01], [5 x float] [float 8.700000e+01, float 7.000000e+01, float 8.100000e+01, float 7.300000e+01, float 8.800000e+01], [5 x float] [float 7.800000e+01, float 1.000000e+02, float 5.800000e+01, float 9.300000e+01, float 9.600000e+01], [5 x float] [float 8.700000e+01, float 6.000000e+01, float 6.100000e+01, float 1.000000e+02, float 9.300000e+01], [5 x float] [float 9.400000e+01, float 7.200000e+01, float 8.800000e+01, float 9.300000e+01, float 1.000000e+02], [5 x float] [float 8.700000e+01, float 8.000000e+01, float 7.100000e+01, float 7.300000e+01, float 6.800000e+01], [5 x float] [float 8.000000e+01, float 7.200000e+01, float 8.800000e+01, float 9.300000e+01, float 9.600000e+01]]
@.str.1 = [7 x i8] c"%6.2f \00"
@.str.5 = [6 x i8] c"%6.2f\00"
@str = [36 x i8] c"The average score of every student:\00"
@str.6 = [35 x i8] c"The average score of every course:\00"
@str.7 = [47 x i8] c"The average score difference of every student:\00"
define void @main() {
%1 = alloca [10 x [5 x float]]
%2 = alloca [10 x float]
%3 = bitcast [10 x [5 x float]]* %1 to i8*
%4 = bitcast [10 x float]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %0, %17
%7 = phi i64 [ 0, %0 ], [ %18, %17 ]
%8 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 %7, i64 0
%9 = call float @average(float* %8, i32 5)
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = trunc i64 %7 to i8
%13 = urem i8 %12, 5
%14 = icmp eq i8 %13, 4
br i1 %14, label %15, label %17
15: ; preds = %6
%16 = call i32 @putchar(i32 10)
br label %17
17: ; preds = %6, %15
%18 = add nuw nsw i64 %7, 1
%19 = icmp eq i64 %18, 10
br i1 %19, label %20, label %6
20: ; preds = %17
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0))
%22 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 0
%23 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 0, i64 0
%24 = load float, float* %23
store float %24, float* %22
%25 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 1, i64 0
%26 = load float, float* %25
%27 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 1
store float %26, float* %27
%28 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 2, i64 0
%29 = load float, float* %28
%30 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 2
store float %29, float* %30
%31 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 3, i64 0
%32 = load float, float* %31
%33 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 3
store float %32, float* %33
%34 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 4, i64 0
%35 = load float, float* %34
%36 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 4
store float %35, float* %36
%37 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 5, i64 0
%38 = load float, float* %37
%39 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 5
store float %38, float* %39
%40 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 6, i64 0
%41 = load float, float* %40
%42 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 6
store float %41, float* %42
%43 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 7, i64 0
%44 = load float, float* %43
%45 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 7
store float %44, float* %45
%46 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 8, i64 0
%47 = load float, float* %46
%48 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 8
store float %47, float* %48
%49 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 9, i64 0
%50 = load float, float* %49
%51 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 9
store float %50, float* %51
%52 = call float @average(float* %22, i32 10)
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %53)
%55 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 0, i64 1
%56 = load float, float* %55
store float %56, float* %22
%57 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 1, i64 1
%58 = load float, float* %57
store float %58, float* %27
%59 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 2, i64 1
%60 = load float, float* %59
store float %60, float* %30
%61 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 3, i64 1
%62 = load float, float* %61
store float %62, float* %33
%63 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 4, i64 1
%64 = load float, float* %63
store float %64, float* %36
%65 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 5, i64 1
%66 = load float, float* %65
store float %66, float* %39
%67 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 6, i64 1
%68 = load float, float* %67
store float %68, float* %42
%69 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 7, i64 1
%70 = load float, float* %69
store float %70, float* %45
%71 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 8, i64 1
%72 = load float, float* %71
store float %72, float* %48
%73 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 9, i64 1
%74 = load float, float* %73
store float %74, float* %51
%75 = call float @average(float* %22, i32 10)
%76 = fpext float %75 to double
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %76)
%78 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 0, i64 2
%79 = load float, float* %78
store float %79, float* %22
%80 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 1, i64 2
%81 = load float, float* %80
store float %81, float* %27
%82 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 2, i64 2
%83 = load float, float* %82
store float %83, float* %30
%84 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 3, i64 2
%85 = load float, float* %84
store float %85, float* %33
%86 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 4, i64 2
%87 = load float, float* %86
store float %87, float* %36
%88 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 5, i64 2
%89 = load float, float* %88
store float %89, float* %39
%90 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 6, i64 2
%91 = load float, float* %90
store float %91, float* %42
%92 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 7, i64 2
%93 = load float, float* %92
store float %93, float* %45
%94 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 8, i64 2
%95 = load float, float* %94
store float %95, float* %48
%96 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 9, i64 2
%97 = load float, float* %96
store float %97, float* %51
%98 = call float @average(float* %22, i32 10)
%99 = fpext float %98 to double
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %99)
%101 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 0, i64 3
%102 = load float, float* %101
store float %102, float* %22
%103 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 1, i64 3
%104 = load float, float* %103
store float %104, float* %27
%105 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 2, i64 3
%106 = load float, float* %105
store float %106, float* %30
%107 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 3, i64 3
%108 = load float, float* %107
store float %108, float* %33
%109 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 4, i64 3
%110 = load float, float* %109
store float %110, float* %36
%111 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 5, i64 3
%112 = load float, float* %111
store float %112, float* %39
%113 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 6, i64 3
%114 = load float, float* %113
store float %114, float* %42
%115 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 7, i64 3
%116 = load float, float* %115
store float %116, float* %45
%117 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 8, i64 3
%118 = load float, float* %117
store float %118, float* %48
%119 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 9, i64 3
%120 = load float, float* %119
store float %120, float* %51
%121 = call float @average(float* %22, i32 10)
%122 = fpext float %121 to double
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %122)
%124 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 0, i64 4
%125 = load float, float* %124
store float %125, float* %22
%126 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 1, i64 4
%127 = load float, float* %126
store float %127, float* %27
%128 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 2, i64 4
%129 = load float, float* %128
store float %129, float* %30
%130 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 3, i64 4
%131 = load float, float* %130
store float %131, float* %33
%132 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 4, i64 4
%133 = load float, float* %132
store float %133, float* %36
%134 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 5, i64 4
%135 = load float, float* %134
store float %135, float* %39
%136 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 6, i64 4
%137 = load float, float* %136
store float %137, float* %42
%138 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 7, i64 4
%139 = load float, float* %138
store float %139, float* %45
%140 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 8, i64 4
%141 = load float, float* %140
store float %141, float* %48
%142 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 9, i64 4
%143 = load float, float* %142
store float %143, float* %51
%144 = call float @average(float* %22, i32 10)
%145 = fpext float %144 to double
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %145)
%147 = getelementptr inbounds [10 x [5 x float]], [10 x [5 x float]]* %1, i64 0, i64 0
%148 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.7, i64 0, i64 0))
%149 = call float @average(float* %23, i32 5)
%150 = call float @llvm.fmuladd.f32(float %149, float %149, float 0.000000e+00)
%151 = fadd float %149, 0.000000e+00
%152 = call float @average(float* %25, i32 5)
%153 = call float @llvm.fmuladd.f32(float %152, float %152, float %150)
%154 = fadd float %151, %152
%155 = call float @average(float* %28, i32 5)
%156 = call float @llvm.fmuladd.f32(float %155, float %155, float %153)
%157 = fadd float %154, %155
%158 = call float @average(float* %31, i32 5)
%159 = call float @llvm.fmuladd.f32(float %158, float %158, float %156)
%160 = fadd float %157, %158
%161 = call float @average(float* %34, i32 5)
%162 = call float @llvm.fmuladd.f32(float %161, float %161, float %159)
%163 = fadd float %160, %161
%164 = call float @average(float* %37, i32 5)
%165 = call float @llvm.fmuladd.f32(float %164, float %164, float %162)
%166 = fadd float %163, %164
%167 = call float @average(float* %40, i32 5)
%168 = call float @llvm.fmuladd.f32(float %167, float %167, float %165)
%169 = fadd float %166, %167
%170 = call float @average(float* %43, i32 5)
%171 = call float @llvm.fmuladd.f32(float %170, float %170, float %168)
%172 = fadd float %169, %170
%173 = call float @average(float* %46, i32 5)
%174 = call float @llvm.fmuladd.f32(float %173, float %173, float %171)
%175 = fadd float %172, %173
%176 = call float @average(float* %49, i32 5)
%177 = call float @llvm.fmuladd.f32(float %176, float %176, float %174)
%178 = fadd float %175, %176
%179 = fdiv float %177, 1.000000e+01
%180 = fdiv float %178, 1.000000e+01
%181 = fneg float %180
%182 = call float @llvm.fmuladd.f32(float %181, float %180, float %179)
%183 = fpext float %182 to double
%184 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %183)
ret void
}