// File: /workspace/github_cpp_makefile_star2_O2/ColinHarker[P]ltsim/src/runtime.cpp
// Function: displayUtilizationLevel(WindowWrap&, float, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, flag::displayLength)
void displayUtilizationLevel(WindowWrap& disp, float util, const std::string& label, int row, int startColumn, flag::displayLength length)
{
   constexpr int k_StandardLength = 32;
   constexpr int k_SmallLength    = 10;

   int displayLength = (length == flag::displayLength::standard) ? k_StandardLength : k_SmallLength;

   displayElement(disp, row, startColumn, label, flag::printType::standard, flag::color::none);
   displayElement(disp, row, startColumn + 5, "[", flag::printType::standard, flag::color::none);

   int level = static_cast<int>((displayLength * (util / 100)) + startColumn + 6);
   for(int i = 0; i < displayLength; i++)
   {
      int offset = i + startColumn + 6;
      if(offset > level)
      {
         mvwprintw(disp.getWin(), row, offset, " ");
      }
      else
      {
         displayPercentColor(disp, util, "|", row, offset);
      }
      wrefresh(disp.getWin());
   }
   mvwprintw(disp.getWin(), row, startColumn + displayLength + 6, "]");

   std::ostringstream ss;
   ss << std::setprecision(2) << std::setw(4) << std::fixed << util << "%%";
   displayPercentColor(disp, util, ss.str() + " ", row, startColumn + displayLength + 8);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movl %ecx, %ebp
movl %edx, %ebx
movss %xmm0, 0xc(%rsp)
movq %rdi, %r15
testl %r8d, %r8d
pushq $0x20
popq %rax
pushq $0xa
popq %r13
cmovel %eax, %r13d
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x3300
pushq $0x1
popq %r8
movq %r15, %rdi
movl %ebx, %esi
movl %ebp, %edx
movq %r14, %rcx
xorl %r9d, %r9d
callq 0x684c
leaq 0x80(%rsp), %rdi
callq 0x3110
leaq 0x2465(%rip), %rsi      # 0x71f1
leaq 0x60(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
callq 0x49d4
leal 0x5(%rbp), %edx
leaq 0x60(%rsp), %rcx
pushq $0x1
popq %r8
movq %r15, %rdi
movl %ebx, %esi
xorl %r9d, %r9d
callq 0x684c
leaq 0x60(%rsp), %rdi
callq 0x3110
cvtsi2ss %r13d, %xmm0
movss 0xc(%rsp), %xmm1
divss 0x2408(%rip), %xmm1     # 0x71dc
cvtsi2ss %ebp, %xmm2
mulss %xmm0, %xmm1
addss %xmm1, %xmm2
addss 0x23f8(%rip), %xmm2     # 0x71e0
cvttss2si %xmm2, %r12d
movq %rbp, 0x10(%rsp)
addl $0x6, %ebp
leaq 0xa0(%rsp), %r14
movq %r13, 0x18(%rsp)
subl $0x1, %r13d
jb 0x4e74
cmpl %r12d, %ebp
jle 0x4e2c
movq %r15, %rdi
callq 0x6e9c
movq %rax, %rdi
movl %ebx, %esi
movl %ebp, %edx
leaq 0x2232(%rip), %rcx      # 0x7055
xorl %eax, %eax
callq 0x3060
jmp 0x4e60
movq %r14, %rdi
leaq 0x23bd(%rip), %rsi      # 0x71f3
leaq 0xc0(%rsp), %rdx
callq 0x49d4
movq %r15, %rdi
movss 0xc(%rsp), %xmm0
movq %r14, %rsi
movl %ebx, %edx
movl %ebp, %ecx
callq 0x68e9
movq %r14, %rdi
callq 0x3110
movq %r15, %rdi
callq 0x6e9c
movq %rax, %rdi
callq 0x3270
incl %ebp
jmp 0x4e02
movq %r15, %rdi
callq 0x6e9c
movq 0x18(%rsp), %r12
movq 0x10(%rsp), %r13
leal (%r12,%r13), %edx
addl $0x6, %edx
leaq 0x2361(%rip), %rcx      # 0x71f5
movq %rax, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x3060
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x32f0
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x2, 0xc8(%rsp,%rcx)
movq -0x18(%rax), %rcx
movq $0x4, 0xd0(%rsp,%rcx)
movq -0x18(%rax), %rax
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl 0xd8(%rsp,%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0xd8(%rsp,%rax)
movq %r14, %rdi
movss 0xc(%rsp), %xmm0
callq 0x31d0
leaq 0x22f5(%rip), %rsi      # 0x71f7
movq %rax, %rdi
callq 0x3220
leaq 0xc8(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3370
leaq 0x2132(%rip), %rdx      # 0x7055
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x521c
addl %r13d, %r12d
addl $0x8, %r12d
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
movss 0xc(%rsp), %xmm0
movl %ebx, %edx
movl %r12d, %ecx
callq 0x68e9
leaq 0x40(%rsp), %rdi
callq 0x3110
leaq 0x20(%rsp), %rdi
callq 0x3110
leaq 0xc0(%rsp), %rdi
callq 0x3070
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3110
jmp 0x4f96
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3110
jmp 0x4fc0
jmp 0x4fbd
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x4fdf
jmp 0x4fcf
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0x4fdf
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x3070
jmp 0x4fe4
movq %rax, %rbx
jmp 0x4fe4
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x33c0