// File: /workspace/github_cpp_makefile_star2_O1/ratulSharker[P]Havec/src/common.cpp
// Function: process_mem_usage(double&, double&)
void process_mem_usage(double& vm_usage, double& resident_set)
{
   using std::ios_base;
   using std::ifstream;
   using std::string;

   vm_usage     = 0.0;
   resident_set = 0.0;

   // 'file' stat seems to give the most reliable results
   //
   ifstream stat_stream("/proc/self/stat",ios_base::in);

   // dummy vars for leading entries in stat that we don't care about
   //
   string pid, comm, state, ppid, pgrp, session, tty_nr;
   string tpgid, flags, minflt, cminflt, majflt, cmajflt;
   string utime, stime, cutime, cstime, priority, nice;
   string O, itrealvalue, starttime;

   // the two fields we want
   //
   unsigned long vsize;
   long rss;

   stat_stream >> pid >> comm >> state >> ppid >> pgrp >> session >> tty_nr
               >> tpgid >> flags >> minflt >> cminflt >> majflt >> cmajflt
               >> utime >> stime >> cutime >> cstime >> priority >> nice
               >> O >> itrealvalue >> starttime >> vsize >> rss; // don't care about the rest

   stat_stream.close();

   long page_size_kb = sysconf(_SC_PAGE_SIZE) / 1024; // in case x86-64 is configured to use 2MB pages
   vm_usage     = vsize / 1024.0;
   resident_set = rss * page_size_kb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
movq %r13, (%rdi)
movq %r13, (%rsi)
leaq 0x2415(%rip), %rsi      # 0xb618
leaq 0x2d0(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x3470
leaq 0x280(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x260(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x240(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x220(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x200(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x1e0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x1c0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x1a0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x180(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x160(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x140(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x120(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, -0x8(%rax)
movb %r13b, (%rax)
leaq 0x2c0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq %r13, -0x8(%rbp)
movb %r13b, (%rbp)
leaq 0x2a0(%rsp), %r12
movq %r12, -0x10(%r12)
movq %r13, -0x8(%r12)
movb %r13b, (%r12)
leaq 0x270(%rsp), %rsi
movq %r15, %rdi
callq 0x3330
leaq 0x250(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x230(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x210(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x1f0(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x1d0(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x1b0(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x190(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x170(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x150(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x130(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x110(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0xf0(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0xd0(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0xb0(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x90(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x2b0(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x290(%rsp), %rsi
movq %rax, %rdi
callq 0x3330
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x3110
movq %rsp, %rsi
movq %rax, %rdi
callq 0x3280
leaq 0x2d0(%rsp), %rdi
callq 0x3060
movl $0x1e, %edi
callq 0x3150
leaq 0x3ff(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0xa, %rcx
movsd 0x8(%rsp), %xmm0
unpcklps 0x1b19(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1b21(%rip), %xmm0     # 0xb080
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x1a9d(%rip), %xmm1     # 0xb010
movsd %xmm1, (%r14)
imulq (%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
movsd %xmm0, (%rbx)
movq 0x290(%rsp), %rdi
cmpq %r12, %rdi
je 0x95a6
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x2b0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95c3
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x95df
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x95fb
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9617
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9639
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x965e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x9683
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x96a8
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x96cd
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x96f2
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x9717
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x973c
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x9761
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x9786
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x97ab
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x97d0
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x97f5
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x981a
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x983f
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x250(%rsp), %rdi
leaq 0x260(%rsp), %rax
cmpq %rax, %rdi
je 0x9864
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
cmpq %rax, %rdi
je 0x9889
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x3270
leaq 0x2d0(%rsp), %rdi
callq 0x3070
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x290(%rsp), %rdi
cmpq %r12, %rdi
je 0x98c8
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x2b0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x98e5
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9901
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x991d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9939
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x995b
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x9980
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x99a5
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x99ca
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x99ef
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x9a14
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x9a39
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x9a5e
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x9a83
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x9aa8
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x9acd
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x9af2
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x9b17
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x9b3c
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x9b61
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x250(%rsp), %rdi
leaq 0x260(%rsp), %rax
cmpq %rax, %rdi
je 0x9b86
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x3270
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
cmpq %rax, %rdi
je 0x9bab
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x3270
leaq 0x2d0(%rsp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x3450