// File: /workspace/github_cpp_makefile_star2_O3/araujoigor[P]ipp-compiler/./src/include/IWhile.hpp
// Function: IWhile::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[0] = 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);
			}
		}

		fileStream << "while (" << *expression << "){" << endl;
		innerBlock->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), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0xfbae
leaq 0x495a(%rip), %rax      # 0x2b213
movq %rax, -0x70(%rbp)
leaq 0x4950(%rip), %rax      # 0x2b214
movq %rax, -0x68(%rbp)
movq -0x88(%rbp), %rax
testq %rax, %rax
je 0x2697d
movq -0x90(%rbp), %rsi
xorl %ecx, %ecx
cmpb $0x28, (%rsi,%rcx)
je 0x268f1
incq %rcx
cmpq %rcx, %rax
jne 0x268e1
jmp 0x2692c
xorl %edx, %edx
testb %dl, %dl
jne 0x2692c
leaq (%rsi,%rcx), %rdx
incq %rdx
addq %rcx, %rsi
movq -0x60(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x70(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq -0x90(%rbp), %rdi
callq 0x1055f
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rax
leaq 0x6173(%rip), %rcx      # 0x2caa6
movq %rcx, -0x70(%rbp)
leaq 0x6169(%rip), %rcx      # 0x2caa7
movq %rcx, -0x68(%rbp)
testq %rax, %rax
je 0x2697d
cmpb $0x29, (%rsi)
je 0x26956
incq %rsi
decq %rax
jne 0x26947
jmp 0x2697d
xorl %eax, %eax
testb %al, %al
jne 0x2697d
leaq 0x1(%rsi), %rdx
movq -0x60(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x70(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq -0x90(%rbp), %rdi
callq 0x1055f
leaq 0x4dd1(%rip), %rsi      # 0x2b755
leaq -0x70(%rbp), %rdi
xorl %edx, %edx
callq 0x104b8
movq %rbx, -0xf8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x70(%rbp), %rdx
xorl %ecx, %ecx
callq 0x12189
leaq -0x68(%rbp), %rdi
callq 0x17bb6
movq -0xd0(%rbp), %rbx
cmpq -0xc8(%rbp), %rbx
je 0x26c68
leaq -0x40(%rbp), %r15
leaq -0x70(%rbp), %r14
leaq -0xb0(%rbp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0xb0(%rbp)
movq $0x0, -0xa0(%rbp)
movq %r14, %rdi
leaq 0x4d63(%rip), %rsi      # 0x2b75d
xorl %edx, %edx
callq 0x104b8
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x12189
movq %rbx, -0x100(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x17bb6
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 0x26a26
movq -0xb0(%rbp), %rbx
cmpq -0xa8(%rbp), %rbx
je 0x26b9f
xorl %r12d, %r12d
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0xfbae
leaq -0x120(%rbp), %rdi
callq 0xa194
movl %eax, %r14d
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x26aa9
callq 0x7350
leaq 0x15a00(%rip), %rsi     # 0x3c4b0
testb %r14b, %r14b
jne 0x26ad8
movl $0x1, %ecx
movq %rbx, %rdi
leaq 0x45aa(%rip), %rsi      # 0x2b06e
xorl %edx, %edx
callq 0x7790
leaq 0x159be(%rip), %rsi     # 0x3c490
cmpq $-0x1, %rax
je 0x26b02
movslq %r12d, %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %rdi
addq $-0x70, %rdi
callq 0x7230
addq $0x20, %rbx
cmpq -0xa8(%rbp), %rbx
jne 0x26a5e
jmp 0x26b9f
movq -0x30(%rbp), %rax
movq 0x10(%rax), %r14
leaq -0x130(%rbp), %rax
movq %rax, -0x140(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %r13
movq %r13, %rdi
callq 0xfbae
movq %r14, %rdi
movq %r13, %rsi
callq 0xc924
movq %rax, %r14
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x26b57
callq 0x7350
testq %r14, %r14
je 0x26d5b
movq (%r14), %rax
leaq -0xf0(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq *0x10(%rax)
leaq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x74d0
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x26b97
callq 0x7350
incl %r12d
jmp 0x26aec
movq -0x68(%rbp), %r14
movq -0x48(%rbp), %rbx
cmpq %rbx, %r14
jne 0x26bc5
testq %r14, %r14
je 0x26c1e
movq -0x70(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %r14, %rdx
callq 0x73e0
testl %eax, %eax
je 0x26c1e
movq 0x158cc(%rip), %r12     # 0x3c498
cmpq %r12, %r14
jne 0x26bf5
testq %r14, %r14
je 0x26db6
movq 0x158af(%rip), %rsi     # 0x3c490
movq -0x70(%rbp), %rdi
movq %r14, %rdx
callq 0x73e0
testl %eax, %eax
je 0x26db6
cmpq %r12, %rbx
jne 0x26c1e
testq %rbx, %rbx
je 0x26db6
movq 0x15886(%rip), %rsi     # 0x3c490
movq -0x50(%rbp), %rdi
movq %rbx, %rdx
callq 0x73e0
testl %eax, %eax
je 0x26db6
xorl %ebx, %ebx
leaq -0x70(%rbp), %r14
leaq -0xb0(%rbp), %r12
movq -0x50(%rbp,%rbx), %rdi
leaq (%r15,%rbx), %rax
cmpq %rdi, %rax
je 0x26c3e
callq 0x7350
addq $-0x20, %rbx
cmpq $-0x40, %rbx
jne 0x26c2b
movq %r12, %rdi
callq 0xe272
movq -0x100(%rbp), %rbx
addq $0x20, %rbx
cmpq -0xc8(%rbp), %rbx
jne 0x269db
movq -0xf8(%rbp), %r12
leaq 0x10(%r12), %rbx
leaq 0x89c8(%rip), %rsi      # 0x2f643
movl $0x7, %edx
movq %rbx, %rdi
leaq -0x80(%rbp), %r15
callq 0x7460
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x7460
movq %rax, %r14
leaq 0x8aa2(%rip), %rsi      # 0x2f74f
movl $0x2, %edx
movq %rax, %rdi
callq 0x7460
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7360
movsbl %al, %esi
movq %r14, %rdi
callq 0x7030
movq %rax, %rdi
callq 0x72b0
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *(%rax)
leaq 0x8bc5(%rip), %rsi      # 0x2f8bd
movl $0x1, %edx
movq %rbx, %rdi
callq 0x7460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x7360
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7030
movq %rax, %rdi
callq 0x72b0
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x26d3d
callq 0x7350
leaq -0xd0(%rbp), %rdi
callq 0xe272
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x71f0
movq %rax, %r14
leaq 0x4482(%rip), %rsi      # 0x2b1f1
leaq -0xf0(%rbp), %rdi
movq %rbx, %rdx
callq 0xca4b
leaq 0x89eb(%rip), %rsi      # 0x2f770
leaq -0xf0(%rbp), %rdi
callq 0x7850
leaq -0x150(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x26e1d
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x26e2e
movl $0x28, %edi
callq 0x71f0
movq %rax, %r14
leaq -0x170(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x4997(%rip), %rsi      # 0x2b76d
leaq 0x49c9(%rip), %rdx      # 0x2b7a6
leaq -0x180(%rbp), %rdi
callq 0x1c46a
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edx
movb $0x1, %r13b
leaq -0x180(%rbp), %rsi
movq %r14, %rdi
callq 0xcad6
xorl %r13d, %r13d
leaq 0x142a4(%rip), %rsi     # 0x3b0b0
leaq -0x1a2ed(%rip), %rdx    # 0xcb26
movq %r14, %rdi
callq 0x7770
jmp 0x26e77
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, %r13b
movq %r14, %rdi
callq 0xcad6
xorl %r13d, %r13d
leaq 0x14248(%rip), %rsi     # 0x3b0b0
leaq -0x1a349(%rip), %rdx    # 0xcb26
movq %r14, %rdi
callq 0x7770
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x17bb6
jmp 0x26f80
jmp 0x26e92
movq %rax, %rbx
jmp 0x26f95
movq %rax, %rbx
jmp 0x26f84
movq %rax, %rbx
movq -0x180(%rbp), %rdi
cmpq %r12, %rdi
jne 0x26ed4
jmp 0x26ed9
jmp 0x26f10
movq %rax, %rbx
movq -0x160(%rbp), %rdi
cmpq %r12, %rdi
je 0x26ec1
callq 0x7350
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x26ed9
callq 0x7350
testb %r13b, %r13b
jne 0x26f13
jmp 0x26f54
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x26f13
callq 0x7350
jmp 0x26f13
movq %rax, %rbx
jmp 0x26f74
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x17bb6
jmp 0x26f74
movq %rax, %rbx
movq %r14, %rdi
callq 0x72e0
jmp 0x26f54
jmp 0x26f51
movq %rax, %rbx
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
jmp 0x26f45
jmp 0x26f51
movq %rax, %rbx
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x26f54
callq 0x7350
jmp 0x26f54
movq %rax, %rbx
xorl %r14d, %r14d
movq -0x50(%rbp,%r14), %rdi
leaq (%r15,%r14), %rax
cmpq %rdi, %rax
je 0x26f6a
callq 0x7350
addq $-0x20, %r14
cmpq $-0x40, %r14
jne 0x26f57
leaq -0xb0(%rbp), %rdi
callq 0xe272
leaq -0x80(%rbp), %r15
movq -0x90(%rbp), %rdi
cmpq %r15, %rdi
je 0x26f95
callq 0x7350
leaq -0xd0(%rbp), %rdi
callq 0xe272
movq %rbx, %rdi
callq 0x77b0
nop