#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);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int age_in_days;
  scanf("%d", &age_in_days);
  int YEAR_DAYS = 365;
  int MONTH_DAYS = 30;
  int years = (age_in_days / YEAR_DAYS);
  int years_resto = (age_in_days % YEAR_DAYS);
  int months = (years_resto / MONTH_DAYS);
  int months_resto = (years_resto % MONTH_DAYS);
  int days = months_resto;
  printf("%d ano(s)\n", years);
  printf("%d mes(es)\n", months);
  printf("%d dia(s)\n", days);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x16d,-0x18(%rbp)
movl   $0x1e,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %edx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %edx,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0xffffffffb38cf9b1,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0x8,%esi
add    %ecx,%esi
imul   $0x16d,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x4,%edx
add    %ecx,%edx
movswl %dx,%ebx
mov    %edx,%ecx
shl    $0x5,%ecx
mov    %edx,%edi
sub    %ecx,%edi
add    %edx,%edi
add    %eax,%edi
movswl %di,%ebp
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xe72(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"%d ano(s)\0A\00"
@.str.2 = [12 x i8] c"%d mes(es)\0A\00"
@.str.3 = [11 x i8] c"%d dia(s)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 365, i32* %7
store i32 30, i32* %8
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = sdiv i32 %15, %16
store i32 %17, i32* %9
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = srem i32 %18, %19
store i32 %20, i32* %10
%21 = load i32, i32* %10
%22 = load i32, i32* %8
%23 = sdiv i32 %21, %22
store i32 %23, i32* %11
%24 = load i32, i32* %10
%25 = load i32, i32* %8
%26 = srem i32 %24, %25
store i32 %26, i32* %12
%27 = load i32, i32* %12
store i32 %27, i32* %13
%28 = load i32, i32* %9
%29 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %11
%31 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %13
%33 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"%d ano(s)\0A\00"
@.str.2 = [12 x i8] c"%d mes(es)\0A\00"
@.str.3 = [11 x i8] c"%d dia(s)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 365
%8 = srem i32 %6, 365
%9 = trunc i32 %8 to i16
%10 = sdiv i16 %9, 30
%11 = sext i16 %10 to i32
%12 = srem i16 %9, 30
%13 = sext i16 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %13)
ret i32 0
}