// File: /workspace/github_c_makefile_star2_O0/anuwu[P]ERPLAG-Compiler/symbolTable.c
// Function: checkOP
varST * checkOP (moduleST * thisModule ,moduleST * targetModule , astNode * outputNode) 
{
	varST *searchedVar, *entryVar ;
	varSTentry *varEntry = targetModule->outputVars[0] ;
	int sameArgNoErr = 0 ;

	astNode * outputIter = outputNode ;
	while(outputIter->next)
		outputIter = outputIter->next ;
	
	while( outputIter && varEntry )
	{
		searchedVar = searchVar (thisModule , outputIter->tok->lexeme) ;
		entryVar = varEntry->thisVarST ;

		if(searchedVar == NULL)
		{
			errSemantic () ;
			#ifdef _WIN64
				printf ("In module \"%s\" at line %d, variable \"%s\" is undeclared in the call to module \"%s\"\n", getParentModuleName (thisModule) , outputIter->tok->lineNumber , outputIter->tok->lexeme, targetModule->lexeme ) ;
			#endif
			#if defined __linux__ || __MACH__
				printf ("In module " ANSI_BOLD "%s" ANSI_RESET " at line " ANSI_BOLD ANSI_CYAN "%d" ANSI_RESET ", variable " ANSI_BOLD ANSI_RED "%s" ANSI_RESET " is undeclared in the call to module " ANSI_BOLD "%s" ANSI_RESET "\n", getParentModuleName (thisModule) , outputIter->tok->lineNumber , outputIter->tok->lexeme, targetModule->lexeme ) ;
			#endif
			realBase->semanticError = 1 ;
			sameArgNoErr = 1 ;
		}
		else 
		{
			if(entryVar->datatype != searchedVar->datatype)
			{
				errSemantic () ;
				#ifdef _WIN64
					printf ("In module \"%s\" at line %d, \"%s\" and \"%s\" have conflicting return types in the call to module \"%s\"\n", getParentModuleName (thisModule), outputIter->tok->lineNumber, outputIter->tok->lexeme , entryVar->lexeme, targetModule->lexeme) ;
				#endif
				#if defined __linux__ || __MACH__
					printf ("In module " ANSI_BOLD "%s" ANSI_RESET " at line " ANSI_BOLD ANSI_CYAN "%d" ANSI_RESET ", " ANSI_BOLD ANSI_RED "%s" ANSI_RESET " and " ANSI_BOLD ANSI_RED "%s" ANSI_RESET " have conflicting return types in the call to module " ANSI_BOLD "%s" ANSI_RESET "\n" , getParentModuleName (thisModule), outputIter->tok->lineNumber, outputIter->tok->lexeme , entryVar->lexeme, targetModule->lexeme) ;
				#endif
				realBase->semanticError = 1 ;
				sameArgNoErr = 1 ;
			}
		}
		
		varEntry = varEntry->next ;
		outputIter = outputIter->prev ;
	}

	if (varEntry==NULL && outputIter)
	{
		errSemantic () ;
		#ifdef _WIN64
			printf ("In module \"%s\" at line %d, extra output variables in the call to module \"%s\"\n", getParentModuleName (thisModule), outputIter->tok->lineNumber, targetModule->lexeme) ;
		#endif
		#if defined __linux__ || __MACH__
			printf ("In module " ANSI_BOLD "%s" ANSI_RESET " at line " ANSI_BOLD ANSI_CYAN "%d" ANSI_RESET ", extra output variables in the call to module " ANSI_BOLD "%s" ANSI_RESET "\n", getParentModuleName (thisModule), outputIter->tok->lineNumber, targetModule->lexeme) ;
		#endif
		realBase->semanticError = 1 ;
		return searchVar (thisModule , outputIter->tok->lexeme ) ;
	}
	else if (varEntry && outputIter==NULL) 
	{
		errSemantic () ;
		#ifdef _WIN64
			printf ("In module \"%s\" at line %d, insufficient number of outputs in the call to module \"%s\"\n", getParentModuleName (thisModule), outputNode->tok->lineNumber, targetModule->lexeme) ;
		#endif
		#if defined __linux__ || __MACH__
			printf ("In module " ANSI_BOLD "%s" ANSI_RESET " at line " ANSI_BOLD ANSI_CYAN "%d" ANSI_RESET ", insufficient number of outputs in the call to module " ANSI_BOLD "%s" ANSI_RESET "\n", getParentModuleName (thisModule), outputNode->tok->lineNumber, targetModule->lexeme) ;
		#endif
		realBase->semanticError = 1 ;
		return entryVar ;
	}
	else{
		if (sameArgNoErr)
			return (varST *) 1 ;
		else
			return NULL ;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x1177b
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x11762
jmp 0x1177d
xorl %eax, %eax
cmpq $0x0, -0x48(%rbp)
movb %al, -0x49(%rbp)
je 0x11794
cmpq $0x0, -0x38(%rbp)
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x117a0
jmp 0x118b1
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x10ba0
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x11824
movb $0x0, %al
callq 0x14d10
movq -0x10(%rbp), %rdi
callq 0x116e0
movq %rax, %rsi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x10(%rax), %edx
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq (%rax), %r8
leaq 0x617f(%rip), %rdi      # 0x17982
movb $0x0, %al
callq 0x1090
movq 0x257f7(%rip), %rax     # 0x37008
movl $0x1, 0xd8(%rax)
movl $0x1, -0x3c(%rbp)
jmp 0x11894
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x8(%rcx), %eax
je 0x11892
movb $0x0, %al
callq 0x14d10
movq -0x10(%rbp), %rdi
callq 0x116e0
movq %rax, %rsi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x10(%rax), %edx
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x30(%rbp), %rax
movq (%rax), %r8
movq -0x18(%rbp), %rax
movq (%rax), %r9
leaq 0x6526(%rip), %rdi      # 0x17d99
movb $0x0, %al
callq 0x1090
movq 0x25787(%rip), %rax     # 0x37008
movl $0x1, 0xd8(%rax)
movl $0x1, -0x3c(%rbp)
jmp 0x11894
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x1177d
cmpq $0x0, -0x38(%rbp)
jne 0x1191e
cmpq $0x0, -0x48(%rbp)
je 0x1191e
movb $0x0, %al
callq 0x14d10
movq -0x10(%rbp), %rdi
callq 0x116e0
movq %rax, %rsi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x10(%rax), %edx
movq -0x18(%rbp), %rax
movq (%rax), %rcx
leaq 0x6540(%rip), %rdi      # 0x17e2b
movb $0x0, %al
callq 0x1090
movq 0x2570f(%rip), %rax     # 0x37008
movl $0x1, 0xd8(%rax)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x10ba0
movq %rax, -0x8(%rbp)
jmp 0x11993
cmpq $0x0, -0x38(%rbp)
je 0x1197a
cmpq $0x0, -0x48(%rbp)
jne 0x1197a
movb $0x0, %al
callq 0x14d10
movq -0x10(%rbp), %rdi
callq 0x116e0
movq %rax, %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x10(%rax), %edx
movq -0x18(%rbp), %rax
movq (%rax), %rcx
leaq 0x653a(%rip), %rdi      # 0x17e92
movb $0x0, %al
callq 0x1090
movq 0x256a2(%rip), %rax     # 0x37008
movl $0x1, 0xd8(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x11993
cmpl $0x0, -0x3c(%rbp)
je 0x1198b
movl $0x1, %eax
movq %rax, -0x8(%rbp)
jmp 0x11993
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)