// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq -0xb0(%rbp), %r14
movl $0xf, %esi
movq %r14, %rdi
callq 0x2763a
movl $0x1, %ecx
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x5f, %r8d
callq 0x7800
movq %r15, -0x50(%rbp)
leaq 0x10(%r15), %r14
leaq 0x86a5(%rip), %rsi      # 0x2f70d
movl $0x8, %edx
movq %r14, %rdi
callq 0x7460
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq %r14, %rdi
callq 0x7460
movq %rax, %r15
leaq 0x8681(%rip), %rsi      # 0x2f716
movl $0x6, %edx
movq %rax, %rdi
callq 0x7460
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq %r15, %rdi
callq 0x7460
leaq 0x865e(%rip), %rsi      # 0x2f71d
movl $0x3, %edx
movq %rax, %rdi
callq 0x7460
movl 0x20(%rbx), %r12d
movl %r12d, %r13d
negl %r13d
cmovsl %r12d, %r13d
movl $0x1, %r15d
cmpl $0xa, %r13d
jb 0x27130
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r13d, %ecx
cmpl $0x63, %ecx
jbe 0x27127
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2712d
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x27130
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x270f4
addl $-0x3, %r15d
jmp 0x27130
addl $-0x2, %r15d
jmp 0x27130
decl %r15d
shrl $0x1f, %r12d
leal (%r15,%r12), %esi
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x90(%rbp), %rdi
movl $0x2d, %edx
callq 0x7490
addq -0x90(%rbp), %r12
movq %r12, %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0xfa8b
cmpb $0x0, 0x30(%rbx)
je 0x27200
cmpb $0x1, 0x31(%rbx)
movq -0x50(%rbp), %r12
jne 0x27317
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8594(%rip), %rsi      # 0x2f721
leaq 0x85b8(%rip), %rdx      # 0x2f74c
leaq -0x48(%rbp), %rdi
callq 0x1c46a
movl $0x28, %edi
callq 0x71f0
movq %rax, %r14
leaq -0xc0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0xfbae
movl 0x8(%rbx), %edx
movb $0x1, %r13b
leaq -0xd0(%rbp), %rsi
movq %r14, %rdi
callq 0xcad6
xorl %r13d, %r13d
leaq 0x13ec4(%rip), %rsi     # 0x3b0b0
leaq -0x1a6cd(%rip), %rdx    # 0xcb26
movq %r14, %rdi
callq 0x7770
jmp 0x27550
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
callq 0xf994
movq %rax, %r12
testq %rax, %rax
je 0x273f1
movq (%r12), %rax
leaq -0x48(%rbp), %rdi
movq %r12, %rsi
callq *0x10(%rax)
movq -0x40(%rbp), %r15
cmpq 0x15266(%rip), %r15     # 0x3c498
jne 0x27258
testq %r15, %r15
je 0x2743c
movq 0x1524c(%rip), %rsi     # 0x3c490
movq -0x48(%rbp), %rdi
movq %r15, %rdx
callq 0x73e0
testl %eax, %eax
je 0x2743c
cmpq 0x15259(%rip), %r15     # 0x3c4b8
jne 0x272c3
testq %r15, %r15
je 0x2727d
movq 0x15243(%rip), %rsi     # 0x3c4b0
movq -0x48(%rbp), %rdi
movq %r15, %rdx
callq 0x73e0
testl %eax, %eax
jne 0x272c3
movq 0x14d44(%rip), %r15     # 0x3bfc8
leaq 0x83e2(%rip), %rsi      # 0x2f66d
movl $0x9f, %edx
movq %r15, %rdi
callq 0x7460
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x7360
movsbl %al, %esi
movq 0x14d12(%rip), %rdi     # 0x3bfc8
callq 0x7030
movq %rax, %rdi
callq 0x72b0
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%r12), %rsi
movq 0x10(%r12), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0xfbae
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %r15
movq %r15, %rsi
callq 0x74d0
movq (%r15), %rdi
cmpq %r13, %rdi
movq -0x50(%rbp), %r12
je 0x27305
callq 0x7350
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27317
callq 0x7350
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %r14, %rdi
callq 0x7460
movq %rax, %r15
leaq 0x83e3(%rip), %rsi      # 0x2f71a
movl $0x2, %edx
movq %rax, %rdi
callq 0x7460
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq %r15, %rdi
callq 0x7460
leaq 0x83ec(%rip), %rsi      # 0x2f74d
movl $0x4, %edx
movq %rax, %rdi
callq 0x7460
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *(%rax)
leaq 0x853c(%rip), %rsi      # 0x2f8bd
movl $0x1, %edx
movq %r14, %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 -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x273ca
callq 0x7350
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x273df
callq 0x7350
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbx), %rdx
leaq 0x3df5(%rip), %rsi      # 0x2b1f1
leaq -0x70(%rbp), %rdi
callq 0xca4b
leaq 0x8364(%rip), %rsi      # 0x2f770
leaq -0x70(%rbp), %rdi
callq 0x7850
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x274be
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x274c9
leaq -0x60(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x82d6(%rip), %rsi      # 0x2f721
leaq 0x82fa(%rip), %rdx      # 0x2f74c
leaq -0x70(%rbp), %rdi
callq 0x1c46a
movl $0x28, %edi
callq 0x71f0
movq %rax, %r14
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0xfbae
movl 0x8(%rbx), %edx
movb $0x1, %r13b
leaq -0xf0(%rbp), %rsi
movq %r14, %rdi
callq 0xcad6
xorl %r13d, %r13d
leaq 0x13c06(%rip), %rsi     # 0x3b0b0
leaq -0x1a98b(%rip), %rdx    # 0xcb26
movq %r14, %rdi
callq 0x7770
jmp 0x27550
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x274f2
callq 0x7350
movl $0x28, %edi
callq 0x71f0
movq %rax, %r14
leaq -0x100(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x110(%rbp), %rdi
callq 0xfbae
movl 0x8(%rbx), %edx
movb $0x1, %r13b
leaq -0x110(%rbp), %rsi
movq %r14, %rdi
callq 0xcad6
xorl %r13d, %r13d
leaq 0x13b6f(%rip), %rsi     # 0x3b0b0
leaq -0x1aa22(%rip), %rdx    # 0xcb26
movq %r14, %rdi
callq 0x7770
movq %rax, %rbx
movq -0x110(%rbp), %rdi
jmp 0x275a7
jmp 0x275b8
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x27572
callq 0x7350
testb %r13b, %r13b
jne 0x2757c
jmp 0x27584
movq %rax, %rbx
movq %r14, %rdi
callq 0x72e0
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x275dd
callq 0x7350
jmp 0x275dd
movq %rax, %rbx
leaq -0x60(%rbp), %rax
jmp 0x275e1
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x275b1
callq 0x7350
testb %r13b, %r13b
jne 0x275bb
jmp 0x275c3
movq %rax, %rbx
movq %r14, %rdi
callq 0x72e0
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x275ea
jmp 0x275fd
jmp 0x275da
jmp 0x275fa
jmp 0x275fa
jmp 0x275da
jmp 0x275fa
jmp 0x275fa
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x275fd
callq 0x7350
jmp 0x275fd
jmp 0x275f5
jmp 0x275f5
movq %rax, %rbx
jmp 0x27612
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x27612
callq 0x7350
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27627
callq 0x7350
movq %rbx, %rdi
callq 0x77b0
nop