#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() {
  float alt;
  int peso;
  printf("Informe os valores com ponto, sem virgulas \n");
  printf("Informe a altura (ex:1.90):");
  scanf("%f", &alt);
  printf("Informe o peso (KG inteiro sem numero quebrado):");
  scanf("%f", &peso);
  float imc = peso / (alt * alt);
  printf("Seu IMC é:%f", imc);
  if (imc < 18)
    printf("\nVoce esta abaixo do peso");
  else if (imc <= 25)
    printf("\nVoce esta no peso");
  else if (imc <= 30)
    printf("\nVoce esta acima do peso");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3f(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1f(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cvtsi2ssl -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xee1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xe4c(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11d1 <main+0xb1>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1220 <main+0x100>
movss  0xe2b(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     11f6 <main+0xd6>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121b <main+0xfb>
movss  0xe0a(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     1216 <main+0xf6>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121b <main+0xfb>
jmp    1220 <main+0x100>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf71(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0e(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
cvtsi2ssl 0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  0xe41(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    11cd <main+0x9d>
lea    0xe9c(%rip),%rdi
jmp    11f7 <main+0xc7>
movss  0xe2f(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    11f0 <main+0xc0>
movss  0xe26(%rip),%xmm0
ucomiss %xmm1,%xmm0
jb     11fe <main+0xce>
lea    0xea6(%rip),%rdi
jmp    11f7 <main+0xc7>
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Informe os valores com ponto, sem virgulas \0A\00"
@.str.1 = [28 x i8] c"Informe a altura (ex:1.90):\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [49 x i8] c"Informe o peso (KG inteiro sem numero quebrado):\00"
@.str.4 = [14 x i8] c"Seu IMC \C3\A9:%f\00"
@.str.5 = [26 x i8] c"\0AVoce esta abaixo do peso\00"
@.str.6 = [19 x i8] c"\0AVoce esta no peso\00"
@.str.7 = [25 x i8] c"\0AVoce esta acima do peso\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to float
%12 = load float, float* %2
%13 = load float, float* %2
%14 = fmul float %12, %13
%15 = fdiv float %11, %14
store float %15, float* %4
%16 = load float, float* %4
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %17)
%19 = load float, float* %4
%20 = fcmp olt float %19, 1.800000e+01
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %35
23: ; preds = %0
%24 = load float, float* %4
%25 = fcmp ole float %24, 2.500000e+01
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %34
28: ; preds = %23
%29 = load float, float* %4
%30 = fcmp ole float %29, 3.000000e+01
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
br label %34
34: ; preds = %33, %26
br label %35
35: ; preds = %34, %21
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Informe a altura (ex:1.90):\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [49 x i8] c"Informe o peso (KG inteiro sem numero quebrado):\00"
@.str.4 = [14 x i8] c"Seu IMC \C3\A9:%f\00"
@.str.5 = [26 x i8] c"\0AVoce esta abaixo do peso\00"
@.str.6 = [19 x i8] c"\0AVoce esta no peso\00"
@.str.7 = [25 x i8] c"\0AVoce esta acima do peso\00"
@str = [44 x i8] c"Informe os valores com ponto, sem virgulas \00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = bitcast float* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = load float, float* %1
%13 = fmul float %12, %12
%14 = fdiv float %11, %13
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %15)
%17 = fcmp olt float %14, 1.800000e+01
br i1 %17, label %22, label %18
18: ; preds = %0
%19 = fcmp ugt float %14, 2.500000e+01
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = fcmp ugt float %14, 3.000000e+01
br i1 %21, label %25, label %22
22: ; preds = %20, %18, %0
%23 = phi i8* [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), %0 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), %18 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), %20 ]
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %23)
br label %25
25: ; preds = %22, %20
ret i32 0
}