#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 scanf(char *, int *);
int time(int /*<<< orphan*/);
int time_conv(int, int);
int main(void) {
  time_t countdown, day, hour, minute, now;
  int val, num_days, num_hours, num_minutes, num_seconds, s;
  now = time(0);
  s = scanf("%ld", &countdown);
  countdown = countdown - now;
  day = 24 * 60 * 60;
  hour = 60 * 60;
  minute = 60;
  val = time_conv(countdown, day);
  num_days = val;
  countdown = countdown - val * day;
  val = time_conv(countdown, hour);
  num_hours = val;
  countdown = countdown - val * hour;
  val = time_conv(countdown, minute);
  num_minutes = val;
  countdown = countdown - val * minute;
  num_seconds = countdown;
  printf("There are %d days %d hours %d minutes and %d seconds", num_days,
         num_hours, num_minutes, num_seconds);
  printf(" left before Fall Break!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,-0x18(%rbp)
lea    0xea0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x15180,-0xc(%rbp)
movl   $0xe10,-0x10(%rbp)
movl   $0x3c,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <time_conv@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <time_conv@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <time_conv@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%ebx
lea    0xe9d(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%edi
sub    %ebx,%edi
mov    %edi,0x4(%rsp)
mov    $0x15180,%esi
call   1050 <time_conv@plt>
mov    %eax,%ebx
imul   $0xfffeae80,%eax,%edi
add    0x4(%rsp),%edi
mov    %edi,0x4(%rsp)
mov    $0xe10,%esi
call   1050 <time_conv@plt>
mov    %eax,%ebp
imul   $0xfffff1f0,%eax,%edi
add    0x4(%rsp),%edi
mov    %edi,0x4(%rsp)
mov    $0x3c,%esi
call   1050 <time_conv@plt>
imul   $0xffffffc4,%eax,%r8d
add    0x4(%rsp),%r8d
mov    %r8d,0x4(%rsp)
lea    0xe3a(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe5b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [53 x i8] c"There are %d days %d hours %d minutes and %d seconds\00"
@.str.2 = [28 x i8] c" left before Fall Break!!!\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
store i32 0, i32* %1
%13 = call i32 @time(i32 0)
store i32 %13, i32* %6
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 %14, i32* %12
%15 = load i32, i32* %2
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
store i32 %17, i32* %2
store i32 86400, i32* %3
store i32 3600, i32* %4
store i32 60, i32* %5
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 @time_conv(i32 %18, i32 %19)
store i32 %20, i32* %7
%21 = load i32, i32* %7
store i32 %21, i32* %8
%22 = load i32, i32* %2
%23 = load i32, i32* %7
%24 = load i32, i32* %3
%25 = mul nsw i32 %23, %24
%26 = sub nsw i32 %22, %25
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = load i32, i32* %4
%29 = call i32 @time_conv(i32 %27, i32 %28)
store i32 %29, i32* %7
%30 = load i32, i32* %7
store i32 %30, i32* %9
%31 = load i32, i32* %2
%32 = load i32, i32* %7
%33 = load i32, i32* %4
%34 = mul nsw i32 %32, %33
%35 = sub nsw i32 %31, %34
store i32 %35, i32* %2
%36 = load i32, i32* %2
%37 = load i32, i32* %5
%38 = call i32 @time_conv(i32 %36, i32 %37)
store i32 %38, i32* %7
%39 = load i32, i32* %7
store i32 %39, i32* %10
%40 = load i32, i32* %2
%41 = load i32, i32* %7
%42 = load i32, i32* %5
%43 = mul nsw i32 %41, %42
%44 = sub nsw i32 %40, %43
store i32 %44, i32* %2
%45 = load i32, i32* %2
store i32 %45, i32* %11
%46 = load i32, i32* %8
%47 = load i32, i32* %9
%48 = load i32, i32* %10
%49 = load i32, i32* %11
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %46, i32 %47, i32 %48, i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [53 x i8] c"There are %d days %d hours %d minutes and %d seconds\00"
@str = [27 x i8] c" left before Fall Break!!!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32 0)
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sub nsw i32 %5, %3
store i32 %6, i32* %1
%7 = call i32 @time_conv(i32 %6, i32 86400)
%8 = load i32, i32* %1
%9 = mul i32 %7, -86400
%10 = add i32 %9, %8
store i32 %10, i32* %1
%11 = call i32 @time_conv(i32 %10, i32 3600)
%12 = load i32, i32* %1
%13 = mul i32 %11, -3600
%14 = add i32 %13, %12
store i32 %14, i32* %1
%15 = call i32 @time_conv(i32 %14, i32 60)
%16 = load i32, i32* %1
%17 = mul i32 %15, -60
%18 = add i32 %17, %16
store i32 %18, i32* %1
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %11, i32 %15, i32 %18)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}