// File: 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
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x260(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
callq 0x33b0
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0xd2ce
movq -0x260(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x3110
movq -0x270(%rbp), %rdi
callq 0x3800
movb %al, -0x261(%rbp)
jmp 0xcc3b
leaq -0x40(%rbp), %rdi
callq 0x3190
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0xcc53
jmp 0xd2cc
movq -0x260(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x3110
movq -0x280(%rbp), %rdi
callq 0x3970
movl %eax, -0x274(%rbp)
jmp 0xcc7e
leaq -0x70(%rbp), %rdi
callq 0x3190
movl -0x274(%rbp), %eax
movl %eax, -0x50(%rbp)
cmpl $0x1, -0x50(%rbp)
je 0xcca6
cmpl $0x3, -0x50(%rbp)
je 0xcca6
cmpl $0x5, -0x50(%rbp)
jne 0xd2ca
leaq -0x91(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x3440
movq -0x288(%rbp), %rdx
leaq 0x853b(%rip), %rsi      # 0x15202
leaq -0x90(%rbp), %rdi
callq 0x50d0
jmp 0xccd5
leaq -0x91(%rbp), %rdi
callq 0x32f0
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x3440
movq -0x290(%rbp), %rdx
leaq 0x8500(%rip), %rsi      # 0x15202
leaq -0xb8(%rbp), %rdi
callq 0x50d0
jmp 0xcd10
leaq -0xb9(%rbp), %rdi
callq 0x32f0
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x3440
movq -0x298(%rbp), %rdx
leaq 0x84c5(%rip), %rsi      # 0x15202
leaq -0xe0(%rbp), %rdi
callq 0x50d0
jmp 0xcd4b
leaq -0xe1(%rbp), %rdi
callq 0x32f0
leaq -0x109(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x3440
movq -0x2a0(%rbp), %rdx
leaq 0x848a(%rip), %rsi      # 0x15202
leaq -0x108(%rbp), %rdi
callq 0x50d0
jmp 0xcd86
leaq -0x109(%rbp), %rdi
callq 0x32f0
movq -0x10(%rbp), %rsi
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
movb $0x0, -0x151(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3110
jmp 0xcdb6
leaq -0x130(%rbp), %rdi
callq 0x3cc0
movb %al, -0x2a1(%rbp)
jmp 0xcdca
movb -0x2a1(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
movb %al, -0x2a2(%rbp)
jne 0xce33
movq -0x10(%rbp), %rcx
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
leaq 0x20(%rax,%rcx), %rsi
leaq -0x150(%rbp), %rdi
callq 0x3110
jmp 0xce01
movb $0x1, -0x151(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x3cc0
movb %al, -0x2a3(%rbp)
jmp 0xce1c
movb -0x2a3(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
sete %al
movb %al, -0x2a2(%rbp)
movb -0x2a2(%rbp), %al
movb %al, -0x2a4(%rbp)
testb $0x1, -0x151(%rbp)
jne 0xce4a
jmp 0xce56
leaq -0x150(%rbp), %rdi
callq 0x3190
leaq -0x130(%rbp), %rdi
callq 0x3190
movb -0x2a4(%rbp), %al
testb $0x1, %al
jne 0xce71
jmp 0xd24a
movq -0x10(%rbp), %rdx
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdx
leaq -0x198(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xe6b0
jmp 0xce95
movq -0x10(%rbp), %rcx
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
leaq 0x20(%rax,%rcx), %rdx
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0xe660
jmp 0xcebb
leaq -0x90(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
leaq -0x178(%rbp), %rsi
movq %rsi, -0x2b8(%rbp)
callq 0x3330
movq -0x2b8(%rbp), %rdi
callq 0x3190
leaq -0x198(%rbp), %rdi
callq 0x3190
movq -0x2b0(%rbp), %rsi
leaq -0x1d8(%rbp), %rdi
callq 0x3110
jmp 0xcf09
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x6c20
jmp 0xcf1e
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
leaq -0x1b8(%rbp), %rsi
movq %rsi, -0x2d0(%rbp)
callq 0x3330
movq -0x2d0(%rbp), %rdi
callq 0x3190
leaq -0x1d8(%rbp), %rdi
callq 0x3190
movq -0x2c8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34a0
movq %rax, -0x2c0(%rbp)
jmp 0xcf70
movq -0x2c0(%rbp), %rax
movsbl (%rax), %edx
leaq -0x218(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x8270
jmp 0xcf8f
leaq -0xb8(%rbp), %rdi
movl $0x1, %esi
callq 0x34a0
movq %rax, -0x2d8(%rbp)
jmp 0xcfa9
movq -0x2d8(%rbp), %rax
movsbl (%rax), %edx
leaq -0x1f8(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0xe870
jmp 0xcfc8
leaq -0xe0(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
movq %rsi, -0x2e8(%rbp)
callq 0x3330
movq -0x2e8(%rbp), %rdi
callq 0x3190
leaq -0x218(%rbp), %rdi
callq 0x3190
leaq -0xb8(%rbp), %rdi
movl $0x2, %esi
callq 0x34a0
movq %rax, -0x2e0(%rbp)
jmp 0xd014
movq -0x2e0(%rbp), %rax
movsbl (%rax), %edx
leaq -0x258(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x8270
jmp 0xd033
leaq -0xb8(%rbp), %rdi
movl $0x3, %esi
callq 0x34a0
movq %rax, -0x2f0(%rbp)
jmp 0xd04d
movq -0x2f0(%rbp), %rax
movsbl (%rax), %edx
leaq -0x238(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0xe870
jmp 0xd06c
leaq -0x108(%rbp), %rdi
leaq -0x238(%rbp), %rsi
movq %rsi, -0x2f8(%rbp)
callq 0x3330
movq -0x2f8(%rbp), %rdi
callq 0x3190
leaq -0x258(%rbp), %rdi
callq 0x3190
movq -0x10(%rbp), %rdi
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3050
jmp 0xd0bb
movq -0x10(%rbp), %rcx
movslq -0x50(%rbp), %rax
shlq $0x5, %rax
leaq 0x20(%rax,%rcx), %rdi
leaq -0x108(%rbp), %rsi
callq 0x3050
jmp 0xd0da
jmp 0xd266
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3190
jmp 0xd2d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3190
jmp 0xd2d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x32f0
jmp 0xd2d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x32f0
jmp 0xd2bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xe1(%rbp), %rdi
callq 0x32f0
jmp 0xd2b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x109(%rbp), %rdi
callq 0x32f0
jmp 0xd2a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd298
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd1cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
testb $0x1, -0x151(%rbp)
jne 0xd1bd
jmp 0xd1c9
leaq -0x150(%rbp), %rdi
callq 0x3190
jmp 0xd1cb
leaq -0x130(%rbp), %rdi
callq 0x3190
jmp 0xd298
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3190
jmp 0xd298
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x3190
jmp 0xd298
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x3190
jmp 0xd298
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x3190
jmp 0xd298
movq 0xdd7f(%rip), %rdi      # 0x1afd0
leaq 0x7fa2(%rip), %rsi      # 0x151fa
callq 0x3270
jmp 0xd25f
xorl %edi, %edi
callq 0x3320
leaq -0x108(%rbp), %rdi
callq 0x3190
leaq -0xe0(%rbp), %rdi
callq 0x3190
leaq -0xb8(%rbp), %rdi
callq 0x3190
leaq -0x90(%rbp), %rdi
callq 0x3190
jmp 0xd2ca
leaq -0x108(%rbp), %rdi
callq 0x3190
leaq -0xe0(%rbp), %rdi
callq 0x3190
leaq -0xb8(%rbp), %rdi
callq 0x3190
leaq -0x90(%rbp), %rdi
callq 0x3190
jmp 0xd2d7
jmp 0xd2cc
jmp 0xd2ce
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3430