// File: /workspace/github_cpp_makefile_star2_O1/sthapliyal37[P]Microprocessor_8085_Updated/arithmetic.cpp
// Function: DCR(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 DCR(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] = hexSub(registers[registerID],"01",flag,false);
			}
			else{
				string address = "";
				address = address + registers[5] + registers[6];
				if(validityAddress(address)){
				
					memory[address] = hexSub(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 0x86ae
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 0x835c
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
movq -0x30(%rbp), %rbx
je 0x86ae
leaq 0x5ca0(%rip), %rsi      # 0xe010
movq %r12, %rdi
callq 0x20a0
testl %eax, %eax
je 0x849a
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 0x83cc
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 0x5d9b(%rip), %rsi      # 0xe1a4
leaq 0x5d96(%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 0x49e6
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 0x8463
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x847e
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0x86ae
movq -0x100(%rbp), %rsi
jmp 0x86a6
leaq -0x40(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x5d59(%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 0x850a
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x8512
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 0x854d
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x856c
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 0x85b9
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r15b, %r15b
je 0x86c0
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 0x5ba5(%rip), %rsi      # 0xe1a4
leaq 0x5ba0(%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 0x49e6
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 0x8662
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0x867d
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x8699
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x86ae
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 0x9909(%rip), %rdi      # 0x11fd0
leaq 0x5b2c(%rip), %rsi      # 0xe1fa
callq 0x21f0
xorl %edi, %edi
callq 0x2260
movq %rax, -0x30(%rbp)
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x86fc
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x86fc
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8720
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x8720
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x87e9
movq -0x80(%rbp), %rsi
jmp 0x8778
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x87e9
movq -0xc0(%rbp), %rsi
jmp 0x8778
movq %rbx, %r15
movq %rax, -0x30(%rbp)
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x87e9
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x87e9
jmp 0x87e2
movq %rax, -0x30(%rbp)
jmp 0x8817
jmp 0x87e2
movq %rax, -0x30(%rbp)
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x87b4
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x87b4
movq %rax, -0x30(%rbp)
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0x8817
movq -0x100(%rbp), %rsi
jmp 0x880f
movq %rax, -0x30(%rbp)
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
je 0x8817
movq -0x140(%rbp), %rsi
jmp 0x880f
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x8817
movq -0x40(%rbp), %rsi
jmp 0x880f
movq %rax, -0x30(%rbp)
movq -0x170(%rbp), %rdi
cmpq %rbx, %rdi
je 0x8817
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x30(%rbp), %rdi
callq 0x2320