// File: /workspace/github_cpp_makefile_star2_O3/sthapliyal37[P]Microprocessor_8085_Updated/Branch.cpp
// Function: JNZ(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 JNZ(string instruction, string pc, string* registers,bool* flag){
	if(flag[6] == false){
		//cout<<"inside jnz::"<<" "<<instruction<<endl;	
		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, 0x6(%r8)
movq %rdx, (%rdi)
je 0xb322
movq %rdx, -0x30(%rbp)
leaq 0x3019(%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 0xb23d
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
xorl %r13d, %r13d
movl $0x3, %r15d
leaq 0x2ff3(%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 0xb28a
orb $0x30, %al
movsbl %al, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4bc8
jmp 0xb29a
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 0xb2be
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x2210
sarl $0x4, %r13d
addq $-0x1, %r15
jb 0xb251
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 0xb304
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
testb %r14b, %r14b
movq -0x30(%rbp), %rax
jne 0xb357
movq (%rbx), %rdi
cmpq %rax, %rdi
je 0xb357
movq (%rax), %rsi
incq %rsi
callq 0x2210
jmp 0xb357
movq (%rsi), %rcx
leaq 0x10(%rsi), %rax
cmpq %rax, %rcx
je 0xb33a
movq %rcx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0xb340
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 0xb39f
movq -0x40(%rbp), %rsi
jmp 0xb38e
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0xb39f
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0xb39f
jmp 0xb39c
jmp 0xb39c
movq %rax, %r14
movq (%rbx), %rdi
cmpq -0x30(%rbp), %rdi
je 0xb3b7
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2320
nop