#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() {
  int seg;
  printf("Digite quantos segundos deseja converter para h:m:s: ");
  scanf("%d", &seg);
  printf("%d segundos = %dh:%dmin:%ds", seg, seg / 3600, (seg % 3600) / 60,
         (seg % 3600) % 60);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rsi
imul   $0xffffffff91a2b3c5,%rsi,%rdx
shr    $0x20,%rdx
add    %esi,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0xb,%edx
add    %eax,%edx
imul   $0xe10,%edx,%eax
mov    %esi,%edi
sub    %eax,%edi
movswl %di,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %edi,%eax
movzwl %ax,%ecx
movswl %cx,%eax
shr    $0xf,%ecx
sar    $0x5,%eax
add    %ecx,%eax
movswl %ax,%ecx
imul   $0x3c,%eax,%eax
sub    %eax,%edi
movswl %di,%r8d
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Digite quantos segundos deseja converter para h:m:s: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"%d segundos = %dh:%dmin:%ds\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 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* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 3600
%8 = load i32, i32* %2
%9 = srem i32 %8, 3600
%10 = sdiv i32 %9, 60
%11 = load i32, i32* %2
%12 = srem i32 %11, 3600
%13 = srem i32 %12, 60
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7, i32 %10, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [54 x i8] c"Digite quantos segundos deseja converter para h:m:s: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"%d segundos = %dh:%dmin:%ds\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 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 = sdiv i32 %5, 3600
%7 = srem i32 %5, 3600
%8 = trunc i32 %7 to i16
%9 = sdiv i16 %8, 60
%10 = sext i16 %9 to i32
%11 = srem i16 %8, 60
%12 = sext i16 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6, i32 %10, i32 %12)
ret i32 0
}