#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 *);
int main() {
  printf("\t\tPrograma para saber quanto demora a tornar-se génio!\n\n");
  int num_horas;
  printf("Quantas horas vai dedicar por dia para ser genio?");
  scanf("%d", &num_horas);
  float dias = num_horas / 365;
  float anos = 10000 / dias;
  printf("Voce vai demorar %.0f dias ou seja aproximadamente %.0f anos\n%d "
         "meses para ficar genio\n",
         dias, anos, (anos - (int)anos) * 12);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x16d,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe94(%rip),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm3
subss  %xmm3,%xmm2
movss  0xe5a(%rip),%xmm3
mulss  %xmm3,%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xec2(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf5d(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0xffffffffb38cf9b1,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x8,%ecx
add    %eax,%ecx
cvtsi2ss %ecx,%xmm0
movss  0xe7c(%rip),%xmm2
divss  %xmm0,%xmm2
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm2,%xmm1
cvttps2dq %xmm2,%xmm3
cvtdq2ps %xmm3,%xmm3
subss  %xmm3,%xmm2
mulss  0xe61(%rip),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe8f(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"\09\09Programa para saber quanto demora a tornar-se g\C3\A9nio!\0A\0A\00"
@.str.1 = [50 x i8] c"Quantas horas vai dedicar por dia para ser genio?\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [88 x i8] c"Voce vai demorar %.0f dias ou seja aproximadamente %.0f anos\0A%d meses para ficar genio\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = sdiv i32 %7, 365
%9 = sitofp i32 %8 to float
store float %9, float* %2
%10 = load float, float* %2
%11 = fdiv float 1.000000e+04, %10
store float %11, float* %3
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = load float, float* %3
%17 = load float, float* %3
%18 = fptosi float %17 to i32
%19 = sitofp i32 %18 to float
%20 = fsub float %16, %19
%21 = fmul float %20, 1.200000e+01
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.3, i64 0, i64 0), double %13, double %15, double %22)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [50 x i8] c"Quantas horas vai dedicar por dia para ser genio?\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [88 x i8] c"Voce vai demorar %.0f dias ou seja aproximadamente %.0f anos\0A%d meses para ficar genio\0A\00"
@str = [57 x i8] c"\09\09Programa para saber quanto demora a tornar-se g\C3\A9nio!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 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 = sdiv i32 %6, 365
%8 = sitofp i32 %7 to float
%9 = fdiv float 1.000000e+04, %8
%10 = fpext float %8 to double
%11 = fpext float %9 to double
%12 = fptosi float %9 to i32
%13 = sitofp i32 %12 to float
%14 = fsub float %9, %13
%15 = fmul float %14, 1.200000e+01
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.3, i64 0, i64 0), double %10, double %11, double %16)
ret i32 0
}