#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*/ printf(char *, ...);
void display(const char *label, double used, int const warning,
             int const critical, int const decimals) {
  if (critical != 0 && used > critical) {
    printf("%s<span color='%s'>", label, "#FF7373");
  } else if (warning != 0 && used > warning) {
    printf("%s<span color='%s'>", label, "#FFA500");
  } else {
    printf("%s<span>", label);
  }
  printf("%*.*lf%%</span>\n", decimals + 3 + 1, decimals, used);
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1166 <display+0x56>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1166 <display+0x56>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
lea    0xeba(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b9 <display+0xa9>
cmpl   $0x0,-0x14(%rbp)
je     11a2 <display+0x92>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a2 <display+0x92>
mov    -0x8(%rbp),%rsi
lea    0xe71(%rip),%rdi
lea    0xe86(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b4 <display+0xa4>
mov    -0x8(%rbp),%rsi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b9 <display+0xa9>
mov    -0x1c(%rbp),%esi
add    $0x3,%esi
add    $0x1,%esi
mov    -0x1c(%rbp),%edx
movsd  -0x10(%rbp),%xmm0
lea    0xe5c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%ebx
mov    %rdi,%rax
test   %edx,%edx
movsd  %xmm0,0x8(%rsp)
je     113e <display+0x2e>
cvtsi2sd %edx,%xmm1
ucomisd %xmm1,%xmm0
jbe    113e <display+0x2e>
lea    0xecb(%rip),%rdi
lea    0xed8(%rip),%rdx
jmp    115d <display+0x4d>
test   %esi,%esi
je     1169 <display+0x59>
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
ucomisd %xmm1,%xmm0
jbe    1169 <display+0x59>
lea    0xeaa(%rip),%rdi
lea    0xebf(%rip),%rdx
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    117a <display+0x6a>
lea    0xeb4(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rbx),%esi
lea    0xea9(%rip),%rdi
mov    %ebx,%edx
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%s<span color='%s'>\00"
@.str.1 = [8 x i8] c"#FF7373\00"
@.str.2 = [8 x i8] c"#FFA500\00"
@.str.3 = [9 x i8] c"%s<span>\00"
@.str.4 = [17 x i8] c"%*.*lf%%</span>\0A\00"
define void @display(i8* %0, double %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store double %1, double* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load double, double* %7
%15 = load i32, i32* %9
%16 = sitofp i32 %15 to double
%17 = fcmp ogt double %14, %16
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i8*, i8** %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %36
21: ; preds = %13, %5
%22 = load i32, i32* %8
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = load double, double* %7
%26 = load i32, i32* %8
%27 = sitofp i32 %26 to double
%28 = fcmp ogt double %25, %27
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = load i8*, i8** %6
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %35
32: ; preds = %24, %21
%33 = load i8*, i8** %6
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %33)
br label %35
35: ; preds = %32, %29
br label %36
36: ; preds = %35, %18
%37 = load i32, i32* %10
%38 = add nsw i32 %37, 3
%39 = add nsw i32 %38, 1
%40 = load i32, i32* %10
%41 = load double, double* %7
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %39, i32 %40, double %41)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s<span color='%s'>\00"
@.str.1 = [8 x i8] c"#FF7373\00"
@.str.2 = [8 x i8] c"#FFA500\00"
@.str.3 = [9 x i8] c"%s<span>\00"
@.str.4 = [17 x i8] c"%*.*lf%%</span>\0A\00"
define void @display(i8* %0, double %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp ne i32 %3, 0
%7 = sitofp i32 %3 to double
%8 = fcmp olt double %7, %1
%9 = and i1 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %21
12: ; preds = %5
%13 = icmp ne i32 %2, 0
%14 = sitofp i32 %2 to double
%15 = fcmp olt double %14, %1
%16 = and i1 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %21
19: ; preds = %12
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %21
21: ; preds = %17, %19, %10
%22 = add nsw i32 %4, 4
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %22, i32 %4, double %1)
ret void
}