// File: /workspace/github_cpp_makefile_star2_O2/sthapliyal37[P]Microprocessor_8085_Updated/arithmetic.cpp
// Function: INX(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*)
void INX(string instruction,string* registers,bool* flag)
{
int length = instruction.length();
	if(length == 1){
	
		if(validityRegisters(instruction)){
			
			int registerID = registerNumber(instruction);
			if(registerID == 1 || registerID == 3 || registerID == 5){
			
				string data16bit = "";
				string temporary = "";	
				string s1 = "";
				string s2 = "";
				if(validityData(registers[registerID]) == true && validityData(registers[registerID+1]) == true){
					
					data16bit = data16bit + registers[registerID] + registers[registerID + 1];
					temporary = increaseAddress(data16bit);
					 s1 = s1 + temporary[0] + temporary[1];		
					 s2 = s2 + temporary[2] + temporary[3];
					 registers[registerID] = s1; 
					 registers[registerID+1] = s2;
				}
				else{
					
					cout<<"Error: \n";
					exit(0);
				}
			}
			}
			}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x160, %rsp            # imm = 0x160
cmpl $0x1, 0x8(%rdi)
jne 0x665b
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x180(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2280
movq %r15, %rdi
callq 0x262c
movl %eax, %r15d
leaq -0x180(%rbp), %rdi
callq 0x20f0
testb %r15b, %r15b
je 0x665b
leaq -0x160(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2280
movq %r15, %rdi
callq 0x2740
movl %eax, %r14d
leaq -0x160(%rbp), %rdi
callq 0x20f0
cmpl $0x5, %r14d
ja 0x665b
pushq $0x2a
popq %rax
btl %r14d, %eax
jae 0x665b
leaq 0x3de2(%rip), %rsi      # 0xa202
leaq -0x100(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x2f1e
leaq 0x3dcb(%rip), %rsi      # 0xa202
leaq -0x80(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x2f1e
leaq 0x3db4(%rip), %rsi      # 0xa202
leaq -0xc0(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0x2f1e
leaq 0x3d9a(%rip), %rsi      # 0xa202
leaq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x2f1e
movl %r14d, %eax
shlq $0x5, %rax
addq %rax, %rbx
leaq -0xe0(%rbp), %rdi
movq %rbx, %rsi
callq 0x2280
leaq -0xe0(%rbp), %rdi
callq 0x28cb
testb %al, %al
je 0x666b
leaq 0x20(%rbx), %r14
leaq -0x140(%rbp), %rdi
movq %r14, %rsi
callq 0x2280
leaq -0x140(%rbp), %rdi
callq 0x28cb
movl %eax, %r15d
leaq -0x140(%rbp), %rdi
callq 0x20f0
leaq -0xe0(%rbp), %rdi
callq 0x20f0
testb %r15b, %r15b
je 0x6677
leaq -0x40(%rbp), %rdi
leaq -0x100(%rbp), %rsi
movq %rbx, %rdx
callq 0x71f4
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq %r14, %rdx
callq 0x71cb
leaq -0x100(%rbp), %r15
leaq -0x60(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2250
movq %r12, %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
callq 0x20f0
leaq -0x120(%rbp), %rdi
movq %r15, %rsi
callq 0x2280
leaq -0x60(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x3864
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x2250
movq %r12, %rdi
callq 0x20f0
leaq -0x120(%rbp), %rdi
callq 0x20f0
movq (%r15), %rax
movsbl (%rax), %edx
leaq -0x40(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x401e
movq -0x80(%rbp), %rax
movsbl 0x1(%rax), %edx
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x72b5
leaq -0xc0(%rbp), %rdi
leaq -0x60(%rbp), %r15
movq %r15, %rsi
callq 0x2250
movq %r15, %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
callq 0x20f0
movq -0x80(%rbp), %rax
movsbl 0x2(%rax), %edx
leaq -0x40(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x401e
movq -0x80(%rbp), %rax
movsbl 0x3(%rax), %edx
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x72b5
leaq -0xa0(%rbp), %rdi
movq %r15, %rsi
callq 0x2250
movq %r15, %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
callq 0x20f0
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
callq 0x2120
leaq -0xa0(%rbp), %rsi
movq %r14, %rdi
callq 0x2120
leaq -0xa0(%rbp), %rdi
callq 0x20f0
leaq -0xc0(%rbp), %rdi
callq 0x20f0
leaq -0x80(%rbp), %rdi
callq 0x20f0
leaq -0x100(%rbp), %rdi
callq 0x20f0
addq $0x160, %rsp            # imm = 0x160
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq -0xe0(%rbp), %rdi
callq 0x20f0
movq 0x7952(%rip), %rdi      # 0xdfd0
leaq 0x3b75(%rip), %rsi      # 0xa1fa
callq 0x21e0
xorl %edi, %edi
callq 0x2240
jmp 0x66a7
jmp 0x6700
jmp 0x66a7
jmp 0x6700
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
jmp 0x66ed
jmp 0x6700
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
jmp 0x66ed
jmp 0x6700
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x20f0
jmp 0x66e6
movq %rax, %rbx
jmp 0x670f
movq %rax, %rbx
jmp 0x671b
movq %rax, %rbx
jmp 0x6724
movq %rax, %rbx
jmp 0x6730
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
jmp 0x672b
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x20f0
jmp 0x6703
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
jmp 0x672b
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x20f0
leaq -0xc0(%rbp), %rdi
callq 0x20f0
leaq -0x80(%rbp), %rdi
callq 0x20f0
leaq -0x100(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2310