#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
main(void) {
  char grade;
  int birthyear;
  double GPA;
  int age;
  printf("Please enter your grade: ");
  grade = getchar();
  printf("Birthdate: ");
  scanf("%d", &birthyear);
  getchar();
  printf("Enter GPA: ");
  scanf("%lf", &GPA);
  getchar();
  age = 2013 - birthyear;
  printf("I'm %d years old. My GPA is %.3lf and my grade is %c. \n", age, GPA,
         grade);
  printf("In %d I'll be %d.  ", 2013 + 1, ++age);
  printf("Will get grade of %c+. \n", grade);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x7dd,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
movsbl -0x1(%rbp),%edx
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x7de,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0xc(%rsp),%ebp
mov    $0x7dd,%esi
sub    %ebp,%esi
movsd  0x10(%rsp),%xmm0
movsbl %bl,%ebx
lea    0xe81(%rip),%rdi
mov    %ebx,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x7de,%edx
sub    %ebp,%edx
lea    0xea2(%rip),%rdi
mov    $0x7de,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter your grade: \00"
@.str.1 = [12 x i8] c"Birthdate: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [12 x i8] c"Enter GPA: \00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [56 x i8] c"I'm %d years old. My GPA is %.3lf and my grade is %c. \0A\00"
@.str.6 = [20 x i8] c"In %d I'll be %d. \00"
@.str.7 = [25 x i8] c"Will get grade of %c+. \0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%9 = call signext i8 (...) @getchar()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %3)
%12 = call signext i8 (...) @getchar()
%13 = load i32, i32* %2
%14 = sub nsw i32 2013, %13
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = load double, double* %3
%17 = load i8, i8* %1
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), i32 %15, double %16, i32 %18)
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 2014, i32 %21)
%23 = load i8, i8* %1
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %24)
%26 = call signext i8 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter your grade: \00"
@.str.1 = [12 x i8] c"Birthdate: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [12 x i8] c"Enter GPA: \00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [56 x i8] c"I'm %d years old. My GPA is %.3lf and my grade is %c. \0A\00"
@.str.6 = [20 x i8] c"In %d I'll be %d. \00"
@.str.7 = [25 x i8] c"Will get grade of %c+. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = tail call signext i8 (...) @getchar()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%9 = call signext i8 (...) @getchar()
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %2)
%12 = call signext i8 (...) @getchar()
%13 = load i32, i32* %1
%14 = sub nsw i32 2013, %13
%15 = load double, double* %2
%16 = sext i8 %6 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0), i32 %14, double %15, i32 %16)
%18 = sub i32 2014, %13
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 2014, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %16)
%21 = call signext i8 (...) @getchar()
ret i32 0
}