// File: /workspace/github_cpp_makefile_star2_O3/araujoigor[P]ipp-compiler/./src/include/IMath.hpp
// Function: IMath::checkAndGetExpression[abi:cxx11](IBlock*, int)
std::string checkAndGetExpression(IBlock *ownerBlock, int myLine) {

		/* Utiliza-se um tokenizer que quebra a expressão matemática nos seus operadores */
		boost::char_separator<char> separator("+-*/() ");
		Tokenizer tokens(expression, separator);

		/* Para cada token, verificamos se exitem erros, como variáveis não declaradas
		 * ou valores String
		 */
		for(auto tokenIterator = tokens.begin(); tokenIterator != tokens.end(); tokenIterator++){
			/* Se o token atual NÃO for um NUMERO, deve ser uma variável */
			if(!isNumber(*tokenIterator)){
				/* Portanto obtemos a variavel */
				IData *data = ownerBlock->getLocalVariable(*tokenIterator);
				std::string errorMsg;

				/* Se não for uma variável, então é uma string ou a variável não foi declarada
				 * Então geramos o erro aproriado
				 */
				if(data == NULL){
					if(tokenIterator->find("\"") != std::string::npos)
						errorMsg = "Impossivel utilizar uma string em uma expressao matematica (valor " + *tokenIterator + ")";
					else
						errorMsg = "Variavel " + *tokenIterator + " nao declarada.";

					throw ISourceErrorException(errorMsg, myLine);
				}
				/* Se for uma variavel string, também geramos um erro.*/
				else if(data->getType() == IString::myType){
					errorMsg = "Impossivel usar uma string em uma expressao matematica (variavel " + *tokenIterator + ")" ;
					throw ISourceErrorException(errorMsg, myLine);
				}
				else if(data->getType() == IReal::myType)
					mathType = TYPE_REAL;
			}else if(!IMath::isInteger(*tokenIterator))
				mathType = TYPE_REAL;
		}

		if(outType == TYPE_INTEGER){
			expression.insert(0, "(int)");
		}

		return expression;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movl %ecx, %r14d
movq %rdx, -0x88(%rbp)
movq %rsi, %r12
movq %rdi, %r15
leaq 0x1e6be(%rip), %rsi     # 0x2b341
leaq -0x370(%rbp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xd564
leaq -0x320(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0xd60a
movq %r15, -0x78(%rbp)
movl %r14d, -0x4c(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0xd694
leaq -0x100(%rbp), %r15
leaq -0x1c8(%rbp), %r14
leaq -0x270(%rbp), %r13
movq %r12, -0x80(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0xd758
movb -0x178(%rbp), %al
movb -0xf0(%rbp), %cl
cmpb $0x1, %al
jne 0xcd1c
testb $0x1, %cl
je 0xcd1c
movq -0x188(%rbp), %rax
cmpq -0x100(%rbp), %rax
je 0xceff
xorl %ebx, %ebx
jmp 0xcd21
cmpb %cl, %al
sete %bl
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0xcd39
callq 0x7350
movq -0x1b8(%rbp), %rdi
leaq -0x1a8(%rbp), %rax
cmpq %rax, %rdi
je 0xcd51
callq 0x7350
movq -0x1d8(%rbp), %rdi
cmpq %r14, %rdi
je 0xcd62
callq 0x7350
testb %bl, %bl
jne 0xd0a1
cmpb $0x0, -0xf0(%rbp)
je 0xd2a4
leaq -0xb8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0xfbae
leaq -0xc8(%rbp), %rdi
callq 0xa194
movl %eax, %ebx
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0xcdc8
callq 0x7350
movb -0xf0(%rbp), %al
testb %bl, %bl
je 0xce41
testb %al, %al
je 0xd2a4
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0xfbae
leaq -0xa8(%rbp), %rdi
callq 0xa826
movl %eax, %ebx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xce2b
callq 0x7350
testb %bl, %bl
jne 0xcfb0
movl $0x1, 0x38(%r12)
jmp 0xcfb0
testb %al, %al
je 0xd2a4
leaq -0x1e8(%rbp), %r12
movq %r12, -0x1f8(%rbp)
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1f8(%rbp), %rbx
movq %rbx, %rdi
callq 0xfbae
movq -0x88(%rbp), %rdi
movq %rbx, %rsi
callq 0xc924
movq %rax, %rbx
movq -0x1f8(%rbp), %rdi
cmpq %r12, %rdi
je 0xce9a
callq 0x7350
movq %r14, -0x1d8(%rbp)
movq $0x0, -0x1d0(%rbp)
movb $0x0, -0x1c8(%rbp)
testq %rbx, %rbx
je 0xd1e7
movq (%rbx), %rax
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq *0x10(%rax)
movq -0x40(%rbp), %rdx
cmpq 0x2f5c4(%rip), %rdx     # 0x3c498
jne 0xcef6
movq -0x48(%rbp), %r14
testq %rdx, %rdx
je 0xcf12
movq 0x2f5aa(%rip), %rsi     # 0x3c490
movq %r14, %rdi
callq 0x73e0
testl %eax, %eax
sete %r12b
jmp 0xcf15
movq -0x48(%rbp), %r14
xorl %r12d, %r12d
jmp 0xcf15
movq -0x180(%rbp), %rax
cmpq -0xf8(%rbp), %rax
jmp 0xcd1e
movb $0x1, %r12b
leaq -0x38(%rbp), %rax
cmpq %rax, %r14
je 0xcf26
movq %r14, %rdi
callq 0x7350
testb %r12b, %r12b
jne 0xd189
movq (%rbx), %rax
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq *0x10(%rax)
movq -0x80(%rbp), %r12
movq -0x40(%rbp), %rdx
cmpq 0x2f56d(%rip), %rdx     # 0x3c4b8
jne 0xcf6d
movq -0x48(%rbp), %rbx
testq %rdx, %rdx
je 0xcf76
movq 0x2f553(%rip), %rsi     # 0x3c4b0
movq %rbx, %rdi
callq 0x73e0
testl %eax, %eax
sete %r14b
jmp 0xcf79
movq -0x48(%rbp), %rbx
xorl %r14d, %r14d
jmp 0xcf79
movb $0x1, %r14b
leaq -0x38(%rbp), %rax
cmpq %rax, %rbx
je 0xcf8a
movq %rbx, %rdi
callq 0x7350
testb %r14b, %r14b
je 0xcf98
movl $0x1, 0x38(%r12)
movq -0x1d8(%rbp), %rdi
leaq -0x1c8(%rbp), %r14
cmpq %r14, %rdi
je 0xcfb0
callq 0x7350
movq %r13, -0x280(%rbp)
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
addq %rsi, %rdx
leaq -0x280(%rbp), %rdi
callq 0xfbae
leaq -0x250(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
addq %rsi, %rdx
leaq -0x260(%rbp), %rdi
callq 0xfbae
movb -0x8(%r15), %al
movb %al, 0x38(%r13)
movq -0x10(%r15), %rax
movq %rax, 0x30(%r13)
movb 0x10(%r15), %al
movb %al, 0x50(%r13)
movups (%r15), %xmm0
movups %xmm0, 0x40(%r13)
leaq -0x208(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x218(%rbp), %rdi
callq 0xfbae
leaq -0x150(%rbp), %rdi
callq 0xdbe6
movq -0x218(%rbp), %rdi
leaq -0x208(%rbp), %rax
cmpq %rax, %rdi
je 0xd06f
callq 0x7350
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xd087
callq 0x7350
movq -0x280(%rbp), %rdi
cmpq %r13, %rdi
je 0xccdc
callq 0x7350
jmp 0xccdc
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd0b6
callq 0x7350
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
movq -0x78(%rbp), %rbx
je 0xd0cf
callq 0x7350
leaq -0x140(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd0e4
callq 0x7350
cmpl $0x0, 0x3c(%r12)
jne 0xd105
leaq 0x1e2db(%rip), %rcx     # 0x2b3ce
movl $0x5, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7450
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xfbae
leaq -0x2e0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd135
callq 0x7350
leaq -0x300(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd14a
callq 0x7350
leaq -0x340(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd15f
callq 0x7350
leaq -0x360(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd174
callq 0x7350
movq %rbx, %rax
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, -0xf0(%rbp)
je 0xd2a4
leaq 0x1e1ef(%rip), %rsi     # 0x2b38c
leaq -0x70(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0xca4b
leaq 0x1f8f2(%rip), %rsi     # 0x2caa6
leaq -0x70(%rbp), %rdi
callq 0x7850
leaq -0x38(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xd2c3
movups (%rcx), %xmm0
leaq -0x38(%rbp), %rdx
movups %xmm0, (%rdx)
jmp 0xd2ce
cmpb $0x0, -0xf0(%rbp)
je 0xd2a4
leaq 0x1de73(%rip), %rsi     # 0x2b06e
movl $0x1, %ecx
leaq -0xe8(%rbp), %rdi
xorl %edx, %edx
callq 0x7790
cmpq $-0x1, %rax
jne 0xd24a
cmpb $0x0, -0xf0(%rbp)
je 0xd2a4
leaq 0x1dfc9(%rip), %rsi     # 0x2b1f1
leaq -0x70(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0xca4b
leaq 0x22531(%rip), %rsi     # 0x2f770
leaq -0x70(%rbp), %rdi
callq 0x7850
jmp 0xd27a
cmpb $0x0, -0xf0(%rbp)
je 0xd2a4
leaq 0x1e0ef(%rip), %rsi     # 0x2b349
leaq -0x70(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0xca4b
leaq 0x1f835(%rip), %rsi     # 0x2caa6
leaq -0x70(%rbp), %rdi
callq 0x7850
leaq -0x38(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xd383
movups (%rcx), %xmm0
leaq -0x38(%rbp), %rdx
movups %xmm0, (%rdx)
jmp 0xd38e
leaq 0x1e129(%rip), %rdi     # 0x2b3d4
leaq 0x1e129(%rip), %rsi     # 0x2b3db
leaq 0x1e148(%rip), %rcx     # 0x2b401
movl $0x3b, %edx
callq 0x72a0
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
movq 0x8(%rax), %rdx
leaq -0x48(%rbp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x1d8(%rbp), %rdi
movq %rbx, %rsi
callq 0x74d0
movq (%rbx), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xd309
callq 0x7350
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd31b
callq 0x7350
movl $0x28, %edi
callq 0x71f0
movq %rax, %r14
leaq -0x290(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x1d8(%rbp), %rsi
movq -0x1d0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x2a0(%rbp), %rdi
callq 0xfbae
movb $0x1, %r12b
leaq -0x2a0(%rbp), %rsi
movq %r14, %rdi
movl -0x4c(%rbp), %edx
callq 0xcad6
xorl %r12d, %r12d
leaq 0x2dd41(%rip), %rsi     # 0x3b0b0
leaq -0x850(%rip), %rdx      # 0xcb26
movq %r14, %rdi
callq 0x7770
jmp 0xd43e
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
movq 0x8(%rax), %rdx
leaq -0x48(%rbp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x1d8(%rbp), %rdi
movq %rbx, %rsi
callq 0x74d0
movq (%rbx), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xd3c9
callq 0x7350
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd3db
callq 0x7350
movl $0x28, %edi
callq 0x71f0
movq %rax, %r14
leaq -0x2b0(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x1d8(%rbp), %rsi
movq -0x1d0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x2c0(%rbp), %rdi
callq 0xfbae
movb $0x1, %r12b
leaq -0x2c0(%rbp), %rsi
movq %r14, %rdi
movl -0x4c(%rbp), %edx
callq 0xcad6
xorl %r12d, %r12d
leaq 0x2dc81(%rip), %rsi     # 0x3b0b0
leaq -0x910(%rip), %rdx      # 0xcb26
movq %r14, %rdi
callq 0x7770
movq %rax, %rbx
movq -0x2c0(%rbp), %rdi
jmp 0xd45e
jmp 0xd46f
jmp 0xd48e
jmp 0xd48e
jmp 0xd4cf
jmp 0xd4cf
movq %rax, %rbx
movq -0x2a0(%rbp), %rdi
cmpq %r15, %rdi
je 0xd468
callq 0x7350
testb %r12b, %r12b
jne 0xd472
jmp 0xd4d2
movq %rax, %rbx
movq %r14, %rdi
callq 0x72e0
jmp 0xd4d2
jmp 0xd486
movq %rax, %rbx
jmp 0xd54f
movq %rax, %rbx
jmp 0xd543
movq %rax, %rbx
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd4d2
callq 0x7350
jmp 0xd4d2
jmp 0xd4cf
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
jmp 0xd526
movq %rax, %rbx
movq -0x1f8(%rbp), %rdi
cmpq %r12, %rdi
jne 0xd52b
jmp 0xd537
jmp 0xd4cf
jmp 0xd534
movq %rax, %rbx
movq -0x1d8(%rbp), %rdi
leaq -0x1c8(%rbp), %rax
jmp 0xd526
movq %rax, %rbx
movq -0x280(%rbp), %rdi
cmpq %r13, %rdi
jne 0xd52b
jmp 0xd537
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
callq 0xd89a
jmp 0xd537
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
callq 0xd81c
jmp 0xd537
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0xd537
callq 0x7350
jmp 0xd537
jmp 0xd534
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0xd81c
leaq -0x320(%rbp), %rdi
callq 0xd864
leaq -0x370(%rbp), %rdi
callq 0xd89a
movq %rbx, %rdi
callq 0x77b0
nop