// File: /workspace/github_cpp_makefile_star2_O3/saumya-prakash[P]AssemblerEmulator/Emulator.cpp
// Function: Emulator::current_state[abi:cxx11]() const
string Emulator::current_state() const
{
    ostringstream oss;

    oss<<setw(11)<<"PC = "<<PC<<"   ";
    oss<<setw(11)<<"SP = "<<SP<<"   ";
    oss<<setw(11)<<"A = "<<A<<"   ";
    oss<<setw(11)<<"B = "<<B<<"   ";
    
    oss<<"Memory Content = "<<"0x"<<setw(8)<<setfill('0')<<hex<<mempory_space[PC]<<dec<<setfill(' ')<<"   ";

    oss<<" "<<reverse_decode(mempory_space[PC]);


    return oss.str();

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x2200
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x30(%rsp,%rax)
leaq 0x26af(%rip), %rsi      # 0x74f3
movl $0x5, %edx
movq %r15, %rdi
callq 0x21b0
movl 0x28(%r14), %esi
leaq 0x20(%rsp), %rdi
callq 0x2260
leaq 0x2693(%rip), %rsi      # 0x74f9
movl $0x3, %edx
movq %rax, %rdi
callq 0x21b0
leaq 0x20(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x30(%rsp,%rax)
leaq 0x26cb(%rip), %rsi      # 0x755a
movl $0x5, %edx
callq 0x21b0
movl 0x2c(%r14), %esi
leaq 0x20(%rsp), %rdi
callq 0x2260
leaq 0x264b(%rip), %rsi      # 0x74f9
movl $0x3, %edx
movq %rax, %rdi
callq 0x21b0
leaq 0x20(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x30(%rsp,%rax)
leaq 0x2689(%rip), %rsi      # 0x7560
movl $0x4, %edx
callq 0x21b0
movl 0x20(%r14), %esi
leaq 0x20(%rsp), %rdi
callq 0x2260
leaq 0x2603(%rip), %rsi      # 0x74f9
movl $0x3, %edx
movq %rax, %rdi
callq 0x21b0
leaq 0x20(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x30(%rsp,%rax)
leaq 0x2646(%rip), %rsi      # 0x7565
movl $0x4, %edx
callq 0x21b0
movl 0x24(%r14), %esi
leaq 0x20(%rsp), %rdi
callq 0x2260
leaq 0x25bb(%rip), %rsi      # 0x74f9
movl $0x3, %edx
movq %rax, %rdi
callq 0x21b0
leaq 0x25ab(%rip), %rsi      # 0x74fd
leaq 0x20(%rsp), %rdi
movl $0x11, %edx
callq 0x21b0
leaq 0x25a7(%rip), %rsi      # 0x750f
leaq 0x20(%rsp), %rdi
movl $0x2, %edx
callq 0x21b0
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rcx
movq $0x8, 0x30(%rsp,%rcx)
movq -0x18(%rax), %rcx
leaq (%rsp,%rcx), %r15
addq $0x20, %r15
cmpb $0x0, 0xe1(%r15)
jne 0x4fb9
movq %r15, %rdi
movl $0x20, %esi
callq 0x2170
movb $0x1, 0xe1(%r15)
movq 0x20(%rsp), %rax
movb $0x30, 0xe0(%r15)
movq -0x18(%rax), %rax
movl 0x38(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x38(%rsp,%rax)
movq 0x30(%r14), %rax
movslq 0x28(%r14), %rcx
movl (%rax,%rcx,4), %esi
leaq 0x20(%rsp), %rdi
callq 0x2260
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r15,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%r15,%rcx)
movq -0x18(%rax), %rax
movq %r15, %r12
addq %rax, %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x502d
movq %r12, %rdi
movl $0x20, %esi
callq 0x2170
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
leaq 0x24bc(%rip), %rsi      # 0x74f9
movl $0x3, %edx
movq %r15, %rdi
callq 0x21b0
leaq 0x24aa(%rip), %rsi      # 0x74fb
leaq 0x20(%rsp), %rdi
movl $0x1, %edx
callq 0x21b0
movq 0x30(%r14), %rax
movslq 0x28(%r14), %rcx
movl (%rax,%rcx,4), %edx
movq %rsp, %rdi
callq 0x5806
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50a1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x2230
movq 0x4f13(%rip), %rsi      # 0x9fc8
leaq 0x20(%rsp), %rdi
callq 0x20d0
leaq 0x90(%rsp), %rdi
callq 0x20a0
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5103
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x5103
jmp 0x5100
movq %rax, %rbx
movq 0x4ebe(%rip), %rsi      # 0x9fc8
leaq 0x20(%rsp), %rdi
callq 0x20d0
leaq 0x90(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2270
nop