#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 x;
  char a;
  int b;
  printf("Enter here you grade: ");
  scanf("%d", &x);
  b = (x >= 50) ? 1 : 0;
  printf("In binar, meriti.. %d", b);
  printf("Valoarea lui a = %d", 'a');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x32,%edx
cmovge %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x61,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %esi,%esi
cmpl   $0x32,0x4(%rsp)
setge  %sil
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter here you grade: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"In binar, meriti.. %d\00"
@.str.3 = [20 x i8] c"Valoarea lui a = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 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* %2)
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 50
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 97)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter here you grade: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"In binar, meriti.. %d\00"
@.str.3 = [20 x i8] c"Valoarea lui a = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 49
%7 = zext i1 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 97)
ret i32 0
}