// File: /workspace/github_cpp_makefile_star2_O1/ColinHarker[P]ltsim/src/runtime.cpp
// Function: updateCpuWindow(WindowWrap&, Cpu&, RandomAccessMemory&)
void updateCpuWindow(WindowWrap& disp, Cpu& cpuContainer, RandomAccessMemory& memory)
{
   constexpr int k_StartColumn = 0;
   constexpr int k_StartRow    = 3;

   cpuContainer.run();
   memory.run();

   float util = cpuContainer.getCpu().getUtilization();
   float mem  = memory.getMemUsage();
   float swap = memory.getSwapUsage();

   std::vector<CpuReader> core = cpuContainer.getCores();

   displayUtilizationLevel(disp, util, "CPU", k_StartRow, k_StartColumn, flag::displayLength::standard);
   displayUtilizationLevel(disp, mem, "MEM", k_StartRow + 1, k_StartColumn, flag::displayLength::standard);
   displayUtilizationLevel(disp, swap, "SWAP", k_StartRow + 2, k_StartColumn, flag::displayLength::standard);

   displayCpuCores(disp, core, k_StartRow + 4, flag::displayLength::small);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x45d0
movq %r15, %rdi
callq 0x4bd6
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x460c
movq %r12, %rdi
callq 0x3d76
movss %xmm0, 0xc(%rsp)
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5350
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3210
leaq 0x20(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x536c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3210
movq %r15, %rdi
callq 0x5254
movss %xmm0, 0x8(%rsp)
movq %r15, %rdi
callq 0x525a
movss %xmm0, 0x4(%rsp)
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
callq 0x468a
leaq 0x10(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x4df1(%rip), %rsi      # 0xa198
leaq 0x4ded(%rip), %rdx      # 0xa19b
callq 0x5260
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movss 0xc(%rsp), %xmm0
movl $0x3, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5530
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x53e7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3210
leaq 0x10(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x4da6(%rip), %rsi      # 0xa19c
leaq 0x4da2(%rip), %rdx      # 0xa19f
callq 0x5260
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movss 0x8(%rsp), %xmm0
movl $0x4, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5530
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x5436
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3210
leaq 0x10(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x4d5b(%rip), %rsi      # 0xa1a0
leaq 0x4d58(%rip), %rdx      # 0xa1a4
callq 0x5260
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movss 0x4(%rsp), %xmm0
movl $0x5, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5530
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x5485
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3210
leaq 0x78(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x46e2
leaq 0x78(%rsp), %rsi
movq %rbx, %rdi
movl $0x7, %edx
movl $0x1, %ecx
callq 0x5940
leaq 0x78(%rsp), %rdi
callq 0x3a90
leaq 0x90(%rsp), %rdi
callq 0x3a90
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3a90
jmp 0x550c
jmp 0x5509
jmp 0x54ed
jmp 0x5509
jmp 0x54ed
jmp 0x5509
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x550c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3210
jmp 0x550c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x3a90
movq %rbx, %rdi
callq 0x33f0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3a5a
jmp 0x5519