#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*/ html_tablecloserow();
int /*<<< orphan*/ html_tabledata(int, int, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ html_tableopenrow(int /*<<< orphan*/);
int /*<<< orphan*/ split_time(double, double *, double *, double *);
int /*<<< orphan*/ sprintf(char *, char *, double, double, double);
void writetime(char *descrip, double time) {
  char buf[64];
  double h, m, s;
  split_time(time, &h, &m, &s);
  html_tableopenrow((0));
  html_tabledata((2), 1, 1, 0, descrip);
  if (h < 12) {
    sprintf(buf, "%.0f:%02.0f:%02.0f", h, m, s);
    html_tabledata((3), 1, 1, 0, buf);
    html_tabledata((2), 1, 1, 0, "am");
  } else {
    sprintf(buf, "%.0f:%02.0f:%02.0f", h - 12, m, s);
    html_tabledata((3), 1, 1, 0, buf);
    html_tabledata((2), 1, 1, 0, "pm");
  }
  html_tablecloserow();
}


x86 assembly (clang, -O0):
<writetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x58(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x68(%rbp),%rdx
call   1070 <split_time@plt>
xor    %edi,%edi
call   1030 <html_tableopenrow@plt>
mov    -0x8(%rbp),%r8
mov    $0x2,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1050 <html_tabledata@plt>
movsd  0xe63(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    11fd <writetime+0xad>
lea    -0x50(%rbp),%rdi
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
lea    0xe46(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0x3,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1050 <html_tabledata@plt>
mov    $0x2,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
lea    0xe2a(%rip),%r8
mov    %edx,%esi
call   1050 <html_tabledata@plt>
jmp    1259 <writetime+0x109>
lea    -0x50(%rbp),%rdi
movsd  -0x58(%rbp),%xmm0
movsd  0xdf2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
lea    0xde5(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0x3,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1050 <html_tabledata@plt>
mov    $0x2,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
lea    0xdcc(%rip),%r8
mov    %edx,%esi
call   1050 <html_tabledata@plt>
mov    $0x0,%al
call   1040 <html_tablecloserow@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writetime>:
push   %rbx
sub    $0x60,%rsp
mov    %rdi,%rbx
lea    0x18(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1070 <split_time@plt>
xor    %edi,%edi
call   1030 <html_tableopenrow@plt>
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1050 <html_tabledata@plt>
movsd  0x18(%rsp),%xmm0
movsd  0xe66(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11c6 <writetime+0x76>
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
lea    0xe5d(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1060 <sprintf@plt>
lea    0xe5f(%rip),%rbx
jmp    11f2 <writetime+0xa2>
addsd  0xe3a(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
lea    0xe2f(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1060 <sprintf@plt>
lea    0xe34(%rip),%rbx
lea    0x20(%rsp),%r8
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1050 <html_tabledata@plt>
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1050 <html_tabledata@plt>
xor    %eax,%eax
call   1040 <html_tablecloserow@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%.0f:%02.0f:%02.0f\00"
@.str.1 = [3 x i8] c"am\00"
@.str.2 = [3 x i8] c"pm\00"
define void @writetime(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [64 x i8]
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%9 = load double, double* %4
%10 = call i32 @split_time(double %9, double* %6, double* %7, double* %8)
%11 = call i32 @html_tableopenrow(i32 0)
%12 = load i8*, i8** %3
%13 = call i32 @html_tabledata(i32 2, i32 1, i32 1, i32 0, i8* %12)
%14 = load double, double* %6
%15 = fcmp olt double %14, 1.200000e+01
br i1 %15, label %16, label %25
16: ; preds = %2
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%18 = load double, double* %6
%19 = load double, double* %7
%20 = load double, double* %8
%21 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %18, double %19, double %20)
%22 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%23 = call i32 @html_tabledata(i32 3, i32 1, i32 1, i32 0, i8* %22)
%24 = call i32 @html_tabledata(i32 2, i32 1, i32 1, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %35
25: ; preds = %2
%26 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%27 = load double, double* %6
%28 = fsub double %27, 1.200000e+01
%29 = load double, double* %7
%30 = load double, double* %8
%31 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %28, double %29, double %30)
%32 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%33 = call i32 @html_tabledata(i32 3, i32 1, i32 1, i32 0, i8* %32)
%34 = call i32 @html_tabledata(i32 2, i32 1, i32 1, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %25, %16
%36 = call i32 (...) @html_tablecloserow()
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%.0f:%02.0f:%02.0f\00"
@.str.1 = [3 x i8] c"am\00"
@.str.2 = [3 x i8] c"pm\00"
define void @writetime(i8* %0, double %1) {
%3 = alloca [64 x i8]
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = bitcast double* %4 to i8*
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = call i32 @split_time(double %1, double* %4, double* %5, double* %6)
%12 = call i32 @html_tableopenrow(i32 0)
%13 = call i32 @html_tabledata(i32 2, i32 1, i32 1, i32 0, i8* %0)
%14 = load double, double* %4
%15 = fcmp olt double %14, 1.200000e+01
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load double, double* %5
%18 = load double, double* %6
%19 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %14, double %17, double %18)
br label %25
20: ; preds = %2
%21 = fadd double %14, -1.200000e+01
%22 = load double, double* %5
%23 = load double, double* %6
%24 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %21, double %22, double %23)
br label %25
25: ; preds = %20, %16
%26 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %20 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %16 ]
%27 = call i32 @html_tabledata(i32 3, i32 1, i32 1, i32 0, i8* %7)
%28 = call i32 @html_tabledata(i32 2, i32 1, i32 1, i32 0, i8* %26)
%29 = call i32 (...) @html_tablecloserow()
ret void
}