// File: 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
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x20, -0x28(%rbp)
movl $0xa, -0x2c(%rbp)
movl -0x24(%rbp), %eax
testl %eax, %eax
movl $0x20, %ecx
movl $0xa, %eax
cmovel %ecx, %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x290(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x288(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x284(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x3130
movq -0x290(%rbp), %rdi
movl -0x288(%rbp), %esi
movl -0x284(%rbp), %edx
movq -0x280(%rbp), %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0xcbf0
jmp 0x80b0
leaq -0x50(%rbp), %rdi
callq 0x31d0
movq -0x8(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x2a0(%rbp)
movl -0x20(%rbp), %eax
addl $0x5, %eax
movl %eax, -0x29c(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x3520
movq -0x298(%rbp), %rdx
leaq 0x6087(%rip), %rsi      # 0xe181
leaq -0x80(%rbp), %rdi
callq 0x76e0
jmp 0x8105
movl -0x29c(%rbp), %edx
movl -0x2a0(%rbp), %esi
movq -0x2a8(%rbp), %rdi
leaq -0x80(%rbp), %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0xcbf0
jmp 0x812c
leaq -0x80(%rbp), %rdi
callq 0x31d0
leaq -0x81(%rbp), %rdi
callq 0x3320
cvtsi2ssl -0x30(%rbp), %xmm0
movss -0xc(%rbp), %xmm2
movss 0x601d(%rip), %xmm1     # 0xe170
divss %xmm1, %xmm2
cvtsi2ssl -0x20(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x6000(%rip), %xmm1     # 0xe16c
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x830c
movl -0x8c(%rbp), %eax
addl -0x20(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
cmpl -0x88(%rbp), %eax
jle 0x8229
movq -0x8(%rbp), %rdi
callq 0xde80
movq %rax, %rdi
movl -0x1c(%rbp), %esi
movl -0x90(%rbp), %edx
leaq 0x5e86(%rip), %rcx      # 0xe055
movb $0x0, %al
callq 0x3080
jmp 0x82e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x31d0
jmp 0x84f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8218
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x31d0
leaq -0x81(%rbp), %rdi
callq 0x3320
jmp 0x84f0
movq -0x8(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movss -0xc(%rbp), %xmm0
movss %xmm0, -0x2b4(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x3520
movq -0x2b0(%rbp), %rdx
leaq 0x5f21(%rip), %rsi      # 0xe183
leaq -0xb0(%rbp), %rdi
callq 0x76e0
jmp 0x8270
movss -0x2b4(%rbp), %xmm0
movq -0x2c0(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl -0x90(%rbp), %ecx
leaq -0xb0(%rbp), %rsi
callq 0xccf0
jmp 0x8296
leaq -0xb0(%rbp), %rdi
callq 0x31d0
leaq -0xb1(%rbp), %rdi
callq 0x3320
jmp 0x82e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x82d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x31d0
leaq -0xb1(%rbp), %rdi
callq 0x3320
jmp 0x84f0
movq -0x8(%rbp), %rdi
callq 0xde80
movq %rax, %rdi
callq 0x3350
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x8184
movq -0x8(%rbp), %rdi
callq 0xde80
movq %rax, %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movl -0x30(%rbp), %eax
movl %eax, %ecx
movl %edx, %eax
leal 0x6(%rax,%rcx), %edx
leaq 0x5e55(%rip), %rcx      # 0xe185
xorl %eax, %eax
callq 0x3080
leaq -0x230(%rbp), %rdi
callq 0x3410
movl $0x2, %edi
callq 0x88b0
movl %eax, -0x2c4(%rbp)
jmp 0x8355
movl -0x2c4(%rbp), %eax
movl %eax, -0x234(%rbp)
movl -0x234(%rbp), %esi
leaq -0x230(%rbp), %rdi
callq 0x34c0
movq %rax, -0x2d0(%rbp)
jmp 0x837c
movl $0x4, %edi
callq 0x88d0
movl %eax, -0x2d4(%rbp)
jmp 0x838e
movq -0x2d0(%rbp), %rdi
movl -0x2d4(%rbp), %eax
movl %eax, -0x238(%rbp)
movl -0x238(%rbp), %esi
callq 0x3360
movq %rax, -0x2e0(%rbp)
jmp 0x83b5
movq -0x2e0(%rbp), %rdi
leaq 0x52d(%rip), %rsi       # 0x88f0
callq 0x30e0
movq %rax, -0x2e8(%rbp)
jmp 0x83d1
movq -0x2e8(%rbp), %rdi
movss -0xc(%rbp), %xmm0
callq 0x3230
movq %rax, -0x2f0(%rbp)
jmp 0x83eb
movq -0x2f0(%rbp), %rdi
leaq 0x5d8e(%rip), %rsi      # 0xe187
callq 0x32a0
jmp 0x8400
movq -0x8(%rbp), %rax
movq %rax, -0x300(%rbp)
movss -0xc(%rbp), %xmm0
movss %xmm0, -0x2f4(%rbp)
leaq -0x278(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x32d0
jmp 0x842d
leaq 0x5c21(%rip), %rdx      # 0xe055
leaq -0x258(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x8920
jmp 0x8449
movss -0x2f4(%rbp), %xmm0
movq -0x300(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %esi
movl -0x30(%rbp), %eax
movl %eax, %ecx
movl %esi, %eax
leal 0x8(%rax,%rcx), %ecx
leaq -0x258(%rbp), %rsi
callq 0xccf0
jmp 0x8477
leaq -0x258(%rbp), %rdi
callq 0x31d0
leaq -0x278(%rbp), %rdi
callq 0x31d0
leaq -0x230(%rbp), %rdi
callq 0x3090
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x84e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x84d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x31d0
leaq -0x278(%rbp), %rdi
callq 0x31d0
leaq -0x230(%rbp), %rdi
callq 0x3090
movq -0x58(%rbp), %rdi
callq 0x3510
nopl (%rax)