// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdx, %rax
movq 0x8(%rdi), %rdx
cmpl $0x1, %edx
jne 0x8173
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rax, -0x30(%rbp)
leaq -0x160(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rdi), %rsi
addq %rsi, %rdx
leaq -0x170(%rbp), %r13
movq %r13, %rdi
callq 0x3224
movq %r13, %rdi
callq 0x265c
movl %eax, %r13d
movq -0x170(%rbp), %rdi
cmpq %rbx, %rdi
je 0x7e21
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
movq -0x30(%rbp), %rbx
je 0x8173
leaq 0x61db(%rip), %rsi      # 0xe010
movq %r12, %rdi
callq 0x20a0
testl %eax, %eax
je 0x7f5f
leaq -0x140(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x150(%rbp), %r14
movq %r14, %rdi
callq 0x3224
movq %r14, %rdi
callq 0x2778
movl %eax, %r14d
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
je 0x7e91
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x2210
movslq %r14d, %r13
shlq $0x5, %r13
leaq -0x100(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%r15,%r13), %rsi
movq 0x8(%r15,%r13), %rdx
addq %rsi, %rdx
leaq -0x110(%rbp), %rdi
callq 0x3224
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x62d6(%rip), %rsi      # 0xe1a4
leaq 0x62d1(%rip), %rdx      # 0xe1a6
leaq -0xf0(%rbp), %rdi
callq 0x32be
leaq -0x50(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x44ff
addq %r13, %r15
leaq -0x50(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2270
movq (%rbx), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x7f28
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x7f43
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0x8173
movq -0x100(%rbp), %rsi
jmp 0x816b
leaq -0x40(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x6294(%rip), %rdx      # 0xe202
leaq -0x50(%rbp), %rdi
movq %rdx, %rsi
callq 0x32be
leaq 0xa0(%r15), %rdx
leaq -0x130(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa216
movq 0xc0(%r15), %rsi
movq 0xc8(%r15), %rdx
leaq -0x130(%rbp), %rdi
callq 0x20b0
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7fcf
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x7fd7
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x70(%rbp), %r15
movq %rdx, 0x8(%r15)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x2270
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x8012
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8031
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0xc0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x3224
leaq -0xd0(%rbp), %rdi
callq 0x2991
movl %eax, %r15d
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x807e
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r15b, %r15b
je 0x8185
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0xa27a
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x3224
leaq -0xa0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x60e0(%rip), %rsi      # 0xe1a4
leaq 0x60db(%rip), %rdx      # 0xe1a6
leaq -0xb0(%rbp), %rdi
callq 0x32be
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
movq -0x30(%rbp), %rcx
xorl %r8d, %r8d
callq 0x44ff
movq %rbx, %r15
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0xa27a
leaq -0x70(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2270
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x8127
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8142
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x815e
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x8173
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9e44(%rip), %rdi      # 0x11fd0
leaq 0x605f(%rip), %rsi      # 0xe1f2
callq 0x21f0
xorl %edi, %edi
callq 0x2260
movq %rax, -0x30(%rbp)
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x81c1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x81c1
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0x81e5
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x81e5
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x82ae
movq -0x80(%rbp), %rsi
jmp 0x823d
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x82ae
movq -0xc0(%rbp), %rsi
jmp 0x823d
movq %rbx, %r15
movq %rax, -0x30(%rbp)
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x82ae
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x82ae
jmp 0x82a7
movq %rax, -0x30(%rbp)
jmp 0x82dc
jmp 0x82a7
movq %rax, -0x30(%rbp)
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8279
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x8279
movq %rax, -0x30(%rbp)
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0x82dc
movq -0x100(%rbp), %rsi
jmp 0x82d4
movq %rax, -0x30(%rbp)
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
je 0x82dc
movq -0x140(%rbp), %rsi
jmp 0x82d4
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x82dc
movq -0x40(%rbp), %rsi
jmp 0x82d4
movq %rax, -0x30(%rbp)
movq -0x170(%rbp), %rdi
cmpq %rbx, %rdi
je 0x82dc
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x30(%rbp), %rdi
callq 0x2320