// File: /workspace/github_cpp_makefile_star2_O1/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 0x3c88
movq %r15, %rdi
movl %ebx, 0x8(%rsp)
movl %ebx, %esi
movl %ebp, %edx
movq %r14, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x8eb8
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0x55c3
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3210
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4bce(%rip), %rsi      # 0xa1a5
leaq 0x4bc8(%rip), %rdx      # 0xa1a6
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x5260
leal 0x5(%rbp), %edx
movq %r15, %rdi
movl 0x8(%rsp), %esi
movq %r14, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x8eb8
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x5626
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3210
cvtsi2ss %r13d, %xmm0
movss 0xc(%rsp), %xmm1
divss 0x4b57(%rip), %xmm1     # 0xa190
mulss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
addss %xmm1, %xmm0
addss 0x4b44(%rip), %xmm0     # 0xa194
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 0x5697
movq %r15, %rdi
callq 0x969e
movq %rax, %rdi
movl 0x8(%rsp), %esi
movl %ebp, %edx
leaq 0x49c7(%rip), %rcx      # 0xa055
xorl %eax, %eax
callq 0x3060
jmp 0x56e0
movq %r12, 0x40(%rsp)
movq %r13, %rdi
leaq 0x4b01(%rip), %rsi      # 0xa1a7
leaq 0x4afb(%rip), %rdx      # 0xa1a8
callq 0x5260
movq %r15, %rdi
movss 0xc(%rsp), %xmm0
movq %r13, %rsi
movl 0x8(%rsp), %edx
movl %ebp, %ecx
callq 0x8f55
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x56e0
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3210
movq %r15, %rdi
callq 0x969e
movq %rax, %rdi
callq 0x3260
incl %ebp
decl %ebx
jne 0x5671
movq %r15, %rdi
callq 0x969e
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %r12
leal (%rbx,%r12), %edx
addl $0x6, %edx
leaq 0x4a8f(%rip), %rcx      # 0xa1a9
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 0x4a1e(%rip), %rsi      # 0xa1ab
movl $0x2, %edx
movq %rax, %rdi
callq 0x3270
leaq 0xc8(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x3380
leaq 0x48a2(%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 0x57e7
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x57ee
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 0x8f55
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x5838
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3210
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5853
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3210
movq 0x876e(%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 0x58a5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3210
jmp 0x58a5
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x58fb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3210
jmp 0x58fb
jmp 0x58f8
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x5938
movq 0x90(%rsp), %rsi
jmp 0x5930
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0x5938
movq 0xb0(%rsp), %rsi
jmp 0x5930
movq %rax, %rbx
movq 0x86c6(%rip), %rsi      # 0xdfc8
leaq 0xc0(%rsp), %rdi
callq 0x3140
leaq 0x130(%rsp), %rdi
callq 0x30c0
jmp 0x5938
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x5938
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3210
movq %rbx, %rdi
callq 0x33f0