// File: JayWalker512[P]JayParser/VM.cpp
// Function: VM::execJMP()
void VM::execJMP()
{
	readNextInstruction();	// Using instruction as buffer for the ID
	
	m_program->seekg(0, std::ios_base::beg);
	
	do {
		if ((unsigned char)m_program->get() == JMPMK)
			if ((unsigned char)m_program->get() == m_instruction)
				return;	// Marker is found
	} while (!m_program->eof());
	
	m_log->add(new Error(FATAL + FILEERR + 3, "Trying to read pass the end of file."));
	m_log->add(new Error(FATAL + PARSERR + 2, "Jump marker not found."));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x45b0
movq -0x70(%rbp), %rax
movq 0x40040(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x21f0
movq -0x70(%rbp), %rax
movq 0x40040(%rax), %rdi
callq 0x21c0
movzbl %al, %eax
cmpl $0x8, %eax
jne 0x48f0
movq -0x70(%rbp), %rax
movq 0x40040(%rax), %rdi
callq 0x21c0
movq -0x70(%rbp), %rcx
movzbl %al, %eax
cmpl 0x40028(%rcx), %eax
jne 0x48ee
jmp 0x4a24
jmp 0x48f0
jmp 0x48f2
movq -0x70(%rbp), %rax
movq 0x40040(%rax), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x22b0
xorb $-0x1, %al
testb $0x1, %al
jne 0x48b2
movq -0x70(%rbp), %rax
movq 0x40048(%rax), %rax
movq %rax, -0x88(%rbp)
movl $0x28, %edi
callq 0x2150
movq %rax, -0x80(%rbp)
movb $0x1, -0x3d(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x2280
movq -0x78(%rbp), %rdx
leaq 0x858(%rip), %rsi       # 0x51a3
leaq -0x28(%rbp), %rdi
callq 0x2820
jmp 0x4956
movq -0x80(%rbp), %rdi
movl $0x80ffff03, %esi       # imm = 0x80FFFF03
leaq -0x28(%rbp), %rdx
callq 0x28d0
jmp 0x496a
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdi
movb $0x0, -0x3d(%rbp)
callq 0x27f0
jmp 0x4980
leaq -0x28(%rbp), %rdi
callq 0x20c0
leaq -0x29(%rbp), %rdi
callq 0x2190
movq -0x70(%rbp), %rax
movq 0x40048(%rax), %rax
movq %rax, -0xa0(%rbp)
movl $0x28, %edi
callq 0x2150
movq %rax, -0x98(%rbp)
movb $0x1, -0x62(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x2280
movq -0x90(%rbp), %rdx
leaq 0x7f1(%rip), %rsi       # 0x51c8
leaq -0x60(%rbp), %rdi
callq 0x2820
jmp 0x49e2
movq -0x98(%rbp), %rdi
movl $0x80ffee02, %esi       # imm = 0x80FFEE02
leaq -0x60(%rbp), %rdx
callq 0x28d0
jmp 0x49f9
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdi
movb $0x0, -0x62(%rbp)
callq 0x27f0
jmp 0x4a12
leaq -0x60(%rbp), %rdi
callq 0x20c0
leaq -0x61(%rbp), %rdi
callq 0x2190
addq $0xa0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4a50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x20c0
leaq -0x29(%rbp), %rdi
callq 0x2190
testb $0x1, -0x3d(%rbp)
jne 0x4a61
jmp 0x4a6f
movq -0x80(%rbp), %rdi
movl $0x28, %esi
callq 0x2160
jmp 0x4ab8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4a94
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x20c0
leaq -0x61(%rbp), %rdi
callq 0x2190
testb $0x1, -0x62(%rbp)
jne 0x4aa5
jmp 0x4ab6
movq -0x98(%rbp), %rdi
movl $0x28, %esi
callq 0x2160
jmp 0x4ab8
movq -0x38(%rbp), %rdi
callq 0x2270
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)