#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
scalar_t__ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long, unsigned long,
                          unsigned long);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void para_cronometro(time_t *medidor) {
  time_t tms;
  unsigned long int horas, minutos, segundos, dias;
  tms = time(NULL);
  segundos = (unsigned long int)difftime(tms, *medidor);
  minutos = (segundos / 60);
  segundos = (unsigned long int)(segundos % 60);
  horas = minutos / 60;
  minutos = (unsigned long int)(minutos % 60);
  dias = horas / 24;
  horas = (unsigned long int)(horas % 24);
  printf("\ntime elapsed: %lu days, %lu hours, %lu minutes, %lu seconds", dias,
         horas, minutos, segundos);
}


x86 assembly (clang, -O0):
<para_cronometro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
call   1040 <difftime@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x18,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x18,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xe23(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<para_cronometro>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    (%rbx),%esi
mov    %eax,%edi
call   1040 <difftime@plt>
mov    %rax,%rsi
movabs $0x8888888888888889,%rdi
88 88 88
mul    %rdi
mov    %rdx,%r9
shr    $0x5,%r9
imul   $0x3c,%r9,%rcx
mov    %rsi,%rax
mov    %rsi,%r8
sub    %rcx,%r8
shr    $0x4,%rax
movabs $0x91a2b3c4d5e6f81,%rcx
2b 1a 09
mul    %rcx
mov    %rdx,%rcx
mov    %r9,%rax
mul    %rdi
shr    $0x3,%rcx
shr    $0x5,%rdx
imul   $0x3c,%rdx,%rax
sub    %rax,%r9
movabs $0xc22e450672894ab7,%rdx
45 2e c2
mov    %rsi,%rax
mul    %rdx
mov    %rdx,%rsi
shr    $0x10,%rsi
movabs $0xaaaaaaaaaaaaaaab,%rdx
aa aa aa
mov    %rcx,%rax
mul    %rdx
shr    %rdx
and    $0xfffffffffffffff8,%rdx
lea    (%rdx,%rdx,2),%rax
sub    %rax,%rcx
lea    0xe33(%rip),%rdi
mov    %rcx,%rdx
mov    %r9,%rcx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"\0Atime elapsed: %lu days, %lu hours, %lu minutes, %lu seconds\00"
define void @para_cronometro(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %2
%8 = call i32 @time(i32* null)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = call i64 @difftime(i32 %9, i32 %11)
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = udiv i64 %13, 60
store i64 %14, i64* %5
%15 = load i64, i64* %6
%16 = urem i64 %15, 60
store i64 %16, i64* %6
%17 = load i64, i64* %5
%18 = udiv i64 %17, 60
store i64 %18, i64* %4
%19 = load i64, i64* %5
%20 = urem i64 %19, 60
store i64 %20, i64* %5
%21 = load i64, i64* %4
%22 = udiv i64 %21, 24
store i64 %22, i64* %7
%23 = load i64, i64* %4
%24 = urem i64 %23, 24
store i64 %24, i64* %4
%25 = load i64, i64* %7
%26 = load i64, i64* %4
%27 = load i64, i64* %5
%28 = load i64, i64* %6
%29 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 %25, i64 %26, i64 %27, i64 %28)
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"\0Atime elapsed: %lu days, %lu hours, %lu minutes, %lu seconds\00"
define void @para_cronometro(i32* nocapture %0) {
%2 = tail call i32 @time(i32* null)
%3 = load i32, i32* %0
%4 = tail call i64 @difftime(i32 %2, i32 %3)
%5 = udiv i64 %4, 60
%6 = urem i64 %4, 60
%7 = udiv i64 %4, 3600
%8 = urem i64 %5, 60
%9 = udiv i64 %4, 86400
%10 = urem i64 %7, 24
%11 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %10, i64 %8, i64 %6)
ret void
}