#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, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int seconds;
  int time_in_hours, time_in_minutes, time_in_seconds;
  scanf("%d", &seconds);
  time_in_hours = seconds / 3600;
  time_in_minutes = (seconds - (time_in_hours * 3600)) / 60;
  time_in_seconds = (seconds - (time_in_hours * 3600) - (time_in_minutes * 60));
  printf("%d ", seconds);
  printf("s = %d h %d m %d s\n", time_in_hours, time_in_minutes,
         time_in_seconds);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xe10,-0x8(%rbp),%ecx
sub    %ecx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xe10,-0x8(%rbp),%ecx
sub    %ecx,%eax
imul   $0x3c,-0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rsi
imul   $0xffffffff91a2b3c5,%rsi,%r14
shr    $0x20,%r14
add    %esi,%r14d
mov    %r14d,%eax
shr    $0x1f,%eax
sar    $0xb,%r14d
add    %eax,%r14d
imul   $0xfffff1f0,%r14d,%eax
add    %esi,%eax
cltq
imul   $0xffffffff88888889,%rax,%rbx
shr    $0x20,%rbx
add    %eax,%ebx
mov    %ebx,%ecx
shr    $0x1f,%ecx
sar    $0x5,%ebx
add    %ecx,%ebx
imul   $0xffffffc4,%ebx,%ebp
add    %eax,%ebp
lea    0xe7c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe72(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [20 x i8] c"s = %d h %d m %d s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 3600
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 3600
%11 = sub nsw i32 %8, %10
%12 = sdiv i32 %11, 60
store i32 %12, i32* %3
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = mul nsw i32 %14, 3600
%16 = sub nsw i32 %13, %15
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 60
%19 = sub nsw i32 %16, %18
store i32 %19, i32* %4
%20 = load i32, i32* %1
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %23, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [20 x i8] c"s = %d h %d m %d s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 3600
%6 = mul nsw i32 %5, -3600
%7 = add i32 %6, %4
%8 = sdiv i32 %7, 60
%9 = mul nsw i32 %8, -60
%10 = add i32 %9, %7
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %8, i32 %10)
ret i32 0
}