#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 sek, sekundy, lata, dni, godziny, min;
  printf("\nPodaj ile ilość sekund: ");
  scanf("%i", &sek);
  sekundy = sek;
  lata = sek / (3600 * 24 * 365);
  ;
  sek = sek % (3600 * 24 * 365);
  ;
  dni = sek / (3600 * 24);
  ;
  sek = sek % (3600 * 24);
  ;
  godziny = sek / 3600;
  ;
  sek = sek % 3600;
  ;
  min = sek / 60;
  ;
  sek = sek % 60;
  ;
  printf("\nTwoje  %i sek to %d l %d d %d godz. %d min %d sek. \n", sekundy,
         lata, dni, godziny, min, sek);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x1e13380,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x1e13380,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x8(%rbp),%eax
lea    0xe41(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x14(%rsp),%rsi
imul   $0x4418a47b,%rsi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x20,%rdx
sar    $0x17,%edx
add    %eax,%edx
imul   $0x1e13380,%edx,%eax
mov    %esi,%ecx
sub    %eax,%ecx
movslq %ecx,%rax
imul   $0xffffffffc22e4507,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
sar    $0x10,%ecx
add    %edi,%ecx
imul   $0x15180,%ecx,%edi
sub    %edi,%eax
cltq
imul   $0xffffffff91a2b3c5,%rax,%r8
shr    $0x20,%r8
add    %eax,%r8d
mov    %r8d,%edi
shr    $0x1f,%edi
sar    $0xb,%r8d
add    %edi,%r8d
imul   $0xe10,%r8d,%edi
sub    %edi,%eax
movswl %ax,%edi
imul   $0xffff8889,%edi,%edi
shr    $0x10,%edi
add    %eax,%edi
movzwl %di,%r9d
movswl %r9w,%edi
shr    $0xf,%r9d
sar    $0x5,%edi
add    %r9d,%edi
movswl %di,%r9d
imul   $0x3c,%edi,%edi
sub    %edi,%eax
cwtl
mov    %eax,0x14(%rsp)
mov    %eax,(%rsp)
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0APodaj ile ilo\C5\9B\C4\87 sekund: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [54 x i8] c"\0ATwoje %i sek to %d l %d d %d godz. %d min %d sek. \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 i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 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
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 31536000
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = srem i32 %13, 31536000
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 86400
store i32 %16, i32* %5
%17 = load i32, i32* %2
%18 = srem i32 %17, 86400
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = sdiv i32 %19, 3600
store i32 %20, i32* %6
%21 = load i32, i32* %2
%22 = srem i32 %21, 3600
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = sdiv i32 %23, 60
store i32 %24, i32* %7
%25 = load i32, i32* %2
%26 = srem i32 %25, 60
store i32 %26, i32* %2
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = load i32, i32* %2
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %28, i32 %29, i32 %30, i32 %31, i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0APodaj ile ilo\C5\9B\C4\87 sekund: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [54 x i8] c"\0ATwoje %i sek to %d l %d d %d godz. %d min %d sek. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 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 = sdiv i32 %5, 31536000
%7 = srem i32 %5, 31536000
%8 = sdiv i32 %7, 86400
%9 = srem i32 %7, 86400
%10 = sdiv i32 %9, 3600
%11 = srem i32 %9, 3600
%12 = trunc i32 %11 to i16
%13 = sdiv i16 %12, 60
%14 = sext i16 %13 to i32
%15 = srem i16 %12, 60
%16 = sext i16 %15 to i32
store i32 %16, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6, i32 %8, i32 %10, i32 %14, i32 %16)
ret i32 0
}