#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 */
struct timeval {
  int dummy;
};

/* Variables and functions */
scalar_t__ diffms(struct timeval, struct timeval);
int /*<<< orphan*/ printf(char *, int, int);
void displayTime(struct timeval start, struct timeval stop) {
  int delta = (int)diffms(stop, start);
  int minutes = delta / 60000;
  int seconds = (delta % 60000) / 1000;
  printf("Elapsed time: %i'%02i\"\n\n", minutes, seconds);
}


x86 assembly (clang, -O0):
<displayTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <diffms@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xea60,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xea60,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayTime>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1040 <diffms@plt>
cltq
imul   $0x45e7b273,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x2e,%rsi
add    %ecx,%esi
imul   $0xea60,%esi,%ecx
sub    %ecx,%eax
cltq
imul   $0x10624dd3,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x26,%rdx
add    %eax,%edx
lea    0xe99(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [25 x i8] c"Elapsed time: %i'%02i\22\0A\0A\00"
define void @displayTime(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 %1, i32* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i64 @diffms(i32 %11, i32 %13)
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = sdiv i32 %16, 60000
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = srem i32 %18, 60000
%20 = sdiv i32 %19, 1000
store i32 %20, i32* %7
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Elapsed time: %i'%02i\22\0A\0A\00"
define void @displayTime(i32 %0, i32 %1) {
%3 = tail call i64 @diffms(i32 %1, i32 %0)
%4 = trunc i64 %3 to i32
%5 = sdiv i32 %4, 60000
%6 = srem i32 %4, 60000
%7 = sdiv i32 %6, 1000
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret void
}