#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 /*<<< orphan*/ scanf(char *, float *);
int main() {
  float spanish;
  float french;
  float german;
  int percent;
  int pass;
  printf("Please enter french mark: ");
  scanf("%f", &french);
  printf("Please enter german mark: ");
  scanf("%f", &german);
  printf("Please enter spanish mark: ");
  scanf("%f", &spanish);
  percent = ((spanish + french + german) / 90 * 100);
  if (french >= 15 && german >= 15) {
    pass = 1;
  } else if (french >= 15 && spanish >= 15) {
    pass = 1;
  }
  if (pass == 1) {
    printf("You passed! Your percentage was %i\n", percent);
  } else if (pass == 2) {
    printf("You failed. You percentage was %i\n", percent);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  0xe68(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe58(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe3c(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11ef <main+0xcf>
movss  -0x10(%rbp),%xmm0
movss  0xe26(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11ef <main+0xcf>
movl   $0x1,-0x18(%rbp)
jmp    1227 <main+0x107>
movss  -0xc(%rbp),%xmm0
movss  0xe04(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1222 <main+0x102>
movss  -0x8(%rbp),%xmm0
movss  0xdee(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1222 <main+0x102>
movl   $0x1,-0x18(%rbp)
jmp    1227 <main+0x107>
cmpl   $0x1,-0x18(%rbp)
jne    1247 <main+0x127>
mov    -0x14(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1267 <main+0x147>
cmpl   $0x2,-0x18(%rbp)
jne    1262 <main+0x142>
mov    -0x14(%rbp),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1267 <main+0x147>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee9(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
divss  0xe69(%rip),%xmm0
mulss  0xe65(%rip),%xmm0
cvttss2si %xmm0,%esi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter french mark: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"Please enter german mark: \00"
@.str.3 = [28 x i8] c"Please enter spanish mark: \00"
@.str.4 = [36 x i8] c"You passed! Your percentage was %i\0A\00"
@.str.5 = [35 x i8] c"You failed. You percentage was %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%13 = load float, float* %2
%14 = load float, float* %3
%15 = fadd float %13, %14
%16 = load float, float* %4
%17 = fadd float %15, %16
%18 = fdiv float %17, 9.000000e+01
%19 = fmul float %18, 1.000000e+02
%20 = fptosi float %19 to i32
store i32 %20, i32* %5
%21 = load float, float* %3
%22 = fcmp oge float %21, 1.500000e+01
br i1 %22, label %23, label %27
23: ; preds = %0
%24 = load float, float* %4
%25 = fcmp oge float %24, 1.500000e+01
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 1, i32* %6
br label %35
27: ; preds = %23, %0
%28 = load float, float* %3
%29 = fcmp oge float %28, 1.500000e+01
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load float, float* %2
%32 = fcmp oge float %31, 1.500000e+01
br i1 %32, label %33, label %34
33: ; preds = %30
store i32 1, i32* %6
br label %34
34: ; preds = %33, %30, %27
br label %35
35: ; preds = %34, %26
%36 = load i32, i32* %6
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* %5
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %39)
br label %48
41: ; preds = %35
%42 = load i32, i32* %6
%43 = icmp eq i32 %42, 2
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* %5
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %44, %41
br label %48
48: ; preds = %47, %38
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please enter french mark: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"Please enter german mark: \00"
@.str.3 = [28 x i8] c"Please enter spanish mark: \00"
@.str.4 = [36 x i8] c"You passed! Your percentage was %i\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%13 = load float, float* %1
%14 = load float, float* %2
%15 = fadd float %13, %14
%16 = load float, float* %3
%17 = fadd float %15, %16
%18 = fdiv float %17, 9.000000e+01
%19 = fmul float %18, 1.000000e+02
%20 = fptosi float %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %20)
ret i32 0
}