#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() {
  int wiek, miesiace, dni, godziny, minuty;
  long int sekundy;
  printf("Podaj swoj wiek:");
  scanf("%d", &wiek);
  miesiace = wiek * 12;
  dni = wiek * 365;
  godziny = dni * 24;
  minuty = godziny * 60;
  sekundy = minuty * 60;
  printf("Twój wiek w sekundach:\n");
  printf("%d miesiecy\n", miesiace);
  printf("%d dni\n", dni);
  printf("%d godzin\n", godziny);
  printf("%d minut\n", minuty);
  printf("%ld sekund\n", sekundy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0xc,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x16d,-0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x18,-0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x3c,-0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0x3c,-0x18(%rbp),%eax
cltq
mov    %rax,-0x20(%rbp)
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
lea    0x0(,%rax,4),%ecx
lea    (%rcx,%rcx,2),%ebx
imul   $0x16d,%eax,%ebp
imul   $0x2238,%eax,%r12d
imul   $0x80520,%eax,%r15d
imul   $0x1e13380,%eax,%eax
movslq %eax,%r14
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe78(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe70(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6a(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Podaj swoj wiek:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Tw\C3\B3j wiek w sekundach:\0A\00"
@.str.3 = [13 x i8] c"%d miesiecy\0A\00"
@.str.4 = [8 x i8] c"%d dni\0A\00"
@.str.5 = [11 x i8] c"%d godzin\0A\00"
@.str.6 = [10 x i8] c"%d minut\0A\00"
@.str.7 = [12 x i8] c"%ld sekund\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 12
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 365
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 24
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = mul nsw i32 %16, 60
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = mul nsw i32 %18, 60
%20 = sext i32 %19 to i64
store i64 %20, i64* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %5
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %28)
%30 = load i64, i64* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i64 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Podaj swoj wiek:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [13 x i8] c"%d miesiecy\0A\00"
@.str.4 = [8 x i8] c"%d dni\0A\00"
@.str.5 = [11 x i8] c"%d godzin\0A\00"
@.str.6 = [10 x i8] c"%d minut\0A\00"
@.str.7 = [12 x i8] c"%ld sekund\0A\00"
@str = [24 x i8] c"Tw\C3\B3j wiek w sekundach:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 12
%7 = mul nsw i32 %5, 365
%8 = mul i32 %5, 8760
%9 = mul i32 %5, 525600
%10 = mul i32 %5, 31536000
%11 = sext i32 %10 to i64
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %7)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %8)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %9)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i64 %11)
ret i32 0
}