#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 *, ...);
main() {
  char nome[20];
  float nota1, nota2, nota3, media;
  printf("Nome: ");
  scanf("%s", &nome);
  printf("Nota 1: ");
  scanf("%f", &nota1);
  printf("Nota 2: ");
  scanf("%f", &nota2);
  printf("Nota 3: ");
  scanf("%f", &nota3);
  media = (nota1 + nota2 + nota3) / 3;
  printf("\nNome: %s - Media: %f", nome, media);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x24(%rbp),%xmm0
addss  -0x28(%rbp),%xmm0
addss  -0x2c(%rbp),%xmm0
movss  0xe41(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
lea    -0x20(%rbp),%rsi
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
divss  0xe3d(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5b(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Nome: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"Nota 1: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [9 x i8] c"Nota 2: \00"
@.str.5 = [9 x i8] c"Nota 3: \00"
@.str.6 = [22 x i8] c"\0ANome: %s - Media: %f\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [20 x i8]* %1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%14 = load float, float* %2
%15 = load float, float* %3
%16 = fadd float %14, %15
%17 = load float, float* %4
%18 = fadd float %16, %17
%19 = fdiv float %18, 3.000000e+00
store float %19, float* %5
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%21 = load float, float* %5
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %20, double %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Nome: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"Nota 1: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [9 x i8] c"Nota 2: \00"
@.str.5 = [9 x i8] c"Nota 3: \00"
@.str.6 = [22 x i8] c"\0ANome: %s - Media: %f\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [20 x i8]* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 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), float* %2)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%17 = load float, float* %2
%18 = load float, float* %3
%19 = fadd float %17, %18
%20 = load float, float* %4
%21 = fadd float %19, %20
%22 = fdiv float %21, 3.000000e+00
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %5, double %23)
ret i32 0
}