// File: 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
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x1d8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
callq 0x33b0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
jne 0xcbcb
movq -0x1d8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x3110
movq -0x1e8(%rbp), %rdi
callq 0x3800
movb %al, -0x1d9(%rbp)
jmp 0xc74f
leaq -0x48(%rbp), %rdi
callq 0x3190
movb -0x1d9(%rbp), %al
testb $0x1, %al
jne 0xc767
jmp 0xcbc9
movq -0x1d8(%rbp), %rdi
leaq 0x889b(%rip), %rsi      # 0x15010
callq 0xe630
testb $0x1, %al
jne 0xc783
jmp 0xc8f4
movq -0x1d8(%rbp), %rsi
leaq -0x78(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x3110
movq -0x1f8(%rbp), %rdi
callq 0x3970
movl %eax, -0x1ec(%rbp)
jmp 0xc7ae
leaq -0x78(%rbp), %rdi
callq 0x3190
movl -0x1ec(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rsi
movslq -0x58(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x3110
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x3440
movq -0x200(%rbp), %rdx
leaq 0x89a8(%rip), %rsi      # 0x151a4
leaq -0xd8(%rbp), %rdi
callq 0x50d0
jmp 0xc80a
movq -0x18(%rbp), %rcx
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
xorl %r8d, %r8d
callq 0x7f00
jmp 0xc82d
movq -0x10(%rbp), %rdi
movslq -0x58(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0x3330
leaq -0x98(%rbp), %rdi
callq 0x3190
leaq -0xd8(%rbp), %rdi
callq 0x3190
leaq -0xd9(%rbp), %rdi
callq 0x32f0
leaq -0xb8(%rbp), %rdi
callq 0x3190
jmp 0xcbc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3190
jmp 0xcbd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3190
jmp 0xcbd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xc8d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x3190
leaq -0xd9(%rbp), %rdi
callq 0x32f0
leaq -0xb8(%rbp), %rdi
callq 0x3190
jmp 0xcbd4
leaq -0x101(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x3440
movq -0x208(%rbp), %rdx
leaq 0x88ed(%rip), %rsi      # 0x15202
leaq -0x100(%rbp), %rdi
callq 0x50d0
jmp 0xc923
leaq -0x101(%rbp), %rdi
callq 0x32f0
movq -0x10(%rbp), %rdx
addq $0xa0, %rdx
leaq -0x148(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe6b0
jmp 0xc94f
movq -0x10(%rbp), %rdx
addq $0xc0, %rdx
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0xe660
jmp 0xc96f
leaq -0x100(%rbp), %rdi
movq %rdi, -0x210(%rbp)
leaq -0x128(%rbp), %rsi
movq %rsi, -0x218(%rbp)
callq 0x3330
movq -0x218(%rbp), %rdi
callq 0x3190
leaq -0x148(%rbp), %rdi
callq 0x3190
movq -0x210(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x3110
jmp 0xc9bd
leaq -0x168(%rbp), %rdi
callq 0x3db0
movb %al, -0x219(%rbp)
jmp 0xc9d1
leaq -0x168(%rbp), %rdi
callq 0x3190
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0xc9ec
jmp 0xcb8f
movq -0x20(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe790
movq %rax, -0x228(%rbp)
jmp 0xca05
movq -0x228(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x3110
jmp 0xca1a
leaq -0x1c9(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x3440
movq -0x230(%rbp), %rdx
leaq 0x8769(%rip), %rsi      # 0x151a4
leaq -0x1c8(%rbp), %rdi
callq 0x50d0
jmp 0xca49
movq -0x18(%rbp), %rcx
leaq -0x188(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
xorl %r8d, %r8d
callq 0x7f00
jmp 0xca6c
movq -0x20(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe790
movq %rax, -0x238(%rbp)
jmp 0xca85
movq -0x238(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x3330
leaq -0x188(%rbp), %rdi
callq 0x3190
leaq -0x1c8(%rbp), %rdi
callq 0x3190
leaq -0x1c9(%rbp), %rdi
callq 0x32f0
leaq -0x1a8(%rbp), %rdi
callq 0x3190
jmp 0xcbab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x101(%rbp), %rdi
callq 0x32f0
jmp 0xcbd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xcbb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x3190
jmp 0xcbb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x3190
jmp 0xcbb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xcb75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xcb69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x3190
leaq -0x1c8(%rbp), %rdi
callq 0x3190
leaq -0x1c9(%rbp), %rdi
callq 0x32f0
leaq -0x1a8(%rbp), %rdi
callq 0x3190
jmp 0xcbb9
movq 0xe43a(%rip), %rdi      # 0x1afd0
leaq 0x865d(%rip), %rsi      # 0x151fa
callq 0x3270
jmp 0xcba4
xorl %edi, %edi
callq 0x3320
leaq -0x100(%rbp), %rdi
callq 0x3190
jmp 0xcbc7
leaq -0x100(%rbp), %rdi
callq 0x3190
jmp 0xcbd4
jmp 0xcbc9
jmp 0xcbcb
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3430
nopl (%rax)