// File: 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
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x1d8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
callq 0x33b0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
jne 0xc6db
movq -0x1d8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x3110
movq -0x1e8(%rbp), %rdi
callq 0x3800
movb %al, -0x1d9(%rbp)
jmp 0xc25f
leaq -0x48(%rbp), %rdi
callq 0x3190
movb -0x1d9(%rbp), %al
testb $0x1, %al
jne 0xc277
jmp 0xc6d9
movq -0x1d8(%rbp), %rdi
leaq 0x8d8b(%rip), %rsi      # 0x15010
callq 0xe630
testb $0x1, %al
jne 0xc293
jmp 0xc404
movq -0x1d8(%rbp), %rsi
leaq -0x78(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x3110
movq -0x1f8(%rbp), %rdi
callq 0x3970
movl %eax, -0x1ec(%rbp)
jmp 0xc2be
leaq -0x78(%rbp), %rdi
callq 0x3190
movl -0x1ec(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rsi
movslq -0x58(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x3110
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x3440
movq -0x200(%rbp), %rdx
leaq 0x8e98(%rip), %rsi      # 0x151a4
leaq -0xd8(%rbp), %rdi
callq 0x50d0
jmp 0xc31a
movq -0x18(%rbp), %rcx
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
xorl %r8d, %r8d
callq 0x76b0
jmp 0xc33d
movq -0x10(%rbp), %rdi
movslq -0x58(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0x3330
leaq -0x98(%rbp), %rdi
callq 0x3190
leaq -0xd8(%rbp), %rdi
callq 0x3190
leaq -0xd9(%rbp), %rdi
callq 0x32f0
leaq -0xb8(%rbp), %rdi
callq 0x3190
jmp 0xc6d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3190
jmp 0xc6e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3190
jmp 0xc6e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xc3e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x3190
leaq -0xd9(%rbp), %rdi
callq 0x32f0
leaq -0xb8(%rbp), %rdi
callq 0x3190
jmp 0xc6e4
leaq -0x101(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x3440
movq -0x208(%rbp), %rdx
leaq 0x8ddd(%rip), %rsi      # 0x15202
leaq -0x100(%rbp), %rdi
callq 0x50d0
jmp 0xc433
leaq -0x101(%rbp), %rdi
callq 0x32f0
movq -0x10(%rbp), %rdx
addq $0xa0, %rdx
leaq -0x148(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe6b0
jmp 0xc45f
movq -0x10(%rbp), %rdx
addq $0xc0, %rdx
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0xe660
jmp 0xc47f
leaq -0x100(%rbp), %rdi
movq %rdi, -0x210(%rbp)
leaq -0x128(%rbp), %rsi
movq %rsi, -0x218(%rbp)
callq 0x3330
movq -0x218(%rbp), %rdi
callq 0x3190
leaq -0x148(%rbp), %rdi
callq 0x3190
movq -0x210(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x3110
jmp 0xc4cd
leaq -0x168(%rbp), %rdi
callq 0x3db0
movb %al, -0x219(%rbp)
jmp 0xc4e1
leaq -0x168(%rbp), %rdi
callq 0x3190
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0xc4fc
jmp 0xc69f
movq -0x20(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe790
movq %rax, -0x228(%rbp)
jmp 0xc515
movq -0x228(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x3110
jmp 0xc52a
leaq -0x1c9(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x3440
movq -0x230(%rbp), %rdx
leaq 0x8c59(%rip), %rsi      # 0x151a4
leaq -0x1c8(%rbp), %rdi
callq 0x50d0
jmp 0xc559
movq -0x18(%rbp), %rcx
leaq -0x188(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
xorl %r8d, %r8d
callq 0x76b0
jmp 0xc57c
movq -0x20(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe790
movq %rax, -0x238(%rbp)
jmp 0xc595
movq -0x238(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x3330
leaq -0x188(%rbp), %rdi
callq 0x3190
leaq -0x1c8(%rbp), %rdi
callq 0x3190
leaq -0x1c9(%rbp), %rdi
callq 0x32f0
leaq -0x1a8(%rbp), %rdi
callq 0x3190
jmp 0xc6bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x101(%rbp), %rdi
callq 0x32f0
jmp 0xc6e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xc6c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x3190
jmp 0xc6c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x3190
jmp 0xc6c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xc685
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xc679
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x3190
leaq -0x1c8(%rbp), %rdi
callq 0x3190
leaq -0x1c9(%rbp), %rdi
callq 0x32f0
leaq -0x1a8(%rbp), %rdi
callq 0x3190
jmp 0xc6c9
movq 0xe92a(%rip), %rdi      # 0x1afd0
leaq 0x8b45(%rip), %rsi      # 0x151f2
callq 0x3270
jmp 0xc6b4
xorl %edi, %edi
callq 0x3320
leaq -0x100(%rbp), %rdi
callq 0x3190
jmp 0xc6d7
leaq -0x100(%rbp), %rdi
callq 0x3190
jmp 0xc6e4
jmp 0xc6d9
jmp 0xc6db
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3430
nopl (%rax)