#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 *, double);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char nome1[8], nome2[8], nome3[8];
  int idade1, idade2, idade3;
  double peso1, peso2, peso3;
  scanf("%s", &nome1);
  scanf("%i", &idade1);
  scanf("%lf", &peso1);
  scanf("%s", &nome2);
  scanf("%i", &idade2);
  scanf("%lf", &peso2);
  scanf("%s", &nome3);
  scanf("%i", &idade3);
  scanf("%lf", &peso3);
  double pesoMedio = (peso1 + peso2 + peso3) / 3;
  printf("IDADE 1 = %i\n", idade1);
  printf("IDADE 2 = %i\n", idade2);
  printf("IDADE 3 = %i\n", idade3);
  printf("O PESO MEDIO E = %0.2f\n", pesoMedio);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9c(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe7e(%rip),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe66(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe57(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe48(%rip),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  0xe18(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x20(%rbp),%xmm0
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x24(%rbp),%xmm0
lea    0xe12(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x28(%rbp),%xmm0
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
lea    0xed8(%rip),%r14
lea    0x48(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec5(%rip),%r15
lea    0x14(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rbx
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x40(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x38(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x30(%rsp),%xmm0
addsd  0x28(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
divsd  0xe21(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl 0x14(%rsp),%xmm0
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe11(%rip),%rdi
movsd  0x18(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [14 x i8] c"IDADE 1 = %i\0A\00"
@.str.4 = [14 x i8] c"IDADE 2 = %i\0A\00"
@.str.5 = [14 x i8] c"IDADE 3 = %i\0A\00"
@.str.6 = [24 x i8] c"O PESO MEDIO E = %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca [8 x i8]
%4 = alloca [8 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %1
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [8 x i8]* %2)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %8)
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [8 x i8]* %3)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %9)
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [8 x i8]* %4)
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %10)
%21 = load double, double* %8
%22 = load double, double* %9
%23 = fadd double %21, %22
%24 = load double, double* %10
%25 = fadd double %23, %24
%26 = fdiv double %25, 3.000000e+00
store double %26, double* %11
%27 = load i32, i32* %5
%28 = sitofp i32 %27 to double
%29 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %28)
%30 = load i32, i32* %6
%31 = sitofp i32 %30 to double
%32 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %31)
%33 = load i32, i32* %7
%34 = sitofp i32 %33 to double
%35 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %34)
%36 = load double, double* %11
%37 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [14 x i8] c"IDADE 1 = %i\0A\00"
@.str.4 = [14 x i8] c"IDADE 2 = %i\0A\00"
@.str.5 = [14 x i8] c"IDADE 3 = %i\0A\00"
@.str.6 = [24 x i8] c"O PESO MEDIO E = %0.2f\0A\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = alloca [8 x i8]
%3 = alloca [8 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%13 = bitcast i32* %4 to i8*
%14 = bitcast i32* %5 to i8*
%15 = bitcast i32* %6 to i8*
%16 = bitcast double* %7 to i8*
%17 = bitcast double* %8 to i8*
%18 = bitcast double* %9 to i8*
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [8 x i8]* %1)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %7)
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [8 x i8]* %2)
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %8)
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [8 x i8]* %3)
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %9)
%28 = load double, double* %7
%29 = load double, double* %8
%30 = fadd double %28, %29
%31 = load double, double* %9
%32 = fadd double %30, %31
%33 = fdiv double %32, 3.000000e+00
%34 = load i32, i32* %4
%35 = sitofp i32 %34 to double
%36 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %35)
%37 = load i32, i32* %5
%38 = sitofp i32 %37 to double
%39 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %38)
%40 = load i32, i32* %6
%41 = sitofp i32 %40 to double
%42 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %41)
%43 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %33)
ret i32 0
}