#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 *, char *, int, int, int, char *, char);
void main(void) {
  struct student {
    int id;
    int age;
    int class;
    char name[50];
    char grad;
  };
  struct student ahmed = {53643, 13, 4, "Ahmed Al-Sayed Hegazy", 'B'};
  printf("%s's Data:\n Id:%d\n Age:%d\n Class:%d\n Name:%s\n Grade:%c\n",
         ahmed.name, ahmed.id, ahmed.age, ahmed.class, ahmed.name, ahmed.grad);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rsi
add    $0xc,%rsi
mov    -0x40(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x38(%rbp),%r8d
lea    -0x40(%rbp),%r9
add    $0xc,%r9
lea    0xee2(%rip),%rdi
movsbl -0x2(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movups 0xf15(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movups 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movups 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x1c(%rsp),%rsi
movl   $0x42,(%rsp)
lea    0xee9(%rip),%rdi
mov    $0xd18b,%edx
mov    $0xd,%ecx
mov    $0x4,%r8d
mov    %rsi,%r9
call   1030 <printf@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
%struct.student = type { i32, i32, i32, [50 x i8], i8 }
@__const.main.ahmed = %struct.student { i32 53643, i32 13, i32 4, [50 x i8] c"Ahmed Al-Sayed Hegazy\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i8 66 }
@.str = [56 x i8] c"%s's Data:\0A Id:%d\0A Age:%d\0A Class:%d\0A Name:%s\0A Grade:%c\0A\00"
define void @main() {
%1 = alloca %struct.student
%2 = bitcast %struct.student* %1 to i8*
%3 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 3
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 2
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 3
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %11, i64 0, i64 0
%13 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 4
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6, i32 %8, i32 %10, i8* %12, i8 signext %14)
ret void
}

LLVM IR (-O2):
%struct.student = type { i32, i32, i32, [50 x i8], i8 }
@__const.main.ahmed = %struct.student { i32 53643, i32 13, i32 4, [50 x i8] c"Ahmed Al-Sayed Hegazy\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i8 66 }
@.str = [56 x i8] c"%s's Data:\0A Id:%d\0A Age:%d\0A Class:%d\0A Name:%s\0A Grade:%c\0A\00"
define void @main() {
%1 = alloca %struct.student
%2 = bitcast %struct.student* %1 to i8*
%3 = getelementptr inbounds %struct.student, %struct.student* %1, i64 0, i32 3, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %3, i32 53643, i32 13, i32 4, i8* %3, i8 signext 66)
ret void
}