// File: /workspace/github_cpp_makefile_star2_O1/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 0xac75
movq (%rsi), %rcx
leaq 0x10(%rsi), %rax
cmpq %rax, %rcx
je 0xadb9
movq %rcx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0xadbf
movq %rdx, -0x30(%rbp)
leaq 0x3582(%rip), %rdx      # 0xe202
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x32be
leaq -0x80(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x3224
leaq -0x90(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x475e
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0xacd4
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
xorl %r13d, %r13d
movl $0x3, %r15d
leaq 0x355c(%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 0xad21
orb $0x30, %al
movsbl %al, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4c11
jmp 0xad31
addb $0x37, %al
movsbl %al, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4c11
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2270
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xad55
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
sarl $0x4, %r13d
addq $-0x1, %r15
jb 0xace8
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x3224
leaq -0x50(%rbp), %rdi
callq 0x2991
movl %eax, %r14d
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0xad9b
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r14b, %r14b
movq -0x30(%rbp), %rax
jne 0xadd6
movq (%rbx), %rdi
cmpq %rax, %rdi
je 0xadd6
movq (%rax), %rsi
incq %rsi
callq 0x2210
jmp 0xadd6
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 0xae1e
movq -0x40(%rbp), %rsi
jmp 0xae0d
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0xae1e
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0xae1e
jmp 0xae1b
jmp 0xae1b
movq %rax, %r14
movq (%rbx), %rdi
cmpq -0x30(%rbp), %rdi
je 0xae36
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2320