// File: /workspace/github_cpp_makefile_star2_O3/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 0x1ff1(%rip), %rsi      # 0xb6b0
leaq 0x2d0(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x3450
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 0x3320
leaq 0x250(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x230(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x210(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x1f0(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x1d0(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x1b0(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x190(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x170(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x150(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x130(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x110(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0xf0(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0xd0(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0xb0(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x90(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x2b0(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x290(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x3110
movq %rsp, %rsi
movq %rax, %rdi
callq 0x3270
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 0x165d(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1665(%rip), %xmm0     # 0xb080
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x15e1(%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 0x9a62
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x2b0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9a7f
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9a9b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x9ab7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9ad3
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9af5
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x9b1a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x9b3f
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x9b64
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x9b89
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x9bae
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x9bd3
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x9bf8
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x9c1d
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x9c42
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x9c67
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x9c8c
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x9cb1
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x9cd6
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x9cfb
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x250(%rsp), %rdi
leaq 0x260(%rsp), %rax
cmpq %rax, %rdi
je 0x9d20
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
cmpq %rax, %rdi
je 0x9d45
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x3260
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 0x9d84
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x2b0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9da1
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x9dbd
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x9dd9
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9df5
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9e17
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x9e3c
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x9e61
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x9e86
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x9eab
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x9ed0
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x9ef5
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x9f1a
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x9f3f
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x9f64
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x9f89
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x9fae
movq 0x1e0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x9fd3
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x9ff8
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0xa01d
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x250(%rsp), %rdi
leaq 0x260(%rsp), %rax
cmpq %rax, %rdi
je 0xa042
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
cmpq %rax, %rdi
je 0xa067
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x3260
leaq 0x2d0(%rsp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x3430