#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 count_passes(int *, int, int);
int /*<<< orphan*/ print_arr(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int grades[10] = {70, 80, 95, 65, 35, 85, 54, 78, 45, 68};
  int result;
  print_arr(grades, 10);
  result = count_passes(grades, 10, 70);
  if (result == 1)
    printf("There was %d pass.\n", result);
  else
    printf("There were %d passes.\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <print_arr@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
mov    $0x46,%edx
call   1060 <count_passes@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
jne    11a6 <main+0x66>
mov    -0x34(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
jmp    11b5 <main+0x75>
mov    -0x34(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <print_arr@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x46,%edx
call   1050 <count_passes@plt>
cmp    $0x1,%eax
jne    118d <main+0x5d>
lea    0xea2(%rip),%rdi
mov    $0x1,%esi
jmp    1196 <main+0x66>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.grades = [10 x i32] [i32 70, i32 80, i32 95, i32 65, i32 35, i32 85, i32 54, i32 78, i32 45, i32 68]
@.str = [20 x i8] c"There was %d pass.\0A\00"
@.str.1 = [23 x i8] c"There were %d passes.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @print_arr(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @count_passes(i32* %7, i32 10, i32 70)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %17
14: ; preds = %0
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %11
ret i32 0
}

LLVM IR (-O2):
@__const.main.grades = [10 x i32] [i32 70, i32 80, i32 95, i32 65, i32 35, i32 85, i32 54, i32 78, i32 45, i32 68]
@.str = [20 x i8] c"There was %d pass.\0A\00"
@.str.1 = [23 x i8] c"There were %d passes.\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_arr(i32* %3, i32 10)
%5 = call i32 @count_passes(i32* %3, i32 10, i32 70)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1)
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %11
11: ; preds = %9, %7
ret i32 0
}