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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ stderr;
void _d_error_clock(double c) {
  if (c > 3600)
    fprintf(stderr, "%ldh", (long)(c / 3600));
  if (c > 60)
    fprintf(stderr, "%ldm", ((long)(c / 60)) % 60);
  fprintf(stderr, "%.2fs", c - 60 * ((long)(c / 60)));
}


x86 assembly (clang, -O0):
<_d_error_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1164 <_d_error_clock+0x54>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm0
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11b5 <_d_error_clock+0xa5>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
cvtsi2sd %rdx,%xmm0
lea    0xe65(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe38(%rip),%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rax
imul   $0x3c,%rax,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
lea    0xe2d(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_d_error_clock>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm1
ucomisd 0xedf(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
jbe    115d <_d_error_clock+0x4d>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
movapd %xmm1,%xmm0
divsd  0xec2(%rip),%xmm0
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
movsd  0x8(%rsp),%xmm1
ucomisd 0xea3(%rip),%xmm1
jbe    11c8 <_d_error_clock+0xb8>
mov    0x2e72(%rip),%rax
movapd %xmm1,%xmm0
divsd  0xe8e(%rip),%xmm0
cvttsd2si %xmm0,%rbx
mov    (%rax),%edi
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rbx,%rax
imul   %rcx
add    %rbx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x5,%rdx
add    %rax,%rdx
imul   $0x3c,%rdx,%rax
mov    %rbx,%rcx
sub    %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
lea    0xe5a(%rip),%rsi
call   1030 <fprintf@plt>
movsd  0x8(%rsp),%xmm1
jmp    11d9 <_d_error_clock+0xc9>
movapd %xmm1,%xmm0
divsd  0xe34(%rip),%xmm0
cvttsd2si %xmm0,%rbx
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
imul   $0x3c,%rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
subsd  %xmm0,%xmm1
lea    0xe21(%rip),%rsi
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%ldh\00"
@.str.1 = [5 x i8] c"%ldm\00"
@.str.2 = [6 x i8] c"%.2fs\00"
define void @_d_error_clock(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 3.600000e+03
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load double, double* %2
%8 = fdiv double %7, 3.600000e+03
%9 = fptosi double %8 to i64
%10 = sitofp i64 %9 to double
%11 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %10)
br label %12
12: ; preds = %5, %1
%13 = load double, double* %2
%14 = fcmp ogt double %13, 6.000000e+01
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = load double, double* %2
%18 = fdiv double %17, 6.000000e+01
%19 = fptosi double %18 to i64
%20 = srem i64 %19, 60
%21 = sitofp i64 %20 to double
%22 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %21)
br label %23
23: ; preds = %15, %12
%24 = load i32, i32* @stderr
%25 = load double, double* %2
%26 = load double, double* %2
%27 = fdiv double %26, 6.000000e+01
%28 = fptosi double %27 to i64
%29 = mul nsw i64 60, %28
%30 = sitofp i64 %29 to double
%31 = fsub double %25, %30
%32 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %31)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%ldh\00"
@.str.1 = [5 x i8] c"%ldm\00"
@.str.2 = [6 x i8] c"%.2fs\00"
define void @_d_error_clock(double %0) {
%2 = fcmp ogt double %0, 3.600000e+03
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = fdiv double %0, 3.600000e+03
%6 = fptosi double %5 to i64
%7 = sitofp i64 %6 to double
%8 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %7)
br label %9
9: ; preds = %3, %1
%10 = fcmp ogt double %0, 6.000000e+01
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = fdiv double %0, 6.000000e+01
%13 = fptosi double %12 to i64
br label %21
14: ; preds = %9
%15 = load i32, i32* @stderr
%16 = fdiv double %0, 6.000000e+01
%17 = fptosi double %16 to i64
%18 = srem i64 %17, 60
%19 = sitofp i64 %18 to double
%20 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %19)
br label %21
21: ; preds = %11, %14
%22 = phi i64 [ %13, %11 ], [ %17, %14 ]
%23 = load i32, i32* @stderr
%24 = mul nsw i64 %22, 60
%25 = sitofp i64 %24 to double
%26 = fsub double %0, %25
%27 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %26)
ret void
}