// File: /workspace/github_cpp_makefile_star2_O1/helchr[P]reMap/sysinfo.cpp
// Function: SysInfo::readRegister(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)
unsigned int SysInfo::readRegister(const std::string& path, unsigned int offset)
{
    std::ifstream ifs(path,std::ios::in|std::ios::binary);
    if(!ifs.good())
    {
        throw(std::runtime_error("Can not open file at " + path));
    }
    ifs.ignore(offset);
    if(!ifs.good())
    {
        throw(std::runtime_error("Offset " + std::to_string(offset) + " is not within file " + path));
    }
    unsigned int reg = 0;
    ifs.read((char*)&reg,sizeof(reg));
    return reg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movl %esi, %ebp
movq %rdi, %r14
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl $0xc, %edx
callq 0x5720
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xa0(%rsp,%rax)
jne 0xcbc7
movl %ebp, %esi
leaq 0x80(%rsp), %rdi
callq 0x5070
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xa0(%rsp,%rax)
jne 0xcc11
movq %rsp, %rsi
movl $0x0, (%rsi)
leaq 0x80(%rsp), %rdi
movl $0x4, %edx
callq 0x5560
movl (%rsp), %ebx
leaq 0x80(%rsp), %rdi
callq 0x5120
movl %ebx, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x5240
movq %rax, %rbx
leaq 0x1599e(%rip), %rsi     # 0x22579
movq %rsp, %rdi
movq %r14, %rdx
callq 0xe47e
movb $0x1, %bpl
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x5730
xorl %ebp, %ebp
movq 0x1f3f3(%rip), %rsi     # 0x2bff0
movq 0x1f38c(%rip), %rdx     # 0x2bf90
movq %rbx, %rdi
callq 0x5760
jmp 0xcccc
movl $0x10, %edi
callq 0x5240
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
movl %ebp, %esi
callq 0xe5d0
leaq 0x1595e(%rip), %rsi     # 0x2258f
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xe560
leaq 0x15950(%rip), %rsi     # 0x22597
leaq 0x60(%rsp), %rdi
callq 0x5840
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xcc72
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0xcc7f
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rsp, %rdi
movq %r14, %rdx
callq 0xe506
movb $0x1, %bpl
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x5730
xorl %ebp, %ebp
movq 0x1f333(%rip), %rsi     # 0x2bff0
movq 0x1f2cc(%rip), %rdx     # 0x2bf90
movq %rbx, %rdi
callq 0x5760
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xccf2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
jmp 0xccf2
movq %rax, %r14
movb $0x1, %bpl
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0xcd11
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5470
jmp 0xcd11
movq %rax, %r14
movb $0x1, %bpl
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcd34
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5470
jmp 0xcd34
movq %rax, %r14
movb $0x1, %bpl
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcd71
movq 0x50(%rsp), %rsi
jmp 0xcd61
jmp 0xcd6b
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcd71
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
jmp 0xcd71
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0xcd85
movq %rbx, %rdi
callq 0x5390
jmp 0xcd85
jmp 0xcd82
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x5120
movq %r14, %rdi
callq 0x5790