// File: s0sasaki[P]ExecutableBlockchain/vm.cpp
// Function: VM::displayState() const
void VM::displayState() const {
    std::cout << std::endl;
    std::cout << "ib="   << std::setw(4) << std::right << ib      << ", " ;
    std::cout << "ip="   << std::setw(4) << std::right << ip      << ", " ;
    std::cout << "rsp="  << std::setw(4) << std::right << rsp     << ", " ;
    std::cout << "psp="  << std::setw(4) << std::right << psp     << ", " ;
    std::cout << "fnum=" << std::setw(4) << std::right << mem[ip] << ", " ;
    displayOp(mem[ip]);
    for(int32_t i = 0; i <= psp; i++) {
        std::cout << data_stack[i] << " ";
    }
    std::cout << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x6cb5(%rip), %rdi      # 0x11fd0
movq 0x6c9e(%rip), %rsi      # 0x11fc0
callq 0x2250
movq 0x6ca2(%rip), %rdi      # 0x11fd0
leaq 0x10d4(%rip), %rsi      # 0xc409
callq 0x2210
movq %rax, -0x50(%rbp)
movl $0x4, %edi
callq 0xb580
movq -0x50(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
callq 0x2280
movq %rax, %rdi
leaq 0x23f(%rip), %rsi       # 0xb5a0
callq 0x20a0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl (%rax), %esi
callq 0x2340
movq %rax, %rdi
leaq 0x108f(%rip), %rsi      # 0xc40d
callq 0x2210
movq 0x6c46(%rip), %rdi      # 0x11fd0
leaq 0x107f(%rip), %rsi      # 0xc410
callq 0x2210
movq %rax, -0x48(%rbp)
movl $0x4, %edi
callq 0xb580
movq -0x48(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0x2280
movq %rax, %rdi
leaq 0x1e3(%rip), %rsi       # 0xb5a0
callq 0x20a0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x2340
movq %rax, %rdi
leaq 0x1032(%rip), %rsi      # 0xc40d
callq 0x2210
movq 0x6be9(%rip), %rdi      # 0x11fd0
leaq 0x1026(%rip), %rsi      # 0xc414
callq 0x2210
movq %rax, -0x40(%rbp)
movl $0x4, %edi
callq 0xb580
movq -0x40(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0x2280
movq %rax, %rdi
leaq 0x186(%rip), %rsi       # 0xb5a0
callq 0x20a0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x2340
movq %rax, %rdi
leaq 0xfd5(%rip), %rsi       # 0xc40d
callq 0x2210
movq 0x6b8c(%rip), %rdi      # 0x11fd0
leaq 0xfce(%rip), %rsi       # 0xc419
callq 0x2210
movq %rax, -0x38(%rbp)
movl $0x4, %edi
callq 0xb580
movq -0x38(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0x2280
movq %rax, %rdi
leaq 0x129(%rip), %rsi       # 0xb5a0
callq 0x20a0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x2340
movq %rax, %rdi
leaq 0xf78(%rip), %rsi       # 0xc40d
callq 0x2210
movq 0x6b2f(%rip), %rdi      # 0x11fd0
leaq 0xf76(%rip), %rsi       # 0xc41e
callq 0x2210
movq %rax, -0x30(%rbp)
movl $0x4, %edi
callq 0xb580
movq -0x30(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0x2280
movq %rax, %rdi
leaq 0xcc(%rip), %rsi        # 0xb5a0
callq 0x20a0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movslq 0x4(%rax), %rcx
movl 0x1020(%rax,%rcx,4), %esi
callq 0x2340
movq %rax, %rdi
leaq 0xf13(%rip), %rsi       # 0xc40d
callq 0x2210
movq -0x28(%rbp), %rdi
movq %rdi, %rsi
addq $0x1020, %rsi           # imm = 0x1020
movslq 0x4(%rdi), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0xaf00
movl $0x0, -0x20(%rbp)
movq -0x28(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl 0xc(%rcx), %eax
jg 0xb565
movq -0x28(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl 0x4020(%rax,%rcx,4), %esi
movq 0x6a8a(%rip), %rdi      # 0x11fd0
callq 0x2340
movq %rax, %rdi
leaq 0xe07(%rip), %rsi       # 0xc35c
callq 0x2210
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xb524
movq 0x6a64(%rip), %rdi      # 0x11fd0
movq 0x6a4d(%rip), %rsi      # 0x11fc0
callq 0x2250
addq $0x50, %rsp
popq %rbp
retq
nop