// File: 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:
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, 0xd8(%rsp)
movq %rdi, %rax
movq %rax, 0xe0(%rsp)
movq %rdi, 0x2c0(%rsp)
movq %rsi, 0x2b8(%rsp)
movq 0x2b8(%rsp), %rax
movq %rax, 0xe8(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x2310
movl $0xb, %edi
callq 0x75a0
movl %eax, 0xf4(%rsp)
jmp 0x5a5a
movl 0xf4(%rsp), %eax
movl %eax, 0x13c(%rsp)
movl 0x13c(%rsp), %esi
leaq 0x140(%rsp), %rdi
callq 0x2290
movq %rax, 0xd0(%rsp)
jmp 0x5a86
movq 0xd0(%rsp), %rdi
leaq 0x4aa0(%rip), %rsi      # 0xa535
callq 0x21f0
movq %rax, 0xc8(%rsp)
jmp 0x5aa4
movq 0xc8(%rsp), %rdi
movq 0xe8(%rsp), %rax
movl 0x28(%rax), %esi
callq 0x2380
movq %rax, 0xc0(%rsp)
jmp 0x5ac6
movq 0xc0(%rsp), %rdi
leaq 0x4a66(%rip), %rsi      # 0xa53b
callq 0x21f0
jmp 0x5adc
movl $0xb, %edi
callq 0x75a0
movl %eax, 0xbc(%rsp)
jmp 0x5aef
movl 0xbc(%rsp), %eax
movl %eax, 0x128(%rsp)
movl 0x128(%rsp), %esi
leaq 0x140(%rsp), %rdi
callq 0x2290
movq %rax, 0xb0(%rsp)
jmp 0x5b1b
movq 0xb0(%rsp), %rdi
leaq 0x4a72(%rip), %rsi      # 0xa59c
callq 0x21f0
movq %rax, 0xa8(%rsp)
jmp 0x5b39
movq 0xa8(%rsp), %rdi
movq 0xe8(%rsp), %rax
movl 0x2c(%rax), %esi
callq 0x2380
movq %rax, 0xa0(%rsp)
jmp 0x5b5b
movq 0xa0(%rsp), %rdi
leaq 0x49d1(%rip), %rsi      # 0xa53b
callq 0x21f0
jmp 0x5b71
movl $0xb, %edi
callq 0x75a0
movl %eax, 0x9c(%rsp)
jmp 0x5b84
movl 0x9c(%rsp), %eax
movl %eax, 0x124(%rsp)
movl 0x124(%rsp), %esi
leaq 0x140(%rsp), %rdi
callq 0x2290
movq %rax, 0x90(%rsp)
jmp 0x5bb0
movq 0x90(%rsp), %rdi
leaq 0x49e3(%rip), %rsi      # 0xa5a2
callq 0x21f0
movq %rax, 0x88(%rsp)
jmp 0x5bce
movq 0x88(%rsp), %rdi
movq 0xe8(%rsp), %rax
movl 0x20(%rax), %esi
callq 0x2380
movq %rax, 0x80(%rsp)
jmp 0x5bf0
movq 0x80(%rsp), %rdi
leaq 0x493c(%rip), %rsi      # 0xa53b
callq 0x21f0
jmp 0x5c06
movl $0xb, %edi
callq 0x75a0
movl %eax, 0x7c(%rsp)
jmp 0x5c16
movl 0x7c(%rsp), %eax
movl %eax, 0x120(%rsp)
movl 0x120(%rsp), %esi
leaq 0x140(%rsp), %rdi
callq 0x2290
movq %rax, 0x70(%rsp)
jmp 0x5c3c
movq 0x70(%rsp), %rdi
leaq 0x495f(%rip), %rsi      # 0xa5a7
callq 0x21f0
movq %rax, 0x68(%rsp)
jmp 0x5c54
movq 0x68(%rsp), %rdi
movq 0xe8(%rsp), %rax
movl 0x24(%rax), %esi
callq 0x2380
movq %rax, 0x60(%rsp)
jmp 0x5c70
movq 0x60(%rsp), %rdi
leaq 0x48bf(%rip), %rsi      # 0xa53b
callq 0x21f0
jmp 0x5c83
leaq 0x48b5(%rip), %rsi      # 0xa53f
leaq 0x140(%rsp), %rdi
callq 0x21f0
movq %rax, 0x58(%rsp)
jmp 0x5c9e
movq 0x58(%rsp), %rdi
leaq 0x48a7(%rip), %rsi      # 0xa551
callq 0x21f0
movq %rax, 0x50(%rsp)
jmp 0x5cb6
movl $0x8, %edi
callq 0x75a0
movl %eax, 0x4c(%rsp)
jmp 0x5cc6
movq 0x50(%rsp), %rdi
movl 0x4c(%rsp), %eax
movl %eax, 0x11c(%rsp)
movl 0x11c(%rsp), %esi
callq 0x2290
movq %rax, 0x40(%rsp)
jmp 0x5ce9
movl $0x30, %edi
callq 0x75c0
movb %al, 0x3f(%rsp)
jmp 0x5cf9
movq 0x40(%rsp), %rdi
movb 0x3f(%rsp), %al
movb %al, 0x11b(%rsp)
movzbl 0x11b(%rsp), %esi
callq 0x2350
movq %rax, 0x30(%rsp)
jmp 0x5d1d
movq 0x30(%rsp), %rdi
leaq 0x18b7(%rip), %rsi      # 0x75e0
callq 0x20b0
movq %rax, 0x28(%rsp)
jmp 0x5d35
movq 0x28(%rsp), %rdi
movq 0xe8(%rsp), %rcx
movq 0x30(%rcx), %rax
movslq 0x28(%rcx), %rcx
movl (%rax,%rcx,4), %esi
callq 0x2380
movq %rax, 0x20(%rsp)
jmp 0x5d59
movq 0x20(%rsp), %rdi
leaq 0x189b(%rip), %rsi      # 0x7600
callq 0x20b0
movq %rax, 0x18(%rsp)
jmp 0x5d71
movl $0x20, %edi
callq 0x75c0
movb %al, 0x17(%rsp)
jmp 0x5d81
movq 0x18(%rsp), %rdi
movb 0x17(%rsp), %al
movb %al, 0x11a(%rsp)
movzbl 0x11a(%rsp), %esi
callq 0x2350
movq %rax, 0x8(%rsp)
jmp 0x5da5
movq 0x8(%rsp), %rdi
leaq 0x478a(%rip), %rsi      # 0xa53b
callq 0x21f0
jmp 0x5db8
leaq 0x477e(%rip), %rsi      # 0xa53d
leaq 0x140(%rsp), %rdi
callq 0x21f0
movq %rax, (%rsp)
jmp 0x5dd2
movq 0xe8(%rsp), %rsi
movq 0x30(%rsi), %rax
movslq 0x28(%rsi), %rcx
movl (%rax,%rcx,4), %edx
leaq 0xf8(%rsp), %rdi
callq 0x64c0
jmp 0x5df4
movq (%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x21d0
jmp 0x5e07
leaq 0xf8(%rsp), %rdi
callq 0x2140
movq 0xd8(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x2220
jmp 0x5e2b
leaq 0x140(%rsp), %rdi
callq 0x2080
movq 0xe0(%rsp), %rax
addq $0x2c8, %rsp            # imm = 0x2C8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
jmp 0x5e7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x2140
leaq 0x140(%rsp), %rdi
callq 0x2080
movq 0x130(%rsp), %rdi
callq 0x2390
nopl (%rax)