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

/* Variables and functions */
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, unsigned int,
                           unsigned int);
void printelapsedtime(time_t start, time_t now, int y, int x, WINDOW *win) {
  time_t elapsed;
  unsigned int hours;
  unsigned int mins;
  elapsed = now - start;
  hours = elapsed / 3600;
  mins = (elapsed % 3600) / 60;
  wmove(win, y, x);
  wprintw(win, " Elapsed time: %3u:%02u ", hours, mins);
}


x86 assembly (clang, -O0):
<printelapsedtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <wmove@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0xe79(%rip),%rsi
call   1030 <wprintw@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printelapsedtime>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%r14
sub    %edi,%esi
movslq %esi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rbx
shr    $0x20,%rbx
add    %eax,%ebx
mov    %ebx,%esi
shr    $0x1f,%esi
sar    $0xb,%ebx
add    %esi,%ebx
imul   $0xe10,%ebx,%esi
sub    %esi,%eax
movswl %ax,%esi
imul   $0xffff8889,%esi,%esi
shr    $0x10,%esi
add    %eax,%esi
movzwl %si,%eax
movswl %ax,%esi
shr    $0xf,%eax
sar    $0x5,%esi
add    %eax,%esi
movswl %si,%ebp
mov    %r8,%rdi
mov    %edx,%esi
mov    %ecx,%edx
call   1040 <wmove@plt>
lea    0xe83(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <wprintw@plt>

LLVM IR (-O0):
@.str = [25 x i8] c" Elapsed time: %3u:%02u \00"
define void @printelapsedtime(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %11
%17 = load i32, i32* %11
%18 = sdiv i32 %17, 3600
store i32 %18, i32* %12
%19 = load i32, i32* %11
%20 = srem i32 %19, 3600
%21 = sdiv i32 %20, 60
store i32 %21, i32* %13
%22 = load i32*, i32** %10
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = call i32 @wmove(i32* %22, i32 %23, i32 %24)
%26 = load i32*, i32** %10
%27 = load i32, i32* %12
%28 = load i32, i32* %13
%29 = call i32 @wprintw(i32* %26, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %28)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c" Elapsed time: %3u:%02u \00"
define void @printelapsedtime(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = sub nsw i32 %1, %0
%7 = sdiv i32 %6, 3600
%8 = srem i32 %6, 3600
%9 = trunc i32 %8 to i16
%10 = sdiv i16 %9, 60
%11 = sext i16 %10 to i32
%12 = tail call i32 @wmove(i32* %4, i32 %2, i32 %3)
%13 = tail call i32 @wprintw(i32* %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %11)
ret void
}