// File: /workspace/github_cpp_makefile_star2_O2/sthapliyal37[P]Microprocessor_8085_Updated/DataTransfer.cpp
// Function: MOV(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void MOV (string instruction,string instruction2,string* registers,bool* flag,map<string,string> &memory)
{
	int length=instruction.length();
	int length2=instruction2.length();
	if(length==1&&length2==1)
	{
        if(instruction=="M"&&instruction2!="M")
        {
            if(validityRegisters(instruction2))
            {
                string address=registers[5]+registers[6];
                memory[address]=registers[registerNumber(instruction2)];
            }
        }
        else if(instruction!="M" && instruction2=="M")
        {
            if(validityRegisters(instruction))
            {
                string address=registers[5]+registers[6];
                registers[registerNumber(instruction)]=memory[address];
            }
        }
        else if(instruction!="M"&&instruction2!="M")
        {
            if(validityRegisters(instruction2)&&validityRegisters(instruction)){
               registers[registerNumber(instruction)]=registers[registerNumber(instruction2)];
		   }
		 }
		 }  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
cmpl $0x1, 0x8(%rdi)
jne 0x82ae
movq %rsi, %r15
movl 0x8(%rsi), %eax
cmpl $0x1, %eax
jne 0x82ae
movq %r8, %r12
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x1fd1(%rip), %rsi      # 0xa010
callq 0x2f0d
testb %al, %al
je 0x80f7
leaq 0x1fbd(%rip), %rsi      # 0xa010
movq %r15, %rdi
callq 0x71be
testb %al, %al
je 0x80f7
leaq -0x140(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x2280
movq %r14, %rdi
callq 0x262c
movl %eax, %r14d
leaq -0x140(%rbp), %rdi
callq 0x20f0
testb %r14b, %r14b
je 0x82ae
leaq 0xa0(%rbx), %rsi
leaq 0xc0(%rbx), %rdx
leaq -0x40(%rbp), %rdi
callq 0x71f4
leaq -0xe0(%rbp), %rdi
movq %r15, %rsi
callq 0x2280
leaq -0xe0(%rbp), %rdi
callq 0x2740
movl %eax, %r14d
leaq -0x40(%rbp), %rsi
movq %r12, %rdi
callq 0x724c
movslq %r14d, %rcx
shlq $0x5, %rcx
addq %rcx, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2120
leaq -0xe0(%rbp), %rdi
jmp 0x81b5
leaq 0x1f12(%rip), %rsi      # 0xa010
movq %r14, %rdi
callq 0x71be
testb %al, %al
je 0x81c3
leaq 0x1efb(%rip), %rsi      # 0xa010
movq %r15, %rdi
callq 0x2f0d
testb %al, %al
je 0x81c3
leaq -0x120(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2280
movq %r15, %rdi
callq 0x262c
movl %eax, %r15d
leaq -0x120(%rbp), %rdi
callq 0x20f0
testb %r15b, %r15b
je 0x82ae
leaq 0xa0(%rbx), %rsi
leaq 0xc0(%rbx), %rdx
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x71f4
movq %r12, %rdi
movq %r15, %rsi
callq 0x724c
movq %rax, %r15
leaq -0xc0(%rbp), %rdi
movq %r14, %rsi
callq 0x2280
leaq -0xc0(%rbp), %rdi
callq 0x2740
cltq
shlq $0x5, %rax
addq %rax, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2120
leaq -0xc0(%rbp), %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
jmp 0x82a9
leaq 0x1e46(%rip), %rsi      # 0xa010
movq %r14, %rdi
callq 0x71be
testb %al, %al
je 0x82ae
leaq 0x1e2f(%rip), %rsi      # 0xa010
movq %r15, %rdi
callq 0x71be
testb %al, %al
je 0x82ae
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2280
movq %r12, %rdi
callq 0x262c
testb %al, %al
je 0x82a2
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0x2280
leaq -0x80(%rbp), %rdi
callq 0x262c
movl %eax, %r12d
leaq -0x80(%rbp), %rdi
callq 0x20f0
leaq -0xa0(%rbp), %rdi
callq 0x20f0
testb %r12b, %r12b
je 0x82ae
leaq -0x100(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2280
movq %r12, %rdi
callq 0x2740
movl %eax, %r15d
leaq -0x60(%rbp), %rdi
movq %r14, %rsi
callq 0x2280
leaq -0x60(%rbp), %rdi
callq 0x2740
movslq %r15d, %rsi
shlq $0x5, %rsi
addq %rbx, %rsi
movslq %eax, %rdi
shlq $0x5, %rdi
addq %rbx, %rdi
callq 0x2120
leaq -0x60(%rbp), %rdi
callq 0x20f0
leaq -0x100(%rbp), %rdi
jmp 0x82a9
leaq -0xa0(%rbp), %rdi
callq 0x20f0
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x20f0
jmp 0x82cf
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
jmp 0x8330
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x20f0
jmp 0x8308
jmp 0x82f4
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
jmp 0x8327
movq %rax, %rbx
jmp 0x832c
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
jmp 0x8330
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
jmp 0x8330
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
jmp 0x8330
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2310