// File: /workspace/github_cpp_makefile_star2_O3/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 0x865a
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 0x31ec
movq %r13, %rdi
callq 0x265c
movl %eax, %r13d
movq -0x170(%rbp), %rdi
cmpq %rbx, %rdi
je 0x8308
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r13b, %r13b
movq -0x30(%rbp), %rbx
je 0x865a
leaq 0x5cf4(%rip), %rsi      # 0xe010
movq %r12, %rdi
callq 0x20a0
testl %eax, %eax
je 0x8446
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 0x31ec
movq %r14, %rdi
callq 0x2778
movl %eax, %r14d
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
je 0x8378
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 0x31ec
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x5def(%rip), %rsi      # 0xe1a4
leaq 0x5dea(%rip), %rdx      # 0xe1a6
leaq -0xf0(%rbp), %rdi
callq 0x328a
leaq -0x50(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x4986
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 0x840f
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x842a
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0x865a
movq -0x100(%rbp), %rsi
jmp 0x8652
leaq -0x40(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x5dad(%rip), %rdx      # 0xe202
leaq -0x50(%rbp), %rdi
movq %rdx, %rsi
callq 0x328a
leaq 0xa0(%r15), %rdx
leaq -0x130(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa180
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 0x84b6
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x84be
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 0x84f9
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8518
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 0x31ec
leaq -0xd0(%rbp), %rdi
callq 0x2997
movl %eax, %r15d
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8565
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r15b, %r15b
je 0x866c
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0xa1e4
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x31ec
leaq -0xa0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x5bf9(%rip), %rsi      # 0xe1a4
leaq 0x5bf4(%rip), %rdx      # 0xe1a6
leaq -0xb0(%rbp), %rdi
callq 0x328a
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
movq -0x30(%rbp), %rcx
xorl %r8d, %r8d
callq 0x4986
movq %rbx, %r15
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0xa1e4
leaq -0x70(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2270
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x860e
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8629
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x8645
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x865a
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 0x995d(%rip), %rdi      # 0x11fd0
leaq 0x5b80(%rip), %rsi      # 0xe1fa
callq 0x21f0
xorl %edi, %edi
callq 0x2260
movq %rax, -0x30(%rbp)
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x86a8
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x86a8
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0x86cc
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x86cc
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x8795
movq -0x80(%rbp), %rsi
jmp 0x8724
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8795
movq -0xc0(%rbp), %rsi
jmp 0x8724
movq %rbx, %r15
movq %rax, -0x30(%rbp)
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8795
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x8795
jmp 0x878e
movq %rax, -0x30(%rbp)
jmp 0x87c3
jmp 0x878e
movq %rax, -0x30(%rbp)
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x8760
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x8760
movq %rax, -0x30(%rbp)
movq -0x110(%rbp), %rdi
cmpq %r14, %rdi
je 0x87c3
movq -0x100(%rbp), %rsi
jmp 0x87bb
movq %rax, -0x30(%rbp)
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
je 0x87c3
movq -0x140(%rbp), %rsi
jmp 0x87bb
movq %rbx, %r15
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x87c3
movq -0x40(%rbp), %rsi
jmp 0x87bb
movq %rax, -0x30(%rbp)
movq -0x170(%rbp), %rdi
cmpq %rbx, %rdi
je 0x87c3
movq -0x160(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x30(%rbp), %rdi
callq 0x2320