#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int secs, mins, hours, days, weeks, input;
  printf("Please only input non-negative integers: ");
  scanf("%d", &input);
  secs = input % 60;
  mins = (input / 60) % 60;
  hours = (input / 3600) % 24;
  if (mins == 0 && secs > 0 && hours > 0) {
    printf("%d %s and %d %s", hours, hours == 1 ? "hour" : "hours", secs,
           secs == 1 ? "second" : "seconds");
  } else if (hours == 0 && secs > 0 && mins > 0) {
    printf("%d %s and %d %s", mins, mins == 1 ? "minute" : "minutes", secs,
           secs == 1 ? "second" : "seconds");
  } else if (secs == 0 && mins > 0 && hours > 0) {
    printf("%d %s and %d %s", hours, hours == 1 ? "hour" : "hours", mins,
           mins == 1 ? "minute" : "minutes");
  } else {
    printf("%d %s, %d %s and %d %s", hours, hours == 1 ? "hour" : "hours", mins,
           mins == 1 ? "minute" : "minutes", secs,
           secs == 1 ? "second" : "seconds");
  }
  return EXIT_SUCCESS;
}


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    0xee6(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11ee <main+0xce>
cmpl   $0x0,-0x8(%rbp)
jle    11ee <main+0xce>
cmpl   $0x0,-0x10(%rbp)
jle    11ee <main+0xce>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xe80(%rip),%rdx
lea    0xe74(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdx
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edi
lea    0xe72(%rip),%r8
lea    0xe64(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r8
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    132c <main+0x20c>
cmpl   $0x0,-0x10(%rbp)
jne    1255 <main+0x135>
cmpl   $0x0,-0x8(%rbp)
jle    1255 <main+0x135>
cmpl   $0x0,-0xc(%rbp)
jle    1255 <main+0x135>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xe35(%rip),%rdx
lea    0xe27(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdx
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edi
lea    0xe0b(%rip),%r8
lea    0xdfd(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r8
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1327 <main+0x207>
cmpl   $0x0,-0x8(%rbp)
jne    12bc <main+0x19c>
cmpl   $0x0,-0xc(%rbp)
jle    12bc <main+0x19c>
cmpl   $0x0,-0x10(%rbp)
jle    12bc <main+0x19c>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xdb2(%rip),%rdx
lea    0xda6(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdx
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%edi
lea    0xdb3(%rip),%r8
lea    0xda5(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r8
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1322 <main+0x202>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xd69(%rip),%rdx
lea    0xd5d(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdx
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%edi
lea    0xd6a(%rip),%r8
lea    0xd5c(%rip),%rax
cmp    $0x1,%edi
cmove  %rax,%r8
mov    -0x8(%rbp),%r9d
mov    -0x8(%rbp),%r10d
lea    0xd3e(%rip),%rax
lea    0xd30(%rip),%rdi
cmp    $0x1,%r10d
cmove  %rdi,%rax
lea    0xd3f(%rip),%rdi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1327 <main+0x207>
jmp    132c <main+0x20c>
mov    0x2cad(%rip),%rax
mov    (%rax),%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    0xef1(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x14(%rsp),%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%edx
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %eax,%r9d
sub    %edx,%r9d
movslq %ecx,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x5,%eax
add    %edx,%eax
imul   $0x3c,%eax,%eax
mov    %esi,%edx
shr    $0x1f,%edx
sar    $0xb,%esi
add    %edx,%esi
movslq %esi,%rsi
imul   $0x2aaaaaab,%rsi,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
shr    $0x22,%rdx
add    %edi,%edx
shl    $0x3,%edx
lea    (%rdx,%rdx,2),%edx
sub    %edx,%esi
sub    %eax,%ecx
jne    11fc <main+0xdc>
test   %r9d,%r9d
jle    11fc <main+0xdc>
test   %esi,%esi
jle    11fc <main+0xdc>
cmp    $0x1,%esi
lea    0xe5b(%rip),%rax
lea    0xe59(%rip),%rdx
cmove  %rax,%rdx
cmp    $0x1,%r9d
lea    0xe50(%rip),%rax
lea    0xe50(%rip),%r8
cmove  %rax,%r8
lea    0xe63(%rip),%rdi
jmp    123d <main+0x11d>
test   %esi,%esi
jne    1255 <main+0x135>
test   %r9d,%r9d
jle    1255 <main+0x135>
test   %ecx,%ecx
jle    1255 <main+0x135>
cmp    $0x1,%ecx
lea    0xe34(%rip),%rax
lea    0xe34(%rip),%rdx
cmove  %rax,%rdx
cmp    $0x1,%r9d
lea    0xe0f(%rip),%rax
lea    0xe0f(%rip),%r8
cmove  %rax,%r8
lea    0xe22(%rip),%rdi
mov    %ecx,%esi
mov    %r9d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2d92(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret
cmp    $0x1,%esi
lea    0xdce(%rip),%rax
lea    0xdcc(%rip),%rdx
cmove  %rax,%rdx
cmp    $0x1,%ecx
lea    0xdd3(%rip),%rax
lea    0xdd3(%rip),%r8
cmove  %rax,%r8
test   %r9d,%r9d
jne    1295 <main+0x175>
test   %ecx,%ecx
jle    1295 <main+0x175>
test   %esi,%esi
jle    1295 <main+0x175>
lea    0xdca(%rip),%rdi
jmp    1240 <main+0x120>
cmp    $0x1,%r9d
lea    0xd98(%rip),%rax
lea    0xd98(%rip),%rdi
cmove  %rax,%rdi
mov    %rdi,(%rsp)
lea    0xda0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1247 <main+0x127>

LLVM IR (-O0):
@.str = [42 x i8] c"Please only input non-negative integers: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"%d %s and %d %s\00"
@.str.3 = [5 x i8] c"hour\00"
@.str.4 = [6 x i8] c"hours\00"
@.str.5 = [7 x i8] c"second\00"
@.str.6 = [8 x i8] c"seconds\00"
@.str.7 = [7 x i8] c"minute\00"
@.str.8 = [8 x i8] c"minutes\00"
@.str.9 = [23 x i8] c"%d %s, %d %s and %d %s\00"
@EXIT_SUCCESS = global i32 0
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 ([42 x i8], [42 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* %7)
%10 = load i32, i32* %7
%11 = srem i32 %10, 60
store i32 %11, i32* %2
%12 = load i32, i32* %7
%13 = sdiv i32 %12, 60
%14 = srem i32 %13, 60
store i32 %14, i32* %3
%15 = load i32, i32* %7
%16 = sdiv i32 %15, 3600
%17 = srem i32 %16, 24
store i32 %17, i32* %4
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %38
20: ; preds = %0
%21 = load i32, i32* %2
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %38
23: ; preds = %20
%24 = load i32, i32* %4
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %38
26: ; preds = %23
%27 = load i32, i32* %4
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 1
%30 = zext i1 %29 to i64
%31 = select i1 %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%32 = load i32, i32* %2
%33 = load i32, i32* %2
%34 = icmp eq i32 %33, 1
%35 = zext i1 %34 to i64
%36 = select i1 %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %27, i8* %31, i32 %32, i8* %36)
br label %99
38: ; preds = %23, %20, %0
%39 = load i32, i32* %4
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %59
41: ; preds = %38
%42 = load i32, i32* %2
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %59
44: ; preds = %41
%45 = load i32, i32* %3
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %59
47: ; preds = %44
%48 = load i32, i32* %3
%49 = load i32, i32* %3
%50 = icmp eq i32 %49, 1
%51 = zext i1 %50 to i64
%52 = select i1 %50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0)
%53 = load i32, i32* %2
%54 = load i32, i32* %2
%55 = icmp eq i32 %54, 1
%56 = zext i1 %55 to i64
%57 = select i1 %55, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %48, i8* %52, i32 %53, i8* %57)
br label %98
59: ; preds = %44, %41, %38
%60 = load i32, i32* %2
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %80
62: ; preds = %59
%63 = load i32, i32* %3
%64 = icmp sgt i32 %63, 0
br i1 %64, label %65, label %80
65: ; preds = %62
%66 = load i32, i32* %4
%67 = icmp sgt i32 %66, 0
br i1 %67, label %68, label %80
68: ; preds = %65
%69 = load i32, i32* %4
%70 = load i32, i32* %4
%71 = icmp eq i32 %70, 1
%72 = zext i1 %71 to i64
%73 = select i1 %71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%74 = load i32, i32* %3
%75 = load i32, i32* %3
%76 = icmp eq i32 %75, 1
%77 = zext i1 %76 to i64
%78 = select i1 %76, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %69, i8* %73, i32 %74, i8* %78)
br label %97
80: ; preds = %65, %62, %59
%81 = load i32, i32* %4
%82 = load i32, i32* %4
%83 = icmp eq i32 %82, 1
%84 = zext i1 %83 to i64
%85 = select i1 %83, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%86 = load i32, i32* %3
%87 = load i32, i32* %3
%88 = icmp eq i32 %87, 1
%89 = zext i1 %88 to i64
%90 = select i1 %88, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0)
%91 = load i32, i32* %2
%92 = load i32, i32* %2
%93 = icmp eq i32 %92, 1
%94 = zext i1 %93 to i64
%95 = select i1 %93, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0)
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i32 %81, i8* %85, i32 %86, i8* %90, i32 %91, i8* %95)
br label %97
97: ; preds = %80, %68
br label %98
98: ; preds = %97, %47
br label %99
99: ; preds = %98, %26
%100 = load i32, i32* @EXIT_SUCCESS
ret i32 %100
}

LLVM IR (-O2):
@.str = [42 x i8] c"Please only input non-negative integers: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"%d %s and %d %s\00"
@.str.3 = [5 x i8] c"hour\00"
@.str.4 = [6 x i8] c"hours\00"
@.str.5 = [7 x i8] c"second\00"
@.str.6 = [8 x i8] c"seconds\00"
@.str.7 = [7 x i8] c"minute\00"
@.str.8 = [8 x i8] c"minutes\00"
@.str.9 = [23 x i8] c"%d %s, %d %s and %d %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 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 = srem i32 %5, 60
%7 = sdiv i32 %5, 60
%8 = srem i32 %7, 60
%9 = sdiv i32 %5, 3600
%10 = srem i32 %9, 24
%11 = icmp eq i32 %8, 0
%12 = icmp sgt i32 %6, 0
%13 = select i1 %11, i1 %12, i1 false
%14 = icmp sgt i32 %10, 0
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %16, label %22
16: ; preds = %0
%17 = icmp eq i32 %10, 1
%18 = select i1 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%19 = icmp eq i32 %6, 1
%20 = select i1 %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %10, i8* %18, i32 %6, i8* %20)
br label %47
22: ; preds = %0
%23 = icmp eq i32 %10, 0
%24 = select i1 %23, i1 %12, i1 false
%25 = icmp sgt i32 %8, 0
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %27, label %33
27: ; preds = %22
%28 = icmp eq i32 %8, 1
%29 = select i1 %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0)
%30 = icmp eq i32 %6, 1
%31 = select i1 %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8, i8* %29, i32 %6, i8* %31)
br label %47
33: ; preds = %22
%34 = icmp eq i32 %6, 0
%35 = select i1 %34, i1 %25, i1 false
%36 = select i1 %35, i1 %14, i1 false
%37 = icmp eq i32 %10, 1
%38 = select i1 %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%39 = icmp eq i32 %8, 1
%40 = select i1 %39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0)
br i1 %36, label %41, label %43
41: ; preds = %33
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %10, i8* %38, i32 %8, i8* %40)
br label %47
43: ; preds = %33
%44 = icmp eq i32 %6, 1
%45 = select i1 %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i32 %10, i8* %38, i32 %8, i8* %40, i32 %6, i8* %45)
br label %47
47: ; preds = %27, %43, %41, %16
%48 = load i32, i32* @EXIT_SUCCESS
ret i32 %48
}