// File: /workspace/github_cpp_makefile_star2_O1/araujoigor[P]ipp-compiler/./src/include/IFlowControl.hpp
// Function: IFlowControl::generateCode(std::basic_fstream<char, std::char_traits<char>>&)
void generateCode(std::fstream& fileStream) {
		//Variavel para armazenamento dos tokens que iremos gerar através da quebra
		//da expressao do if pelos tokens '&&' e '||'
		vector<string> tokens;

		//Armazenamos a expressao original temporariamente, para processamento
		string tempStr = *expression;

		//eliminamos todos os parenteses para analise
		boost::erase_all(tempStr, "(");
		boost::erase_all(tempStr, ")");

		//Quebramos a expressao pelos operadores || e &&
		boost::algorithm::split_regex(tokens, tempStr, boost::regex("&&|\\|\\|"));

		//Iteramos sobre as sub expressões para dividir os elementos da expressão e procurar por comparações
		//incorretas e/ou variaveis não declaradas
		for(auto it = tokens.begin(); it != tokens.end(); it++){
			//Vetor de strings para armazenamento das subexpressões
			vector<string> varsExps;

			//Quebramos cada subexpressão pelos operadores de comparação
			boost::algorithm::split_regex(varsExps, *it, boost::regex("==|!=|<|>|<=|>="));
			string type[2];
			int i = 0;

			//Obtemos o tipo de cada operando das comparações
			for(auto it2 = varsExps.begin(); it2 != varsExps.end(); it2++){
				//Se for um numeri=o
				if(IMath::isNumber(*it2)){
					type[i] = IReal::myType;
					continue;
				}

				//Se for uma string
				if(it2->find("\"") != string::npos){
					type[i] = IString::myType;
					continue;
				}

				IData *data = ownerBlock->getLocalVariable(*it2);

				//Se for uma variavel
				if(data == NULL){
					//Variavel nao declarada, gera um erro
					throw ISourceErrorException("Variavel " + *it2 + " nao declarada.", myLine);
				}else{
					type[i] = data->getType();
				}

				i++;
			}

			//Caso a comparação seja de tipagem errada, gera-se um erro
			if(type[0] != type[1] && (type[0] == IString::myType || type[1] == IString::myType)){
				throw ISourceErrorException("Impossivel comparar uma variavel numerica com uma string.", myLine);
			}
		}

		//Se tudo estiver certo, traduzimos o código
		fileStream << "if (" << *expression << "){" << endl;
		ifBlock->generateCode(fileStream);
		fileStream << "}" << endl;

		if(elseBlock != NULL){
			fileStream << "else{" << endl;
			elseBlock->generateCode(fileStream);
			fileStream << "}" << endl;
		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movq $0x0, -0xc0(%rbp)
movq %rdi, -0x30(%rbp)
movq 0x18(%rdi), %rax
leaq -0x80(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x10d2a
leaq 0x1b426(%rip), %rax     # 0x2c243
movq %rax, -0x70(%rbp)
leaq 0x1b41c(%rip), %rax     # 0x2c244
movq %rax, -0x68(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rax
leaq (%rsi,%rax), %rdx
testq %rax, %rax
je 0x10e50
cmpb $0x28, (%rsi)
je 0x10e55
incq %rsi
decq %rax
jne 0x10e43
movq %rdx, %rsi
jmp 0x10e59
leaq 0x1(%rsi), %rdx
cmpq %rdx, %rsi
je 0x10e7b
movq -0x60(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x70(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq -0x90(%rbp), %rdi
callq 0x116b5
leaq 0x1cc54(%rip), %rax     # 0x2dad6
movq %rax, -0x70(%rbp)
leaq 0x1cc4a(%rip), %rax     # 0x2dad7
movq %rax, -0x68(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rax
leaq (%rsi,%rax), %rdx
testq %rax, %rax
je 0x10eb5
cmpb $0x29, (%rsi)
je 0x10eba
incq %rsi
decq %rax
jne 0x10ea8
movq %rdx, %rsi
jmp 0x10ebe
leaq 0x1(%rsi), %rdx
cmpq %rdx, %rsi
je 0x10ee0
movq -0x60(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x70(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq -0x90(%rbp), %rdi
callq 0x116b5
leaq 0x1b89e(%rip), %rsi     # 0x2c785
leaq -0x70(%rbp), %rdi
xorl %edx, %edx
callq 0x1160e
movq %rbx, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x70(%rbp), %rdx
xorl %ecx, %ecx
callq 0x132bf
leaq -0x68(%rbp), %rdi
callq 0x18c60
movq -0xd0(%rbp), %r15
cmpq -0xc8(%rbp), %r15
je 0x111d2
leaq -0x40(%rbp), %r14
leaq -0x70(%rbp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0xb0(%rbp)
movq $0x0, -0xa0(%rbp)
movq %r12, %rdi
leaq 0x1b837(%rip), %rsi     # 0x2c78d
xorl %edx, %edx
callq 0x1160e
leaq -0xb0(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x132bf
movq %r15, -0xe0(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x18c60
movl $0x10, %eax
leaq (%rax,%rbp), %rcx
addq $-0x70, %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x10f86
movq -0xb0(%rbp), %r12
cmpq -0xa8(%rbp), %r12
je 0x1110c
xorl %r15d, %r15d
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x10d2a
leaq -0x100(%rbp), %rdi
callq 0xb254
movl %eax, %ebx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x1100a
callq 0x8350
leaq 0x2c49f(%rip), %rsi     # 0x3d4b0
testb %bl, %bl
jne 0x11038
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x1b07a(%rip), %rsi     # 0x2c09e
xorl %edx, %edx
callq 0x8790
leaq 0x2c45e(%rip), %rsi     # 0x3d490
cmpq $-0x1, %rax
je 0x11062
movslq %r15d, %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %rdi
addq $-0x70, %rdi
callq 0x8230
addq $0x20, %r12
cmpq -0xa8(%rbp), %r12
jne 0x10fbe
jmp 0x1110c
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rbx
leaq -0x130(%rbp), %rax
movq %rax, -0x140(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %r13
movq %r13, %rdi
callq 0x10d2a
movq %rbx, %rdi
movq %r13, %rsi
callq 0xda54
movq %rax, %rbx
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x110b9
callq 0x8350
testq %rbx, %rbx
je 0x11359
movq (%rbx), %rax
leaq -0x120(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq *0x10(%rax)
movslq %r15d, %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %rdi
addq $-0x70, %rdi
movq %r13, %rsi
callq 0x84d0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x11104
callq 0x8350
incl %r15d
jmp 0x1104c
movq -0x68(%rbp), %rbx
movq -0x48(%rbp), %r12
cmpq %r12, %rbx
jne 0x11132
testq %rbx, %rbx
je 0x1118b
movq -0x70(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rbx, %rdx
callq 0x83e0
testl %eax, %eax
je 0x1118b
movq 0x2c35f(%rip), %r15     # 0x3d498
cmpq %r15, %rbx
jne 0x11162
testq %rbx, %rbx
je 0x113b3
movq 0x2c342(%rip), %rsi     # 0x3d490
movq -0x70(%rbp), %rdi
movq %rbx, %rdx
callq 0x83e0
testl %eax, %eax
je 0x113b3
cmpq %r15, %r12
jne 0x1118b
testq %r12, %r12
je 0x113b3
movq 0x2c319(%rip), %rsi     # 0x3d490
movq -0x50(%rbp), %rdi
movq %r12, %rdx
callq 0x83e0
testl %eax, %eax
je 0x113b3
xorl %ebx, %ebx
movq -0xe0(%rbp), %r15
leaq -0x70(%rbp), %r12
movq -0x50(%rbp,%rbx), %rdi
leaq (%r14,%rbx), %rax
cmpq %rdi, %rax
je 0x111ab
callq 0x8350
addq $-0x20, %rbx
cmpq $-0x40, %rbx
jne 0x11198
leaq -0xb0(%rbp), %rdi
callq 0xf39a
addq $0x20, %r15
cmpq -0xc8(%rbp), %r15
jne 0x10f37
movq -0xd8(%rbp), %r15
leaq 0x10(%r15), %rbx
leaq 0x1b5f3(%rip), %rsi     # 0x2c7d7
movl $0x4, %edx
movq %rbx, %rdi
callq 0x8460
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x8460
movq %rax, %r14
leaq 0x1f599(%rip), %rsi     # 0x307ab
movl $0x2, %edx
movq %rax, %rdi
callq 0x8460
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8360
movsbl %al, %esi
movq %r14, %rdi
callq 0x8030
movq %rax, %rdi
callq 0x82b0
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *(%rax)
leaq 0x1f6bc(%rip), %rsi     # 0x30919
movl $0x1, %edx
movq %rbx, %rdi
callq 0x8460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8030
movq %rax, %rdi
callq 0x82b0
movq -0x30(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x11326
leaq 0x1b535(%rip), %rsi     # 0x2c7dc
movl $0x5, %edx
movq %rbx, %rdi
callq 0x8460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8030
movq %rax, %rdi
callq 0x82b0
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *(%rax)
leaq 0x1f627(%rip), %rsi     # 0x30919
movl $0x1, %edx
movq %rbx, %rdi
callq 0x8460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8030
movq %rax, %rdi
callq 0x82b0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x1133b
callq 0x8350
leaq -0xd0(%rbp), %rdi
callq 0xf39a
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x81f0
movq %rax, %r15
leaq 0x1aeb4(%rip), %rsi     # 0x2c221
leaq -0x120(%rbp), %rdi
movq %r12, %rdx
callq 0xdb86
leaq 0x1f449(%rip), %rsi     # 0x307cc
leaq -0x120(%rbp), %rdi
callq 0x8850
leaq -0x150(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x11419
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x1142a
movl $0x28, %edi
callq 0x81f0
movq %rax, %r15
leaq -0x170(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x1b3cb(%rip), %rsi     # 0x2c79d
leaq 0x1b3fd(%rip), %rdx     # 0x2c7d6
leaq -0x180(%rbp), %rdi
callq 0x1d592
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edx
movb $0x1, %r12b
leaq -0x180(%rbp), %rsi
movq %r15, %rdi
callq 0xdc12
xorl %r12d, %r12d
leaq 0x2ac58(%rip), %rsi     # 0x3c060
leaq -0x37ad(%rip), %rdx     # 0xdc62
movq %r15, %rdi
callq 0x8770
jmp 0x11473
movq %rdx, -0x160(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x150(%rbp)
movq 0x8(%rax), %rdx
leaq -0x160(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edx
movb $0x1, %r12b
movq %r15, %rdi
callq 0xdc12
xorl %r12d, %r12d
leaq 0x2abfc(%rip), %rsi     # 0x3c060
leaq -0x3809(%rip), %rdx     # 0xdc62
movq %r15, %rdi
callq 0x8770
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x18c60
jmp 0x1156a
jmp 0x114a1
movq %rax, %rbx
jmp 0x1157f
movq %rax, %rbx
movq -0x180(%rbp), %rdi
cmpq %r13, %rdi
jne 0x114d8
jmp 0x114f8
jmp 0x114f2
movq %rax, %rbx
jmp 0x1156a
movq %rax, %rbx
movq -0x160(%rbp), %rdi
cmpq %r13, %rdi
je 0x114c5
callq 0x8350
jmp 0x114c5
movq %rax, %rbx
movb $0x1, %r12b
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x114f8
callq 0x8350
jmp 0x114f8
movq %rax, %rbx
jmp 0x1155e
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x18c60
jmp 0x1155e
movq %rax, %rbx
movb $0x1, %r12b
testb %r12b, %r12b
je 0x1153e
movq %r15, %rdi
callq 0x82e0
jmp 0x1153e
jmp 0x1153b
movq %rax, %rbx
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
jmp 0x1152f
jmp 0x1153b
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x1153e
callq 0x8350
jmp 0x1153e
movq %rax, %rbx
xorl %r15d, %r15d
movq -0x50(%rbp,%r15), %rdi
leaq (%r14,%r15), %rax
cmpq %rdi, %rax
je 0x11554
callq 0x8350
addq $-0x20, %r15
cmpq $-0x40, %r15
jne 0x11541
leaq -0xb0(%rbp), %rdi
callq 0xf39a
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x1157f
callq 0x8350
leaq -0xd0(%rbp), %rdi
callq 0xf39a
movq %rbx, %rdi
callq 0x87b0
nop