#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 long time_t;
struct tm {
  int tm_hour;
  int tm_min;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
struct tm *localtime(long *);
int /*<<< orphan*/ stderr;
void display_stop_time_to_stderr(char *key, long start_time, time_t now) {
  double minutes_taken;
  long seconds_taken;
  struct tm *struct_tm;
  struct_tm = localtime(&now);
  fprintf(stderr, "Stop time  (%s):\t%d:%.2d", key, struct_tm->tm_hour,
          struct_tm->tm_min);
  seconds_taken = now - start_time;
  minutes_taken = (double)((double)seconds_taken / 60.0);
  fprintf(stderr, "   Minutes: %.2lf\n", minutes_taken);
}


x86 assembly (clang, -O0):
<display_stop_time_to_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x30(%rbp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%r8d
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cvtsi2sdq -0x28(%rbp),%xmm0
movsd  0xe7c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
movsd  -0x20(%rbp),%xmm0
lea    0xe7f(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_stop_time_to_stderr>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <localtime@plt>
mov    0x2e9b(%rip),%r15
mov    (%r15),%edi
mov    (%rax),%ecx
mov    0x4(%rax),%r8d
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x8(%rsp),%rax
sub    %r14,%rax
cvtsi2sd %rax,%xmm0
divsd  0xe8c(%rip),%xmm0
mov    (%r15),%edi
lea    0xea3(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
@stderr = global i32 0
@.str = [25 x i8] c"Stop time (%s):\09%d:%.2d\00"
@.str.1 = [19 x i8] c" Minutes: %.2lf\0A\00"
define void @display_stop_time_to_stderr(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca double
%8 = alloca i64
%9 = alloca %struct.tm*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%10 = call %struct.tm* @localtime(i64* %6)
store %struct.tm* %10, %struct.tm** %9
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = load %struct.tm*, %struct.tm** %9
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = load %struct.tm*, %struct.tm** %9
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %15, i32 %18)
%20 = load i64, i64* %6
%21 = load i64, i64* %5
%22 = sub nsw i64 %20, %21
store i64 %22, i64* %8
%23 = load i64, i64* %8
%24 = sitofp i64 %23 to double
%25 = fdiv double %24, 6.000000e+01
store double %25, double* %7
%26 = load i32, i32* @stderr
%27 = load double, double* %7
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %27)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
@stderr = global i32 0
@.str = [25 x i8] c"Stop time (%s):\09%d:%.2d\00"
@.str.1 = [19 x i8] c" Minutes: %.2lf\0A\00"
define void @display_stop_time_to_stderr(i8* %0, i64 %1, i64 %2) {
%4 = alloca i64
store i64 %2, i64* %4
%5 = call %struct.tm* @localtime(i64* %4)
%6 = load i32, i32* @stderr
%7 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %8, i32 %10)
%12 = load i64, i64* %4
%13 = sub nsw i64 %12, %1
%14 = sitofp i64 %13 to double
%15 = fdiv double %14, 6.000000e+01
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %15)
ret void
}