// File: /workspace/github_cpp_makefile_star2_O2/sthapliyal37[P]Microprocessor_8085_Updated/arithmetic.cpp
// Function: INR(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 INR(string instruction,string* registers,bool* flag,map<string,string> &memory)
{
	int length = instruction.length();
	if(length == 1){
	
		if(validityRegisters(instruction)){
		
			if(instruction != "M"){
				int registerID = registerNumber(instruction);
				registers[registerID] = hexAdd(registers[registerID],"01",flag,false); 
			}
			else{
				string address = "";
				address = address + registers[5] + registers[6];
				if(validityAddress(address)){
				
					memory[address] = hexAdd(memory[address],"01",flag,false);
				}
					else{
					
					cout<<"Error:\n";
					exit(0);
				}
			}
			}
			}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
cmpl $0x1, 0x8(%rdi)
jne 0x5fac
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq -0x168(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x2280
movq %r13, %rdi
callq 0x262c
movl %eax, %r13d
leaq -0x168(%rbp), %rdi
callq 0x20f0
testb %r13b, %r13b
je 0x5fac
leaq 0x424e(%rip), %rsi      # 0xa010
movq %r12, %rdi
callq 0x71be
testb %al, %al
je 0x5e77
leaq -0x148(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x2280
movq %r14, %rdi
callq 0x2740
movl %eax, %r14d
leaq -0x148(%rbp), %rdi
callq 0x20f0
movslq %r14d, %rax
shlq $0x5, %rax
addq %rax, %r15
leaq -0x128(%rbp), %rdi
movq %r15, %rsi
callq 0x2280
leaq 0x4389(%rip), %rsi      # 0xa1a4
leaq -0x108(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x2f1e
leaq -0x48(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x108(%rbp), %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x3b76
leaq -0x48(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x20f0
leaq -0x108(%rbp), %rdi
callq 0x20f0
leaq -0x128(%rbp), %rdi
jmp 0x5fa7
leaq 0x4384(%rip), %rsi      # 0xa202
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x2f1e
leaq 0xa0(%r15), %rdx
leaq -0x88(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x71f4
addq $0xc0, %r15
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %r15, %rdx
callq 0x71cb
leaq -0x48(%rbp), %r15
leaq -0x68(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2250
movq %r12, %rdi
callq 0x20f0
leaq -0x88(%rbp), %rdi
callq 0x20f0
leaq -0xe8(%rbp), %rdi
movq %r15, %rsi
callq 0x2280
leaq -0xe8(%rbp), %rdi
callq 0x2915
movl %eax, %r15d
leaq -0xe8(%rbp), %rdi
callq 0x20f0
testb %r15b, %r15b
je 0x5fbe
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x724c
leaq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x2280
leaq 0x426c(%rip), %rsi      # 0xa1a4
leaq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x2f1e
leaq -0x68(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x3b76
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x724c
leaq -0x68(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x20f0
leaq -0xa8(%rbp), %rdi
callq 0x20f0
leaq -0xc8(%rbp), %rdi
callq 0x20f0
leaq -0x48(%rbp), %rdi
callq 0x20f0
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x800b(%rip), %rdi      # 0xdfd0
leaq 0x4226(%rip), %rsi      # 0xa1f2
callq 0x21e0
xorl %edi, %edi
callq 0x2240
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x20f0
jmp 0x5fe9
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x20f0
jmp 0x5ffa
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
jmp 0x6019
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
jmp 0x6019
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x20f0
jmp 0x6055
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x20f0
jmp 0x6036
jmp 0x6052
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
jmp 0x6065
movq %rax, %rbx
jmp 0x606a
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
jmp 0x6065
jmp 0x6052
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
jmp 0x6065
movq %rax, %rbx
leaq -0x168(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2310