#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(void) {
  struct Scores {
    int id;
    double exam1;
    double exam2;
    double exam3;
  };
  struct Scores scores1;
  printf("enter id - ");
  scanf("%i", &scores1.id);
  scores1.exam1 = 100.0;
  scores1.exam2 = 88.0;
  scores1.exam3 = 92.0;
  printf("id = %i, exam1 = %5.1lf,", scores1.id, scores1.exam1);
  printf(" exam2 = %5.1lf, exam3 = %5.1lf\n", scores1.exam2, scores1.exam3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x28(%rbp),%rsi
lea    0xedc(%rip),%rdi
call   1040 <scanf@plt>
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x28(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xea5(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xeed(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
movaps 0xeb6(%rip),%xmm0
movups %xmm0,0x10(%rsp)
movabs $0x4057000000000000,%rax
mov    %rax,0x20(%rsp)
mov    0x8(%rsp),%esi
lea    0xebe(%rip),%rdi
movsd  0xe9f(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
lea    0xeb5(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.Scores = type { i32, double, double, double }
@.str = [12 x i8] c"enter id - \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [25 x i8] c"id = %i, exam1 = %5.1lf,\00"
@.str.3 = [33 x i8] c" exam2 = %5.1lf, exam3 = %5.1lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Scores
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds %struct.Scores, %struct.Scores* %2, i32 0, i32 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = getelementptr inbounds %struct.Scores, %struct.Scores* %2, i32 0, i32 1
store double 1.000000e+02, double* %6
%7 = getelementptr inbounds %struct.Scores, %struct.Scores* %2, i32 0, i32 2
store double 8.800000e+01, double* %7
%8 = getelementptr inbounds %struct.Scores, %struct.Scores* %2, i32 0, i32 3
store double 9.200000e+01, double* %8
%9 = getelementptr inbounds %struct.Scores, %struct.Scores* %2, i32 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.Scores, %struct.Scores* %2, i32 0, i32 1
%12 = load double, double* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %10, double %12)
%14 = getelementptr inbounds %struct.Scores, %struct.Scores* %2, i32 0, i32 2
%15 = load double, double* %14
%16 = getelementptr inbounds %struct.Scores, %struct.Scores* %2, i32 0, i32 3
%17 = load double, double* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %15, double %17)
ret i32 0
}

LLVM IR (-O2):
%struct.Scores = type { i32, double, double, double }
@.str = [12 x i8] c"enter id - \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [25 x i8] c"id = %i, exam1 = %5.1lf,\00"
@.str.3 = [33 x i8] c" exam2 = %5.1lf, exam3 = %5.1lf\0A\00"
define i32 @main() {
%1 = alloca %struct.Scores
%2 = bitcast %struct.Scores* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds %struct.Scores, %struct.Scores* %1, i64 0, i32 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = getelementptr inbounds %struct.Scores, %struct.Scores* %1, i64 0, i32 1
%7 = getelementptr inbounds %struct.Scores, %struct.Scores* %1, i64 0, i32 2
%8 = bitcast double* %6 to <2 x double>*
store <2 x double> <double 1.000000e+02, double 8.800000e+01>, <2 x double>* %8
%9 = getelementptr inbounds %struct.Scores, %struct.Scores* %1, i64 0, i32 3
store double 9.200000e+01, double* %9
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %10, double 1.000000e+02)
%12 = load double, double* %7
%13 = load double, double* %9
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %12, double %13)
ret i32 0
}