#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 *, ...);
void print_output(int time, int hour, int minute, int second) {
  printf("\n%d seconds is ", time);
  if (time >= 3600 && hour > 1)
    printf("%d hours", hour);
  else if (time >= 3600 && hour == 1)
    printf("%d hour", hour);
  if (minute >= 1 && hour >= 1 && second == 0)
    printf(" and ");
  else if (minute >= 1 && hour >= 1)
    printf(", ");
  else if (second >= 1 && hour >= 1)
    printf(" ");
  if (time >= 60 && minute > 1)
    printf("%d minutes ", minute);
  else if (time >= 60 && minute == 1)
    printf("%d minute ", minute);
  if (second >= 1 && time >= 60)
    printf("and ");
  if (time >= 1 && second > 1)
    printf("%d seconds \n\n", second);
  else if (time >= 1 && second == 1)
    printf("%d second \n\n", second);
  else
    printf("\n\n");
}


x86 assembly (clang, -O0):
<print_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xe10,-0x4(%rbp)
jl     1162 <print_output+0x52>
cmpl   $0x1,-0x8(%rbp)
jle    1162 <print_output+0x52>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118f <print_output+0x7f>
cmpl   $0xe10,-0x4(%rbp)
jl     118a <print_output+0x7a>
cmpl   $0x1,-0x8(%rbp)
jne    118a <print_output+0x7a>
mov    -0x8(%rbp),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118f <print_output+0x7f>
cmpl   $0x1,-0xc(%rbp)
jl     11c0 <print_output+0xb0>
cmpl   $0x1,-0x8(%rbp)
jl     11c0 <print_output+0xb0>
cmpl   $0x0,-0x10(%rbp)
jne    11c0 <print_output+0xb0>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1213 <print_output+0x103>
cmpl   $0x1,-0xc(%rbp)
jl     11e7 <print_output+0xd7>
cmpl   $0x1,-0x8(%rbp)
jl     11e7 <print_output+0xd7>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120e <print_output+0xfe>
cmpl   $0x1,-0x10(%rbp)
jl     1209 <print_output+0xf9>
cmpl   $0x1,-0x8(%rbp)
jl     1209 <print_output+0xf9>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120e <print_output+0xfe>
jmp    1213 <print_output+0x103>
cmpl   $0x3c,-0x4(%rbp)
jl     123d <print_output+0x12d>
cmpl   $0x1,-0xc(%rbp)
jle    123d <print_output+0x12d>
mov    -0xc(%rbp),%esi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1267 <print_output+0x157>
cmpl   $0x3c,-0x4(%rbp)
jl     1262 <print_output+0x152>
cmpl   $0x1,-0xc(%rbp)
jne    1262 <print_output+0x152>
mov    -0xc(%rbp),%esi
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1267 <print_output+0x157>
cmpl   $0x1,-0x10(%rbp)
jl     1289 <print_output+0x179>
cmpl   $0x3c,-0x4(%rbp)
jl     1289 <print_output+0x179>
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jl     12b3 <print_output+0x1a3>
cmpl   $0x1,-0x10(%rbp)
jle    12b3 <print_output+0x1a3>
mov    -0x10(%rbp),%esi
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f0 <print_output+0x1e0>
cmpl   $0x1,-0x4(%rbp)
jl     12dd <print_output+0x1cd>
cmpl   $0x1,-0x10(%rbp)
jne    12dd <print_output+0x1cd>
mov    -0x10(%rbp),%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12eb <print_output+0x1db>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f0 <print_output+0x1e0>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_output>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb8(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xe10,%ebp
jl     1169 <print_output+0x39>
cmp    $0x2,%ebx
jl     1169 <print_output+0x39>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
jmp    1182 <print_output+0x52>
cmp    $0xe10,%ebp
jl     1189 <print_output+0x59>
cmp    $0x1,%ebx
jne    1189 <print_output+0x59>
lea    0xe9c(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15d,%r15d
setg   %cl
test   %ebx,%ebx
setg   %al
and    %cl,%al
cmp    $0x1,%al
jne    11a8 <print_output+0x78>
test   %r14d,%r14d
jne    11a8 <print_output+0x78>
lea    0xe7b(%rip),%rdi
jmp    11b7 <print_output+0x87>
test   %al,%al
je     1248 <print_output+0x118>
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x3c,%ebp
jl     11d5 <print_output+0xa5>
cmp    $0x2,%r15d
jl     11d5 <print_output+0xa5>
lea    0xe5a(%rip),%rdi
mov    %r15d,%esi
jmp    11ec <print_output+0xbc>
cmp    $0x3c,%ebp
jl     11f3 <print_output+0xc3>
cmp    $0x1,%r15d
jne    11f3 <print_output+0xc3>
lea    0xe4f(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x3c,%ebp
jl     120b <print_output+0xdb>
test   %r14d,%r14d
jle    120b <print_output+0xdb>
lea    0xe1e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
jle    1221 <print_output+0xf1>
cmp    $0x2,%r14d
jl     1221 <print_output+0xf1>
lea    0xe25(%rip),%rdi
mov    %r14d,%esi
jmp    1237 <print_output+0x107>
test   %ebp,%ebp
jle    1268 <print_output+0x138>
cmp    $0x1,%r14d
jne    1268 <print_output+0x138>
lea    0xe1d(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>
test   %ebx,%ebx
jle    11be <print_output+0x8e>
test   %r14d,%r14d
jle    11be <print_output+0x8e>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11be <print_output+0x8e>
lea    0xdeb(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0A%d seconds is \00"
@.str.1 = [9 x i8] c"%d hours\00"
@.str.2 = [8 x i8] c"%d hour\00"
@.str.3 = [6 x i8] c" and \00"
@.str.4 = [3 x i8] c", \00"
@.str.6 = [12 x i8] c"%d minutes \00"
@.str.7 = [11 x i8] c"%d minute \00"
@.str.8 = [5 x i8] c"and \00"
@.str.9 = [14 x i8] c"%d seconds \0A\0A\00"
@.str.10 = [13 x i8] c"%d second \0A\0A\00"
@str = [2 x i8] c"\0A\00"
define void @print_output(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = icmp sgt i32 %0, 3599
%7 = icmp sgt i32 %1, 1
%8 = and i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %16
11: ; preds = %4
%12 = icmp eq i32 %1, 1
%13 = and i1 %6, %12
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %16
16: ; preds = %11, %14, %9
%17 = icmp sgt i32 %2, 0
%18 = icmp sgt i32 %1, 0
%19 = and i1 %18, %17
%20 = icmp eq i32 %3, 0
%21 = and i1 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %32
24: ; preds = %16
br i1 %19, label %25, label %27
25: ; preds = %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %32
27: ; preds = %24
%28 = icmp sgt i32 %3, 0
%29 = and i1 %18, %28
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = tail call i32 @putchar(i32 32)
br label %32
32: ; preds = %25, %30, %27, %22
%33 = icmp sgt i32 %0, 59
%34 = icmp sgt i32 %2, 1
%35 = and i1 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %2)
br label %43
38: ; preds = %32
%39 = icmp eq i32 %2, 1
%40 = and i1 %33, %39
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 1)
br label %43
43: ; preds = %38, %41, %36
%44 = icmp sgt i32 %3, 0
%45 = and i1 %33, %44
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %48
48: ; preds = %46, %43
%49 = icmp sgt i32 %0, 0
%50 = icmp sgt i32 %3, 1
%51 = and i1 %49, %50
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %3)
br label %61
54: ; preds = %48
%55 = icmp eq i32 %3, 1
%56 = and i1 %49, %55
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 1)
br label %61
59: ; preds = %54
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %61
61: ; preds = %57, %59, %52
ret void
}