// File: ColinHarker[P]ltsim/src/system.cpp
// Function: System::display(WindowWrap&)
void System::display(WindowWrap& disp)
{
   constexpr char titles[] = " CPU   MEM  USER   PID      VSZ    RSS   TTY  STAT START  "
                             "TIME COMMAND";

   mvwprintw(disp.getWin(), 1, 0, titles);
   int ROW = 2;
   for(SystemProcess sp : m_processes)
   {
      float cpu = sp.getCpuAsFloat();
      float mem = sp.getMemAsFloat();

      std::string cpuStr = sp.getCpuAsString();
      std::string memStr = sp.getMemAsString();

      displayPercentColor(disp, cpu, cpuStr + " ", ROW, 1);
      displayPercentColor(disp, mem, memStr, ROW, 7);

      mvwprintw(disp.getWin(), ROW, 12, sp.toString().c_str());
      ROW++;
   }
   wclrtobot(disp.getWin());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2a0(%rbp)
leaq -0x60(%rbp), %rdi
leaq 0x45c7(%rip), %rsi      # 0xe2e0
movl $0x47, %edx
callq 0x3260
movq -0x10(%rbp), %rdi
callq 0xde80
movq %rax, %rdi
leaq -0x60(%rbp), %rcx
movl $0x1, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x3080
movq -0x2a0(%rbp), %rax
movl $0x2, -0x64(%rbp)
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xb670
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0xb6a0
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xb6d0
testb $0x1, %al
jne 0x9d83
jmp 0xa045
leaq -0x78(%rbp), %rdi
callq 0xb710
movq %rax, %rsi
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0xb410
movq -0x2b0(%rbp), %rdi
callq 0x99f0
movss %xmm0, -0x2a4(%rbp)
jmp 0x9db8
movss -0x2a4(%rbp), %xmm0
movss %xmm0, -0x1e4(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x9a50
movss %xmm0, -0x2b4(%rbp)
jmp 0x9dde
movss -0x2b4(%rbp), %xmm0
movss %xmm0, -0x1f8(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x9a20
jmp 0x9e03
leaq -0x238(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x9a80
jmp 0x9e18
movq -0x10(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movss -0x1e4(%rbp), %xmm0
movss %xmm0, -0x2b8(%rbp)
leaq 0x421b(%rip), %rdx      # 0xe055
leaq -0x258(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x7620
jmp 0x9e4f
movss -0x2b8(%rbp), %xmm0
movq -0x2c0(%rbp), %rdi
movl -0x64(%rbp), %edx
leaq -0x258(%rbp), %rsi
movl $0x1, %ecx
callq 0xccf0
jmp 0x9e74
leaq -0x258(%rbp), %rdi
callq 0x31d0
movq -0x10(%rbp), %rax
movq %rax, -0x2d0(%rbp)
movss -0x1f8(%rbp), %xmm0
movss %xmm0, -0x2c4(%rbp)
leaq -0x278(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x3130
jmp 0x9eb0
movss -0x2c4(%rbp), %xmm0
movq -0x2d0(%rbp), %rdi
movl -0x64(%rbp), %edx
leaq -0x278(%rbp), %rsi
movl $0x7, %ecx
callq 0xccf0
jmp 0x9ed5
leaq -0x278(%rbp), %rdi
callq 0x31d0
movq -0x10(%rbp), %rdi
callq 0xde80
movq %rax, -0x2d8(%rbp)
jmp 0x9ef3
movl -0x64(%rbp), %eax
movl %eax, -0x2dc(%rbp)
leaq -0x298(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x9560
jmp 0x9f11
leaq -0x298(%rbp), %rdi
callq 0x3120
movq -0x2d8(%rbp), %rdi
movl -0x2dc(%rbp), %esi
movq %rax, %rcx
xorl %eax, %eax
movl $0xc, %edx
callq 0x3080
jmp 0x9f3b
leaq -0x298(%rbp), %rdi
callq 0x31d0
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x31d0
leaq -0x218(%rbp), %rdi
callq 0x31d0
leaq -0x1e0(%rbp), %rdi
callq 0x3f60
leaq -0x78(%rbp), %rdi
callq 0xb730
jmp 0x9d6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0xa037
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0xa02b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
jmp 0xa01f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x31d0
jmp 0xa01f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x31d0
jmp 0xa01f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f0(%rbp)
movl %eax, -0x1f4(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x31d0
leaq -0x238(%rbp), %rdi
callq 0x31d0
leaq -0x218(%rbp), %rdi
callq 0x31d0
leaq -0x1e0(%rbp), %rdi
callq 0x3f60
jmp 0xa05f
movq -0x10(%rbp), %rdi
callq 0xde80
movq %rax, %rdi
callq 0x33a0
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
movq -0x1f0(%rbp), %rdi
callq 0x3510
nopl (%rax,%rax)