#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 *, int *);
int main() {
  int vize, final;
  char harf;
  printf("Vize notunuz giriniz : ");
  scanf("%d", &vize);
  printf("Final notunuz giriniz: ");
  scanf("%d", &final);
  float ortalama = (vize * 0.4) + (final * 0.6);
  if (ortalama < 50) {
    harf = 'F';
  } else if (ortalama < 60) {
    harf = 'D';
  } else if (ortalama < 70) {
    harf = 'C';
  } else if (ortalama < 80) {
    harf = 'B';
  } else
    harf = 'A';
  printf("===================================\n");
  printf("Basar notu = %.2f\tHarf notu:%c", ortalama, harf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe9b(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe87(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe5e(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    11b5 <main+0x95>
movb   $0x46,-0xd(%rbp)
jmp    1219 <main+0xf9>
movss  0xe47(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    11d0 <main+0xb0>
movb   $0x44,-0xd(%rbp)
jmp    1214 <main+0xf4>
movss  0xe30(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    11eb <main+0xcb>
movb   $0x43,-0xd(%rbp)
jmp    120f <main+0xef>
movss  0xe19(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    1206 <main+0xe6>
movb   $0x42,-0xd(%rbp)
jmp    120a <main+0xea>
movb   $0x41,-0xd(%rbp)
jmp    120f <main+0xef>
jmp    1214 <main+0xf4>
jmp    1219 <main+0xf9>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsbl -0xd(%rbp),%esi
lea    0xe3d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeee(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
cvtsi2sdl 0xc(%rsp),%xmm0
cvtsi2sdl 0x8(%rsp),%xmm1
mulsd  0xe7a(%rip),%xmm1
mulsd  0xe7a(%rip),%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
mov    $0x46,%ebx
movss  0xe6a(%rip),%xmm0
ucomiss %xmm1,%xmm0
ja     11e2 <main+0xb2>
mov    $0x44,%ebx
movss  0xe5c(%rip),%xmm0
ucomiss %xmm1,%xmm0
ja     11e2 <main+0xb2>
mov    $0x43,%ebx
movss  0xe4e(%rip),%xmm0
ucomiss %xmm1,%xmm0
ja     11e2 <main+0xb2>
movss  0xe45(%rip),%xmm0
xor    %ebx,%ebx
ucomiss %xmm1,%xmm0
seta   %bl
add    $0x41,%ebx
lea    0xe89(%rip),%rdi
movss  %xmm1,0x4(%rsp)
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4e(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Vize notunuz giriniz : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Final notunuz giriniz: \00"
@.str.3 = [37 x i8] c"===================================\0A\00"
@.str.4 = [31 x i8] c"Basar notu = %.2f\09Harf notu:%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 6.000000e-01
%15 = call double @llvm.fmuladd.f64(double %11, double 4.000000e-01, double %14)
%16 = fptrunc double %15 to float
store float %16, float* %5
%17 = load float, float* %5
%18 = fcmp olt float %17, 5.000000e+01
br i1 %18, label %19, label %20
19: ; preds = %0
store i8 70, i8* %4
br label %36
20: ; preds = %0
%21 = load float, float* %5
%22 = fcmp olt float %21, 6.000000e+01
br i1 %22, label %23, label %24
23: ; preds = %20
store i8 68, i8* %4
br label %35
24: ; preds = %20
%25 = load float, float* %5
%26 = fcmp olt float %25, 7.000000e+01
br i1 %26, label %27, label %28
27: ; preds = %24
store i8 67, i8* %4
br label %34
28: ; preds = %24
%29 = load float, float* %5
%30 = fcmp olt float %29, 8.000000e+01
br i1 %30, label %31, label %32
31: ; preds = %28
store i8 66, i8* %4
br label %33
32: ; preds = %28
store i8 65, i8* %4
br label %33
33: ; preds = %32, %31
br label %34
34: ; preds = %33, %27
br label %35
35: ; preds = %34, %23
br label %36
36: ; preds = %35, %19
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%38 = load float, float* %5
%39 = fpext float %38 to double
%40 = load i8, i8* %4
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %39, i32 %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Vize notunuz giriniz : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Final notunuz giriniz: \00"
@.str.4 = [31 x i8] c"Basar notu = %.2f\09Harf notu:%c\00"
@str = [36 x i8] c"===================================\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to double
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 6.000000e-01
%14 = call double @llvm.fmuladd.f64(double %10, double 4.000000e-01, double %13)
%15 = fptrunc double %14 to float
%16 = fcmp olt float %15, 5.000000e+01
br i1 %16, label %24, label %17
17: ; preds = %0
%18 = fcmp olt float %15, 6.000000e+01
br i1 %18, label %24, label %19
19: ; preds = %17
%20 = fcmp olt float %15, 7.000000e+01
br i1 %20, label %24, label %21
21: ; preds = %19
%22 = fcmp olt float %15, 8.000000e+01
%23 = select i1 %22, i32 66, i32 65
br label %24
24: ; preds = %21, %19, %17, %0
%25 = phi i32 [ 70, %0 ], [ 68, %17 ], [ 67, %19 ], [ %23, %21 ]
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%27 = fpext float %15 to double
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %27, i32 %25)
ret i32 0
}