// File: /workspace/github_cpp_makefile_star2_O2/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
cmpl $0x1, 0x8(%rdi)
jne 0x62bf
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq -0x168(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x2280
movq %r13, %rdi
callq 0x262c
movl %eax, %r13d
leaq -0x168(%rbp), %rdi
callq 0x20f0
testb %r13b, %r13b
je 0x62bf
leaq 0x3f3b(%rip), %rsi      # 0xa010
movq %r12, %rdi
callq 0x71be
testb %al, %al
je 0x618a
leaq -0x148(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x2280
movq %r14, %rdi
callq 0x2740
movl %eax, %r14d
leaq -0x148(%rbp), %rdi
callq 0x20f0
movslq %r14d, %rax
shlq $0x5, %rax
addq %rax, %r15
leaq -0x128(%rbp), %rdi
movq %r15, %rsi
callq 0x2280
leaq 0x4076(%rip), %rsi      # 0xa1a4
leaq -0x108(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x2f1e
leaq -0x48(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x108(%rbp), %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x3eba
leaq -0x48(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x20f0
leaq -0x108(%rbp), %rdi
callq 0x20f0
leaq -0x128(%rbp), %rdi
jmp 0x62ba
leaq 0x4071(%rip), %rsi      # 0xa202
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x2f1e
leaq 0xa0(%r15), %rdx
leaq -0x88(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x71f4
addq $0xc0, %r15
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %r15, %rdx
callq 0x71cb
leaq -0x48(%rbp), %r15
leaq -0x68(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2250
movq %r12, %rdi
callq 0x20f0
leaq -0x88(%rbp), %rdi
callq 0x20f0
leaq -0xe8(%rbp), %rdi
movq %r15, %rsi
callq 0x2280
leaq -0xe8(%rbp), %rdi
callq 0x2915
movl %eax, %r15d
leaq -0xe8(%rbp), %rdi
callq 0x20f0
testb %r15b, %r15b
je 0x62d1
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x724c
leaq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x2280
leaq 0x3f59(%rip), %rsi      # 0xa1a4
leaq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x2f1e
leaq -0x68(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x3eba
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x724c
leaq -0x68(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x20f0
leaq -0xa8(%rbp), %rdi
callq 0x20f0
leaq -0xc8(%rbp), %rdi
callq 0x20f0
leaq -0x48(%rbp), %rdi
callq 0x20f0
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7cf8(%rip), %rdi      # 0xdfd0
leaq 0x3f1b(%rip), %rsi      # 0xa1fa
callq 0x21e0
xorl %edi, %edi
callq 0x2240
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x20f0
jmp 0x62fc
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x20f0
jmp 0x630d
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
jmp 0x632c
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
jmp 0x632c
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x20f0
jmp 0x6368
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x20f0
jmp 0x6349
jmp 0x6365
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
jmp 0x6378
movq %rax, %rbx
jmp 0x637d
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
jmp 0x6378
jmp 0x6365
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
jmp 0x6378
movq %rax, %rbx
leaq -0x168(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2310