#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 *, ...);
scalar_t__ strcmp(char *, char *);
int main(void) {
  float altura, ideal, peso;
  char sexo[20];
  printf("Insira seu peso: \n");
  scanf("%f", &peso);
  printf("Insira sua altura: \n");
  scanf("%f", &altura);
  printf("Você é homem ou mulher?\n");
  scanf("%s", &sexo);
  if (strcmp(sexo, "homem") == 0) {
    ideal = (72.7 * altura) - 58;
    if (peso > ideal) {
      printf("Você está acima do peso\n");
    } else {
      printf("Você está dentro do peso =D\n");
    }
  } else {
    ideal = (62.1 * altura) - 44.7;
    if (peso > ideal) {
      printf("Você está acima do peso\n");
    } else {
      printf("Você está dentro do peso =D\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x30(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    120e <main+0xde>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe4c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe48(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11fd <main+0xcd>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    1209 <main+0xd9>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    1269 <main+0x139>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xddd(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1258 <main+0x128>
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
jmp    1264 <main+0x134>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    1269 <main+0x139>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
test   %rax,%rax
je     11c4 <main+0x94>
mulsd  0xe46(%rip),%xmm0
addsd  0xe46(%rip),%xmm0
jmp    11d4 <main+0xa4>
mulsd  0xe44(%rip),%xmm0
addsd  0xe44(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
lea    0xea2(%rip),%rax
lea    0xe7d(%rip),%rdi
cmova  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Insira seu peso: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"Insira sua altura: \0A\00"
@.str.3 = [27 x i8] c"Voc\C3\AA \C3\A9 homem ou mulher?\0A\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [6 x i8] c"homem\00"
@.str.6 = [27 x i8] c"Voc\C3\AA est\C3\A1 acima do peso\0A\00"
@.str.7 = [31 x i8] c"Voc\C3\AA est\C3\A1 dentro do peso =D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca [20 x i8]
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 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), float* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), [20 x i8]* %5)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %0
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = call double @llvm.fmuladd.f64(double 7.270000e+01, double %17, double -5.800000e+01)
%19 = fptrunc double %18 to float
store float %19, float* %3
%20 = load float, float* %4
%21 = load float, float* %3
%22 = fcmp ogt float %20, %21
br i1 %22, label %23, label %25
23: ; preds = %15
%24 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %27
25: ; preds = %15
%26 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
br label %41
28: ; preds = %0
%29 = load float, float* %2
%30 = fpext float %29 to double
%31 = call double @llvm.fmuladd.f64(double 6.210000e+01, double %30, double -4.470000e+01)
%32 = fptrunc double %31 to float
store float %32, float* %3
%33 = load float, float* %4
%34 = load float, float* %3
%35 = fcmp ogt float %33, %34
br i1 %35, label %36, label %38
36: ; preds = %28
%37 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %40
38: ; preds = %28
%39 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
br label %41
41: ; preds = %40, %27
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [6 x i8] c"homem\00"
@str = [18 x i8] c"Insira seu peso: \00"
@str.8 = [20 x i8] c"Insira sua altura: \00"
@str.9 = [26 x i8] c"Voc\C3\AA \C3\A9 homem ou mulher?\00"
@str.12 = [30 x i8] c"Voc\C3\AA est\C3\A1 dentro do peso =D\00"
@str.13 = [26 x i8] c"Voc\C3\AA est\C3\A1 acima do peso\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca [20 x i8]
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), [20 x i8]* %3)
%13 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = load float, float* %1
%16 = fpext float %15 to double
br i1 %14, label %17, label %23
17: ; preds = %0
%18 = call double @llvm.fmuladd.f64(double %16, double 7.270000e+01, double -5.800000e+01)
%19 = fptrunc double %18 to float
%20 = load float, float* %2
%21 = fcmp ogt float %20, %19
%22 = select i1 %21, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.12, i64 0, i64 0)
br label %29
23: ; preds = %0
%24 = call double @llvm.fmuladd.f64(double %16, double 6.210000e+01, double -4.470000e+01)
%25 = fptrunc double %24 to float
%26 = load float, float* %2
%27 = fcmp ogt float %26, %25
%28 = select i1 %27, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.12, i64 0, i64 0)
br label %29
29: ; preds = %23, %17
%30 = phi i8* [ %22, %17 ], [ %28, %23 ]
%31 = call i32 @puts(i8* dereferenceable(1) %30)
ret i32 0
}