#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 horas;
  int minutos;
  int segundos;
  printf("Introduce los segundos");
  scanf("%d", &segundos);
  minutos = segundos / 60;
  segundos = segundos % 60;
  horas = minutos / 60;
  minutos = minutos % 60;
  printf("%d horas, %d minutos, %d segundos\n", horas, minutos, segundos);
  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    0xed3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe85(%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    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0xffffffff88888889,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0x5,%edx
add    %ecx,%edx
imul   $0x3c,%edx,%edi
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %eax,%ecx
sub    %edi,%ecx
mov    %ecx,0x4(%rsp)
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0xb,%esi
add    %eax,%esi
movslq %edx,%rdx
imul   $0xffffffff88888889,%rdx,%rax
shr    $0x20,%rax
add    %edx,%eax
mov    %eax,%edi
shr    $0x1f,%edi
sar    $0x5,%eax
add    %edi,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%edx
lea    0xe76(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Introduce los segundos\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"%d horas, %d minutos, %d segundos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 60
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %9, 60
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 60
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = srem i32 %13, 60
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Introduce los segundos\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"%d horas, %d minutos, %d segundos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 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, 60
%7 = srem i32 %5, 60
store i32 %7, i32* %1
%8 = sdiv i32 %5, 3600
%9 = srem i32 %6, 60
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9, i32 %7)
ret i32 0
}