// File: araujoigor[P]ipp-compiler/./src/include/IRepeat.hpp
// Function: IRepeat::generateCode(std::basic_fstream<char, std::char_traits<char>>&)
void generateCode(std::fstream& fileStream) {
		/* Como o método repita se baseia no laço for, geramos um nome de variável
		 * aleatório para utilizar como contador
		 */
		string randomVarName = IBlock::generateRandomVariableName(15);
		randomVarName.insert(randomVarName.begin(), '_');

		/* Criamos o corpo do for */
		fileStream << "for(int " << randomVarName << " = 0; " << randomVarName << " < ";

		string comparer = std::to_string(value);

		/* Se o contador for uma variável, verificamos se a mesma existe e se ela é numérica */
		if(!isValue){
			IData *data = ownerBlock->getLocalVariable(varname);

			/* Se ela não existir, geramos um erro */
			if(data == NULL){
				std::string errorMsg = "Variavel " + *varname + " nao declarada.";
				throw ISourceErrorException(errorMsg, myLine);
			}

			string type = data->getType();

			/* Se o tipo for string, geramos um erro */
			if(type == IString::myType){
				std::string errorMsg = "Variavel string utilizada em laco \'repita\'.";
				throw ISourceErrorException(errorMsg, myLine);
			}else if(type == IReal::myType)
				/* Se for um valor real, mostramos o warning de arrendondamento */
				//warning
				cout << "Atencao: a utilizacao de um valor real em uma expressao \'repita\' causa arredondamento para cima (i.e, `repita 3.3 vezes` repetiria o bloco de código 4 vezes)." << endl;

			comparer = data->getId();
		}else if(isStrValue){
			/* Se for uma variável string, geramos um erro*/
			std::string errorMsg = "Variavel string utilizada em laco \'repita\'.";
			throw ISourceErrorException(errorMsg, myLine);
		}

		/* Terminamos de gerar o bloco */
		fileStream << comparer << "; " << randomVarName << "++){";
		innerBlock->generateCode(fileStream);
		fileStream << "}" << endl;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
movl $0xf, %esi
callq 0x57e70
movq -0x1d8(%rbp), %rdi
callq 0x9470
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xe720
movq -0x1d8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x5f, %edx
callq 0x9b30
movq %rax, -0x1d0(%rbp)
jmp 0x577ee
movq -0x1d0(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
leaq 0xa324(%rip), %rsi      # 0x61b2c
callq 0x9500
movq %rax, -0x1e8(%rbp)
jmp 0x57816
movq -0x1e8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9490
movq %rax, -0x1f0(%rbp)
jmp 0x5782f
movq -0x1f0(%rbp), %rdi
leaq 0xa2f8(%rip), %rsi      # 0x61b35
callq 0x9500
movq %rax, -0x1f8(%rbp)
jmp 0x5784b
movq -0x1f8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9490
movq %rax, -0x200(%rbp)
jmp 0x57864
movq -0x200(%rbp), %rdi
leaq 0xa2ca(%rip), %rsi      # 0x61b3c
callq 0x9500
jmp 0x57879
movq -0x1e0(%rbp), %rax
movl 0x20(%rax), %esi
leaq -0x78(%rbp), %rdi
callq 0x186a0
jmp 0x5788e
movq -0x1e0(%rbp), %rax
testb $0x1, 0x30(%rax)
jne 0x57c0f
movq -0x1e0(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rax), %rsi
callq 0x18610
movq %rax, -0x208(%rbp)
jmp 0x578bc
movq -0x208(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0x57a19
movq -0x1e0(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x5d4b(%rip), %rsi      # 0x5d62f
leaq -0xc0(%rbp), %rdi
callq 0x12960
jmp 0x578f2
leaq 0xa296(%rip), %rdx      # 0x61b8f
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x123f0
jmp 0x5790e
leaq -0xc0(%rbp), %rdi
callq 0x9c30
movb $0x1, -0xe1(%rbp)
movl $0x28, %edi
callq 0x9290
movq %rax, -0x210(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x9240
jmp 0x57947
movq -0x210(%rbp), %rdi
movq -0x1e0(%rbp), %rax
movl 0x8(%rax), %edx
leaq -0xe0(%rbp), %rsi
callq 0x12a70
jmp 0x57966
movq -0x210(%rbp), %rdi
movb $0x0, -0xe1(%rbp)
leaq 0x296dd(%rip), %rsi     # 0x81058
leaq -0x44ea2(%rip), %rdx    # 0x12ae0
callq 0x9a20
jmp 0x57e1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x57e0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x57e04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x9c30
jmp 0x57e04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x579f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x9c30
testb $0x1, -0xe1(%rbp)
jne 0x579fc
jmp 0x57a08
movq -0x210(%rbp), %rdi
callq 0x9400
leaq -0xa0(%rbp), %rdi
callq 0x9c30
jmp 0x57e04
movq -0x80(%rbp), %rsi
movq (%rsi), %rax
movq 0x10(%rax), %rax
leaq -0x108(%rbp), %rdi
callq *%rax
jmp 0x57a2f
leaq -0x108(%rbp), %rdi
leaq 0x2ac23(%rip), %rsi     # 0x82660
callq 0x13620
testb $0x1, %al
jne 0x57a4b
jmp 0x57b63
leaq -0x129(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x9ab0
movq -0x218(%rbp), %rdx
leaq 0xa0d4(%rip), %rsi      # 0x61b40
leaq -0x128(%rbp), %rdi
callq 0x97c0
jmp 0x57a7a
leaq -0x129(%rbp), %rdi
callq 0x95e0
movb $0x1, -0x151(%rbp)
movl $0x28, %edi
callq 0x9290
movq %rax, -0x220(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x9240
jmp 0x57ab3
movq -0x220(%rbp), %rdi
movq -0x1e0(%rbp), %rax
movl 0x8(%rax), %edx
leaq -0x150(%rbp), %rsi
callq 0x12a70
jmp 0x57ad2
movq -0x220(%rbp), %rdi
movb $0x0, -0x151(%rbp)
leaq 0x29571(%rip), %rsi     # 0x81058
leaq -0x4500e(%rip), %rdx    # 0x12ae0
callq 0x9a20
jmp 0x57e1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x129(%rbp), %rdi
callq 0x95e0
jmp 0x57bfe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x57b3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x9c30
testb $0x1, -0x151(%rbp)
jne 0x57b46
jmp 0x57b52
movq -0x220(%rbp), %rdi
callq 0x9400
leaq -0x128(%rbp), %rdi
callq 0x9c30
jmp 0x57bfe
leaq -0x108(%rbp), %rdi
leaq 0x2ab0f(%rip), %rsi     # 0x82680
callq 0x13620
testb $0x1, %al
jne 0x57b7c
jmp 0x57bbd
movq 0x2a445(%rip), %rdi     # 0x81fc8
leaq 0x9f02(%rip), %rsi      # 0x61a8c
callq 0x9500
movq %rax, -0x228(%rbp)
jmp 0x57b98
movq -0x228(%rbp), %rdi
movq 0x2a3f2(%rip), %rsi     # 0x81f98
callq 0x95a0
jmp 0x57bad
jmp 0x57bbd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x57bfe
jmp 0x57bbf
movq -0x80(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0x12700
jmp 0x57bd1
leaq -0x78(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x96a0
leaq -0x178(%rbp), %rdi
callq 0x9c30
leaq -0x108(%rbp), %rdi
callq 0x9c30
jmp 0x57d3a
leaq -0x108(%rbp), %rdi
callq 0x9c30
jmp 0x57e04
movq -0x1e0(%rbp), %rax
testb $0x1, 0x31(%rax)
je 0x57d38
leaq -0x199(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x9ab0
movq -0x230(%rbp), %rdx
leaq 0x9eff(%rip), %rsi      # 0x61b40
leaq -0x198(%rbp), %rdi
callq 0x97c0
jmp 0x57c4f
leaq -0x199(%rbp), %rdi
callq 0x95e0
movb $0x1, -0x1c1(%rbp)
movl $0x28, %edi
callq 0x9290
movq %rax, -0x238(%rbp)
leaq -0x1c0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x9240
jmp 0x57c88
movq -0x238(%rbp), %rdi
movq -0x1e0(%rbp), %rax
movl 0x8(%rax), %edx
leaq -0x1c0(%rbp), %rsi
callq 0x12a70
jmp 0x57ca7
movq -0x238(%rbp), %rdi
movb $0x0, -0x1c1(%rbp)
leaq 0x2939c(%rip), %rsi     # 0x81058
leaq -0x451e3(%rip), %rdx    # 0x12ae0
callq 0x9a20
jmp 0x57e1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x199(%rbp), %rdi
callq 0x95e0
jmp 0x57e04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x57d10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x9c30
testb $0x1, -0x1c1(%rbp)
jne 0x57d1b
jmp 0x57d27
movq -0x238(%rbp), %rdi
callq 0x9400
leaq -0x198(%rbp), %rdi
callq 0x9c30
jmp 0x57e04
jmp 0x57d3a
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
leaq -0x78(%rbp), %rsi
callq 0x9490
movq %rax, -0x240(%rbp)
jmp 0x57d54
movq -0x240(%rbp), %rdi
leaq 0x9dd7(%rip), %rsi      # 0x61b39
callq 0x9500
movq %rax, -0x248(%rbp)
jmp 0x57d70
movq -0x248(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9490
movq %rax, -0x250(%rbp)
jmp 0x57d89
movq -0x250(%rbp), %rdi
leaq 0x9dd5(%rip), %rsi      # 0x61b6c
callq 0x9500
jmp 0x57d9e
movq -0x1e0(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x57db7
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
leaq 0x9f16(%rip), %rsi      # 0x61cdc
callq 0x9500
movq %rax, -0x258(%rbp)
jmp 0x57dd4
movq -0x258(%rbp), %rdi
movq 0x2a1b6(%rip), %rsi     # 0x81f98
callq 0x95a0
jmp 0x57de9
leaq -0x78(%rbp), %rdi
callq 0x9c30
leaq -0x30(%rbp), %rdi
callq 0x9c30
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x9c30
leaq -0x30(%rbp), %rdi
callq 0x9c30
movq -0x48(%rbp), %rdi
callq 0x9a90
nop