// File: /workspace/github_cpp_makefile_star2_O3/sthapliyal37[P]Microprocessor_8085_Updated/Memory_Allocation.cpp
// Function: allocate_memory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string allocate_memory(string s,string pc)
{
		string 						size1[]={"MOV","LDAX","STAX","XCHG","ADD","DCR","INR","SUB","INX","DCX","CMP","CMA","DAD"};
		string size2[]={"ADI","SUI","MVI"};
		string size3[]={"LDA","LXI","STA","SHLD","LHLD","SET","JMP","JC","JNC","JZ","JNZ"};
		int num=0;
		string num1="0001",num2="0002",num3="0003";	
		int n=pc.length();
		//cout<<num<<endl;
		n=sizeof(size1)/sizeof(size1[0]);
		for(int i=0;i<n;i++)
		{
			if(!size1[i].compare(s))
			{
				/*std::stringstream ss;
				ss<< std::hex << num+1;
				std::string res ( ss.str() );*/
				pc=sumBase14(pc,num1);
				return pc;
			}
		}
		n=sizeof(size2)/sizeof(size2[0]);
		for(int i=0;i<n;i++)
		{
				if(!size2[i].compare(s))
				{
					/*pc=itos(num+2);
					std::stringstream ss;
					ss<< std::hex << num+2;
					std::string res ( ss.str() );*/
					pc=sumBase14(pc,num2);
					return pc;
				}							
		}
		n=sizeof(size3)/sizeof(size3[0]);
		for(int i=0;i<n;i++)
		{
				if(!size3[i].compare(s))
				{									
					/*pc=itos(num+3);
					std::stringstream ss;
					ss<< std::hex << num+3;
					std::string res ( ss.str() );*/
					pc=sumBase14(pc,num3);
					return pc;
				}				
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rdx, -0x38(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdi, -0x40(%rbp)
leaq -0x350(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xab2e(%rip), %rsi      # 0xe054
leaq 0xab2a(%rip), %rdx      # 0xe057
leaq -0x360(%rbp), %r12
movq %r12, %rdi
callq 0x328a
leaq -0x340(%rbp), %r13
leaq -0x330(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xac48(%rip), %rsi      # 0xe19d
leaq 0xac45(%rip), %rdx      # 0xe1a1
movq %r13, %rdi
callq 0x328a
leaq -0x320(%rbp), %r13
leaq -0x310(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xaaec(%rip), %rsi      # 0xe069
leaq 0xaae9(%rip), %rdx      # 0xe06d
movq %r13, %rdi
callq 0x328a
leaq -0x300(%rbp), %r13
leaq -0x2f0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xaac9(%rip), %rsi      # 0xe06e
leaq 0xaac6(%rip), %rdx      # 0xe072
movq %r13, %rdi
callq 0x328a
leaq -0x2e0(%rbp), %r13
leaq -0x2d0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xaa49(%rip), %rsi      # 0xe016
leaq 0xaa45(%rip), %rdx      # 0xe019
movq %r13, %rdi
callq 0x328a
leaq -0x2c0(%rbp), %r13
leaq -0x2b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xaa31(%rip), %rsi      # 0xe026
leaq 0xaa2d(%rip), %rdx      # 0xe029
movq %r13, %rdi
callq 0x328a
leaq -0x2a0(%rbp), %r13
leaq -0x290(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xaa05(%rip), %rsi      # 0xe022
leaq 0xaa01(%rip), %rdx      # 0xe025
movq %r13, %rdi
callq 0x328a
leaq -0x280(%rbp), %r13
leaq -0x270(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa9d9(%rip), %rsi      # 0xe01e
leaq 0xa9d5(%rip), %rdx      # 0xe021
movq %r13, %rdi
callq 0x328a
leaq -0x260(%rbp), %r13
leaq -0x250(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa9bd(%rip), %rsi      # 0xe02a
leaq 0xa9b9(%rip), %rdx      # 0xe02d
movq %r13, %rdi
callq 0x328a
leaq -0x240(%rbp), %r13
leaq -0x230(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa999(%rip), %rsi      # 0xe02e
leaq 0xa995(%rip), %rdx      # 0xe031
movq %r13, %rdi
callq 0x328a
leaq -0x220(%rbp), %r13
leaq -0x210(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa981(%rip), %rsi      # 0xe03e
leaq 0xa97d(%rip), %rdx      # 0xe041
movq %r13, %rdi
callq 0x328a
leaq -0x200(%rbp), %r13
leaq -0x1f0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa955(%rip), %rsi      # 0xe03a
leaq 0xa951(%rip), %rdx      # 0xe03d
movq %r13, %rdi
callq 0x328a
leaq -0x1e0(%rbp), %r13
leaq -0x1d0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0xa925(%rip), %rsi      # 0xe032
leaq 0xa921(%rip), %rdx      # 0xe035
movq %r13, %rdi
callq 0x328a
leaq -0x1b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa8ec(%rip), %rsi      # 0xe01a
leaq 0xa8e8(%rip), %rdx      # 0xe01d
leaq -0x1c0(%rbp), %r12
movq %r12, %rdi
callq 0x328a
leaq -0x1a0(%rbp), %r13
leaq -0x190(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa8d9(%rip), %rsi      # 0xe036
leaq 0xa8d5(%rip), %rdx      # 0xe039
movq %r13, %rdi
callq 0x328a
leaq -0x180(%rbp), %r13
leaq -0x170(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xa8d3(%rip), %rsi      # 0xe058
leaq 0xa8cf(%rip), %rdx      # 0xe05b
movq %r13, %rdi
callq 0x328a
leaq -0x4b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa8ba(%rip), %rsi      # 0xe060
leaq 0xa8b6(%rip), %rdx      # 0xe063
leaq -0x4c0(%rbp), %r12
movq %r12, %rdi
callq 0x328a
leaq -0x4a0(%rbp), %r13
leaq -0x490(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa887(%rip), %rsi      # 0xe05c
leaq 0xa883(%rip), %rdx      # 0xe05f
movq %r13, %rdi
callq 0x328a
leaq -0x480(%rbp), %r13
leaq -0x470(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa876(%rip), %rsi      # 0xe073
leaq 0xa872(%rip), %rdx      # 0xe076
movq %r13, %rdi
callq 0x328a
leaq -0x460(%rbp), %r13
leaq -0x450(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa83f(%rip), %rsi      # 0xe064
leaq 0xa83c(%rip), %rdx      # 0xe068
movq %r13, %rdi
callq 0x328a
leaq -0x440(%rbp), %r13
leaq -0x430(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa82a(%rip), %rsi      # 0xe077
leaq 0xa827(%rip), %rdx      # 0xe07b
movq %r13, %rdi
callq 0x328a
leaq -0x420(%rbp), %r13
leaq -0x410(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa807(%rip), %rsi      # 0xe07c
leaq 0xa803(%rip), %rdx      # 0xe07f
movq %r13, %rdi
callq 0x328a
leaq -0x400(%rbp), %r13
leaq -0x3f0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa7a5(%rip), %rsi      # 0xe042
leaq 0xa7a1(%rip), %rdx      # 0xe045
movq %r13, %rdi
callq 0x328a
leaq -0x3e0(%rbp), %r13
leaq -0x3d0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa781(%rip), %rsi      # 0xe046
leaq 0xa77c(%rip), %rdx      # 0xe048
movq %r13, %rdi
callq 0x328a
leaq -0x3c0(%rbp), %r13
leaq -0x3b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa75c(%rip), %rsi      # 0xe049
leaq 0xa758(%rip), %rdx      # 0xe04c
movq %r13, %rdi
callq 0x328a
leaq -0x3a0(%rbp), %r13
leaq -0x390(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa738(%rip), %rsi      # 0xe04d
leaq 0xa733(%rip), %rdx      # 0xe04f
movq %r13, %rdi
callq 0x328a
leaq -0x380(%rbp), %r13
leaq -0x370(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xa713(%rip), %rsi      # 0xe050
leaq 0xa70f(%rip), %rdx      # 0xe053
movq %r13, %rdi
callq 0x328a
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa847(%rip), %rsi      # 0xe1a2
leaq 0xa844(%rip), %rdx      # 0xe1a6
leaq -0x60(%rbp), %rdi
callq 0x328a
leaq -0x90(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa82a(%rip), %rsi      # 0xe1a7
leaq 0xa827(%rip), %rdx      # 0xe1ab
leaq -0xa0(%rbp), %rdi
callq 0x328a
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa80d(%rip), %rsi      # 0xe1ac
leaq 0xa80a(%rip), %rdx      # 0xe1b0
leaq -0x80(%rbp), %rdi
callq 0x328a
xorl %r13d, %r13d
leaq -0x360(,%r13), %rdi
addq %rbp, %rdi
movq -0x30(%rbp), %rsi
callq 0x2050
testl %eax, %eax
je 0x3ae9
addq $0x20, %r13
cmpq $0x1a0, %r13            # imm = 0x1A0
jne 0x39b2
xorl %r13d, %r13d
leaq -0x1c0(,%r13), %rdi
addq %rbp, %rdi
movq -0x30(%rbp), %rsi
callq 0x2050
testl %eax, %eax
je 0x3bb8
addq $0x20, %r13
cmpq $0x60, %r13
jne 0x39de
jmp 0x3a0a
addq $0x20, %r12
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0x2050
testl %eax, %eax
jne 0x3a06
leaq -0xd0(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x31ec
leaq -0xb0(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x31ec
leaq -0xe0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3328
movq %rax, %r13
movq -0x38(%rbp), %r12
movq 0x8(%r12), %rax
movq %rax, -0x30(%rbp)
movq %r13, %rdi
callq 0x20f0
movq %r12, %rdi
xorl %esi, %esi
movq -0x30(%rbp), %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x22b0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
leaq -0x50(%rbp), %r12
je 0x3ac6
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x3c8c
movq -0xd0(%rbp), %rsi
jmp 0x3c84
leaq -0x150(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x31ec
leaq -0x130(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x31ec
leaq -0x160(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x3328
movq %rax, %r13
movq -0x38(%rbp), %r12
movq 0x8(%r12), %rax
movq %rax, -0x30(%rbp)
movq %r13, %rdi
callq 0x20f0
movq %r12, %rdi
xorl %esi, %esi
movq -0x30(%rbp), %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x22b0
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
leaq -0x50(%rbp), %r12
je 0x3b95
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x3c8c
movq -0x150(%rbp), %rsi
jmp 0x3c84
leaq -0x110(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x31ec
leaq -0xf0(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x31ec
leaq -0x120(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3328
movq %rax, %r13
movq -0x38(%rbp), %r12
movq 0x8(%r12), %rax
movq %rax, -0x30(%rbp)
movq %r13, %rdi
callq 0x20f0
movq %r12, %rdi
xorl %esi, %esi
movq -0x30(%rbp), %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x22b0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
leaq -0x50(%rbp), %r12
je 0x3c6a
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x3c8c
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x40(%rbp), %rsi
leaq 0x10(%rsi), %rcx
movq %rcx, (%rsi)
movq -0x38(%rbp), %rax
movq (%rax), %rdx
addq $0x10, %rax
cmpq %rax, %rdx
je 0x3cb3
movq %rdx, (%rsi)
movq (%rax), %rcx
movq %rcx, 0x10(%rsi)
jmp 0x3cb9
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq -0x38(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, 0x8(%rsi)
movq %rax, (%rdx)
movq $0x0, 0x8(%rdx)
movb $0x0, 0x10(%rdx)
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x3ced
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x3d0f
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x3d24
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2210
movq $-0x160, %r12           # imm = 0xFEA0
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x3d3f
movq (%r15), %rsi
incq %rsi
callq 0x2210
addq $-0x20, %r15
addq $0x20, %r12
jne 0x3d2b
movq $-0x60, %r15
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x3d64
movq (%r14), %rsi
incq %rsi
callq 0x2210
addq $-0x20, %r14
addq $0x20, %r15
jne 0x3d50
movq $-0x1a0, %r14           # imm = 0xFE60
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x3d89
movq (%rbx), %rsi
incq %rsi
callq 0x2210
addq $-0x20, %rbx
addq $0x20, %r14
jne 0x3d75
movq -0x40(%rbp), %rax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x30(%rbp)
jmp 0x3de5
jmp 0x3f9a
movq %rax, -0x30(%rbp)
jmp 0x3e2e
jmp 0x3f9a
movq %rax, -0x30(%rbp)
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x3de5
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x3f9e
movq -0xd0(%rbp), %rsi
jmp 0x3f8c
movq %rax, -0x30(%rbp)
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x3e2e
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x3f9e
movq -0x110(%rbp), %rsi
jmp 0x3f8c
movq %rax, -0x30(%rbp)
jmp 0x3f72
jmp 0x3f9a
movq %rax, -0x30(%rbp)
jmp 0x3fb7
movq %rax, -0x30(%rbp)
jmp 0x3fd9
movq %rax, -0x30(%rbp)
jmp 0x3ff2
jmp 0x3e8c
jmp 0x3e8c
jmp 0x3e8c
jmp 0x3e8c
jmp 0x3e8c
jmp 0x3e8c
jmp 0x3e8c
jmp 0x3e8c
jmp 0x3e8c
movq %rax, -0x30(%rbp)
addq $-0x10, %r13
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x3ea9
movq (%r13), %rsi
incq %rsi
callq 0x2210
leaq -0x20(%r13), %rax
addq $-0x10, %r13
cmpq %r12, %r13
movq %rax, %r13
jne 0x3e94
jmp 0x401e
movq %rax, -0x30(%rbp)
jmp 0x401e
jmp 0x3ec9
movq %rax, -0x30(%rbp)
addq $-0x10, %r13
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x3ee6
movq (%r13), %rsi
incq %rsi
callq 0x2210
leaq -0x20(%r13), %rax
addq $-0x10, %r13
cmpq %r12, %r13
movq %rax, %r13
jne 0x3ed1
jmp 0x4047
movq %rax, -0x30(%rbp)
jmp 0x4047
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
jmp 0x3f1a
movq %rax, -0x30(%rbp)
addq $-0x10, %r13
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x3f37
movq (%r13), %rsi
incq %rsi
callq 0x2210
leaq -0x20(%r13), %rax
addq $-0x10, %r13
cmpq %r12, %r13
movq %rax, %r13
jne 0x3f22
jmp 0x4073
movq %rax, -0x30(%rbp)
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x3f72
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x3f9e
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x3f9e
jmp 0x3f9a
jmp 0x3f9a
movq %rax, -0x30(%rbp)
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x3fb7
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x3fd9
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3ff2
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2210
xorl %r12d, %r12d
movq -0x380(%rbp,%r12), %rdi
leaq (%r15,%r12), %rax
cmpq %rdi, %rax
je 0x4011
movq (%rax), %rsi
incq %rsi
callq 0x2210
addq $-0x20, %r12
cmpq $-0x160, %r12           # imm = 0xFEA0
jne 0x3ff5
xorl %r15d, %r15d
movq -0x180(%rbp,%r15), %rdi
leaq (%r14,%r15), %rax
cmpq %rdi, %rax
je 0x403d
movq (%rax), %rsi
incq %rsi
callq 0x2210
addq $-0x20, %r15
cmpq $-0x60, %r15
jne 0x4021
xorl %r14d, %r14d
movq -0x1e0(%rbp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0x4066
movq (%rax), %rsi
incq %rsi
callq 0x2210
addq $-0x20, %r14
cmpq $-0x1a0, %r14           # imm = 0xFE60
jne 0x404a
movq -0x30(%rbp), %rdi
callq 0x2320