#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(void) {
  int sec, min, hour, inp;
  printf("Enter the total seconds: ");
  scanf("%d", &inp);
  printf("\n");
  hour = inp / 3600;
  min = inp % 3600 / 60;
  sec = inp % 3600 % 60;
  hour > 0 ? (hour == 1 ? printf("%d time", hour) : printf("%d timer", hour))
           : printf("");
  min > 0 ? (sec > 0 ? printf(", ") : printf(" og "))
          : (sec > 0 ? printf(" og ") : printf(""));
  min > 0 ? (min == 1 ? printf("%d minut", min) : printf("%d minutter", min))
          : printf("");
  sec > 0 ? printf(" og ") : printf("");
  sec > 0 ? (sec == 1 ? printf("%d sekund", sec) : printf("%d sekunder", sec))
          : printf("");
  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    0xed6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    11e2 <main+0xc2>
cmpl   $0x1,-0x10(%rbp)
jne    11c6 <main+0xa6>
mov    -0x10(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x18(%rbp)
jmp    11da <main+0xba>
mov    -0x10(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
jmp    11f0 <main+0xd0>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    1233 <main+0x113>
cmpl   $0x0,-0x8(%rbp)
jle    121a <main+0xfa>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x1c(%rbp)
jmp    122b <main+0x10b>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
jmp    1267 <main+0x147>
cmpl   $0x0,-0x8(%rbp)
jle    1253 <main+0x133>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x20(%rbp)
jmp    1264 <main+0x144>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmpl   $0x0,-0xc(%rbp)
jle    12b0 <main+0x190>
cmpl   $0x1,-0xc(%rbp)
jne    1294 <main+0x174>
mov    -0xc(%rbp),%esi
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x24(%rbp)
jmp    12a8 <main+0x188>
mov    -0xc(%rbp),%esi
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
jmp    12be <main+0x19e>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    12db <main+0x1bb>
lea    0xd64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e9 <main+0x1c9>
lea    0xd3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1332 <main+0x212>
cmpl   $0x1,-0x8(%rbp)
jne    1316 <main+0x1f6>
mov    -0x8(%rbp),%esi
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x28(%rbp)
jmp    132a <main+0x20a>
mov    -0x8(%rbp),%esi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
jmp    1340 <main+0x220>
lea    0xce5(%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   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq 0xc(%rsp),%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xe10,%esi,%ecx
mov    %eax,%ebp
sub    %ecx,%ebp
movswl %bp,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %ebp,%ecx
movzwl %cx,%ecx
movswl %cx,%ebx
shr    $0xf,%ecx
sar    $0x5,%ebx
add    %ecx,%ebx
imul   $0x3c,%ebx,%ecx
mov    %ebp,%r14d
sub    %ecx,%r14d
cmp    $0xe10,%rax
jl     11dc <main+0xac>
add    $0xfffff1f0,%eax
cmp    $0xe0f,%eax
ja     11ce <main+0x9e>
lea    0xe56(%rip),%rdi
mov    $0x1,%esi
jmp    11d5 <main+0xa5>
lea    0xe50(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x3c,%ebp
jl     1214 <main+0xe4>
test   %r14w,%r14w
lea    0xe42(%rip),%rax
lea    0xe3e(%rip),%rdi
cmovg  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffc4,%ebp
cmp    $0x3c,%ebp
jae    122a <main+0xfa>
lea    0xe29(%rip),%rdi
mov    $0x1,%esi
jmp    1234 <main+0x104>
test   %r14w,%r14w
jle    1276 <main+0x146>
lea    0xe10(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1241 <main+0x111>
movswl %bx,%esi
lea    0xe0b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14w,%r14w
jle    1276 <main+0x146>
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%r14w
jne    1264 <main+0x134>
lea    0xdee(%rip),%rdi
mov    $0x1,%esi
jmp    126f <main+0x13f>
movswl %r14w,%esi
lea    0xde6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c"Enter the total seconds: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [8 x i8] c"%d time\00"
@.str.4 = [9 x i8] c"%d timer\00"
@.str.6 = [3 x i8] c", \00"
@.str.7 = [5 x i8] c" og \00"
@.str.8 = [9 x i8] c"%d minut\00"
@.str.9 = [12 x i8] c"%d minutter\00"
@.str.10 = [10 x i8] c"%d sekund\00"
@.str.11 = [12 x i8] c"%d sekunder\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 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 = call i32 @putchar(i32 10)
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 3600
%8 = srem i32 %6, 3600
%9 = trunc i32 %8 to i16
%10 = sdiv i16 %9, 60
%11 = sext i16 %10 to i32
%12 = srem i16 %9, 60
%13 = sext i16 %12 to i32
%14 = icmp sgt i32 %6, 3599
br i1 %14, label %15, label %22
15: ; preds = %0
%16 = add nsw i32 %6, -3600
%17 = icmp ult i32 %16, 3600
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 1)
br label %22
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %7)
br label %22
22: ; preds = %0, %18, %20
%23 = icmp sgt i32 %8, 59
%24 = icmp sgt i16 %12, 0
br i1 %23, label %25, label %30
25: ; preds = %22
%26 = select i1 %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %26)
%28 = add nsw i32 %8, -60
%29 = icmp ult i32 %28, 60
br i1 %29, label %33, label %35
30: ; preds = %22
br i1 %24, label %31, label %45
31: ; preds = %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %38
33: ; preds = %25
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 1)
br label %37
35: ; preds = %25
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %11)
br label %37
37: ; preds = %33, %35
br i1 %24, label %38, label %45
38: ; preds = %31, %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%40 = icmp eq i16 %12, 1
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 1)
br label %45
43: ; preds = %38
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32 %13)
br label %45
45: ; preds = %30, %37, %41, %43
ret i32 0
}