#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 /*<<< orphan*/ system(char *);
main() {
  system("title 12_SegundosEnHorasMinutosESegundos_Cascallar_Autrán_Manuel");
  printf("EQUIVALENTE EN HORAS MINUTOS E SEGUNDOS\n");
  printf("=======================================\n");
  int s, segundos, minutos, horas;
  printf("Introduce a cantidade de segundos\n");
  scanf("%d", &s);
  horas = s / 3600;
  printf("%d", horas);
  printf(" horas - ");
  minutos = (s % 3600) / 60;
  printf("%d", minutos);
  printf(" minutos - ");
  segundos = (s % 3600) % 60;
  printf("%d", segundos);
  printf(" segundos\n");
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <system@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf42(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf16(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <system@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xf41(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0xb,%esi
add    %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0xc(%rsp),%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x5,%ecx
add    %eax,%ecx
movswl %cx,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0xc(%rsp),%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x3c,%edx,%ecx
sub    %ecx,%eax
movswl %ax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe58(%rip),%rdi
call   1030 <puts@plt>
lea    0xdde(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [66 x i8] c"title 12_SegundosEnHorasMinutosESegundos_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [41 x i8] c"EQUIVALENTE EN HORAS MINUTOS E SEGUNDOS\0A\00"
@.str.2 = [41 x i8] c"=======================================\0A\00"
@.str.3 = [35 x i8] c"Introduce a cantidade de segundos\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [10 x i8] c" horas - \00"
@.str.6 = [12 x i8] c" minutos - \00"
@.str.7 = [11 x i8] c" segundos\0A\00"
@.str.8 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = sdiv i32 %10, 3600
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = srem i32 %15, 3600
%17 = sdiv i32 %16, 60
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%21 = load i32, i32* %1
%22 = srem i32 %21, 3600
%23 = srem i32 %22, 60
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%27 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [66 x i8] c"title 12_SegundosEnHorasMinutosESegundos_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [10 x i8] c" horas - \00"
@.str.6 = [12 x i8] c" minutos - \00"
@.str.8 = [6 x i8] c"pause\00"
@str = [40 x i8] c"EQUIVALENTE EN HORAS MINUTOS E SEGUNDOS\00"
@str.9 = [40 x i8] c"=======================================\00"
@str.10 = [34 x i8] c"Introduce a cantidade de segundos\00"
@str.11 = [10 x i8] c" segundos\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.9, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.10, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = sdiv i32 %8, 3600
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = srem i32 %12, 3600
%14 = trunc i32 %13 to i16
%15 = sdiv i16 %14, 60
%16 = sext i16 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = srem i32 %19, 3600
%21 = trunc i32 %20 to i16
%22 = srem i16 %21, 60
%23 = sext i16 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.11, i64 0, i64 0))
%26 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}