#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 */
float converterDiasEmAnos(float);
float converterHorasEmDias(int);
int obterMeses(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  printf("\tPrograma para saber quanto demora a tornar-se genio!\n\n");
  int num_horas;
  printf("Quantas horas vai dedicar por dia para ser genio? ");
  scanf("%d", &num_horas);
  float dias = converterHorasEmDias(num_horas);
  float anos = converterDiasEmAnos(dias);
  int meses = obterMeses(anos);
  printf("\nVoce vai demorar %.1f dias, ou seja, aproximadamente %d anos e %d "
         "meses para ficar genio",
         dias, (int)anos, meses);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1060 <converterHorasEmDias@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <converterDiasEmAnos@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <obterMeses@plt>
mov    %eax,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvttss2si -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x14(%rsp),%edi
call   1070 <converterHorasEmDias@plt>
movss  %xmm0,0x10(%rsp)
call   1060 <converterDiasEmAnos@plt>
movss  %xmm0,0xc(%rsp)
call   1050 <obterMeses@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
cvttss2si 0xc(%rsp),%esi
lea    0xe71(%rip),%rdi
mov    %eax,%edx
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [56 x i8] c"\09Programa para saber quanto demora a tornar-se genio!\0A\0A\00"
@.str.1 = [51 x i8] c"Quantas horas vai dedicar por dia para ser genio? \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [90 x i8] c"\0AVoce vai demorar %.1f dias, ou seja, aproximadamente %d anos e %d meses para ficar genio\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = call float @converterHorasEmDias(i32 %8)
store float %9, float* %2
%10 = load float, float* %2
%11 = call float @converterDiasEmAnos(float %10)
store float %11, float* %3
%12 = load float, float* %3
%13 = call i32 @obterMeses(float %12)
store i32 %13, i32* %4
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = load float, float* %3
%17 = fptosi float %16 to i32
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.3, i64 0, i64 0), double %15, i32 %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [51 x i8] c"Quantas horas vai dedicar por dia para ser genio? \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [90 x i8] c"\0AVoce vai demorar %.1f dias, ou seja, aproximadamente %d anos e %d meses para ficar genio\00"
@str = [55 x i8] c"\09Programa para saber quanto demora a tornar-se genio!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call float @converterHorasEmDias(i32 %6)
%8 = call float @converterDiasEmAnos(float %7)
%9 = call i32 @obterMeses(float %8)
%10 = fpext float %7 to double
%11 = fptosi float %8 to i32
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @.str.3, i64 0, i64 0), double %10, i32 %11, i32 %9)
ret i32 0
}