// File: /workspace/github_cpp_makefile_star2_O3/salihbektas[P]Simple-CPU-emulator/computer.cpp
// Function: Computer::execute()
void Computer::execute()
{
    while(!myCPU.halted())
    {

        string instruction = myCpuProgram.getLine(myCPU.getPC()-1);

        myCPU.execute(instruction, myMemory);
        //Register debug mode part
        if(debug > 0)
        {
            cout <<"R1 = "<<myCPU.getR1()<<' '<<"R2 = "<<myCPU.getR2()<<' '
                 <<"R3 = "<<myCPU.getR3()<<' '<<"R4 = "<<myCPU.getR4()<<' '
                 <<"R5 = "<<myCPU.getR5()<<endl;

        }
        //Memory debug mode part
        if(debug == 2)
        {

            for(int i = 0; i < 50; i += 5){
                cout << "memory" << i+1 << " : " << myMemory.getMem(i)
                     << " memory" << i+2 << " : " << myMemory.getMem(i+1)
                     << " memory" << i+3 << " : " << myMemory.getMem(i+2)
                     << " memory" << i+4 << " : " << myMemory.getMem(i+3)
                     << " memory" << i+5 << " : " << myMemory.getMem(i+4)
                     <<endl;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
callq 0x6d78
testb %al, %al
jne 0x86df
leaq 0x20(%rbx), %rax
movq %rax, -0x40(%rbp)
leaq 0x50(%rbx), %r15
leaq 0xf92(%rip), %r13       # 0x92c2
leaq 0xf8f(%rip), %r14       # 0x92c6
movq %rbx, -0x38(%rbp)
movq %rbx, %rdi
callq 0x284c
leal -0x1(%rax), %edx
leaq -0x80(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x73d2
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %rdi
callq 0x6d88
movq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movq %r15, %rdx
callq 0x2aca
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x8391
callq 0x2110
movq -0x38(%rbp), %rax
cmpl $0x0, 0x118(%rax)
jle 0x86b9
movl $0x5, %edx
movq 0x3c22(%rip), %rdi      # 0xbfd0
leaq 0xe12(%rip), %rsi       # 0x91c7
callq 0x2130
movq -0x38(%rbp), %rdi
callq 0x281c
movq 0x3c06(%rip), %rdi      # 0xbfd0
movl %eax, %esi
callq 0x21b0
movb $0x20, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2130
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0xdd5(%rip), %rsi       # 0x91cd
callq 0x2130
movq -0x38(%rbp), %rdi
callq 0x2824
movq %rbx, %rdi
movl %eax, %esi
callq 0x21b0
movb $0x20, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2130
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0xd9c(%rip), %rsi       # 0x91d3
callq 0x2130
movq -0x38(%rbp), %rdi
callq 0x282e
movq %rbx, %rdi
movl %eax, %esi
callq 0x21b0
movb $0x20, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2130
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0xd63(%rip), %rsi       # 0x91d9
callq 0x2130
movq -0x38(%rbp), %rdi
callq 0x2838
movq %rbx, %rdi
movl %eax, %esi
callq 0x21b0
movb $0x20, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
leaq -0x29(%rbp), %rsi
callq 0x2130
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0xd2a(%rip), %rsi       # 0x91df
callq 0x2130
movq -0x38(%rbp), %rdi
callq 0x2842
movq %rbx, %rdi
movl %eax, %esi
callq 0x21b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20c0
movq -0x38(%rbp), %rax
cmpl $0x2, 0x118(%rax)
jne 0x86b9
xorl %ebx, %ebx
cmpl $0x31, %ebx
ja 0x86b9
movl $0x6, %edx
movq 0x3ab1(%rip), %rdi      # 0xbfd0
leaq 0xda1(%rip), %rsi       # 0x92c7
callq 0x2130
incl %ebx
movq 0x3a9c(%rip), %rdi      # 0xbfd0
movl %ebx, %esi
callq 0x21b0
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2130
decl %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x2690
movq %r12, %rdi
movl %eax, %esi
callq 0x21b0
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2130
addl $0x2, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x21b0
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2130
decl %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x2690
movq %r12, %rdi
movl %eax, %esi
callq 0x21b0
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2130
addl $0x2, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x21b0
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2130
decl %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x2690
movq %r12, %rdi
movl %eax, %esi
callq 0x21b0
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2130
addl $0x2, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x21b0
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2130
decl %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x2690
movq %r12, %rdi
movl %eax, %esi
callq 0x21b0
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2130
addl $0x2, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x21b0
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2130
decl %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x2690
movq %r12, %rdi
movl %eax, %esi
callq 0x21b0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
incl %ebx
movq %rax, %rdi
callq 0x20c0
jmp 0x850a
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x86cb
callq 0x2110
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x6d78
testb %al, %al
je 0x833b
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x870a
callq 0x2110
jmp 0x870a
jmp 0x8707
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x871c
callq 0x2110
movq %rbx, %rdi
callq 0x21c0