// File: /workspace/github_cpp_makefile_star2_O3/sthapliyal37[P]Microprocessor_8085_Updated/Branch.cpp
// Function: JC(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::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*)
string JC(string instruction,string pc,string* registers,bool* flag){
	if(flag[0] == true)
		return instruction;
	else{
		string resultant = "";
		int value16bit[4];
		int returnValue[] = {0,0,0,3};
		int carry = 0;
		hexToDecimal(pc,value16bit);	  
		for(int i = 3;i>=0;i--){
					
			int value = value16bit[i] + returnValue[i] + carry;
			carry = value / 16;
			value = value % 16;
			if(value>=0 && value<=9)
				resultant = (char)('0'+value) + resultant;
			else{
				resultant = (char)('A'+(value-10)) + resultant;
			}
		}
		if(validityAddress(resultant))
			return resultant;
		
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movb (%r8), %al
leaq 0x10(%rdi), %rdx
movq %rdx, (%rdi)
cmpb $0x1, %al
jne 0xabd5
movq (%rsi), %rcx
leaq 0x10(%rsi), %rax
cmpq %rax, %rcx
je 0xad19
movq %rcx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0xad1f
movq %rdx, -0x30(%rbp)
leaq 0x3622(%rip), %rdx      # 0xe202
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x328a
leaq -0x80(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x31ec
leaq -0x90(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x46ea
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0xac34
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
xorl %r13d, %r13d
movl $0x3, %r15d
leaq 0x35fc(%rip), %r12      # 0xe240
leaq -0x70(%rbp), %r14
movl (%r12,%r15,4), %ecx
addl -0xa0(%rbp,%r15,4), %r13d
movl %r13d, %eax
addl %ecx, %eax
leal 0xf(%rcx,%r13), %r13d
cmovnsl %eax, %r13d
movl %r13d, %ecx
andl $-0x10, %ecx
subl %ecx, %eax
cmpl $0x9, %eax
ja 0xac81
orb $0x30, %al
movsbl %al, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4bc8
jmp 0xac91
addb $0x37, %al
movsbl %al, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4bc8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2270
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xacb5
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
sarl $0x4, %r13d
addq $-0x1, %r15
jb 0xac48
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x31ec
leaq -0x50(%rbp), %rdi
callq 0x2997
movl %eax, %r14d
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0xacfb
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r14b, %r14b
movq -0x30(%rbp), %rax
jne 0xad36
movq (%rbx), %rdi
cmpq %rax, %rdi
je 0xad36
movq (%rax), %rsi
incq %rsi
callq 0x2210
jmp 0xad36
movups (%rax), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, (%rsi)
movq $0x0, 0x8(%rsi)
movb $0x0, 0x10(%rsi)
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0xad7e
movq -0x40(%rbp), %rsi
jmp 0xad6d
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0xad7e
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0xad7e
jmp 0xad7b
jmp 0xad7b
movq %rax, %r14
movq (%rbx), %rdi
cmpq -0x30(%rbp), %rdi
je 0xad96
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2320