#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 main() {
  char student_name1[50];
  char student_name2[50];
  int student_age1;
  int student_age2;
  float student_exam_grade1;
  float student_exam_grade2;
  void horizontalRule(void);
  printf("Type the name of the first student: ");
  scanf(" %[^\n]", student_name1);
  printf("Type the age of the first student: ");
  scanf("%d", &student_age1);
  printf("Type the exam grade of the first student: ");
  scanf("%f", &student_exam_grade1);
  printf("\nType the name of the second student: ");
  scanf(" %[^\n]", student_name2);
  printf("Type the age of the second student: ");
  scanf("%d", &student_age2);
  printf("Type the exam grade of the second student: ");
  scanf("%f", &student_exam_grade2);
  horizontalRule();
  printf("\n\t\tSTUDENTS INFORMATION");
  horizontalRule();
  printf("\nFIRST STUDENT\nName: %s\nAge: %d\nExam grade: %.2f", student_name1,
         student_age1, student_exam_grade1);
  horizontalRule();
  printf("\nSECOND STUDENT\nName: %s\nAge: %d\nExam grade: %.2f\n",
         student_name2, student_age2, student_exam_grade2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x84(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe73(%rip),%rdi
lea    -0x88(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
call   1050 <horizontalRule@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
call   1050 <horizontalRule@plt>
lea    -0x40(%rbp),%rsi
mov    -0x84(%rbp),%edx
movss  -0x8c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
call   1050 <horizontalRule@plt>
lea    -0x80(%rbp),%rsi
mov    -0x88(%rbp),%edx
movss  -0x90(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xed6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x90,%rsp
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%r12
lea    0x50(%rsp),%r14
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%r13
lea    0xc(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%r15
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
call   1050 <horizontalRule@plt>
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
call   1050 <horizontalRule@plt>
mov    0xc(%rsp),%edx
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xedd(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
call   1050 <horizontalRule@plt>
mov    0x8(%rsp),%edx
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeeb(%rip),%rdi
mov    %r15,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Type the name of the first student: \00"
@.str.1 = [7 x i8] c" %[^\0A]\00"
@.str.2 = [36 x i8] c"Type the age of the first student: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [43 x i8] c"Type the exam grade of the first student: \00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [39 x i8] c"\0AType the name of the second student: \00"
@.str.7 = [37 x i8] c"Type the age of the second student: \00"
@.str.8 = [44 x i8] c"Type the exam grade of the second student: \00"
@.str.9 = [24 x i8] c"\0A\09\09STUDENTS INFORMATION\00"
@.str.10 = [49 x i8] c"\0AFIRST STUDENT\0AName: %s\0AAge: %d\0AExam grade: %.2f\00"
@.str.11 = [51 x i8] c"\0ASECOND STUDENT\0AName: %s\0AAge: %d\0AExam grade: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [50 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %6)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %7)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%23 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%24 = load i32, i32* %4
%25 = load float, float* %6
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8* %23, i32 %24, double %26)
%28 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%29 = load i32, i32* %5
%30 = load float, float* %7
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0), i8* %28, i32 %29, double %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Type the name of the first student: \00"
@.str.1 = [7 x i8] c" %[^\0A]\00"
@.str.2 = [36 x i8] c"Type the age of the first student: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [43 x i8] c"Type the exam grade of the first student: \00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [39 x i8] c"\0AType the name of the second student: \00"
@.str.7 = [37 x i8] c"Type the age of the second student: \00"
@.str.8 = [44 x i8] c"Type the exam grade of the second student: \00"
@.str.9 = [24 x i8] c"\0A\09\09STUDENTS INFORMATION\00"
@.str.10 = [49 x i8] c"\0AFIRST STUDENT\0AName: %s\0AAge: %d\0AExam grade: %.2f\00"
@.str.11 = [51 x i8] c"\0ASECOND STUDENT\0AName: %s\0AAge: %d\0AExam grade: %.2f\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [50 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = bitcast float* %6 to i8*
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %5)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %6)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%26 = load i32, i32* %3
%27 = load float, float* %5
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8* %7, i32 %26, double %28)
%30 = load i32, i32* %4
%31 = load float, float* %6
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0), i8* %8, i32 %30, double %32)
ret i32 0
}