// File: /workspace/github_cpp_makefile_star2_O3/sthapliyal37[P]Microprocessor_8085_Updated/Branch.cpp
// Function: JNC(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 JNC(string instruction,string pc,string* registers,bool* flag){

	if(flag[0] == false)
		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
leaq 0x10(%rdi), %rdx
cmpb $0x0, (%r8)
movq %rdx, (%rdi)
je 0xaf0a
movq %rdx, -0x30(%rbp)
leaq 0x3431(%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 0xae25
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
xorl %r13d, %r13d
movl $0x3, %r15d
leaq 0x340b(%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 0xae72
orb $0x30, %al
movsbl %al, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4bc8
jmp 0xae82
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 0xaea6
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
sarl $0x4, %r13d
addq $-0x1, %r15
jb 0xae39
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 0xaeec
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r14b, %r14b
movq -0x30(%rbp), %rax
jne 0xaf3f
movq (%rbx), %rdi
cmpq %rax, %rdi
je 0xaf3f
movq (%rax), %rsi
incq %rsi
callq 0x2210
jmp 0xaf3f
movq (%rsi), %rcx
leaq 0x10(%rsi), %rax
cmpq %rax, %rcx
je 0xaf22
movq %rcx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0xaf28
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 0xaf87
movq -0x40(%rbp), %rsi
jmp 0xaf76
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0xaf87
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0xaf87
jmp 0xaf84
jmp 0xaf84
movq %rax, %r14
movq (%rbx), %rdi
cmpq -0x30(%rbp), %rdi
je 0xaf9f
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2320