#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 *);
void main(void) {
  int entrada, h, m, s, saida;
  printf("Insira os segundos: ");
  scanf("%i", &entrada);
  s = entrada % 60;
  m = entrada / 60 % 60;
  h = entrada / 60 / 60;
  saida = h * 10000 + m * 100 + s;
  printf("A saida em hh mm ss %i", saida);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%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
sub    %edx,%eax
movslq %ecx,%rcx
imul   $0xffffffff88888889,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%edi
shr    $0x1f,%edi
sar    $0x5,%edx
add    %edi,%edx
imul   $0x3c,%edx,%edx
sub    %edx,%ecx
mov    %esi,%edx
shr    $0x1f,%edx
sar    $0xb,%esi
add    %edx,%esi
imul   $0x2710,%esi,%edx
add    %eax,%edx
imul   $0x64,%ecx,%esi
add    %edx,%esi
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Insira os segundos: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [23 x i8] c"A saida em hh mm ss %i\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 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* %1)
%8 = load i32, i32* %1
%9 = srem i32 %8, 60
store i32 %9, i32* %4
%10 = load i32, i32* %1
%11 = sdiv i32 %10, 60
%12 = srem i32 %11, 60
store i32 %12, i32* %3
%13 = load i32, i32* %1
%14 = sdiv i32 %13, 60
%15 = sdiv i32 %14, 60
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = mul nsw i32 %16, 10000
%18 = load i32, i32* %3
%19 = mul nsw i32 %18, 100
%20 = add nsw i32 %17, %19
%21 = load i32, i32* %4
%22 = add nsw i32 %20, %21
store i32 %22, i32* %5
%23 = load i32, i32* %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Insira os segundos: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [23 x i8] c"A saida em hh mm ss %i\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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 = mul nsw i32 %9, 10000
%11 = mul nsw i32 %8, 100
%12 = add i32 %10, %6
%13 = add i32 %12, %11
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret void
}