// File: sthapliyal37[P]Microprocessor_8085_Updated/Essential.cpp
// Function: complement(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string complement(string a)
{
	int l=a.length();
	string complment="";
	for(int i=0;i<l;i++)
	{
		if(a[i]>='0'&&a[i]<='9')
		{
			int diff=15-(a[i]-'0');
			if(diff>=0&&diff<=9)
				complment+=('0'+diff);
			else if(diff>=10&&diff<=15)
				complment+=('A'+(diff-10));	
		}
		if(a[i]>='A'&&a[i]<='F')
		{
			int value=a[i]-'A';
			int diff=15-value;
			if(diff>=0&&diff<=9)
				complment+=('0'+diff);
			else if(diff>=10&&diff<=15)
				complment+=('A'+(diff-10));
		}
	}
	return complment;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rsi, -0x58(%rbp)
movq %rdi, %rax
movq -0x58(%rbp), %rdi
movq %rax, -0x48(%rbp)
movq %rax, %rcx
movq %rcx, -0x50(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
callq 0x33b0
movl %eax, -0x14(%rbp)
movb $0x0, -0x15(%rbp)
leaq -0x16(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x3440
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0xe2c1(%rip), %rsi      # 0x15202
callq 0x50d0
jmp 0x6f48
leaq -0x16(%rbp), %rdi
callq 0x32f0
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x7118
movq -0x58(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x34a0
movq %rax, -0x60(%rbp)
jmp 0x6f77
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x704d
movq -0x58(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x34a0
movq %rax, -0x68(%rbp)
jmp 0x6f9a
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x704d
movq -0x58(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x34a0
movq %rax, -0x70(%rbp)
jmp 0x6fbd
movq -0x70(%rbp), %rax
movsbl (%rax), %ecx
subl $0x30, %ecx
movl $0xf, %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x7027
cmpl $0x9, -0x2c(%rbp)
jg 0x7027
movq -0x48(%rbp), %rdi
movl -0x2c(%rbp), %eax
addl $0x30, %eax
movsbl %al, %esi
callq 0x31a0
jmp 0x6ff1
jmp 0x704b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x16(%rbp), %rdi
callq 0x32f0
jmp 0x7138
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x3190
jmp 0x7138
cmpl $0xa, -0x2c(%rbp)
jl 0x7049
cmpl $0xf, -0x2c(%rbp)
jg 0x7049
movq -0x48(%rbp), %rdi
movl -0x2c(%rbp), %eax
addl $0x37, %eax
movsbl %al, %esi
callq 0x31a0
jmp 0x7047
jmp 0x7049
jmp 0x704b
jmp 0x704d
movq -0x58(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x34a0
movq %rax, -0x78(%rbp)
jmp 0x7060
movq -0x78(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0x7108
movq -0x58(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x34a0
movq %rax, -0x80(%rbp)
jmp 0x7083
movq -0x80(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jg 0x7108
movq -0x58(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x34a0
movq %rax, -0x88(%rbp)
jmp 0x70a5
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
subl $0x41, %eax
movl %eax, -0x30(%rbp)
movl $0xf, %eax
subl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x70e2
cmpl $0x9, -0x34(%rbp)
jg 0x70e2
movq -0x48(%rbp), %rdi
movl -0x34(%rbp), %eax
addl $0x30, %eax
movsbl %al, %esi
callq 0x31a0
jmp 0x70e0
jmp 0x7106
cmpl $0xa, -0x34(%rbp)
jl 0x7104
cmpl $0xf, -0x34(%rbp)
jg 0x7104
movq -0x48(%rbp), %rdi
movl -0x34(%rbp), %eax
addl $0x37, %eax
movsbl %al, %esi
callq 0x31a0
jmp 0x7102
jmp 0x7104
jmp 0x7106
jmp 0x7108
jmp 0x710a
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x6f58
movb $0x1, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
jne 0x712b
movq -0x48(%rbp), %rdi
callq 0x3190
movq -0x50(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x3430
nopw %cs:(%rax,%rax)