#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 *, ...);
int /*<<< orphan*/ om_html_entities(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ om_html_print_bar(int /*<<< orphan*/ *, int, char *, char *);
int vi_is_weekend(char *, int);
void om_html_print_numkeybar_entry(FILE *fp, char *key, int max, int tot,
                                   int this, int time_delta) {
  int l, weekend;
  float p;
  if (tot == 0)
    tot++;
  if (max == 0)
    max++;
  l = ((float)(100 * this)) / max;
  p = ((float)(100 * this)) / tot;
  weekend = vi_is_weekend(key, time_delta);
  if (weekend)
    fprintf(fp, "<tr><td align=\"left\" class=\"keyentrywe\">");
  else
    fprintf(fp, "<tr><td align=\"left\" class=\"keyentry\">");
  om_html_entities(fp, key);
  fprintf(fp,
          "&nbsp;&nbsp;&nbsp;</td><td align=\"left\" class=\"valueentry\">");
  fprintf(fp, "%d (%02.1f%%)", this, p);
  fprintf(fp, "</td><td align=\"left\" class=\"bar\">");
  om_html_print_bar(fp, l, "barfill", "barempty");
  fprintf(fp, "</td></tr>\n");
}


x86 assembly (clang, -O0):
<om_html_print_numkeybar_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1171 <om_html_print_numkeybar_entry+0x31>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1184 <om_html_print_numkeybar_entry+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
imul   $0x64,-0x1c(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
imul   $0x64,-0x1c(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1030 <vi_is_weekend@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     11e2 <om_html_print_numkeybar_entry+0xa2>
mov    -0x8(%rbp),%rdi
lea    0xe2a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    11f4 <om_html_print_numkeybar_entry+0xb4>
mov    -0x8(%rbp),%rdi
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <om_html_entities@plt>
mov    -0x8(%rbp),%rdi
lea    0xe44(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%edx
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe62(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe5e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    0xe6c(%rip),%rdx
lea    0xe6d(%rip),%rcx
call   1050 <om_html_print_bar@plt>
mov    -0x8(%rbp),%rdi
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_html_print_numkeybar_entry>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8d,%r14d
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%r12
imul   $0x64,%r8d,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rsi,%rdi
mov    %r9d,%esi
call   1030 <vi_is_weekend@plt>
test   %eax,%eax
je     1194 <om_html_print_numkeybar_entry+0x44>
lea    0xe73(%rip),%rdi
mov    $0x28,%esi
jmp    11a0 <om_html_print_numkeybar_entry+0x50>
lea    0xe8e(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
test   %ebp,%ebp
mov    $0x1,%eax
cmove  %eax,%ebp
test   %ebx,%ebx
cmove  %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  0xc(%rsp),%xmm2
movaps %xmm2,%xmm3
cvtsi2ss %ebp,%xmm1
divss  %xmm0,%xmm3
movss  %xmm3,0x8(%rsp)
divss  %xmm1,%xmm2
cvttss2si %xmm2,%ebx
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <om_html_entities@plt>
lea    0xe5c(%rip),%rdi
mov    $0x3b,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe75(%rip),%rsi
mov    %r12,%rdi
mov    %r14d,%edx
mov    $0x1,%al
call   1040 <fprintf@plt>
lea    0xe6f(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1070 <fwrite@plt>
lea    0xe79(%rip),%rdx
lea    0xe7a(%rip),%rcx
mov    %r12,%rdi
mov    %ebx,%esi
call   1050 <om_html_print_bar@plt>
lea    0xe72(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r12,%rcx
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <fwrite@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"<tr><td align=\22left\22 class=\22keyentrywe\22>\00"
@.str.1 = [39 x i8] c"<tr><td align=\22left\22 class=\22keyentry\22>\00"
@.str.2 = [60 x i8] c"&nbsp;&nbsp;&nbsp;</td><td align=\22left\22 class=\22valueentry\22>\00"
@.str.3 = [14 x i8] c"%d (%02.1f%%)\00"
@.str.4 = [35 x i8] c"</td><td align=\22left\22 class=\22bar\22>\00"
@.str.5 = [8 x i8] c"barfill\00"
@.str.6 = [9 x i8] c"barempty\00"
@.str.7 = [12 x i8] c"</td></tr>\0A\00"
define void @om_html_print_numkeybar_entry(i32* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %10
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %6
%19 = load i32, i32* %10
%20 = add nsw i32 %19, 1
store i32 %20, i32* %10
br label %21
21: ; preds = %18, %6
%22 = load i32, i32* %9
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %27
27: ; preds = %24, %21
%28 = load i32, i32* %11
%29 = mul nsw i32 100, %28
%30 = sitofp i32 %29 to float
%31 = load i32, i32* %9
%32 = sitofp i32 %31 to float
%33 = fdiv float %30, %32
%34 = fptosi float %33 to i32
store i32 %34, i32* %13
%35 = load i32, i32* %11
%36 = mul nsw i32 100, %35
%37 = sitofp i32 %36 to float
%38 = load i32, i32* %10
%39 = sitofp i32 %38 to float
%40 = fdiv float %37, %39
store float %40, float* %15
%41 = load i8*, i8** %8
%42 = load i32, i32* %12
%43 = call i32 @vi_is_weekend(i8* %41, i32 %42)
store i32 %43, i32* %14
%44 = load i32, i32* %14
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %27
%47 = load i32*, i32** %7
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %52
49: ; preds = %27
%50 = load i32*, i32** %7
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %52
52: ; preds = %49, %46
%53 = load i32*, i32** %7
%54 = load i8*, i8** %8
%55 = call i32 @om_html_entities(i32* %53, i8* %54)
%56 = load i32*, i32** %7
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%58 = load i32*, i32** %7
%59 = load i32, i32* %11
%60 = load float, float* %15
%61 = fpext float %60 to double
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %59, double %61)
%63 = load i32*, i32** %7
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%65 = load i32*, i32** %7
%66 = load i32, i32* %13
%67 = call i32 @om_html_print_bar(i32* %65, i32 %66, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%68 = load i32*, i32** %7
%69 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"<tr><td align=\22left\22 class=\22keyentrywe\22>\00"
@.str.1 = [39 x i8] c"<tr><td align=\22left\22 class=\22keyentry\22>\00"
@.str.2 = [60 x i8] c"&nbsp;&nbsp;&nbsp;</td><td align=\22left\22 class=\22valueentry\22>\00"
@.str.3 = [14 x i8] c"%d (%02.1f%%)\00"
@.str.4 = [35 x i8] c"</td><td align=\22left\22 class=\22bar\22>\00"
@.str.5 = [8 x i8] c"barfill\00"
@.str.6 = [9 x i8] c"barempty\00"
@.str.7 = [12 x i8] c"</td></tr>\0A\00"
define void @om_html_print_numkeybar_entry(i32* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %4, 100
%8 = sitofp i32 %7 to float
%9 = tail call i32 @vi_is_weekend(i8* %1, i32 %5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 40, i64 1, i32* %0)
br label %15
13: ; preds = %6
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i64 38, i64 1, i32* %0)
br label %15
15: ; preds = %13, %11
%16 = icmp eq i32 %2, 0
%17 = select i1 %16, i32 1, i32 %2
%18 = icmp eq i32 %3, 0
%19 = select i1 %18, i32 1, i32 %3
%20 = sitofp i32 %19 to float
%21 = fdiv float %8, %20
%22 = sitofp i32 %17 to float
%23 = fdiv float %8, %22
%24 = fptosi float %23 to i32
%25 = tail call i32 @om_html_entities(i32* %0, i8* %1)
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i64 59, i64 1, i32* %0)
%27 = fpext float %21 to double
%28 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %4, double %27)
%29 = tail call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i64 34, i64 1, i32* %0)
%30 = tail call i32 @om_html_print_bar(i32* %0, i32 %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%31 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i64 11, i64 1, i32* %0)
ret void
}