#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, int,
                           double, double);
void reportTimes(FILE *file, double tot_secs, char *str) {
  int hrs, mins;
  double secs;
  mins = (int)(tot_secs / 60.0) % 60;
  hrs = (int)(tot_secs / 3600.0) % 60;
  secs = tot_secs - 3600 * hrs - 60 * mins;
  fprintf(file, "%s %d hrs., %d mins, %.2lf secs. (= %.2lf secs)\n", str, hrs,
          mins, secs, tot_secs);
}


x86 assembly (clang, -O0):
<reportTimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
imul   $0xe10,-0x1c(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
imul   $0x3c,-0x20(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe66(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reportTimes>:
movapd %xmm0,%xmm1
divsd  0xee4(%rip),%xmm1
cvttsd2si %xmm1,%eax
mov    %rsi,%rdx
movapd %xmm0,%xmm1
movapd %xmm0,%xmm2
movslq %eax,%r8
imul   $0xffffffff88888889,%r8,%rax
shr    $0x20,%rax
add    %r8d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%r8d
divsd  0xeb4(%rip),%xmm1
cvttsd2si %xmm1,%eax
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%esi
shr    $0x1f,%esi
sar    $0x5,%eax
add    %esi,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%ecx
imul   $0xe10,%ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm2
imul   $0x3c,%r8d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm2
lea    0xe72(%rip),%rsi
movapd %xmm0,%xmm1
movapd %xmm2,%xmm0
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"%s %d hrs., %d mins, %.2lf secs. (= %.2lf secs)\0A\00"
define void @reportTimes(i32* %0, double %1, i8* %2) {
%4 = alloca i32*
%5 = alloca double
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store i32* %0, i32** %4
store double %1, double* %5
store i8* %2, i8** %6
%10 = load double, double* %5
%11 = fdiv double %10, 6.000000e+01
%12 = fptosi double %11 to i32
%13 = srem i32 %12, 60
store i32 %13, i32* %8
%14 = load double, double* %5
%15 = fdiv double %14, 3.600000e+03
%16 = fptosi double %15 to i32
%17 = srem i32 %16, 60
store i32 %17, i32* %7
%18 = load double, double* %5
%19 = load i32, i32* %7
%20 = mul nsw i32 3600, %19
%21 = sitofp i32 %20 to double
%22 = fsub double %18, %21
%23 = load i32, i32* %8
%24 = mul nsw i32 60, %23
%25 = sitofp i32 %24 to double
%26 = fsub double %22, %25
store double %26, double* %9
%27 = load i32*, i32** %4
%28 = load i8*, i8** %6
%29 = load i32, i32* %7
%30 = load i32, i32* %8
%31 = load double, double* %9
%32 = load double, double* %5
%33 = call i32 @fprintf(i32* %27, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %28, i32 %29, i32 %30, double %31, double %32)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"%s %d hrs., %d mins, %.2lf secs. (= %.2lf secs)\0A\00"
define void @reportTimes(i32* nocapture %0, double %1, i8* %2) {
%4 = fdiv double %1, 6.000000e+01
%5 = fptosi double %4 to i32
%6 = srem i32 %5, 60
%7 = fdiv double %1, 3.600000e+03
%8 = fptosi double %7 to i32
%9 = srem i32 %8, 60
%10 = mul nsw i32 %9, 3600
%11 = sitofp i32 %10 to double
%12 = fsub double %1, %11
%13 = mul nsw i32 %6, 60
%14 = sitofp i32 %13 to double
%15 = fsub double %12, %14
%16 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %9, i32 %6, double %15, double %1)
ret void
}