// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x20, %eax
movl $0xa, %r13d
cmovel %eax, %r13d
leaq 0xb0(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0xa0(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3c8e
movq %r15, %rdi
movl %ebx, 0x8(%rsp)
movl %ebx, %esi
movl %ebp, %edx
movq %r14, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x8e5c
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0x5593
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3210
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4c4e(%rip), %rsi      # 0xa1f5
leaq 0x4c48(%rip), %rdx      # 0xa1f6
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x522a
leal 0x5(%rbp), %edx
movq %r15, %rdi
movl 0x8(%rsp), %esi
movq %r14, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x8e5c
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x55f6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3210
cvtsi2ss %r13d, %xmm0
movss 0xc(%rsp), %xmm1
divss 0x4bd7(%rip), %xmm1     # 0xa1e0
mulss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
addss %xmm1, %xmm0
addss 0x4bc4(%rip), %xmm0     # 0xa1e4
cvttss2si %xmm0, %r14d
movq %rbp, 0x10(%rsp)
addl $0x6, %ebp
leaq 0x50(%rsp), %r12
movq %r13, %rax
leaq 0x40(%rsp), %r13
movq %rax, 0x18(%rsp)
movl %eax, %ebx
cmpl %r14d, %ebp
jle 0x5667
movq %r15, %rdi
callq 0x960e
movq %rax, %rdi
movl 0x8(%rsp), %esi
movl %ebp, %edx
leaq 0x49f7(%rip), %rcx      # 0xa055
xorl %eax, %eax
callq 0x3060
jmp 0x56b0
movq %r12, 0x40(%rsp)
movq %r13, %rdi
leaq 0x4b81(%rip), %rsi      # 0xa1f7
leaq 0x4b7b(%rip), %rdx      # 0xa1f8
callq 0x522a
movq %r15, %rdi
movss 0xc(%rsp), %xmm0
movq %r13, %rsi
movl 0x8(%rsp), %edx
movl %ebp, %ecx
callq 0x8ef9
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x56b0
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3210
movq %r15, %rdi
callq 0x960e
movq %rax, %rdi
callq 0x3260
incl %ebp
decl %ebx
jne 0x5641
movq %r15, %rdi
callq 0x960e
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %r12
leal (%rbx,%r12), %edx
addl $0x6, %edx
leaq 0x4b0f(%rip), %rcx      # 0xa1f9
movq %rax, %rdi
movl 0x8(%rsp), %esi
xorl %eax, %eax
callq 0x3060
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x32e0
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)
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movq %r14, %rdi
callq 0x3390
leaq 0x4a9e(%rip), %rsi      # 0xa1fb
movl $0x2, %edx
movq %rax, %rdi
callq 0x3270
leaq 0xc8(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x3380
leaq 0x48d2(%rip), %rsi      # 0xa055
leaq 0x60(%rsp), %rdi
callq 0x3430
addl %r12d, %ebx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x57b7
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x57be
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
addl $0x8, %ebx
movq %r15, %rdi
movss 0xc(%rsp), %xmm0
movl 0x8(%rsp), %edx
movl %ebx, %ecx
callq 0x8ef9
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x5808
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3210
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5823
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3210
movq 0x879e(%rip), %rsi      # 0xdfc8
leaq 0xc0(%rsp), %rdi
callq 0x3140
leaq 0x130(%rsp), %rdi
callq 0x30c0
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x5875
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3210
jmp 0x5875
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x58cb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3210
jmp 0x58cb
jmp 0x58c8
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x5908
movq 0x90(%rsp), %rsi
jmp 0x5900
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0x5908
movq 0xb0(%rsp), %rsi
jmp 0x5900
movq %rax, %rbx
movq 0x86f6(%rip), %rsi      # 0xdfc8
leaq 0xc0(%rsp), %rdi
callq 0x3140
leaq 0x130(%rsp), %rdi
callq 0x30c0
jmp 0x5908
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x5908
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3210
movq %rbx, %rdi
callq 0x33f0