#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 */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int time(int /*<<< orphan*/);
int time_conv(int, int);
int main(void) {
  time_t countdown, day, hour, minute, year, now;
  int val, num_years, num_days, num_hours, num_minutes, num_seconds, s;
  now = time(0);
  printf("\n%ld\n", now);
  minute = 60;
  hour = 60 * minute;
  day = 24 * hour;
  year = 365 * day;
  val = time_conv(now, year);
  num_years = val;
  now = now - val * year;
  val = time_conv(now, day);
  num_days = val;
  now = now - val * day;
  val = time_conv(now, hour);
  num_hours = val;
  now = now - val * hour;
  val = time_conv(now, minute);
  num_minutes = val;
  now = now - val * minute;
  num_seconds = now;
  printf("There are %d years %d days %d hours %d minutes and %d seconds",
         num_years, num_days, num_hours, num_minutes, num_seconds);
  printf(" given from time(0)\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3c,-0x14(%rbp)
imul   $0x3c,-0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x18,-0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x16d,-0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <time_conv@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
imul   -0x18(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <time_conv@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <time_conv@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <time_conv@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
imul   -0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%ebp
lea    0xea8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    $0x1e13380,%esi
call   1050 <time_conv@plt>
mov    %eax,%r14d
imul   $0xfe1ecc80,%eax,%ebx
add    %ebp,%ebx
mov    %ebx,%edi
mov    $0x15180,%esi
call   1050 <time_conv@plt>
mov    %eax,%r15d
imul   $0xfffeae80,%eax,%ebp
add    %ebx,%ebp
mov    %ebp,%edi
mov    $0xe10,%esi
call   1050 <time_conv@plt>
mov    %eax,%r12d
imul   $0xfffff1f0,%eax,%ebx
add    %ebp,%ebx
mov    %ebx,%edi
mov    $0x3c,%esi
call   1050 <time_conv@plt>
imul   $0xffffffc4,%eax,%r9d
add    %ebx,%r9d
lea    0xe46(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %r12d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\0A%ld\0A\00"
@.str.1 = [62 x i8] c"There are %d years %d days %d hours %d minutes and %d seconds\00"
@.str.2 = [21 x i8] c" given from time(0)\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
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %1
%15 = call i32 @time(i32 0)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 60, i32* %5
%18 = load i32, i32* %5
%19 = mul nsw i32 60, %18
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = mul nsw i32 24, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = mul nsw i32 365, %22
store i32 %23, i32* %6
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = call i32 @time_conv(i32 %24, i32 %25)
store i32 %26, i32* %8
%27 = load i32, i32* %8
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = load i32, i32* %6
%31 = mul nsw i32 %29, %30
%32 = sub nsw i32 %28, %31
store i32 %32, i32* %7
%33 = load i32, i32* %7
%34 = load i32, i32* %3
%35 = call i32 @time_conv(i32 %33, i32 %34)
store i32 %35, i32* %8
%36 = load i32, i32* %8
store i32 %36, i32* %10
%37 = load i32, i32* %7
%38 = load i32, i32* %8
%39 = load i32, i32* %3
%40 = mul nsw i32 %38, %39
%41 = sub nsw i32 %37, %40
store i32 %41, i32* %7
%42 = load i32, i32* %7
%43 = load i32, i32* %4
%44 = call i32 @time_conv(i32 %42, i32 %43)
store i32 %44, i32* %8
%45 = load i32, i32* %8
store i32 %45, i32* %11
%46 = load i32, i32* %7
%47 = load i32, i32* %8
%48 = load i32, i32* %4
%49 = mul nsw i32 %47, %48
%50 = sub nsw i32 %46, %49
store i32 %50, i32* %7
%51 = load i32, i32* %7
%52 = load i32, i32* %5
%53 = call i32 @time_conv(i32 %51, i32 %52)
store i32 %53, i32* %8
%54 = load i32, i32* %8
store i32 %54, i32* %12
%55 = load i32, i32* %7
%56 = load i32, i32* %8
%57 = load i32, i32* %5
%58 = mul nsw i32 %56, %57
%59 = sub nsw i32 %55, %58
store i32 %59, i32* %7
%60 = load i32, i32* %7
store i32 %60, i32* %13
%61 = load i32, i32* %9
%62 = load i32, i32* %10
%63 = load i32, i32* %11
%64 = load i32, i32* %12
%65 = load i32, i32* %13
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i32 %61, i32 %62, i32 %63, i32 %64, i32 %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%ld\0A\00"
@.str.1 = [62 x i8] c"There are %d years %d days %d hours %d minutes and %d seconds\00"
@str = [20 x i8] c" given from time(0)\00"
define i32 @main() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @time_conv(i32 %1, i32 31536000)
%4 = mul i32 %3, -31536000
%5 = add i32 %4, %1
%6 = tail call i32 @time_conv(i32 %5, i32 86400)
%7 = mul i32 %6, -86400
%8 = add i32 %7, %5
%9 = tail call i32 @time_conv(i32 %8, i32 3600)
%10 = mul i32 %9, -3600
%11 = add i32 %10, %8
%12 = tail call i32 @time_conv(i32 %11, i32 60)
%13 = mul i32 %12, -60
%14 = add i32 %13, %11
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %6, i32 %9, i32 %12, i32 %14)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}