#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_numkeycomparativebar_entry(FILE *fp, char *key, int tot,
                                              int this, int time_delta) {
  int l, weekend;
  float p;
  if (tot == 0)
    tot++;
  p = ((float)(100 * this)) / tot;
  l = (int)p;
  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, "barleft", "barright");
  fprintf(fp, "</td></tr>\n");
}


x86 assembly (clang, -O0):
<om_html_print_numkeycomparativebar_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)
cmpl   $0x0,-0x14(%rbp)
jne    116d <om_html_print_numkeycomparativebar_entry+0x2d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
imul   $0x64,-0x18(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
cvttss2si -0x28(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <vi_is_weekend@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     11bb <om_html_print_numkeycomparativebar_entry+0x7b>
mov    -0x8(%rbp),%rdi
lea    0xe51(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    11cd <om_html_print_numkeycomparativebar_entry+0x8d>
mov    -0x8(%rbp),%rdi
lea    0xe63(%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    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe89(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
lea    0xe93(%rip),%rdx
lea    0xe94(%rip),%rcx
call   1050 <om_html_print_bar@plt>
mov    -0x8(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_html_print_numkeycomparativebar_entry>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
test   %edx,%edx
mov    $0x1,%eax
cmovne %edx,%eax
imul   $0x64,%ecx,%ecx
cvtsi2ss %ecx,%xmm1
cvtsi2ss %eax,%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
mov    %rsi,%rdi
mov    %r8d,%esi
call   1030 <vi_is_weekend@plt>
test   %eax,%eax
je     119c <om_html_print_numkeycomparativebar_entry+0x4c>
lea    0xe6b(%rip),%rdi
mov    $0x28,%esi
jmp    11a8 <om_html_print_numkeycomparativebar_entry+0x58>
lea    0xe86(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
cvttss2si 0x4(%rsp),%r15d
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <om_html_entities@plt>
lea    0xe82(%rip),%rdi
mov    $0x3b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
mov    $0x1,%al
call   1040 <fprintf@plt>
lea    0xe95(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0xe9f(%rip),%rdx
lea    0xea0(%rip),%rcx
mov    %rbx,%rdi
mov    %r15d,%esi
call   1050 <om_html_print_bar@plt>
lea    0xe97(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
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"barleft\00"
@.str.6 = [9 x i8] c"barright\00"
@.str.7 = [12 x i8] c"</td></tr>\0A\00"
define void @om_html_print_numkeycomparativebar_entry(i32* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca float
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%14 = load i32, i32* %8
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %5
%17 = load i32, i32* %8
%18 = add nsw i32 %17, 1
store i32 %18, i32* %8
br label %19
19: ; preds = %16, %5
%20 = load i32, i32* %9
%21 = mul nsw i32 100, %20
%22 = sitofp i32 %21 to float
%23 = load i32, i32* %8
%24 = sitofp i32 %23 to float
%25 = fdiv float %22, %24
store float %25, float* %13
%26 = load float, float* %13
%27 = fptosi float %26 to i32
store i32 %27, i32* %11
%28 = load i8*, i8** %7
%29 = load i32, i32* %10
%30 = call i32 @vi_is_weekend(i8* %28, i32 %29)
store i32 %30, i32* %12
%31 = load i32, i32* %12
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %19
%34 = load i32*, i32** %6
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %39
36: ; preds = %19
%37 = load i32*, i32** %6
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %36, %33
%40 = load i32*, i32** %6
%41 = load i8*, i8** %7
%42 = call i32 @om_html_entities(i32* %40, i8* %41)
%43 = load i32*, i32** %6
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%45 = load i32*, i32** %6
%46 = load i32, i32* %9
%47 = load float, float* %13
%48 = fpext float %47 to double
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %46, double %48)
%50 = load i32*, i32** %6
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%52 = load i32*, i32** %6
%53 = load i32, i32* %11
%54 = call i32 @om_html_print_bar(i32* %52, i32 %53, 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))
%55 = load i32*, i32** %6
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, 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"barleft\00"
@.str.6 = [9 x i8] c"barright\00"
@.str.7 = [12 x i8] c"</td></tr>\0A\00"
define void @om_html_print_numkeycomparativebar_entry(i32* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %2, 0
%7 = select i1 %6, i32 1, i32 %2
%8 = mul nsw i32 %3, 100
%9 = sitofp i32 %8 to float
%10 = sitofp i32 %7 to float
%11 = fdiv float %9, %10
%12 = tail call i32 @vi_is_weekend(i8* %1, i32 %4)
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %5
%15 = 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 %18
16: ; preds = %5
%17 = 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 %18
18: ; preds = %16, %14
%19 = fptosi float %11 to i32
%20 = tail call i32 @om_html_entities(i32* %0, i8* %1)
%21 = 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)
%22 = fpext float %11 to double
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %3, double %22)
%24 = 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)
%25 = tail call i32 @om_html_print_bar(i32* %0, i32 %19, 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))
%26 = 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
}