#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 SecIn = 0, D = 0, H = 0, M = 0, SecOut = 0;
  printf("Introduce la cantidad de segundos: ");
  scanf("%d", &SecIn);
  D = SecIn / 86400;
  SecIn = SecIn % 86400;
  H = SecIn / 3600;
  SecIn = SecIn % 3600;
  M = SecIn / 60;
  SecIn = SecIn % 60;
  SecOut = SecIn;
  printf("La cantidad de tiempo es: %dd %dh %dm %ds\n", D, H, M, SecOut);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Introduce la cantidad de segundos: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"La cantidad de tiempo es: %dd %dh %dm %ds\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 86400
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = srem i32 %11, 86400
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 3600
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = srem i32 %15, 3600
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 60
store i32 %18, i32* %5
%19 = load i32, i32* %2
%20 = srem i32 %19, 60
store i32 %20, i32* %2
%21 = load i32, i32* %2
store i32 %21, i32* %6
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %23, i32 %24, i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Introduce la cantidad de segundos: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"La cantidad de tiempo es: %dd %dh %dm %ds\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 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, 86400
%7 = srem i32 %5, 86400
%8 = sdiv i32 %7, 3600
%9 = srem i32 %7, 3600
%10 = trunc i32 %9 to i16
%11 = sdiv i16 %10, 60
%12 = sext i16 %11 to i32
%13 = srem i16 %10, 60
%14 = sext i16 %13 to i32
store i32 %14, i32* %1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %8, i32 %12, i32 %14)
ret i32 0
}