#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 */
double pAverage(int);
double pMedian(int);
int /*<<< orphan*/ printRRow(int);
int /*<<< orphan*/ printf(char *, ...);
void printResults() {
  int s, t, u, v;
  printf("Program RESULTS: \n\n");
  printf("Student    |");
  for (s = 0; s < 5; s++) {
    printf("  PGM %d |", s + 1);
  }
  printf(" Std Avg \n");
  printf("------------");
  for (t = 0; t < 5; t++)
    printf("---------");
  printf("--------\n");
  for (s = 0; s < 15; s++) {
    printRRow(s);
  }
  printf("------------");
  for (t = 0; t < 5; t++)
    printf("---------");
  printf("--------");
  printf("\nPGM Avg    |");
  for (u = 0; u < 5; u++) {
    printf("%6.1f  |", pAverage(u));
  }
  printf("\nPGM Median |");
  for (v = 0; v < 5; v++) {
    printf("%6.1f  |", pMedian(v));
  }
}


x86 assembly (clang, -O0):
<printResults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1197 <printResults+0x57>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <printResults+0x2b>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11e0 <printResults+0xa0>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ba <printResults+0x7a>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jge    1215 <printResults+0xd5>
mov    -0x4(%rbp),%edi
call   1050 <printRRow@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11f5 <printResults+0xb5>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1250 <printResults+0x110>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <printResults+0xea>
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    12a1 <printResults+0x161>
mov    -0xc(%rbp),%edi
call   1060 <pAverage@plt>
lea    0xdd0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1273 <printResults+0x133>
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    12e4 <printResults+0x1a4>
mov    -0x10(%rbp),%edi
call   1030 <pMedian@plt>
lea    0xd8d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12b6 <printResults+0x176>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResults>:
push   %r15
push   %r14
push   %rbx
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe97(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
lea    0xe44(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe36(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdfe(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <printRRow@plt>
mov    $0x1,%edi
call   1060 <printRRow@plt>
mov    $0x2,%edi
call   1060 <printRRow@plt>
mov    $0x3,%edi
call   1060 <printRRow@plt>
mov    $0x4,%edi
call   1060 <printRRow@plt>
mov    $0x5,%edi
call   1060 <printRRow@plt>
mov    $0x6,%edi
call   1060 <printRRow@plt>
mov    $0x7,%edi
call   1060 <printRRow@plt>
mov    $0x8,%edi
call   1060 <printRRow@plt>
mov    $0x9,%edi
call   1060 <printRRow@plt>
mov    $0xa,%edi
call   1060 <printRRow@plt>
mov    $0xb,%edi
call   1060 <printRRow@plt>
mov    $0xc,%edi
call   1060 <printRRow@plt>
mov    $0xd,%edi
call   1060 <printRRow@plt>
mov    $0xe,%edi
call   1060 <printRRow@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd1f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <pAverage@plt>
lea    0xd18(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <pAverage@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x2,%edi
call   1070 <pAverage@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x3,%edi
call   1070 <pAverage@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x4,%edi
call   1070 <pAverage@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xcc0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1040 <pMedian@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1040 <pMedian@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x2,%edi
call   1040 <pMedian@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x3,%edi
call   1040 <pMedian@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x4,%edi
call   1040 <pMedian@plt>
mov    %rbx,%rdi
mov    $0x1,%al
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Program RESULTS: \0A\0A\00"
@.str.1 = [13 x i8] c"Student |\00"
@.str.2 = [11 x i8] c" PGM %d |\00"
@.str.3 = [11 x i8] c" Std Avg \0A\00"
@.str.4 = [13 x i8] c"------------\00"
@.str.5 = [10 x i8] c"---------\00"
@.str.6 = [10 x i8] c"--------\0A\00"
@.str.7 = [9 x i8] c"--------\00"
@.str.8 = [14 x i8] c"\0APGM Avg |\00"
@.str.9 = [9 x i8] c"%6.1f |\00"
@.str.10 = [14 x i8] c"\0APGM Median |\00"
define void @printResults() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %7
17: ; preds = %7
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %20
20: ; preds = %25, %17
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 5
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %25
25: ; preds = %23
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %20
28: ; preds = %20
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %30
30: ; preds = %36, %28
%31 = load i32, i32* %1
%32 = icmp slt i32 %31, 15
br i1 %32, label %33, label %39
33: ; preds = %30
%34 = load i32, i32* %1
%35 = call i32 @printRRow(i32 %34)
br label %36
36: ; preds = %33
%37 = load i32, i32* %1
%38 = add nsw i32 %37, 1
store i32 %38, i32* %1
br label %30
39: ; preds = %30
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %41
41: ; preds = %46, %39
%42 = load i32, i32* %2
%43 = icmp slt i32 %42, 5
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %41
49: ; preds = %41
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %3
br label %52
52: ; preds = %59, %49
%53 = load i32, i32* %3
%54 = icmp slt i32 %53, 5
br i1 %54, label %55, label %62
55: ; preds = %52
%56 = load i32, i32* %3
%57 = call double @pAverage(i32 %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %57)
br label %59
59: ; preds = %55
%60 = load i32, i32* %3
%61 = add nsw i32 %60, 1
store i32 %61, i32* %3
br label %52
62: ; preds = %52
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %4
br label %64
64: ; preds = %71, %62
%65 = load i32, i32* %4
%66 = icmp slt i32 %65, 5
br i1 %66, label %67, label %74
67: ; preds = %64
%68 = load i32, i32* %4
%69 = call double @pMedian(i32 %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %69)
br label %71
71: ; preds = %67
%72 = load i32, i32* %4
%73 = add nsw i32 %72, 1
store i32 %73, i32* %4
br label %64
74: ; preds = %64
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"Student |\00"
@.str.2 = [11 x i8] c" PGM %d |\00"
@.str.4 = [13 x i8] c"------------\00"
@.str.5 = [10 x i8] c"---------\00"
@.str.8 = [14 x i8] c"\0APGM Avg |\00"
@.str.9 = [9 x i8] c"%6.1f |\00"
@.str.10 = [14 x i8] c"\0APGM Median |\00"
@str = [19 x i8] c"Program RESULTS: \0A\00"
@str.11 = [10 x i8] c" Std Avg \00"
@str.12 = [9 x i8] c"--------\00"
define void @printResults() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 3)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 4)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 5)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.11, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0))
%16 = tail call i32 @printRRow(i32 0)
%17 = tail call i32 @printRRow(i32 1)
%18 = tail call i32 @printRRow(i32 2)
%19 = tail call i32 @printRRow(i32 3)
%20 = tail call i32 @printRRow(i32 4)
%21 = tail call i32 @printRRow(i32 5)
%22 = tail call i32 @printRRow(i32 6)
%23 = tail call i32 @printRRow(i32 7)
%24 = tail call i32 @printRRow(i32 8)
%25 = tail call i32 @printRRow(i32 9)
%26 = tail call i32 @printRRow(i32 10)
%27 = tail call i32 @printRRow(i32 11)
%28 = tail call i32 @printRRow(i32 12)
%29 = tail call i32 @printRRow(i32 13)
%30 = tail call i32 @printRRow(i32 14)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0))
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%39 = tail call double @pAverage(i32 0)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %39)
%41 = tail call double @pAverage(i32 1)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %41)
%43 = tail call double @pAverage(i32 2)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %43)
%45 = tail call double @pAverage(i32 3)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %45)
%47 = tail call double @pAverage(i32 4)
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %47)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%50 = tail call double @pMedian(i32 0)
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %50)
%52 = tail call double @pMedian(i32 1)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %52)
%54 = tail call double @pMedian(i32 2)
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %54)
%56 = tail call double @pMedian(i32 3)
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %56)
%58 = tail call double @pMedian(i32 4)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %58)
ret void
}